Some misc fixes

This commit is contained in:
Alexander Bakker 2018-06-09 21:40:18 +02:00
parent 152cc8b562
commit a2e5504eef
6 changed files with 12 additions and 8 deletions

View file

@ -310,7 +310,7 @@ public class EditEntryActivity extends AegisActivity {
finish(true);
});
break;
case R.id.action_default_image:
case R.id.action_default_icon:
TextDrawable drawable = TextDrawableHelper.generate(_entry.getIssuer(), _entry.getName(), _iconView);
_iconView.setImageDrawable(drawable);
_hasCustomImage = false;
@ -328,7 +328,7 @@ public class EditEntryActivity extends AegisActivity {
menu.findItem(R.id.action_delete).setVisible(false);
}
if (!_hasCustomImage) {
menu.findItem(R.id.action_default_image).setVisible(false);
menu.findItem(R.id.action_default_icon).setVisible(false);
}
return true;

View file

@ -99,7 +99,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
setIntent(intent);
if (!doShortcutActions() || _db.isLocked()) {
startAuthActivity();
unlockDatabase(null);
}
}
@ -155,6 +155,7 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
} else if (data.getBooleanExtra("needsRefresh", false)) {
boolean showIssuer = getPreferences().isIssuerVisible();
_entryListView.setShowIssuer(showIssuer);
_entryListView.refresh(true);
}
}
@ -361,6 +362,10 @@ public class MainActivity extends AegisActivity implements EntryListView.Listene
}
private void unlockDatabase(MasterKey key) {
if (_loaded) {
return;
}
try {
if (!_db.isLoaded()) {
_db.load();

View file

@ -142,7 +142,7 @@ public class PreferencesFragment extends PreferenceFragmentCompat implements Pas
if (!_db.getFile().isEncrypted()) {
PasswordDialogFragment dialog = new PasswordDialogFragment();
// TODO: find a less ugly way to obtain the fragment manager
dialog.show(((AppCompatActivity)getActivity()).getSupportFragmentManager(), null);
dialog.show(getActivity().getSupportFragmentManager(), null);
} else {
new AlertDialog.Builder(getActivity())
.setTitle("Disable encryption")

View file

@ -131,7 +131,6 @@ public class EntryListView extends Fragment implements EntryAdapter.Listener {
public void setShowIssuer(boolean showIssuer) {
_adapter.setShowIssuer(showIssuer);
_adapter.refresh(true);
}
public void addEntry(DatabaseEntry entry) {