mirror of
https://github.com/KokaKiwi/BarInsta
synced 2024-11-22 06:37:30 +00:00
make placeholders look better
This commit is contained in:
parent
8bf9f5f2cc
commit
b4b91c68e3
@ -171,7 +171,7 @@ public final class DirectItemsAdapter extends RecyclerView.Adapter<RecyclerView.
|
|||||||
return new DirectItemVideoCallEventViewHolder(baseBinding, binding, currentUser, thread, callback);
|
return new DirectItemVideoCallEventViewHolder(baseBinding, binding, currentUser, thread, callback);
|
||||||
}
|
}
|
||||||
case PLACEHOLDER: {
|
case PLACEHOLDER: {
|
||||||
final LayoutDmTextBinding binding = LayoutDmTextBinding.inflate(layoutInflater, baseBinding.message, false);
|
final LayoutDmStoryShareBinding binding = LayoutDmStoryShareBinding.inflate(layoutInflater, baseBinding.message, false);
|
||||||
return new DirectItemPlaceholderViewHolder(baseBinding, binding, currentUser, thread, callback);
|
return new DirectItemPlaceholderViewHolder(baseBinding, binding, currentUser, thread, callback);
|
||||||
}
|
}
|
||||||
case ANIMATED_MEDIA: {
|
case ANIMATED_MEDIA: {
|
||||||
|
@ -1,21 +1,23 @@
|
|||||||
package awais.instagrabber.adapters.viewholder.directmessages;
|
package awais.instagrabber.adapters.viewholder.directmessages;
|
||||||
|
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.recyclerview.widget.ItemTouchHelper;
|
import androidx.recyclerview.widget.ItemTouchHelper;
|
||||||
|
|
||||||
import awais.instagrabber.adapters.DirectItemsAdapter.DirectItemCallback;
|
import awais.instagrabber.adapters.DirectItemsAdapter.DirectItemCallback;
|
||||||
import awais.instagrabber.databinding.LayoutDmBaseBinding;
|
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.User;
|
||||||
import awais.instagrabber.repositories.responses.directmessages.DirectItem;
|
import awais.instagrabber.repositories.responses.directmessages.DirectItem;
|
||||||
import awais.instagrabber.repositories.responses.directmessages.DirectThread;
|
import awais.instagrabber.repositories.responses.directmessages.DirectThread;
|
||||||
|
|
||||||
public class DirectItemPlaceholderViewHolder extends DirectItemViewHolder {
|
public class DirectItemPlaceholderViewHolder extends DirectItemViewHolder {
|
||||||
|
|
||||||
private final LayoutDmTextBinding binding;
|
private final LayoutDmStoryShareBinding binding;
|
||||||
|
|
||||||
public DirectItemPlaceholderViewHolder(@NonNull final LayoutDmBaseBinding baseBinding,
|
public DirectItemPlaceholderViewHolder(@NonNull final LayoutDmBaseBinding baseBinding,
|
||||||
final LayoutDmTextBinding binding,
|
final LayoutDmStoryShareBinding binding,
|
||||||
final User currentUser,
|
final User currentUser,
|
||||||
final DirectThread thread,
|
final DirectThread thread,
|
||||||
final DirectItemCallback callback) {
|
final DirectItemCallback callback) {
|
||||||
@ -26,13 +28,11 @@ public class DirectItemPlaceholderViewHolder extends DirectItemViewHolder {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void bindItem(final DirectItem directItemModel, final MessageDirection messageDirection) {
|
public void bindItem(final DirectItem directItemModel, final MessageDirection messageDirection) {
|
||||||
final String text = String.format("%s: %s", directItemModel.getPlaceholder().getTitle(), directItemModel.getPlaceholder().getMessage());
|
binding.shareInfo.setText(directItemModel.getPlaceholder().getTitle());
|
||||||
binding.tvMessage.setText(text);
|
binding.text.setVisibility(View.VISIBLE);
|
||||||
}
|
binding.text.setText(directItemModel.getPlaceholder().getMessage());
|
||||||
|
binding.ivMediaPreview.setVisibility(View.GONE);
|
||||||
@Override
|
binding.typeIcon.setVisibility(View.GONE);
|
||||||
protected boolean showBackground() {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user