diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-03-13 13:54:52 +0100 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-03-13 14:03:27 +0100 |
commit | 8fcffdd7cd1732b10ed6872fc88aead356fd7dbd (patch) | |
tree | b46be532b0ac47d3e4beae10c434cc81477ac6e5 /OpenKeychain/src/main | |
parent | a9a5551d95d964b5037fb2e5308081618a33b802 (diff) | |
download | open-keychain-8fcffdd7cd1732b10ed6872fc88aead356fd7dbd.tar.gz open-keychain-8fcffdd7cd1732b10ed6872fc88aead356fd7dbd.tar.bz2 open-keychain-8fcffdd7cd1732b10ed6872fc88aead356fd7dbd.zip |
use ViewAnimator for progress, streamline text on first step
Diffstat (limited to 'OpenKeychain/src/main')
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" /> - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_dns_1_5" /> - </LinearLayout> </ScrollView> 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"> - <ImageView - android:id="@+id/verify_image" - android:src="@drawable/status_signature_unverified_cutout_24dp" - android:layout_gravity="center_vertical" + <ViewAnimator + android:id="@+id/verify_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dip" android:layout_marginStart="16dip" - /> - - <ProgressBar - android:id="@+id/verify_progress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:visibility="gone" - android:indeterminateOnly="true"/> + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > + + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:id="@+id/verify_image" + android:src="@drawable/status_signature_unverified_cutout_24dp" + /> + + <ProgressBar + android:layout_width="24dp" + android:layout_height="24dp" + android:indeterminateOnly="true"/> + + </ViewAnimator> <TextView android:id="@+id/verify_status" diff --git a/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step1.xml b/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step1.xml index 66b8d2c4f..5dfed35c4 100644 --- a/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step1.xml +++ b/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step1.xml @@ -45,6 +45,13 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_https_1_2" /> + <TextView + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginTop="16dp" + android:textAppearance="?android:attr/textAppearanceMedium" + android:text="@string/linked_create_https_1_3" /> + <org.sufficientlysecure.keychain.ui.widget.HttpsPrefixedText android:id="@+id/linked_create_https_uri" android:layout_width="match_parent" @@ -61,13 +68,6 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_https_1_3" /> - - <TextView - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:layout_marginTop="16dp" - android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_https_1_4" /> </LinearLayout> diff --git a/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step2.xml b/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step2.xml index 2a7088748..b756cbe7a 100644 --- a/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step2.xml +++ b/OpenKeychain/src/main/res/layout/linked_create_https_fragment_step2.xml @@ -76,22 +76,30 @@ android:layout_height="wrap_content" android:layout_marginTop="8dp"> - <ImageView - android:id="@+id/verify_image" - android:src="@drawable/status_signature_unverified_cutout_24dp" - android:layout_gravity="center_vertical" + <ViewAnimator + android:id="@+id/verify_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dip" android:layout_marginStart="16dip" - /> - - <ProgressBar - android:id="@+id/verify_progress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:visibility="gone" - android:indeterminateOnly="true"/> + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > + + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:id="@+id/verify_image" + android:src="@drawable/status_signature_unverified_cutout_24dp" + /> + + <ProgressBar + android:layout_width="24dp" + android:layout_height="24dp" + android:indeterminateOnly="true"/> + + </ViewAnimator> <TextView android:id="@+id/verify_status" diff --git a/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step1.xml b/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step1.xml index d51555ccd..76521fa11 100644 --- a/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step1.xml +++ b/OpenKeychain/src/main/res/layout/linked_create_twitter_fragment_step1.xml @@ -33,21 +33,12 @@ <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" + android:layout_gravity="center_vertical" android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_twitter_1_1" /> </LinearLayout> - <EditText - android:id="@+id/linked_create_twitter_handle" - android:layout_width="match_parent" - android:layout_height="wrap_content" - android:imeOptions="actionNext" - android:layout_marginTop="16dp" - android:ems="10" - android:layout_gravity="center_horizontal" - android:hint="@string/linked_create_twitter_handle"/> - <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" @@ -62,6 +53,16 @@ android:textAppearance="?android:attr/textAppearanceMedium" android:text="@string/linked_create_twitter_1_3" /> + <EditText + android:id="@+id/linked_create_twitter_handle" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:imeOptions="actionNext" + android:layout_marginTop="16dp" + android:ems="10" + android:layout_gravity="center_horizontal" + android:hint="@string/linked_create_twitter_handle"/> + </LinearLayout> </ScrollView> 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" /> <EditText android:id="@+id/linked_create_twitter_preview" @@ -40,7 +40,7 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_twitter_3_2" /> + android:text="@string/linked_create_twitter_2_2" /> <LinearLayout android:layout_width="wrap_content" @@ -73,29 +73,37 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_twitter_3_3" /> + android:text="@string/linked_create_twitter_2_3" /> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="8dp"> - <ImageView - android:id="@+id/verify_image" - android:src="@drawable/status_signature_unverified_cutout_24dp" - android:layout_gravity="center_vertical" + <ViewAnimator + android:id="@+id/verify_progress" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginLeft="16dip" android:layout_marginStart="16dip" - /> + android:layout_gravity="center_vertical" + android:inAnimation="@anim/fade_in" + android:outAnimation="@anim/fade_out" + > - <ProgressBar - android:id="@+id/verify_progress" - android:layout_width="wrap_content" - android:layout_height="wrap_content" - android:visibility="gone" - android:indeterminateOnly="true"/> + <ImageView + android:layout_width="24dp" + android:layout_height="24dp" + android:id="@+id/verify_image" + android:src="@drawable/status_signature_unverified_cutout_24dp" + /> + + <ProgressBar + android:layout_width="24dp" + android:layout_height="24dp" + android:indeterminateOnly="true"/> + + </ViewAnimator> <TextView android:id="@+id/verify_status" @@ -111,7 +119,7 @@ <Button android:layout_width="wrap_content" android:layout_height="wrap_content" - android:text="Verify" + android:text="@string/linked_create_verify" android:id="@+id/button_verify" android:layout_marginRight="16dp" android:layout_marginEnd="16dip" @@ -124,7 +132,7 @@ android:layout_height="wrap_content" android:layout_marginTop="16dp" android:textAppearance="?android:attr/textAppearanceMedium" - android:text="@string/linked_create_twitter_3_4" /> + android:text="@string/linked_create_twitter_2_4" /> </LinearLayout> 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" + > <include layout="@layout/cert_list_widget" /> 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 @@ <string name="unlocked">Unlocked</string> <string name="nfc_settings">Settings</string> - <string name="linked_create_https_1_1">"You can link your key to a website you control. Note that your server must have a valid https certificate!"</string> - <string name="linked_create_https_1_2">"Please enter the url where you are able to place a text file for proof:"</string> - <string name="linked_create_https_1_3">"Example: https://example.com/pgpkey.txt"</string> - <string name="linked_create_https_1_4">"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."</string> + <string name="linked_create_https_1_1">"By creating a Linked Identity of this type, you can link your key to a website you control."</string> + <string name="linked_create_https_1_2">"To do this, you publish a text file on this website, then create a Linked Identity which links to it."</string> + <string name="linked_create_https_1_3">"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!"</string> + <string name="linked_create_https_1_4">"Example: https://example.com/pgpkey.txt"</string> <string name="linked_create_https_created">"The proof file has been created. For the next step, you should save and upload it to the URI you indicated:"</string> <string name="linked_create_https_2_1">"A proof file for this URI has been created:"</string> <string name="linked_create_https_2_2">"For the next step, you should save and upload this file."</string> <string name="linked_create_https_2_3">"Make sure the file is reachable at the correct URI, then verify your setup."</string> <string name="linked_create_https_2_4">"After verification is successful, hit next to add the linked identity to your keyring and finish the process."</string> - <string name="linked_create_twitter_1_1">"You can link your pgp key to your account on Twitter. Please enter your username:"</string> - <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_1_1">"By creating a Linked Identity of this type, you can link your key to a Twitter account you control."</string> + <string name="linked_create_twitter_1_2">"To do this, you publish a specific Tweet on your timeline, then create a Linked Identity which links to this tweet."</string> + <string name="linked_create_twitter_1_3">"Please enter your Twitter screen name to proceed."</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, 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> - <string name="linked_create_twitter_3_2">"Tweet the message using either method."</string> - <string name="linked_create_twitter_3_3">"After the tweet is published, hit the button to verify that everything is correct"</string> - <string name="linked_create_twitter_3_4">"Next"</string> - - <string name="linked_create_dns_1_1">"You can link your key to a domain name you control by publishing a special TXT record."</string> - <string name="linked_create_dns_1_2">"A linked identity of this type is especially useful if the email address you use is at the same domain."</string> - <string name="linked_create_dns_1_3">"Please enter a fully qualified domain name:"</string> + <string name="linked_create_twitter_2_1">"This is the text for your Tweet:"</string> + <string name="linked_create_twitter_2_2">"You may add more text to the Tweet, so long as the text inside the brackets is unmodified. Tweet this message using either method."</string> + <string name="linked_create_twitter_2_3">"Once your Tweet is published, click the button below to scan your timeline for it."</string> + <string name="linked_create_twitter_2_4">"Next"</string> + + <string name="linked_create_dns_1_1">"By creating a Linked Identity of this type, you can link your key to a domain name you control."</string> + <string name="linked_create_dns_1_2">"To do this, you create a specific TXT record for the domain, then create a Linked Identity which links to this record."</string> + <!-- An Identity of this type is especially appropriate if your email address is at the same domain. --> + <string name="linked_create_dns_1_3">"Please enter a fully qualified domain name to proceed."</string> <string name="linked_create_dns_1_4">"Example: subdomain.example.com"</string> - <string name="linked_create_dns_1_5">"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."</string> <string name="linked_create_dns_2_1">"Your proof text:"</string> <string name="linked_create_dns_2_2">"For the next step, bla bla"</string> <string name="linked_create_dns_2_3">"More bla:"</string> @@ -1308,13 +1305,14 @@ <string name="linked_select_2">Please select a type:</string> <string name="linked_id_generic_text">"This file claims ownership of the OpenPGP key with long id %2$s.\n\nCookie for proof:\n%1$s"</string> <string name="linked_verifying">Verifying…</string> - <string name="linked_verify_success">Verification successful!</string> + <string name="linked_verify_success">Verified!</string> <string name="linked_verify_error">Verification error!</string> <string name="linked_verify_pending">Not yet verified</string> <string name="linked_need_verify">The resource needs to be verified before you can proceed!</string> <string name="menu_linked_add_identity">"Add Linked Identity"</string> <string name="section_linked_identities">Linked Identities</string> <string name="btn_link_identity">Link Identity</string> + <string name="linked_create_verify">Verify</string> <plurals name="linked_id_expand"> <item quantity="one">"There is one more unknown identity type"</item> <item quantity="other">"There are %d more unknown identity types"</item> |