diff options
author | Vincent Breitmoser <valodim@mugenguild.com> | 2015-04-27 19:49:42 +0200 |
---|---|---|
committer | Vincent Breitmoser <valodim@mugenguild.com> | 2015-04-27 19:49:42 +0200 |
commit | fc61208ce78e1a70dbd407bb554ff3e3edd91cea (patch) | |
tree | 9288cd97d6fe5d6b2221ebb4fda1563f98dc8c65 /OpenKeychain/src/main | |
parent | dd1243c31289973e238d36ca35b10539eb909239 (diff) | |
download | open-keychain-fc61208ce78e1a70dbd407bb554ff3e3edd91cea.tar.gz open-keychain-fc61208ce78e1a70dbd407bb554ff3e3edd91cea.tar.bz2 open-keychain-fc61208ce78e1a70dbd407bb554ff3e3edd91cea.zip |
small ui niceties
Diffstat (limited to 'OpenKeychain/src/main')
6 files changed, 30 insertions, 13 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/LinkedIdsAdapter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/LinkedIdsAdapter.java index 480421499..9455f9489 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/LinkedIdsAdapter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/adapter/LinkedIdsAdapter.java @@ -18,6 +18,7 @@ package org.sufficientlysecure.keychain.ui.adapter; +import android.animation.ObjectAnimator; import android.app.Activity; import android.content.Context; import android.database.Cursor; @@ -39,6 +40,7 @@ import org.sufficientlysecure.keychain.provider.KeychainContract.UserPackets; import org.sufficientlysecure.keychain.ui.linked.LinkedIdViewFragment; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils; import org.sufficientlysecure.keychain.ui.util.KeyFormattingUtils.State; +import org.sufficientlysecure.keychain.ui.util.SubtleAttentionSeeker; import org.sufficientlysecure.keychain.util.FilterCursorWrapper; import java.io.IOException; @@ -219,6 +221,13 @@ public class LinkedIdsAdapter extends UserAttributesAdapter { vIcon.setImageResource(id.getDisplayIcon()); } + + public void seekAttention() { + ObjectAnimator anim = SubtleAttentionSeeker.tintText(vComment, 1000); + anim.setStartDelay(200); + anim.start(); + } + } } 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 295ef4aef..89d72faf3 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 @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.linked; import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.View.OnClickListener; @@ -81,7 +82,7 @@ public class LinkedIdCreateTwitterStep2Fragment extends LinkedIdCreateFinalFragm }); ((TextView) view.findViewById(R.id.linked_tweet_published)).setText( - getString(R.string.linked_create_twitter_2_3, mResourceHandle) + Html.fromHtml(getString(R.string.linked_create_twitter_2_3, mResourceHandle)) ); return view; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java index f618181c6..f4987d137 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/linked/LinkedIdViewFragment.java @@ -3,7 +3,6 @@ package org.sufficientlysecure.keychain.ui.linked; import java.io.IOException; import java.util.Collections; -import android.animation.ObjectAnimator; import android.content.Context; import android.content.Intent; import android.database.Cursor; @@ -26,6 +25,7 @@ import android.view.View.OnClickListener; import android.view.ViewGroup; import android.widget.ImageView; import android.widget.TextSwitcher; +import android.widget.TextView; import android.widget.ViewAnimator; import org.sufficientlysecure.keychain.Constants; @@ -477,10 +477,11 @@ public class LinkedIdViewFragment extends CryptoOperationFragment implements } if (result.success()) { mViewHolder.vText.setText(getString(mLinkedResource.getVerifiedText(mIsSecret))); + // hack to preserve bold text + ((TextView) mViewHolder.vText.getCurrentView()).setText( + mLinkedResource.getVerifiedText(mIsSecret)); mViewHolder.setVerifyingState(mContext, VerifyState.VERIFY_OK, mIsSecret); - ObjectAnimator anim = SubtleAttentionSeeker.tada(mViewHolder.vButtonConfirm, 0.6f, 1000); - anim.setStartDelay(800); - anim.start(); + mViewHolder.mLinkedIdHolder.seekAttention(); } else { mViewHolder.setVerifyingState(mContext, VerifyState.VERIFY_ERROR, mIsSecret); result.createNotify(getActivity()).show(); @@ -501,7 +502,7 @@ public class LinkedIdViewFragment extends CryptoOperationFragment implements mCertifyKeyId = mViewHolder.vKeySpinner.getSelectedItemId(); if (mCertifyKeyId == key.none || mCertifyKeyId == key.symmetric) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { - SubtleAttentionSeeker.tint(mViewHolder.vKeySpinnerContainer, 600).start(); + SubtleAttentionSeeker.tintBackground(mViewHolder.vKeySpinnerContainer, 600).start(); } else { Notify.create(getActivity(), R.string.select_key_to_certify, Style.ERROR).show(); } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/SubtleAttentionSeeker.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/SubtleAttentionSeeker.java index bf4211899..4549e8993 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/SubtleAttentionSeeker.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/util/SubtleAttentionSeeker.java @@ -94,9 +94,15 @@ public class SubtleAttentionSeeker { } @TargetApi(VERSION_CODES.LOLLIPOP) - public static ObjectAnimator tint(View view, int duration) { + public static ObjectAnimator tintBackground(View view, int duration) { return ObjectAnimator.ofArgb(view, "backgroundColor", 0x00FF0000, 0x33FF0000, 0x00FF0000).setDuration(duration); } + @TargetApi(VERSION_CODES.LOLLIPOP) + public static ObjectAnimator tintText(View view, int duration) { + return ObjectAnimator.ofArgb(view, "backgroundColor", + 0x00FF7F00, 0x33FF7F00, 0x00FF7F00).setDuration(duration); + } + } diff --git a/OpenKeychain/src/main/res/layout/linked_id_item.xml b/OpenKeychain/src/main/res/layout/linked_id_item.xml index c70701962..4846bd0a4 100644 --- a/OpenKeychain/src/main/res/layout/linked_id_item.xml +++ b/OpenKeychain/src/main/res/layout/linked_id_item.xml @@ -38,7 +38,7 @@ <TextView android:id="@+id/linked_id_comment" - android:layout_width="wrap_content" + android:layout_width="match_parent" android:layout_height="wrap_content" android:textColor="@color/tertiary_text_light" tools:text="comment" diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 90389cdc1..0df71b768 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -1326,7 +1326,7 @@ <string name="linked_create_twitter_handle">Twitter Handle</string> <string name="linked_create_twitter_2_1">"Click either button to tweet the message!"</string> <string name="linked_create_twitter_2_2">"You can edit the Tweet before posting it, so long as the text inside the brackets is unmodified."</string> - <string name="linked_create_twitter_2_3">"Once your Tweet is published as <b>@%s</b>, click the Verify button to scan your timeline for it."</string> + <string name="linked_create_twitter_2_3">"Once your Tweet is published as <b>@%s</b>, click the Verify button to scan your timeline for it."</string> <string name="linked_create_twitter_2_4">"After successful verification, press the Finish button to add the Linked Identity to your keyring and finish the process."</string> <string name="linked_create_github_1_1">"By creating a Linked Identity of this type, you can link your key to a Github account you control."</string> @@ -1350,10 +1350,10 @@ <string name="linked_create_verify">"Verify"</string> <string name="linked_text_clipboard">Text has been copied to clipboard</string> - <string name="linked_verified_https">"The link between this Website and key was securely verified. If you believe the Website is genuine, confirm this verification with your key."</string> - <string name="linked_verified_github">"The link between this Github account and key was securely verified. If you believe the account is genuine, confirm this verification with your key."</string> - <string name="linked_verified_dns">"The link between this Domain Name and key was securely verified. If you believe the Domain is genuine, confirm this verification with your key."</string> - <string name="linked_verified_twitter">"The link between this Twitter account and key was securely verified. If you believe the account is genuine, confirm this verification with your key."</string> + <string name="linked_verified_https">"The link between this Website and key was securely verified. <b>If you believe the Website is genuine</b>, confirm this verification with your key."</string> + <string name="linked_verified_github">"The link between this Github account and key was securely verified. <b>If you believe the account is genuine</b>, confirm this verification with your key."</string> + <string name="linked_verified_dns">"The link between this Domain Name and key was securely verified. <b>If you believe the Domain is genuine</b>, confirm this verification with your key."</string> + <string name="linked_verified_twitter">"The link between this Twitter account and key was securely verified. <b>If you believe the account is genuine</b>, confirm this verification with your key."</string> <string name="linked_verified_secret_https">"The link between your Website and key was securely verified. Everything looks in order."</string> <string name="linked_verified_secret_github">"The link between your Github account and key was securely verified. Everything looks in order."</string> <string name="linked_verified_secret_dns">"The link between your Domain Name and key was securely verified. Everything looks in order."</string> |