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.Menu;
|
||||||
import android.view.MenuInflater;
|
import android.view.MenuInflater;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
@@ -127,13 +126,6 @@ public class EntryActivity extends LockingHideActivity {
|
|||||||
entryContentsView = findViewById(R.id.entry_contents);
|
entryContentsView = findViewById(R.id.entry_contents);
|
||||||
entryContentsView.applyFontVisibilityToFields(PreferencesUtil.fieldFontIsInVisibility(this));
|
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
|
// Init the clipboard helper
|
||||||
clipboardHelper = new ClipboardHelper(this);
|
clipboardHelper = new ClipboardHelper(this);
|
||||||
firstLaunchOfActivity = true;
|
firstLaunchOfActivity = true;
|
||||||
@@ -302,6 +294,12 @@ public class EntryActivity extends LockingHideActivity {
|
|||||||
inflater.inflate(R.menu.entry, menu);
|
inflater.inflate(R.menu.entry, menu);
|
||||||
inflater.inflate(R.menu.database_lock, 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);
|
MenuItem togglePassword = menu.findItem(R.id.menu_toggle_pass);
|
||||||
if (entryContentsView != null && togglePassword != null) {
|
if (entryContentsView != null && togglePassword != null) {
|
||||||
if (entryContentsView.isPasswordPresent() || entryContentsView.atLeastOneFieldProtectedPresent()) {
|
if (entryContentsView.isPasswordPresent() || entryContentsView.atLeastOneFieldProtectedPresent()) {
|
||||||
@@ -341,6 +339,10 @@ public class EntryActivity extends LockingHideActivity {
|
|||||||
entryContentsView.setHiddenPasswordStyle(!mShowPassword);
|
entryContentsView.setHiddenPasswordStyle(!mShowPassword);
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
case R.id.menu_edit:
|
||||||
|
EntryEditActivity.launch(EntryActivity.this, mEntry);
|
||||||
|
return true;
|
||||||
|
|
||||||
case R.id.menu_goto_url:
|
case R.id.menu_goto_url:
|
||||||
String url;
|
String url;
|
||||||
url = mEntry.getUrl();
|
url = mEntry.getUrl();
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ public class EntryEditActivity extends LockingHideActivity
|
|||||||
* @param act from activity
|
* @param act from activity
|
||||||
* @param pw Entry to update
|
* @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)) {
|
if (LockingActivity.checkTimeIsAllowedOrFinish(act)) {
|
||||||
Intent intent = new Intent(act, EntryEditActivity.class);
|
Intent intent = new Intent(act, EntryEditActivity.class);
|
||||||
intent.putExtra(KEY_ENTRY, Types.UUIDtoBytes(pw.getUUID()));
|
intent.putExtra(KEY_ENTRY, Types.UUIDtoBytes(pw.getUUID()));
|
||||||
@@ -111,7 +111,7 @@ public class EntryEditActivity extends LockingHideActivity
|
|||||||
* @param act from activity
|
* @param act from activity
|
||||||
* @param pwGroup Group who will contains new entry
|
* @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)) {
|
if (LockingActivity.checkTimeIsAllowedOrFinish(act)) {
|
||||||
Intent intent = new Intent(act, EntryEditActivity.class);
|
Intent intent = new Intent(act, EntryEditActivity.class);
|
||||||
intent.putExtra(KEY_PARENT, pwGroup.getId());
|
intent.putExtra(KEY_PARENT, pwGroup.getId());
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ public class GroupActivity extends ListNodesActivity
|
|||||||
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
||||||
});
|
});
|
||||||
addNodeButtonView.setAddEntryClickListener(v ->
|
addNodeButtonView.setAddEntryClickListener(v ->
|
||||||
EntryEditActivity.Launch(GroupActivity.this, mCurrentGroup));
|
EntryEditActivity.launch(GroupActivity.this, mCurrentGroup));
|
||||||
|
|
||||||
setGroupTitle();
|
setGroupTitle();
|
||||||
setGroupIcon();
|
setGroupIcon();
|
||||||
@@ -230,7 +230,7 @@ public class GroupActivity extends ListNodesActivity
|
|||||||
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
GroupEditDialogFragment.TAG_CREATE_GROUP);
|
||||||
break;
|
break;
|
||||||
case ENTRY:
|
case ENTRY:
|
||||||
EntryEditActivity.Launch(GroupActivity.this, (PwEntry) node);
|
EntryEditActivity.launch(GroupActivity.this, (PwEntry) node);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -71,14 +71,4 @@
|
|||||||
|
|
||||||
</ScrollView>
|
</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>
|
</RelativeLayout>
|
||||||
@@ -24,9 +24,14 @@
|
|||||||
android:title="@string/menu_showpass"
|
android:title="@string/menu_showpass"
|
||||||
android:orderInCategory="21"
|
android:orderInCategory="21"
|
||||||
app:showAsAction="always" />
|
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"
|
<item android:id="@+id/menu_goto_url"
|
||||||
android:icon="@drawable/ic_launch_white_24dp"
|
android:icon="@drawable/ic_launch_white_24dp"
|
||||||
android:title="@string/menu_url"
|
android:title="@string/menu_url"
|
||||||
android:orderInCategory="22"
|
android:orderInCategory="23"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
Reference in New Issue
Block a user