From 186501062053c09d275f3127f7d3aa53bfd661cd Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Mon, 10 Dec 2018 20:20:00 +0000 Subject: [PATCH] account summary: account rows with minimum height of an action bar --- app/src/main/java/net/ktnx/mobileledger/AccountSummary.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java index 79c5d709..d653ced4 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java +++ b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java @@ -254,6 +254,10 @@ public class AccountSummary extends AppCompatActivity { } }; + int actionBarHeight = + getTheme().obtainStyledAttributes(new int[]{android.R.attr.actionBarSize}) + .getDimensionPixelSize(0, dp2px(56)); + try (Cursor cursor = db.rawQuery("SELECT name FROM accounts ORDER BY name;", null)) { boolean even = false; while (cursor.moveToNext()) { @@ -263,6 +267,8 @@ public class AccountSummary extends AppCompatActivity { r.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT)); r.setGravity(Gravity.CENTER_VERTICAL); r.setPadding(getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin), dp2px(3), getResources().getDimensionPixelSize(R.dimen.activity_horizontal_margin), dp2px(4)); + r.setMinimumHeight(actionBarHeight); + if (even) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { r.setBackgroundColor( -- 2.39.5