X-Git-Url: https://git.ktnx.net/?p=mobile-ledger.git;a=blobdiff_plain;f=app%2Fsrc%2Fmain%2Fjava%2Fnet%2Fktnx%2Fmobileledger%2FAccountSummary.java;h=dedc1005649fa6872b860029ea3d65c0b9459f62;hp=2b05c1b3b2559435208dc6455c4db3b1d4b6e67a;hb=017a2f0a73f4fe28ba170bb6d6e5827b426727e3;hpb=d54573f51530baacd9567a8aa2894a57f170f5e8 diff --git a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java index 2b05c1b3..dedc1005 100644 --- a/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java +++ b/app/src/main/java/net/ktnx/mobileledger/AccountSummary.java @@ -75,9 +75,34 @@ public class AccountSummary extends AppCompatActivity { update_accounts(false); } + @Override + protected void onStart() { + super.onStart(); + LinearLayout grp = drawer.findViewById(R.id.nav_actions); + for (int i = 0; i < grp.getChildCount(); i++) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + grp.getChildAt(i).setBackgroundColor( + getResources().getColor(R.color.drawer_background, getTheme())); + } + else { + grp.getChildAt(i) + .setBackgroundColor(getResources().getColor(R.color.drawer_background)); + } + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + drawer.findViewById(R.id.nav_account_summary).setBackgroundColor( + getResources().getColor(R.color.table_row_even_bg, getTheme())); + } + else { + drawer.findViewById(R.id.nav_account_summary) + .setBackgroundColor(getResources().getColor(R.color.table_row_even_bg)); + } + } + public void fab_new_transaction_clicked(View view) { Intent intent = new Intent(this, NewTransactionActivity.class); startActivity(intent); + overridePendingTransition(R.anim.slide_in_right, R.anim.dummy); } public void nav_exit_clicked(View view) { @@ -133,11 +158,10 @@ public class AccountSummary extends AppCompatActivity { MobileLedgerDB.setDb_filename(this.getApplicationInfo().deviceProtectedDataDir + "/" + MobileLedgerDB.DATABASE_NAME); } else { - MobileLedgerDB.setDb_filename(MobileLedgerDB.DATABASE_NAME); + MobileLedgerDB.setDb_filename( + this.getApplicationInfo().dataDir + "/" + MobileLedgerDB.DATABASE_NAME); } - MobileLedgerDB.initDB(); - - MobileLedgerDB.applyRevisions(getResources(), getPackageName()); + MobileLedgerDB.initDB(getResources(), getPackageName()); account_list_last_updated = MobileLedgerDB.get_option_value("last_refresh", (long) 0); @@ -239,10 +263,19 @@ 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)); - if (even) - r.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg, getTheme())); + if (even) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + r.setBackgroundColor( + getResources().getColor(R.color.table_row_even_bg, getTheme())); + } + else { + r.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg)); + } + } even = !even; - r.setContextClickable(true); + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + r.setContextClickable(true); + } r.setOnCreateContextMenuListener(ccml);