Add null-check of swipe icon.
This commit is contained in:
committed by
Jannis Mattheis
parent
6b00bfb63c
commit
ed8689daa0
@@ -425,6 +425,7 @@ public class MessagesActivity extends AppCompatActivity
|
||||
|
||||
Drawable drawable =
|
||||
ContextCompat.getDrawable(MessagesActivity.this, R.drawable.ic_delete);
|
||||
icon = null;
|
||||
if (drawable != null) {
|
||||
icon = DrawableCompat.wrap(drawable.mutate());
|
||||
DrawableCompat.setTint(icon, iconColorId);
|
||||
@@ -457,6 +458,7 @@ public class MessagesActivity extends AppCompatActivity
|
||||
float dY,
|
||||
int actionState,
|
||||
boolean isCurrentlyActive) {
|
||||
if (icon != null) {
|
||||
View itemView = viewHolder.itemView;
|
||||
|
||||
int iconHeight = itemView.getHeight() / 3;
|
||||
@@ -498,6 +500,7 @@ public class MessagesActivity extends AppCompatActivity
|
||||
|
||||
background.draw(c);
|
||||
icon.draw(c);
|
||||
}
|
||||
|
||||
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user