mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-16 19:57:31 +00:00
Add viewholder for default (unhandled) dm item types
This commit is contained in:
parent
052402a974
commit
f7fb374aca
@ -12,6 +12,7 @@ import java.util.List;
|
|||||||
|
|
||||||
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageActionLogViewHolder;
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageActionLogViewHolder;
|
||||||
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageAnimatedMediaViewHolder;
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageAnimatedMediaViewHolder;
|
||||||
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageDefaultViewHolder;
|
||||||
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageItemViewHolder;
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageItemViewHolder;
|
||||||
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageLinkViewHolder;
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageLinkViewHolder;
|
||||||
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageMediaShareViewHolder;
|
import awais.instagrabber.adapters.viewholder.directmessages.DirectMessageMediaShareViewHolder;
|
||||||
@ -76,7 +77,6 @@ public final class DirectMessageItemsAdapter extends ListAdapter<DirectItemModel
|
|||||||
final LayoutDmBaseBinding baseBinding = LayoutDmBaseBinding.inflate(layoutInflater, parent, false);
|
final LayoutDmBaseBinding baseBinding = LayoutDmBaseBinding.inflate(layoutInflater, parent, false);
|
||||||
final ViewGroup itemViewParent = baseBinding.messageCard;
|
final ViewGroup itemViewParent = baseBinding.messageCard;
|
||||||
switch (directItemType) {
|
switch (directItemType) {
|
||||||
default:
|
|
||||||
case LIKE:
|
case LIKE:
|
||||||
case TEXT: {
|
case TEXT: {
|
||||||
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, itemViewParent, false);
|
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, itemViewParent, false);
|
||||||
@ -130,6 +130,10 @@ public final class DirectMessageItemsAdapter extends ListAdapter<DirectItemModel
|
|||||||
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, itemViewParent, false);
|
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, itemViewParent, false);
|
||||||
return new DirectMessageVideoCallEventViewHolder(baseBinding, binding, onClickListener);
|
return new DirectMessageVideoCallEventViewHolder(baseBinding, binding, onClickListener);
|
||||||
}
|
}
|
||||||
|
default: {
|
||||||
|
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, itemViewParent, false);
|
||||||
|
return new DirectMessageDefaultViewHolder(baseBinding, binding, onClickListener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -0,0 +1,30 @@
|
|||||||
|
package awais.instagrabber.adapters.viewholder.directmessages;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
|
||||||
|
import awais.instagrabber.R;
|
||||||
|
import awais.instagrabber.databinding.LayoutDmBaseBinding;
|
||||||
|
import awais.instagrabber.databinding.LayoutDmTextBinding;
|
||||||
|
import awais.instagrabber.models.direct_messages.DirectItemModel;
|
||||||
|
|
||||||
|
public class DirectMessageDefaultViewHolder extends DirectMessageItemViewHolder {
|
||||||
|
|
||||||
|
private final LayoutDmTextBinding binding;
|
||||||
|
|
||||||
|
public DirectMessageDefaultViewHolder(@NonNull final LayoutDmBaseBinding baseBinding,
|
||||||
|
@NonNull final LayoutDmTextBinding binding,
|
||||||
|
final View.OnClickListener onClickListener) {
|
||||||
|
super(baseBinding, onClickListener);
|
||||||
|
this.binding = binding;
|
||||||
|
setItemView(binding.getRoot());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void bindItem(final DirectItemModel directItemModel) {
|
||||||
|
final Context context = itemView.getContext();
|
||||||
|
binding.tvMessage.setText(context.getText(R.string.dms_inbox_raven_message_unknown));
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user