]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/AccountSummary.java
account summary: account rows with minimum height of an action bar
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / AccountSummary.java
index dedc1005649fa6872b860029ea3d65c0b9459f62..d653ced44ed798f4984bafbd59b0668d76226477 100644 (file)
@@ -139,7 +139,7 @@ public class AccountSummary extends AppCompatActivity {
         // Handle action bar item clicks here. The action bar will
         // automatically handle clicks on the Home/Up button, so long
         // as you specify a parent activity in AndroidManifest.xml.
-        int id = item.getItemId();
+//        int id = item.getItemId();
 
         //noinspection SimplifiableIfStatement
         //if (id == R.id.action_settings) {
@@ -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(