From 8fcffdd7cd1732b10ed6872fc88aead356fd7dbd Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Fri, 13 Mar 2015 13:54:52 +0100 Subject: use ViewAnimator for progress, streamline text on first step --- .../ui/linked/LinkedIdCreateFinalFragment.java | 11 +++--- .../layout/linked_create_dns_fragment_step1.xml | 7 ---- .../layout/linked_create_dns_fragment_step2.xml | 32 ++++++++++------- .../layout/linked_create_https_fragment_step1.xml | 14 ++++---- .../layout/linked_create_https_fragment_step2.xml | 32 ++++++++++------- .../linked_create_twitter_fragment_step1.xml | 21 ++++++------ .../linked_create_twitter_fragment_step2.xml | 40 +++++++++++++--------- .../main/res/layout/linked_id_view_fragment.xml | 3 +- OpenKeychain/src/main/res/values/strings.xml | 38 ++++++++++---------- 9 files changed, 106 insertions(+), 92 deletions(-) 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 7be967907..38dce0c17 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 @@ -15,6 +15,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextView; +import android.widget.ViewAnimator; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.LinkedVerifyResult; @@ -35,8 +36,8 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment { protected LinkedIdWizard mLinkedIdWizard; private ImageView mVerifyImage; - private View mVerifyProgress; private TextView mVerifyStatus; + private ViewAnimator mVerifyAnimator; // This is a resource, set AFTER it has been verified LinkedCookieResource mVerifiedResource = null; @@ -69,7 +70,7 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment { }); mVerifyImage = (ImageView) view.findViewById(R.id.verify_image); - mVerifyProgress = view.findViewById(R.id.verify_progress); + mVerifyAnimator = (ViewAnimator) view.findViewById(R.id.verify_progress); mVerifyStatus = (TextView) view.findViewById(R.id.verify_status); view.findViewById(R.id.button_verify).setOnClickListener(new OnClickListener() { @@ -89,13 +90,8 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment { abstract LinkedCookieResource getResource(); private void setVerifyProgress(boolean on, Boolean success) { - mVerifyProgress.setVisibility(on ? View.VISIBLE : View.GONE); - mVerifyImage.setVisibility(on ? View.GONE : View.VISIBLE); if (success == null) { mVerifyStatus.setText(R.string.linked_verifying); - mVerifyImage.setImageResource(R.drawable.status_signature_unverified_cutout_24dp); - mVerifyImage.setColorFilter(getResources().getColor(R.color.tertiary_text_light), - PorterDuff.Mode.SRC_IN); } else if (success) { mVerifyStatus.setText(R.string.linked_verify_success); mVerifyImage.setImageResource(R.drawable.status_signature_verified_cutout_24dp); @@ -107,6 +103,7 @@ public abstract class LinkedIdCreateFinalFragment extends Fragment { mVerifyImage.setColorFilter(getResources().getColor(R.color.android_red_dark), PorterDuff.Mode.SRC_IN); } + mVerifyAnimator.setDisplayedChild(on ? 1 : 0); } protected void proofVerify() { diff --git a/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step1.xml b/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step1.xml index 98bffe02e..c0a898843 100644 --- a/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step1.xml +++ b/OpenKeychain/src/main/res/layout/linked_create_dns_fragment_step1.xml @@ -68,13 +68,6 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_dns_1_4" /> - - 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 7181089eb..6aed07e83 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 @@ -72,22 +72,30 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp"> - - - + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > + + + + + + + + - - - - - + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > + + + + + + - - + + diff --git a/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step2.xml b/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step2.xml index 0f3bb3985..2ffcd468b 100644 --- a/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step2.xml +++ b/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step2.xml @@ -21,7 +21,7 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_twitter_3_1" /> + android:text="@string/linked_create_twitter_2_1" /> + android:text="@string/linked_create_twitter_2_2" /> + android:text="@string/linked_create_twitter_2_3" /> - + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > - + + + + + + android:text="@string/linked_create_twitter_2_4" /> diff --git a/OpenKeychain/src/main/res/layout/linked_id_view_fragment.xml b/OpenKeychain/src/main/res/layout/linked_id_view_fragment.xml index e17820ff1..106d2343f 100644 --- a/OpenKeychain/src/main/res/layout/linked_id_view_fragment.xml +++ b/OpenKeychain/src/main/res/layout/linked_id_view_fragment.xml @@ -37,7 +37,8 @@ android:layout_height="wrap_content" android:id="@+id/linked_verify_container" android:inAnimation="@anim/fade_in" - android:outAnimation="@anim/fade_out"> + android:outAnimation="@anim/fade_out" + > diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 47a354081..6611390ce 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -1272,33 +1272,30 @@ Unlocked Settings - "You can link your key to a website you control. Note that your server must have a valid https certificate!" - "Please enter the url where you are able to place a text file for proof:" - "Example: https://example.com/pgpkey.txt" - "In the next step, a text file will be generated, which you will be asked to upload to the uri. This file links back to your pgp key, to make the connection verifiable in both directions." + "By creating a Linked Identity of this type, you can link your key to a website you control." + "To do this, you publish a text file on this website, then create a Linked Identity which links to it." + "Please enter a URL where you are able to place a text file for proof. Note that your server must support https and have a valid TLS certificate!" + "Example: https://example.com/pgpkey.txt" "The proof file has been created. For the next step, you should save and upload it to the URI you indicated:" "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." - "You can link your pgp key to your account on Twitter. Please enter your username:" - "A message will be generated in the next step, which you can then customize and finally publish to your timeline." - "This tweet links back to your pgp key, to make the connection verifiable in both directions." + "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 - "A message for this Twitter account has been created. You can add some text in front if you like, or leave it as-is." - "Here's a preview of the full tweet:" - "Once you are happy with the tweet, click next to proceed." - "Alright, here's the finished text:" - "Tweet the message using either method." - "After the tweet is published, hit the button to verify that everything is correct" - "Next" - - "You can link your key to a domain name you control by publishing a special TXT record." - "A linked identity of this type is especially useful if the email address you use is at the same domain." - "Please enter a fully qualified domain name:" + "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" + + "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." + + "Please enter a fully qualified domain name to proceed." "Example: subdomain.example.com" - "In the next step, a message will be generated which you will be asked to publish as a TXT record. This record then links back to your pgp key, to make the connection verifiable in both directions." "Your proof text:" "For the next step, bla bla" "More bla:" @@ -1308,13 +1305,14 @@ 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… - Verification successful! + Verified! Verification error! Not yet verified The resource needs to be verified before you can proceed! "Add Linked Identity" Linked Identities Link Identity + Verify "There is one more unknown identity type" "There are %d more unknown identity types" -- cgit v1.2.3