even more linked id ui work
This commit is contained in:
@@ -113,7 +113,6 @@ public class LinkedIdsAdapter extends UserAttributesAdapter {
|
|||||||
ViewHolder holder = (ViewHolder) view.getTag();
|
ViewHolder holder = (ViewHolder) view.getTag();
|
||||||
|
|
||||||
if (!mIsSecret) {
|
if (!mIsSecret) {
|
||||||
holder.vVerified.setVisibility(View.VISIBLE);
|
|
||||||
int isVerified = cursor.getInt(INDEX_VERIFIED);
|
int isVerified = cursor.getInt(INDEX_VERIFIED);
|
||||||
switch (isVerified) {
|
switch (isVerified) {
|
||||||
case Certs.VERIFIED_SECRET:
|
case Certs.VERIFIED_SECRET:
|
||||||
@@ -129,8 +128,6 @@ public class LinkedIdsAdapter extends UserAttributesAdapter {
|
|||||||
null, State.INVALID, KeyFormattingUtils.DEFAULT_COLOR);
|
null, State.INVALID, KeyFormattingUtils.DEFAULT_COLOR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
holder.vVerified.setVisibility(View.GONE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
RawLinkedIdentity id = getItemAtPosition(cursor);
|
RawLinkedIdentity id = getItemAtPosition(cursor);
|
||||||
|
|||||||
@@ -3,15 +3,12 @@ package org.sufficientlysecure.keychain.ui.linked;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
import android.animation.Animator;
|
|
||||||
import android.animation.Animator.AnimatorListener;
|
|
||||||
import android.animation.ObjectAnimator;
|
import android.animation.ObjectAnimator;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
@@ -139,10 +136,14 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
switch (loader.getId()) {
|
switch (loader.getId()) {
|
||||||
case LOADER_ID_LINKED_ID:
|
case LOADER_ID_LINKED_ID:
|
||||||
|
|
||||||
|
// Nothing to load means break if we are *expected* to load
|
||||||
if (!cursor.moveToFirst()) {
|
if (!cursor.moveToFirst()) {
|
||||||
Notify.create(getActivity(), "Error loading identity!",
|
if (mIdLoadedListener != null) {
|
||||||
Notify.LENGTH_LONG, Style.ERROR).show();
|
Notify.create(getActivity(), "Error loading identity!",
|
||||||
finishFragment();
|
Notify.LENGTH_LONG, Style.ERROR).show();
|
||||||
|
finishFragment();
|
||||||
|
}
|
||||||
|
// Or just ignore, this is probably some intermediate state during certify
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,9 +172,14 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void finishFragment() {
|
public void finishFragment() {
|
||||||
FragmentManager manager = getFragmentManager();
|
new Handler().post(new Runnable() {
|
||||||
manager.removeOnBackStackChangedListener(this);
|
@Override
|
||||||
manager.popBackStack("linked_id", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
public void run() {
|
||||||
|
FragmentManager manager = getFragmentManager();
|
||||||
|
manager.removeOnBackStackChangedListener(LinkedIdViewFragment.this);
|
||||||
|
manager.popBackStack("linked_id", FragmentManager.POP_BACK_STACK_INCLUSIVE);
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface OnIdentityLoadedListener {
|
public interface OnIdentityLoadedListener {
|
||||||
@@ -256,7 +262,6 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
private final View vButtonVerify;
|
private final View vButtonVerify;
|
||||||
private final View vButtonRetry;
|
private final View vButtonRetry;
|
||||||
private final View vButtonConfirm;
|
private final View vButtonConfirm;
|
||||||
private final View vButtonBack;
|
|
||||||
|
|
||||||
private final ViewAnimator vProgress;
|
private final ViewAnimator vProgress;
|
||||||
private final TextSwitcher vText;
|
private final TextSwitcher vText;
|
||||||
@@ -269,7 +274,6 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
|
|
||||||
mLinkedIdHolder = new LinkedIdsAdapter.ViewHolder(root);
|
mLinkedIdHolder = new LinkedIdsAdapter.ViewHolder(root);
|
||||||
|
|
||||||
vButtonBack = root.findViewById(R.id.back_button);
|
|
||||||
vButtonVerify = root.findViewById(R.id.button_verify);
|
vButtonVerify = root.findViewById(R.id.button_verify);
|
||||||
vButtonRetry = root.findViewById(R.id.button_retry);
|
vButtonRetry = root.findViewById(R.id.button_retry);
|
||||||
vButtonConfirm = root.findViewById(R.id.button_confirm);
|
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),
|
.setColorFilter(mContext.getResources().getColor(R.color.android_red_light),
|
||||||
PorterDuff.Mode.SRC_IN);
|
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() {
|
mViewHolder.vButtonVerify.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
@@ -510,8 +504,9 @@ public class LinkedIdViewFragment extends Fragment implements
|
|||||||
if (certifyKeyId == key.none || certifyKeyId == key.symmetric) {
|
if (certifyKeyId == key.none || certifyKeyId == key.symmetric) {
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||||
SubtleAttentionSeeker.tint(mViewHolder.vKeySpinnerContainer, 600).start();
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -133,8 +133,6 @@ public class CertListWidget extends ViewAnimator
|
|||||||
vCollapsed.setText("This identity is not yet verified or confirmed.");
|
vCollapsed.setText("This identity is not yet verified or confirmed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
setVisibility(View.VISIBLE);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.content.Context;
|
|||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v4.content.CursorLoader;
|
import android.support.v4.content.CursorLoader;
|
||||||
import android.support.v4.content.Loader;
|
import android.support.v4.content.Loader;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
@@ -138,4 +139,9 @@ public class CertifyKeySpinner extends KeySpinner {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @StringRes int getNoneString() {
|
||||||
|
return R.string.choice_select_cert;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ package org.sufficientlysecure.keychain.ui.widget;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
|
import android.support.annotation.StringRes;
|
||||||
import android.support.v4.app.FragmentActivity;
|
import android.support.v4.app.FragmentActivity;
|
||||||
import android.support.v4.app.LoaderManager;
|
import android.support.v4.app.LoaderManager;
|
||||||
import android.support.v4.content.Loader;
|
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 vKeyEmail = (TextView) view.findViewById(R.id.keyspinner_key_email);
|
||||||
TextView vKeyDuplicate = (TextView) view.findViewById(R.id.keyspinner_duplicate);
|
TextView vKeyDuplicate = (TextView) view.findViewById(R.id.keyspinner_duplicate);
|
||||||
|
|
||||||
vKeyName.setText(R.string.choice_none);
|
vKeyName.setText(getNoneString());
|
||||||
vKeyEmail.setVisibility(View.GONE);
|
vKeyEmail.setVisibility(View.GONE);
|
||||||
vKeyDuplicate.setVisibility(View.GONE);
|
vKeyDuplicate.setVisibility(View.GONE);
|
||||||
vKeyStatus.setVisibility(View.GONE);
|
vKeyStatus.setVisibility(View.GONE);
|
||||||
@@ -296,4 +297,8 @@ public abstract class KeySpinner extends TintSpinner implements LoaderManager.Lo
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public @StringRes int getNoneString() {
|
||||||
|
return R.string.choice_none;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,18 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<org.sufficientlysecure.keychain.ui.widget.CertListWidget
|
<org.sufficientlysecure.keychain.ui.widget.CertListWidget
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginLeft="12dp"
|
android:id="@+id/linked_id_certs"
|
||||||
android:layout_marginRight="12dp"
|
tools:showIn="@layout/linked_id_view_fragment">
|
||||||
android:id="@+id/linked_id_certs">
|
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
>
|
tools:ignore="UseCompoundDrawables">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/cert_collapsed_list"
|
android:id="@+id/cert_collapsed_list"
|
||||||
@@ -21,6 +21,7 @@
|
|||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:layout_weight="1"
|
android:layout_weight="1"
|
||||||
|
tools:text="The identity is not yet verified or confirmed."
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
|||||||
@@ -62,8 +62,9 @@
|
|||||||
android:id="@+id/linked_id_certified_icon"
|
android:id="@+id/linked_id_certified_icon"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:src="@drawable/status_signature_unknown_cutout_24dp"
|
android:layout_gravity="center_horizontal"
|
||||||
android:layout_gravity="center_horizontal" />
|
tools:src="@drawable/status_signature_unknown_cutout_24dp"
|
||||||
|
/>
|
||||||
|
|
||||||
<Space
|
<Space
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|||||||
@@ -201,6 +201,7 @@
|
|||||||
<string name="choice_4hours">"4 hours"</string>
|
<string name="choice_4hours">"4 hours"</string>
|
||||||
<string name="choice_8hours">"8 hours"</string>
|
<string name="choice_8hours">"8 hours"</string>
|
||||||
<string name="choice_forever">"forever"</string>
|
<string name="choice_forever">"forever"</string>
|
||||||
|
<string name="choice_select_cert">"Select a Key"</string>
|
||||||
<string name="dsa">"DSA"</string>
|
<string name="dsa">"DSA"</string>
|
||||||
<string name="elgamal">"ElGamal"</string>
|
<string name="elgamal">"ElGamal"</string>
|
||||||
<string name="rsa">"RSA"</string>
|
<string name="rsa">"RSA"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user