1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-12-23 05:16:58 +00:00

downloads use shortcode, and tagged post notification

This commit is contained in:
Austin Huang 2020-11-06 18:09:29 -05:00
parent 495a4a974f
commit c2b8d8cb4f
No known key found for this signature in database
GPG Key ID: 84C23AA04587A91F
5 changed files with 11 additions and 6 deletions

View File

@ -42,6 +42,9 @@ public final class NotificationViewHolder extends RecyclerView.ViewHolder {
text = R.string.mention_notif;
subtext = model.getText();
break;
case TAGGED:
text = R.string.tagged_notif;
break;
case FOLLOW:
text = R.string.follow_notif;
break;

View File

@ -9,10 +9,11 @@ public enum NotificationType implements Serializable {
FOLLOW("GraphFollowAggregatedStory"),
COMMENT("GraphCommentMediaStory"),
MENTION("GraphMentionStory"),
TAGGED("GraphUserTaggedStory"),
REQUEST("REQUEST");
private final String itemType;
private static Map<String, NotificationType> map = new HashMap<>();
private static final Map<String, NotificationType> map = new HashMap<>();
static {
for (NotificationType type : NotificationType.values()) {

View File

@ -185,7 +185,7 @@ public final class DownloadUtils {
case MEDIA_TYPE_IMAGE:
case MEDIA_TYPE_VIDEO: {
final String url = feedModel.getDisplayUrl();
final File file = getDownloadSaveFile(downloadDir, feedModel.getPostId(), url);
final File file = getDownloadSaveFile(downloadDir, feedModel.getShortCode(), url);
checkList.add(file.exists());
break;
}
@ -194,7 +194,7 @@ public final class DownloadUtils {
for (int i = 0; i < sliderItems.size(); i++) {
final PostChild child = sliderItems.get(i);
final String url = child.getDisplayUrl();
final File file = getDownloadChildSaveFile(downloadDir, feedModel.getPostId(), i + 1, url);
final File file = getDownloadChildSaveFile(downloadDir, feedModel.getShortCode(), i + 1, url);
checkList.add(file.exists());
}
break;
@ -275,7 +275,7 @@ public final class DownloadUtils {
case MEDIA_TYPE_IMAGE:
case MEDIA_TYPE_VIDEO: {
final String url = feedModel.getDisplayUrl();
final File file = getDownloadSaveFile(downloadDir, feedModel.getPostId(), url);
final File file = getDownloadSaveFile(downloadDir, feedModel.getShortCode(), url);
map.put(url, file.getAbsolutePath());
break;
}
@ -287,7 +287,7 @@ public final class DownloadUtils {
}
final PostChild child = sliderItems.get(i);
final String url = child.getDisplayUrl();
final File file = getDownloadChildSaveFile(downloadDir, feedModel.getPostId(), i + 1, url);
final File file = getDownloadChildSaveFile(downloadDir, feedModel.getShortCode(), i + 1, url);
map.put(url, file.getAbsolutePath());
}
break;

View File

@ -111,7 +111,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:textStyle="italic"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/preview_barrier"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toEndOf="@id/ivProfilePic"
app:layout_constraintTop_toBottomOf="@id/tvSubComment"
tools:text="some long long long long long date" />

View File

@ -225,6 +225,7 @@
<string name="comment_notif">Commented on your post:</string>
<string name="follow_notif">Started following you</string>
<string name="mention_notif">Mentioned you:</string>
<string name="tagged_notif">Tagged you in a post</string>
<string name="request_notif">Requested following you</string>
<string name="request_approve">Approve request</string>
<string name="request_reject">Reject request</string>