From: Damyan Ivanov Date: Mon, 10 Dec 2018 20:20:00 +0000 (+0000) Subject: account summary: account rows with minimum height of an action bar X-Git-Tag: v0.3~254 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=186501062053c09d275f3127f7d3aa53bfd661cd;p=mobile-ledger.git account summary: account rows with minimum height of an action bar --- 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(