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 =
|
Drawable drawable =
|
||||||
ContextCompat.getDrawable(MessagesActivity.this, R.drawable.ic_delete);
|
ContextCompat.getDrawable(MessagesActivity.this, R.drawable.ic_delete);
|
||||||
|
icon = null;
|
||||||
if (drawable != null) {
|
if (drawable != null) {
|
||||||
icon = DrawableCompat.wrap(drawable.mutate());
|
icon = DrawableCompat.wrap(drawable.mutate());
|
||||||
DrawableCompat.setTint(icon, iconColorId);
|
DrawableCompat.setTint(icon, iconColorId);
|
||||||
@@ -457,6 +458,7 @@ public class MessagesActivity extends AppCompatActivity
|
|||||||
float dY,
|
float dY,
|
||||||
int actionState,
|
int actionState,
|
||||||
boolean isCurrentlyActive) {
|
boolean isCurrentlyActive) {
|
||||||
|
if (icon != null) {
|
||||||
View itemView = viewHolder.itemView;
|
View itemView = viewHolder.itemView;
|
||||||
|
|
||||||
int iconHeight = itemView.getHeight() / 3;
|
int iconHeight = itemView.getHeight() / 3;
|
||||||
@@ -498,6 +500,7 @@ public class MessagesActivity extends AppCompatActivity
|
|||||||
|
|
||||||
background.draw(c);
|
background.draw(c);
|
||||||
icon.draw(c);
|
icon.draw(c);
|
||||||
|
}
|
||||||
|
|
||||||
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
super.onChildDraw(c, recyclerView, viewHolder, dX, dY, actionState, isCurrentlyActive);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user