|
|
@ -1,21 +1,23 @@ |
|
|
|
package awais.instagrabber.adapters.viewholder.directmessages; |
|
|
|
|
|
|
|
import android.view.View; |
|
|
|
|
|
|
|
import androidx.annotation.NonNull; |
|
|
|
import androidx.recyclerview.widget.ItemTouchHelper; |
|
|
|
|
|
|
|
import awais.instagrabber.adapters.DirectItemsAdapter.DirectItemCallback; |
|
|
|
import awais.instagrabber.databinding.LayoutDmBaseBinding; |
|
|
|
import awais.instagrabber.databinding.LayoutDmTextBinding; |
|
|
|
import awais.instagrabber.databinding.LayoutDmStoryShareBinding; |
|
|
|
import awais.instagrabber.repositories.responses.User; |
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectItem; |
|
|
|
import awais.instagrabber.repositories.responses.directmessages.DirectThread; |
|
|
|
|
|
|
|
public class DirectItemPlaceholderViewHolder extends DirectItemViewHolder { |
|
|
|
|
|
|
|
private final LayoutDmTextBinding binding; |
|
|
|
private final LayoutDmStoryShareBinding binding; |
|
|
|
|
|
|
|
public DirectItemPlaceholderViewHolder(@NonNull final LayoutDmBaseBinding baseBinding, |
|
|
|
final LayoutDmTextBinding binding, |
|
|
|
final LayoutDmStoryShareBinding binding, |
|
|
|
final User currentUser, |
|
|
|
final DirectThread thread, |
|
|
|
final DirectItemCallback callback) { |
|
|
@ -26,13 +28,11 @@ public class DirectItemPlaceholderViewHolder extends DirectItemViewHolder { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void bindItem(final DirectItem directItemModel, final MessageDirection messageDirection) { |
|
|
|
final String text = String.format("%s: %s", directItemModel.getPlaceholder().getTitle(), directItemModel.getPlaceholder().getMessage()); |
|
|
|
binding.tvMessage.setText(text); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
protected boolean showBackground() { |
|
|
|
return true; |
|
|
|
binding.shareInfo.setText(directItemModel.getPlaceholder().getTitle()); |
|
|
|
binding.text.setVisibility(View.VISIBLE); |
|
|
|
binding.text.setText(directItemModel.getPlaceholder().getMessage()); |
|
|
|
binding.ivMediaPreview.setVisibility(View.GONE); |
|
|
|
binding.typeIcon.setVisibility(View.GONE); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|