diff options
Diffstat (limited to 'OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui')
5 files changed, 29 insertions, 28 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 e94ea5189..480421499 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 @@ -113,7 +113,6 @@ public class LinkedIdsAdapter extends UserAttributesAdapter { ViewHolder holder = (ViewHolder) view.getTag(); if (!mIsSecret) { - holder.vVerified.setVisibility(View.VISIBLE); int isVerified = cursor.getInt(INDEX_VERIFIED); switch (isVerified) { case Certs.VERIFIED_SECRET: @@ -129,8 +128,6 @@ public class LinkedIdsAdapter extends UserAttributesAdapter { null, State.INVALID, KeyFormattingUtils.DEFAULT_COLOR); break; } - } else { - holder.vVerified.setVisibility(View.GONE); } RawLinkedIdentity id = getItemAtPosition(cursor); 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 5c1389573..3a83939e7 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,15 +3,12 @@ package org.sufficientlysecure.keychain.ui.linked; import java.io.IOException; import java.util.Arrays; -import android.animation.Animator; -import android.animation.Animator.AnimatorListener; import android.animation.ObjectAnimator; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.database.Cursor; import android.graphics.PorterDuff; -import android.graphics.drawable.Drawable; import android.net.Uri; import android.os.AsyncTask; import android.os.Build; @@ -139,10 +136,14 @@ public class LinkedIdViewFragment extends Fragment implements switch (loader.getId()) { case LOADER_ID_LINKED_ID: + // Nothing to load means break if we are *expected* to load if (!cursor.moveToFirst()) { - Notify.create(getActivity(), "Error loading identity!", - Notify.LENGTH_LONG, Style.ERROR).show(); - finishFragment(); + if (mIdLoadedListener != null) { + Notify.create(getActivity(), "Error loading identity!", + Notify.LENGTH_LONG, Style.ERROR).show(); + finishFragment(); + } + // Or just ignore, this is probably some intermediate state during certify break; } @@ -171,9 +172,14 @@ public class LinkedIdViewFragment extends Fragment implements } public void finishFragment() { - FragmentManager manager = getFragmentManager(); - manager.removeOnBackStackChangedListener(this); - manager.popBackStack("linked_id", FragmentManager.POP_BACK_STACK_INCLUSIVE); + new Handler().post(new Runnable() { + @Override + public void run() { + FragmentManager manager = getFragmentManager(); + manager.removeOnBackStackChangedListener(LinkedIdViewFragment.this); + manager.popBackStack("linked_id", FragmentManager.POP_BACK_STACK_INCLUSIVE); + } + }); } public interface OnIdentityLoadedListener { @@ -256,7 +262,6 @@ public class LinkedIdViewFragment extends Fragment implements private final View vButtonVerify; private final View vButtonRetry; private final View vButtonConfirm; - private final View vButtonBack; private final ViewAnimator vProgress; private final TextSwitcher vText; @@ -269,7 +274,6 @@ public class LinkedIdViewFragment extends Fragment implements mLinkedIdHolder = new LinkedIdsAdapter.ViewHolder(root); - vButtonBack = root.findViewById(R.id.back_button); vButtonVerify = root.findViewById(R.id.button_verify); vButtonRetry = root.findViewById(R.id.button_retry); vButtonConfirm = root.findViewById(R.id.button_confirm); @@ -409,16 +413,6 @@ public class LinkedIdViewFragment extends Fragment implements .setColorFilter(mContext.getResources().getColor(R.color.android_red_light), PorterDuff.Mode.SRC_IN); - - - mViewHolder.vButtonBack.setClickable(true); - mViewHolder.vButtonBack.findViewById(R.id.back_button).setOnClickListener(new OnClickListener() { - @Override - public void onClick(View v) { - getFragmentManager().popBackStack(); - } - }); - mViewHolder.vButtonVerify.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { @@ -510,8 +504,9 @@ public class LinkedIdViewFragment extends Fragment implements if (certifyKeyId == key.none || certifyKeyId == key.symmetric) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { SubtleAttentionSeeker.tint(mViewHolder.vKeySpinnerContainer, 600).start(); + } else { + Notify.create(getActivity(), R.string.select_key_to_certify, Style.ERROR).show(); } - Notify.create(getActivity(), R.string.select_key_to_certify, Style.ERROR).show(); return; } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java index c8f80f4a5..0f33a3b8a 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertListWidget.java @@ -133,8 +133,6 @@ public class CertListWidget extends ViewAnimator vCollapsed.setText("This identity is not yet verified or confirmed."); } - setVisibility(View.VISIBLE); - } @Override diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java index 460163a47..714933b58 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/CertifyKeySpinner.java @@ -21,6 +21,7 @@ import android.content.Context; import android.database.Cursor; import android.net.Uri; import android.os.Bundle; +import android.support.annotation.StringRes; import android.support.v4.content.CursorLoader; import android.support.v4.content.Loader; import android.util.AttributeSet; @@ -138,4 +139,9 @@ public class CertifyKeySpinner extends KeySpinner { return true; } + public @StringRes int getNoneString() { + return R.string.choice_select_cert; + } + + } diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java index 70f4e7792..5a6c61f7d 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/widget/KeySpinner.java @@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.widget; import android.content.Context; import android.database.Cursor; import android.graphics.Color; +import android.support.annotation.StringRes; import android.support.v4.app.FragmentActivity; import android.support.v4.app.LoaderManager; import android.support.v4.content.Loader; @@ -277,7 +278,7 @@ public abstract class KeySpinner extends TintSpinner implements LoaderManager.Lo TextView vKeyEmail = (TextView) view.findViewById(R.id.keyspinner_key_email); TextView vKeyDuplicate = (TextView) view.findViewById(R.id.keyspinner_duplicate); - vKeyName.setText(R.string.choice_none); + vKeyName.setText(getNoneString()); vKeyEmail.setVisibility(View.GONE); vKeyDuplicate.setVisibility(View.GONE); vKeyStatus.setVisibility(View.GONE); @@ -296,4 +297,8 @@ public abstract class KeySpinner extends TintSpinner implements LoaderManager.Lo return true; } + public @StringRes int getNoneString() { + return R.string.choice_none; + } + } |