Prettify theme, add relaunch to settings on change

This commit is contained in:
d8ahazard 2016-09-26 14:11:00 -05:00 committed by topjohnwu
parent a1335aecfb
commit 835ef01a70
2 changed files with 14 additions and 9 deletions

View File

@ -135,20 +135,25 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
mSelectedId = savedInstanceState == null ? mSelectedId : savedInstanceState.getInt(SELECTED_ITEM_ID); mSelectedId = savedInstanceState == null ? mSelectedId : savedInstanceState.getInt(SELECTED_ITEM_ID);
navigationView.setCheckedItem(mSelectedId); navigationView.setCheckedItem(mSelectedId);
if (savedInstanceState == null) {
mDrawerHandler.removeCallbacksAndMessages(null);
mDrawerHandler.postDelayed(() -> navigate(mSelectedId), 250);
}
navigationView.setNavigationItemSelectedListener(this); navigationView.setNavigationItemSelectedListener(this);
Bundle extras = getIntent().getExtras(); Bundle extras = getIntent().getExtras();
if (extras != null) { if (extras != null) {
navigate(R.id.settings); String toLaunch = "";
Logger.dh("MainActivity: Intent has extras " + getIntent().getExtras().getString("Relaunch")); toLaunch = getIntent().getExtras().getString("Relaunch");
if (toLaunch.equals("Settings")) {
Logger.dh("MainActivity: Intent has extras " + getIntent().getExtras().getString("Relaunch"));
mSelectedId = R.id.settings;
}
} }
mDrawerHandler.removeCallbacksAndMessages(null);
navigate(mSelectedId);
} }
@Override @Override

View File

@ -16,7 +16,7 @@
<color name="dh_primary">#3F51B5</color> <color name="dh_primary">#3F51B5</color>
<color name="dh_primary_dark">#303F9F</color> <color name="dh_primary_dark">#303F9F</color>
<color name="dh_primary_light">#C5CAE9</color> <color name="dh_primary_light">#C5CAE9</color>
<color name="dh_accent">#9C6DFF</color> <color name="dh_accent">#448AFF</color>
<color name="dh_primary_text">#dedede</color> <color name="dh_primary_text">#dedede</color>
<color name="dh_secondary_text">#8A8A8A</color> <color name="dh_secondary_text">#8A8A8A</color>
@ -24,8 +24,8 @@
<color name="dh_divider">#313131</color> <color name="dh_divider">#313131</color>
<color name="dh_alertWarn">#FF9800</color> <color name="dh_alertWarn">#FF9800</color>
<color name="dh_alertOk">@color/dh_accent</color> <color name="dh_alertOk">@color/dh_accent</color>
<color name="dh_alertNeutral">#2196F3</color> <color name="dh_alertNeutral">@color/dh_primary_light</color>
<color name="dh_alertFail">#FF5722</color> <color name="dh_alertFail">@color/red500</color>
</resources> </resources>