mirror of
https://github.com/Kunzisoft/KeePassDX.git
synced 2025-12-04 15:49:33 +01:00
Entry edit as menu, Launch in lowercase
This commit is contained in:
@@ -30,7 +30,6 @@ import android.util.Log;
|
||||
import android.view.Menu;
|
||||
import android.view.MenuInflater;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
@@ -127,13 +126,6 @@ public class EntryActivity extends LockingHideActivity {
|
||||
entryContentsView = findViewById(R.id.entry_contents);
|
||||
entryContentsView.applyFontVisibilityToFields(PreferencesUtil.fieldFontIsInVisibility(this));
|
||||
|
||||
// Setup Edit Buttons
|
||||
View edit = findViewById(R.id.entry_edit);
|
||||
edit.setOnClickListener(v -> EntryEditActivity.Launch(EntryActivity.this, mEntry));
|
||||
if (readOnly) {
|
||||
edit.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
// Init the clipboard helper
|
||||
clipboardHelper = new ClipboardHelper(this);
|
||||
firstLaunchOfActivity = true;
|
||||
@@ -302,6 +294,12 @@ public class EntryActivity extends LockingHideActivity {
|
||||
inflater.inflate(R.menu.entry, menu);
|
||||
inflater.inflate(R.menu.database_lock, menu);
|
||||
|
||||
if (readOnly) {
|
||||
MenuItem edit = menu.findItem(R.id.menu_edit);
|
||||
if (edit != null)
|
||||
edit.setVisible(false);
|
||||
}
|
||||
|
||||
MenuItem togglePassword = menu.findItem(R.id.menu_toggle_pass);
|
||||
if (entryContentsView != null && togglePassword != null) {
|
||||
if (entryContentsView.isPasswordPresent() || entryContentsView.atLeastOneFieldProtectedPresent()) {
|
||||
@@ -340,6 +338,10 @@ public class EntryActivity extends LockingHideActivity {
|
||||
changeShowPasswordIcon(item);
|
||||
entryContentsView.setHiddenPasswordStyle(!mShowPassword);
|
||||
return true;
|
||||
|
||||
case R.id.menu_edit:
|
||||
EntryEditActivity.launch(EntryActivity.this, mEntry);
|
||||
return true;
|
||||
|
||||
case R.id.menu_goto_url:
|
||||
String url;
|
||||
|
||||
@@ -98,7 +98,7 @@ public class EntryEditActivity extends LockingHideActivity
|
||||
* @param act from activity
|
||||
* @param pw Entry to update
|
||||
*/
|
||||
public static void Launch(Activity act, PwEntry pw) {
|
||||
public static void launch(Activity act, PwEntry pw) {
|
||||
if (LockingActivity.checkTimeIsAllowedOrFinish(act)) {
|
||||
Intent intent = new Intent(act, EntryEditActivity.class);
|
||||
intent.putExtra(KEY_ENTRY, Types.UUIDtoBytes(pw.getUUID()));
|
||||
@@ -111,7 +111,7 @@ public class EntryEditActivity extends LockingHideActivity
|
||||
* @param act from activity
|
||||
* @param pwGroup Group who will contains new entry
|
||||
*/
|
||||
public static void Launch(Activity act, PwGroup pwGroup) {
|
||||
public static void launch(Activity act, PwGroup pwGroup) {
|
||||
if (LockingActivity.checkTimeIsAllowedOrFinish(act)) {
|
||||
Intent intent = new Intent(act, EntryEditActivity.class);
|
||||
intent.putExtra(KEY_PARENT, pwGroup.getId());
|
||||
|
||||
@@ -156,7 +156,7 @@ public class GroupActivity extends ListNodesActivity
|
||||
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
||||
});
|
||||
addNodeButtonView.setAddEntryClickListener(v ->
|
||||
EntryEditActivity.Launch(GroupActivity.this, mCurrentGroup));
|
||||
EntryEditActivity.launch(GroupActivity.this, mCurrentGroup));
|
||||
|
||||
setGroupTitle();
|
||||
setGroupIcon();
|
||||
@@ -230,7 +230,7 @@ public class GroupActivity extends ListNodesActivity
|
||||
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
||||
break;
|
||||
case ENTRY:
|
||||
EntryEditActivity.Launch(GroupActivity.this, (PwEntry) node);
|
||||
EntryEditActivity.launch(GroupActivity.this, (PwEntry) node);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -71,14 +71,4 @@
|
||||
|
||||
</ScrollView>
|
||||
|
||||
<android.support.design.widget.FloatingActionButton android:id="@+id/entry_edit"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:src="@drawable/ic_mode_edit_white_24dp"
|
||||
app:useCompatPadding="true"
|
||||
style="@style/KeepassDXStyle.Fab" />
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -24,9 +24,14 @@
|
||||
android:title="@string/menu_showpass"
|
||||
android:orderInCategory="21"
|
||||
app:showAsAction="always" />
|
||||
<item android:id="@+id/menu_edit"
|
||||
android:icon="@drawable/ic_mode_edit_white_24dp"
|
||||
android:title="@string/menu_edit"
|
||||
android:orderInCategory="22"
|
||||
app:showAsAction="always" />
|
||||
<item android:id="@+id/menu_goto_url"
|
||||
android:icon="@drawable/ic_launch_white_24dp"
|
||||
android:title="@string/menu_url"
|
||||
android:orderInCategory="22"
|
||||
android:orderInCategory="23"
|
||||
app:showAsAction="ifRoom" />
|
||||
</menu>
|
||||
|
||||
Reference in New Issue
Block a user