diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java
index 8715c0a2e..2e6181f07 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateDnsStep2Fragment.java
@@ -30,6 +30,7 @@ import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
+import org.sufficientlysecure.keychain.compatibility.ClipboardReflection;
import org.sufficientlysecure.keychain.pgp.linked.LinkedCookieResource;
import org.sufficientlysecure.keychain.pgp.linked.resources.DnsResource;
import org.sufficientlysecure.keychain.ui.util.Notify;
@@ -92,7 +93,7 @@ public class LinkedIdCreateDnsStep2Fragment extends LinkedIdCreateFinalFragment
view.findViewById(R.id.button_save).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
- proofSave();
+ proofToClipboard();
}
});
@@ -115,22 +116,9 @@ public class LinkedIdCreateDnsStep2Fragment extends LinkedIdCreateFinalFragment
startActivity(sendIntent);
}
- private void proofSave () {
- String state = Environment.getExternalStorageState();
- if (!Environment.MEDIA_MOUNTED.equals(state)) {
- Notify.showNotify(getActivity(), "External storage not available!", Style.ERROR);
- return;
- }
-
- String targetName = "pgpkey.txt";
-
- if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) {
- File targetFile = new File(Constants.Path.APP_DIR, targetName);
- FileHelper.saveFile(this, getString(R.string.title_decrypt_to_file),
- getString(R.string.specify_file_to_decrypt_to), targetFile, REQUEST_CODE_OUTPUT);
- } else {
- FileHelper.saveDocument(this, "text/plain", targetName, REQUEST_CODE_OUTPUT);
- }
+ private void proofToClipboard() {
+ ClipboardReflection.copyToClipboard(getActivity(), mResourceString);
+ Notify.showNotify(getActivity(), R.string.linked_text_clipboard, Notify.Style.OK);
}
private void saveFile(Uri uri) {
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
index 040c26aab..30dfd8dfd 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateFinalFragment.java
@@ -41,6 +41,7 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment {
// This is a resource, set AFTER it has been verified
LinkedCookieResource mVerifiedResource = null;
+ private ViewAnimator mVerifyButtonAnimator;
@Override
public void onCreate(Bundle savedInstanceState) {
@@ -69,9 +70,10 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment {
}
});
- mVerifyImage = (ImageView) view.findViewById(R.id.verify_image);
mVerifyAnimator = (ViewAnimator) view.findViewById(R.id.verify_progress);
+ mVerifyImage = (ImageView) view.findViewById(R.id.verify_image);
mVerifyStatus = (TextView) view.findViewById(R.id.verify_status);
+ mVerifyButtonAnimator = (ViewAnimator) view.findViewById(R.id.verify_buttons);
view.findViewById(R.id.button_verify).setOnClickListener(new OnClickListener() {
@Override
@@ -80,6 +82,13 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment {
}
});
+ view.findViewById(R.id.button_retry).setOnClickListener(new OnClickListener() {
+ @Override
+ public void onClick(View v) {
+ proofVerify();
+ }
+ });
+
setVerifyProgress(false, null);
mVerifyStatus.setText(R.string.linked_verify_pending);
@@ -91,20 +100,30 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment {
private void setVerifyProgress(boolean on, Boolean success) {
if (success == null) {
mVerifyStatus.setText(R.string.linked_verifying);
+ displayButton(on ? 2 : 0);
} else if (success) {
mVerifyStatus.setText(R.string.linked_verify_success);
mVerifyImage.setImageResource(R.drawable.status_signature_verified_cutout_24dp);
mVerifyImage.setColorFilter(getResources().getColor(R.color.android_green_dark),
PorterDuff.Mode.SRC_IN);
+ displayButton(2);
} else {
mVerifyStatus.setText(R.string.linked_verify_error);
mVerifyImage.setImageResource(R.drawable.status_signature_unknown_cutout_24dp);
mVerifyImage.setColorFilter(getResources().getColor(R.color.android_red_dark),
PorterDuff.Mode.SRC_IN);
+ displayButton(1);
}
mVerifyAnimator.setDisplayedChild(on ? 1 : 0);
}
+ public void displayButton(int button) {
+ if (mVerifyButtonAnimator.getDisplayedChild() == button) {
+ return;
+ }
+ mVerifyButtonAnimator.setDisplayedChild(button);
+ }
+
protected void proofVerify() {
setVerifyProgress(true, null);
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java
index f8322d3c4..2de9b54c9 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdCreateTwitterStep2Fragment.java
@@ -34,8 +34,6 @@ public class LinkedIdCreateTwitterStep2Fragment extends LinkedIdCreateFinalFragm
public static final String ARG_HANDLE = "handle";
- EditText mEditTweetPreview;
-
String mResourceHandle;
String mResourceString;
@@ -66,9 +64,6 @@ public class LinkedIdCreateTwitterStep2Fragment extends LinkedIdCreateFinalFragm
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = super.onCreateView(inflater, container, savedInstanceState);
- mEditTweetPreview = (EditText) view.findViewById(R.id.linked_create_twitter_preview);
- mEditTweetPreview.setText(mResourceString);
-
view.findViewById(R.id.button_send).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
diff --git a/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step2.xml b/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step2.xml
index 6aed07e83..62e267f05 100644
--- a/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step2.xml
+++ b/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step2.xml
@@ -10,7 +10,7 @@
android:layout_above="@+id/create_key_button_divider">
+ android:textIsSelectable="true"
+ android:textAppearance="?android:attr/textAppearanceSmall"
+ />
+ android:layout_gravity="center_horizontal"
+ style="?android:buttonBarStyle"
+ android:showDividers="middle">
+
+
-
-
+ />
@@ -67,57 +83,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/linked_create_dns_2_3" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+ android:layout_gravity="center_horizontal"
+ style="?android:buttonBarStyle"
+ >
+ />
+
+
@@ -71,57 +85,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/linked_create_https_2_3" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
-
+ android:layout_gravity="center_horizontal"
+ style="?android:buttonBarStyle">
+ />
+ />
@@ -75,57 +72,7 @@
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/linked_create_twitter_2_3" />
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index 6611390ce..1e1e5ffe3 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -1280,16 +1280,16 @@
"A proof file for this URI has been created:""For the next step, you should save and upload this file.""Make sure the file is reachable at the correct URI, then verify your setup."
- "After verification is successful, hit next to add the linked identity to your keyring and finish the process."
+ "After successful verification, press the Finish button to add the Linked Identity to your keyring and finish the process.""By creating a Linked Identity of this type, you can link your key to a Twitter account you control.""To do this, you publish a specific Tweet on your timeline, then create a Linked Identity which links to this tweet.""Please enter your Twitter screen name to proceed."Twitter Handle
- "This is the text for your Tweet:"
- "You may add more text to the Tweet, so long as the text inside the brackets is unmodified. Tweet this message using either method."
- "Once your Tweet is published, click the button below to scan your timeline for it."
- "Next"
+ "Click either button to tweet the message!"
+ "You can edit the Tweet before posting it, so long as the text inside the brackets is unmodified."
+ "Once your Tweet is published, click the Verify button to scan your timeline for it."
+ "After successful verification, press the Finish button to add the Linked Identity to your keyring and finish the process.""By creating a Linked Identity of this type, you can link your key to a domain name you control.""To do this, you create a specific TXT record for the domain, then create a Linked Identity which links to this record."
@@ -1299,20 +1299,21 @@
"Your proof text:""For the next step, bla bla""More bla:"
- "bla bla"
+ "After successful verification, press the Finish button to add the Linked Identity to your keyring and finish the process.""A \'linked identity\' connects your pgp key to a resource on the web."
- Please select a type:
+ "Please select a type:""This file claims ownership of the OpenPGP key with long id %2$s.\n\nCookie for proof:\n%1$s"
- Verifying…
- Verified!
- Verification error!
- Not yet verified
+ "Verifying…"
+ "Verified!"
+ "Verification error!"
+ "Not yet verified"The resource needs to be verified before you can proceed!"Add Linked Identity"
- Linked Identities
- Link Identity
- Verify
+ "Linked Identities"
+ "Finish"
+ "Verify"
+ Text has been copied to clipboard"There is one more unknown identity type""There are %d more unknown identity types"