}
barDrawerToggle.syncState();
- TextView ver = drawer.findViewById(R.id.drawer_version_text);
try {
PackageInfo pi = getApplicationContext().getPackageManager()
.getPackageInfo(getPackageName(), 0);
- ver.setText(pi.versionName);
+ ((TextView) findViewById(R.id.nav_upper).findViewById(
+ R.id.drawer_version_text)).setText(pi.versionName);
+ ((TextView) findViewById(R.id.no_profiles_layout).findViewById(
+ R.id.drawer_version_text)).setText(pi.versionName);
}
catch (Exception e) {
e.printStackTrace();
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N_MR1)
return;
+ ShortcutManager sm = getSystemService(ShortcutManager.class);
List<ShortcutInfo> shortcuts = new ArrayList<>();
int i = 0;
for (MobileLedgerProfile p : list) {
+ if (shortcuts.size() >= sm.getMaxShortcutCountPerActivity())
+ break;
+
if (!p.isPostingPermitted())
continue;
shortcuts.add(si);
i++;
}
- ShortcutManager sm = getSystemService(ShortcutManager.class);
sm.setDynamicShortcuts(shortcuts);
}
private void onProfileListChanged(List<MobileLedgerProfile> newList) {
mProfileListAdapter.notifyDataSetChanged();
- int newProfileTheme = haveProfile ? profile.getThemeId() : -1;
+ int newProfileTheme = haveProfile ? profile.getThemeHue() : -1;
if (newProfileTheme != Colors.profileThemeId) {
debug("profiles",
String.format(Locale.ENGLISH, "profile theme %d → %d", Colors.profileThemeId,
fab.show();
}
else {
- mToolbar.setSubtitle(R.string.profile_subitlte_read_only);
+ mToolbar.setSubtitle(R.string.profile_subtitle_read_only);
fab.hide();
}
}
Bundle bundle = new Bundle();
onSaveInstanceState(bundle);
- storeThemeIdInPrefs(profile.getThemeId());
+ storeThemeIdInPrefs(profile.getThemeHue());
// restart activity to reflect theme change
finish();
startActivity(intent);
overridePendingTransition(R.anim.slide_in_up, R.anim.dummy);
}
- public void navSettingsClicked(View view) {
- Intent intent = new Intent(this, SettingsActivity.class);
- startActivity(intent);
- drawer.closeDrawers();
- }
public void markDrawerItemCurrent(int id) {
TextView item = drawer.findViewById(id);
item.setBackgroundColor(Colors.tableRowDarkBG);