From: Damyan Ivanov Date: Mon, 31 Dec 2018 19:20:21 +0000 (+0000) Subject: set title when fragment is changed X-Git-Tag: v0.3~145 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=bd8dd1b3d4cd6265bde05827e68f2a2bf2841fa0;p=mobile-ledger.git set title when fragment is changed --- diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java index 5aa6ace2..64f61382 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/activity/MainActivity.java @@ -35,6 +35,7 @@ import android.view.ContextMenu; import android.view.MenuItem; import android.view.View; import android.widget.LinearLayout; +import android.widget.TextView; import net.ktnx.mobileledger.R; import net.ktnx.mobileledger.model.LedgerAccount; @@ -93,7 +94,7 @@ public class MainActivity extends AppCompatActivity { startActivity(intent); } public void markDrawerItemCurrent(int id) { - View item = drawer.findViewById(id); + TextView item = drawer.findViewById(id); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { item.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg, getTheme())); } @@ -101,6 +102,8 @@ public class MainActivity extends AppCompatActivity { item.setBackgroundColor(getResources().getColor(R.color.table_row_even_bg)); } + setTitle(item.getText()); + @ColorInt int transparent = getResources().getColor(android.R.color.transparent); LinearLayout actions = drawer.findViewById(R.id.nav_actions);