mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-18 12:47:30 +00:00
support dm message type "clip" (which is glorified "media_share" for reels)
This commit is contained in:
parent
c3d92b8fc0
commit
40cb975384
@ -106,7 +106,8 @@ public final class DirectMessageItemsAdapter extends ListAdapter<DirectItemModel
|
||||
final LayoutDmRavenMediaBinding binding = LayoutDmRavenMediaBinding.inflate(layoutInflater, itemViewParent, false);
|
||||
return new DirectMessageReelShareViewHolder(baseBinding, binding, onClickListener, mentionClickListener);
|
||||
}
|
||||
case MEDIA_SHARE: {
|
||||
case MEDIA_SHARE:
|
||||
case CLIP: {
|
||||
final LayoutDmMediaShareBinding binding = LayoutDmMediaShareBinding.inflate(layoutInflater, itemViewParent, false);
|
||||
return new DirectMessageMediaShareViewHolder(baseBinding, binding, onClickListener);
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ public final class DirectMessageInboxItemViewHolder extends RecyclerView.ViewHol
|
||||
case MEDIA:
|
||||
case MEDIA_SHARE:
|
||||
case RAVEN_MEDIA:
|
||||
case CLIP:
|
||||
messageText = context.getString(R.string.direct_messages_sent_media);
|
||||
break;
|
||||
case ACTION_LOG:
|
||||
|
@ -205,6 +205,7 @@ public class DirectMessageThreadFragment extends Fragment {
|
||||
final DirectItemType itemType = directItemModel.getItemType();
|
||||
switch (itemType) {
|
||||
case MEDIA_SHARE:
|
||||
case CLIP:
|
||||
startActivity(new Intent(requireContext(), PostViewer.class)
|
||||
.putExtra(Constants.EXTRAS_POST, new PostModel(directItemModel.getMediaModel().getCode(), false)));
|
||||
break;
|
||||
@ -281,6 +282,7 @@ public class DirectMessageThreadFragment extends Fragment {
|
||||
|
||||
switch (itemType) {
|
||||
case MEDIA_SHARE:
|
||||
case CLIP:
|
||||
firstOption = R.string.view_post;
|
||||
break;
|
||||
case LINK:
|
||||
|
@ -18,7 +18,8 @@ public enum DirectItemType implements Serializable {
|
||||
REEL_SHARE(11),
|
||||
ACTION_LOG(12),
|
||||
PLACEHOLDER(13),
|
||||
STORY_SHARE(14);
|
||||
STORY_SHARE(14),
|
||||
CLIP(15); // clip is just media_share but reel
|
||||
|
||||
private final int id;
|
||||
private static Map<Integer, DirectItemType> map = new HashMap<>();
|
||||
|
@ -426,7 +426,7 @@ public final class Utils {
|
||||
if (userObj != null) {
|
||||
user = new ProfileModel(
|
||||
userObj.getBoolean("is_private"),
|
||||
false, // temporary
|
||||
false,
|
||||
userObj.optBoolean("is_verified"),
|
||||
String.valueOf(userObj.get("pk")),
|
||||
userObj.getString("username"),
|
||||
@ -467,6 +467,7 @@ public final class Utils {
|
||||
if ("animated_media".equals(itemType)) return DirectItemType.ANIMATED_MEDIA;
|
||||
if ("voice_media".equals(itemType)) return DirectItemType.VOICE_MEDIA;
|
||||
if ("story_share".equals(itemType)) return DirectItemType.STORY_SHARE;
|
||||
if ("clip".equals(itemType)) return DirectItemType.CLIP;
|
||||
return DirectItemType.TEXT;
|
||||
}
|
||||
|
||||
@ -705,6 +706,11 @@ public final class Utils {
|
||||
directMedia = getDirectMediaModel(itemObject.getJSONObject("media_share"));
|
||||
break;
|
||||
|
||||
case CLIP:
|
||||
Log.d("austin_debug", "clip: "+itemObject.getJSONObject("clip").getJSONObject("clip"));
|
||||
directMedia = getDirectMediaModel(itemObject.getJSONObject("clip").getJSONObject("clip"));
|
||||
break;
|
||||
|
||||
case MEDIA:
|
||||
directMedia = getDirectMediaModel(itemObject.optJSONObject("media"));
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user