From 5043cda0fd18ad359e3bd1164a69d6e777f44788 Mon Sep 17 00:00:00 2001 From: jacques Date: Wed, 8 Jun 2022 19:01:24 +0200 Subject: [PATCH] Find a calculation to have same icon size in both swipe direction --- .../main/java/net/foucry/pilldroid/DrugListActivity.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java index d7beaf7..8f3b1f4 100644 --- a/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java +++ b/app/src/main/java/net/foucry/pilldroid/DrugListActivity.java @@ -525,9 +525,9 @@ public class DrugListActivity extends AppCompatActivity { (float) itemView.getBottom(), p); int xMarkLeft = itemView.getLeft() + xMarkMargin; - int xMarkRight = 170; // Arbitrary value cannot find a way to make correct calculation + int xMarkRight = itemView.getLeft() + xMarkMargin + intrinsicWidth; int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2; - int xMarkBottom = itemView.getTop() + intrinsicHeight +xMarkTop; + int xMarkBottom = xMarkTop + intrinsicHeight;// +xMarkTop; icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom); icon.draw(c); @@ -540,7 +540,7 @@ public class DrugListActivity extends AppCompatActivity { int xMarkRight = itemView.getRight() - xMarkMargin; int xMarkTop = itemView.getTop() + (itemHeight - intrinsicHeight) / 2; int xMarkBottom = xMarkTop + intrinsicHeight; - icon.setBounds(xMarkLeft, xMarkTop + 16, xMarkRight, xMarkBottom); + icon.setBounds(xMarkLeft, xMarkTop, xMarkRight, xMarkBottom); icon.draw(c); }