Small improvements

pull/145/head
M66B 6 years ago
parent fe65235de6
commit 7b103c9b9e

@ -135,8 +135,7 @@ public class AdapterAccount extends RecyclerView.Adapter<AdapterAccount.ViewHold
} }
}); });
all.clear(); all = accounts;
all.addAll(accounts);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -102,8 +102,7 @@ public class AdapterAnswer extends RecyclerView.Adapter<AdapterAnswer.ViewHolder
} }
}); });
all.clear(); all = answers;
all.addAll(answers);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -238,8 +238,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
} }
}); });
all.clear(); all = attachments;
all.addAll(attachments);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -132,8 +132,7 @@ public class AdapterIdentity extends RecyclerView.Adapter<AdapterIdentity.ViewHo
} }
}); });
all.clear(); all = identities;
all.addAll(identities);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -72,8 +72,7 @@ public class AdapterLog extends RecyclerView.Adapter<AdapterLog.ViewHolder> {
public void set(@NonNull List<EntityLog> logs) { public void set(@NonNull List<EntityLog> logs) {
Log.i(Helper.TAG, "Set logs=" + logs.size()); Log.i(Helper.TAG, "Set logs=" + logs.size());
all.clear(); all = logs;
all.addAll(logs);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -98,7 +98,7 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
ViewHolder(View itemView) { ViewHolder(View itemView) {
super(itemView); super(itemView);
this.itemView = itemView; this.itemView = itemView.findViewById(R.id.clItem);
vwColor = itemView.findViewById(R.id.vwColor); vwColor = itemView.findViewById(R.id.vwColor);
ivFlagged = itemView.findViewById(R.id.ivFlagged); ivFlagged = itemView.findViewById(R.id.ivFlagged);
ivAvatar = itemView.findViewById(R.id.ivAvatar); ivAvatar = itemView.findViewById(R.id.ivAvatar);

@ -110,8 +110,7 @@ public class AdapterOperation extends RecyclerView.Adapter<AdapterOperation.View
public void set(@NonNull List<EntityOperation> operations) { public void set(@NonNull List<EntityOperation> operations) {
Log.i(Helper.TAG, "Set operations=" + operations.size()); Log.i(Helper.TAG, "Set operations=" + operations.size());
all.clear(); all = operations;
all.addAll(operations);
DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all)); DiffUtil.DiffResult diff = DiffUtil.calculateDiff(new MessageDiffCallback(filtered, all));

@ -117,5 +117,6 @@
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tvError" /> app:layout_constraintTop_toBottomOf="@id/tvError" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout> </FrameLayout>

@ -1,10 +1,15 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="?attr/drawableItemBackground"> android:background="?attr/drawableItemBackground">
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/clItem"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<View <View
android:id="@+id/vwColor" android:id="@+id/vwColor"
android:layout_width="6dp" android:layout_width="6dp"
@ -166,4 +171,6 @@
android:background="?attr/colorSeparator" android:background="?attr/colorSeparator"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/marginBottom" /> app:layout_constraintTop_toBottomOf="@id/marginBottom" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
Loading…
Cancel
Save