diff options
Diffstat (limited to 'OpenKeychain/src')
5 files changed, 19 insertions, 14 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/linked/LinkedResource.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/linked/LinkedResource.java index a3f288dbb..b7d111dc9 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/linked/LinkedResource.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/pgp/linked/LinkedResource.java @@ -52,6 +52,10 @@ public abstract class LinkedResource { } + public static String generatePreview () { + return "[Verifying my PGP key: pgpid+cookie:0x…]"; + } + public LinkedVerifyResult verify(byte[] fingerprint, String nonce) { OperationLog log = new OperationLog(); 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 ff8d03dd4..1106a4a48 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 @@ -65,7 +65,7 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment { LinkedIdWizard mLinkedIdWizard; - EditText mEditUri; + TextView mTextView; ImageView mVerifyImage; View mVerifyProgress; TextView mVerifyStatus; @@ -140,8 +140,8 @@ public class LinkedIdCreateDnsStep2Fragment extends Fragment { } }); - mEditUri = (EditText) view.findViewById(R.id.linked_create_dns_text); - mEditUri.setText(mResourceString); + mTextView = (TextView) view.findViewById(R.id.linked_create_dns_text); + mTextView.setText(mResourceString); setVerifyProgress(false, null); mVerifyStatus.setText(R.string.linked_verify_pending); 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 c02a76669..ab56e7a5d 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 @@ -31,11 +31,10 @@ import android.widget.ImageView; import android.widget.TextView; import org.sufficientlysecure.keychain.R; +import org.sufficientlysecure.keychain.pgp.linked.resources.TwitterResource; public class LinkedIdCreateTwitterStep2Fragment extends Fragment { - private static final int REQUEST_CODE_OUTPUT = 0x00007007; - public static final String HANDLE = "uri", NONCE = "nonce", TEXT = "text"; LinkedIdWizard mLinkedIdWizard; @@ -47,6 +46,7 @@ public class LinkedIdCreateTwitterStep2Fragment extends Fragment { String mResourceHandle; String mResourceNonce, mResourceString; + String mCookiePreview; /** * Creates new instance of this fragment @@ -69,6 +69,8 @@ public class LinkedIdCreateTwitterStep2Fragment extends Fragment { public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.linked_create_twitter_fragment_step2, container, false); + mCookiePreview = TwitterResource.generatePreview(); + mResourceHandle = getArguments().getString(HANDLE); mResourceNonce = getArguments().getString(NONCE); mResourceString = getArguments().getString(TEXT); @@ -98,7 +100,7 @@ public class LinkedIdCreateTwitterStep2Fragment extends Fragment { mVerifyStatus = (TextView) view.findViewById(R.id.verify_status); mEditTweetPreview = (EditText) view.findViewById(R.id.linked_create_twitter_preview); - mEditTweetPreview.setText(mResourceString); + mEditTweetPreview.setText(mCookiePreview); mEditTweetCustom = (EditText) view.findViewById(R.id.linked_create_twitter_custom); mEditTweetCustom.setFilters(new InputFilter[] { @@ -120,17 +122,18 @@ public class LinkedIdCreateTwitterStep2Fragment extends Fragment { @Override public void afterTextChanged(Editable editable) { if (editable != null && editable.length() > 0) { - String str = editable + " " + mResourceString; + String str = editable + " " + mCookiePreview; mEditTweetPreview.setText(str); - mEditTweetTextLen.setText(str.length() + "/140"); + mEditTweetTextLen.setText( + (editable.length() + mResourceString.length() + 1) + "/140"); mEditTweetTextLen.setTextColor(getResources().getColor(str.length() == 140 ? R.color.android_red_dark : R.color.primary_dark_material_light)); } else { - mEditTweetPreview.setText(mResourceString); + mEditTweetPreview.setText(mCookiePreview); mEditTweetTextLen.setText(mResourceString.length() + "/140"); } } 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 c416588d7..edbe33c59 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 @@ -23,15 +23,13 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_dns_2_1" /> - <EditText + <TextView android:id="@+id/linked_create_dns_text" android:layout_width="match_parent" android:layout_height="wrap_content" - android:imeOptions="actionNext" android:layout_marginTop="8dp" android:layout_gravity="center_horizontal" - android:inputType="textUri|none" - android:enabled="false"/> + android:textIsSelectable="true" /> <TextView android:layout_width="wrap_content" diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index ef72989e0..d989b1a47 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -1166,7 +1166,7 @@ <string name="linked_create_twitter_1_2">"A message will be generated in the next step, which you can then customize and finally publish to your timeline."</string> <string name="linked_create_twitter_1_3">"This tweet links back to your pgp key, to make the connection verifiable in both directions."</string> <string name="linked_create_twitter_handle">Twitter Handle</string> - <string name="linked_create_twitter_2_1">"A message for this Twitter account has been created. You can add some text in front if you like."</string> + <string name="linked_create_twitter_2_1">"A message for this Twitter account has been created. You can add some text in front if you like, or leave it as-is."</string> <string name="linked_create_twitter_2_2">"Here's a preview of the full tweet:"</string> <string name="linked_create_twitter_2_3">"Once you are happy with the tweet, click next to proceed."</string> <string name="linked_create_twitter_3_1">"Alright, here's the finished text:"</string> |