mirror of https://github.com/M66B/FairEmail.git
parent
33f1a352ef
commit
1f096d019e
|
@ -197,20 +197,22 @@ public class FragmentMessages extends FragmentEx {
|
||||||
if (dX > margin) {
|
if (dX > margin) {
|
||||||
// Right swipe
|
// Right swipe
|
||||||
Drawable d = getResources().getDrawable(inbox ? R.drawable.baseline_inbox_24 : R.drawable.baseline_archive_24, getContext().getTheme());
|
Drawable d = getResources().getDrawable(inbox ? R.drawable.baseline_inbox_24 : R.drawable.baseline_archive_24, getContext().getTheme());
|
||||||
|
int padding = (itemView.getHeight() - d.getIntrinsicHeight());
|
||||||
d.setBounds(
|
d.setBounds(
|
||||||
itemView.getLeft() + margin,
|
itemView.getLeft() + margin,
|
||||||
itemView.getTop() + d.getIntrinsicHeight() / 2,
|
itemView.getTop() + padding / 2,
|
||||||
itemView.getLeft() + margin + d.getIntrinsicWidth(),
|
itemView.getLeft() + margin + d.getIntrinsicWidth(),
|
||||||
itemView.getTop() + (itemView.getHeight() - d.getIntrinsicHeight() / 2));
|
itemView.getTop() + padding / 2 + d.getIntrinsicHeight());
|
||||||
d.draw(canvas);
|
d.draw(canvas);
|
||||||
} else if (dX < -margin) {
|
} else if (dX < -margin) {
|
||||||
// Left swipe
|
// Left swipe
|
||||||
Drawable d = getResources().getDrawable(inbox ? R.drawable.baseline_inbox_24 : R.drawable.baseline_delete_24, getContext().getTheme());
|
Drawable d = getResources().getDrawable(inbox ? R.drawable.baseline_inbox_24 : R.drawable.baseline_delete_24, getContext().getTheme());
|
||||||
|
int padding = (itemView.getHeight() - d.getIntrinsicHeight());
|
||||||
d.setBounds(
|
d.setBounds(
|
||||||
itemView.getLeft() + itemView.getWidth() - d.getIntrinsicWidth() - margin,
|
itemView.getLeft() + itemView.getWidth() - d.getIntrinsicWidth() - margin,
|
||||||
itemView.getTop() + d.getIntrinsicHeight() / 2,
|
itemView.getTop() + padding / 2,
|
||||||
itemView.getLeft() + itemView.getWidth() - margin,
|
itemView.getLeft() + itemView.getWidth() - margin,
|
||||||
itemView.getTop() + (itemView.getHeight() - d.getIntrinsicHeight() / 2));
|
itemView.getTop() + padding / 2 + d.getIntrinsicHeight());
|
||||||
d.draw(canvas);
|
d.draw(canvas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue