displaytext: add "View Log" option, move "Copy to clipboard" into overflow menu
This commit is contained in:
@@ -19,6 +19,7 @@ package org.sufficientlysecure.keychain.ui;
|
|||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import android.app.Activity;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
@@ -472,6 +473,16 @@ public abstract class DecryptFragment extends Fragment implements LoaderManager.
|
|||||||
|
|
||||||
protected abstract void onVerifyLoaded(boolean hideErrorOverlay);
|
protected abstract void onVerifyLoaded(boolean hideErrorOverlay);
|
||||||
|
|
||||||
|
public void startDisplayLogActivity() {
|
||||||
|
Activity activity = getActivity();
|
||||||
|
if (activity == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
Intent intent = new Intent(activity, LogDisplayActivity.class);
|
||||||
|
intent.putExtra(LogDisplayFragment.EXTRA_RESULT, mDecryptVerifyResult);
|
||||||
|
activity.startActivity(intent);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
if (mImportOpHelper != null) {
|
if (mImportOpHelper != null) {
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public class DisplayTextFragment extends DecryptFragment {
|
|||||||
Bundle args = getArguments();
|
Bundle args = getArguments();
|
||||||
|
|
||||||
String plaintext = args.getString(ARG_PLAINTEXT);
|
String plaintext = args.getString(ARG_PLAINTEXT);
|
||||||
DecryptVerifyResult result = args.getParcelable(ARG_DECRYPT_VERIFY_RESULT);
|
DecryptVerifyResult result = args.getParcelable(ARG_DECRYPT_VERIFY_RESULT);
|
||||||
|
|
||||||
// display signature result in activity
|
// display signature result in activity
|
||||||
mText.setText(plaintext);
|
mText.setText(plaintext);
|
||||||
@@ -137,6 +137,10 @@ public class DisplayTextFragment extends DecryptFragment {
|
|||||||
copyToClipboard(mText.getText().toString());
|
copyToClipboard(mText.getText().toString());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case R.id.decrypt_view_log: {
|
||||||
|
startDisplayLogActivity();
|
||||||
|
break;
|
||||||
|
}
|
||||||
default: {
|
default: {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,16 +2,21 @@
|
|||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<item
|
|
||||||
android:id="@+id/decrypt_copy"
|
|
||||||
android:title="@string/btn_copy_decrypted_text"
|
|
||||||
android:icon="@drawable/ic_content_copy_black_24dp"
|
|
||||||
app:showAsAction="ifRoom" />
|
|
||||||
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/decrypt_share"
|
android:id="@+id/decrypt_share"
|
||||||
android:title="@string/btn_share_decrypted_text"
|
android:title="@string/btn_share_decrypted_text"
|
||||||
android:icon="@drawable/ic_share_black_24dp"
|
android:icon="@drawable/ic_share_black_24dp"
|
||||||
app:showAsAction="ifRoom" />
|
app:showAsAction="ifRoom" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/decrypt_copy"
|
||||||
|
android:title="@string/btn_copy_decrypted_text"
|
||||||
|
android:icon="@drawable/ic_content_copy_black_24dp"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
|
<item
|
||||||
|
android:id="@+id/decrypt_view_log"
|
||||||
|
android:title="@string/btn_view_log"
|
||||||
|
app:showAsAction="never" />
|
||||||
|
|
||||||
</menu>
|
</menu>
|
||||||
|
|||||||
@@ -95,7 +95,7 @@
|
|||||||
<string name="btn_add_files">"Add file(s)"</string>
|
<string name="btn_add_files">"Add file(s)"</string>
|
||||||
<string name="btn_share_decrypted_text">"Share"</string>
|
<string name="btn_share_decrypted_text">"Share"</string>
|
||||||
<string name="btn_open_with">"Open with…"</string>
|
<string name="btn_open_with">"Open with…"</string>
|
||||||
<string name="btn_copy_decrypted_text">"Copy decrypted text"</string>
|
<string name="btn_copy_decrypted_text">"Copy to clipboard"</string>
|
||||||
<string name="btn_decrypt_clipboard">"Read from clipboard"</string>
|
<string name="btn_decrypt_clipboard">"Read from clipboard"</string>
|
||||||
<string name="btn_decrypt_files">"Select input file"</string>
|
<string name="btn_decrypt_files">"Select input file"</string>
|
||||||
<string name="btn_encrypt_files">"Encrypt files"</string>
|
<string name="btn_encrypt_files">"Encrypt files"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user