Refactoring

This commit is contained in:
M66B 2019-10-11 11:22:30 +02:00
parent ea399c2ba0
commit 6a7f04ea5f
1 changed files with 14 additions and 12 deletions

View File

@ -3745,18 +3745,6 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
Log.i("Answer count=" + answers);
}
@Override
public int getItemViewType(int position) {
TupleMessageEx message = differ.getItem(position);
if (message == null || context == null)
return R.layout.item_message_placeholder;
if (filter_duplicates && message.duplicate)
return R.layout.item_message_duplicate;
return (compact ? R.layout.item_message_compact : R.layout.item_message_normal);
}
@Override
public int getItemCount() {
return differ.getItemCount();
@ -4036,6 +4024,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
}
};
@Override
public int getItemViewType(int position) {
TupleMessageEx message = differ.getItem(position);
if (message == null || context == null)
return R.layout.item_message_placeholder;
if (filter_duplicates && message.duplicate)
return R.layout.item_message_duplicate;
return (compact ? R.layout.item_message_compact : R.layout.item_message_normal);
}
@Override
@NonNull
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
@ -4045,6 +4046,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
@Override
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
TupleMessageEx message = differ.getItem(position);
if (message == null || context == null)
return;