Confirm design

This commit is contained in:
Dominik Schürmann 2015-09-24 18:30:14 +02:00
parent fd80d48f50
commit 74281d6203
10 changed files with 113 additions and 153 deletions

View file

@ -4,6 +4,7 @@ python copy OpenKeychain action white search 24
python copy OpenKeychain navigation white arrow_back 24
python copy OpenKeychain navigation white close 24
python copy OpenKeychain navigation white check 24
python copy OpenKeychain navigation black check 24
python copy OpenKeychain navigation black expand_less 24
python copy OpenKeychain navigation black expand_more 24
python copy OpenKeychain navigation white refresh 24

View file

@ -48,24 +48,26 @@ public class CertifyFingerprintFragment extends LoaderFragment implements
static final int REQUEST_CERTIFY = 1;
public static final String ARG_DATA_URI = "uri";
public static final String ARG_ENABLE_WORD_CONFIRM = "enable_word_confirm";
public static final String ARG_ENABLE_PHRASES_CONFIRM = "enable_word_confirm";
private TextView mActionYes;
private TextView mFingerprint;
private TextView mIntro;
private TextView mHeader;
private static final int LOADER_ID_UNIFIED = 0;
private Uri mDataUri;
private boolean mEnableWordConfirm;
private boolean mEnablePhrasesConfirm;
/**
* Creates new instance of this fragment
*/
public static CertifyFingerprintFragment newInstance(Uri dataUri, boolean enableWordConfirm) {
public static CertifyFingerprintFragment newInstance(Uri dataUri, boolean enablePhrasesConfirm) {
CertifyFingerprintFragment frag = new CertifyFingerprintFragment();
Bundle args = new Bundle();
args.putParcelable(ARG_DATA_URI, dataUri);
args.putBoolean(ARG_ENABLE_WORD_CONFIRM, enableWordConfirm);
args.putBoolean(ARG_ENABLE_PHRASES_CONFIRM, enablePhrasesConfirm);
frag.setArguments(args);
@ -77,11 +79,12 @@ public class CertifyFingerprintFragment extends LoaderFragment implements
View root = super.onCreateView(inflater, superContainer, savedInstanceState);
View view = inflater.inflate(R.layout.certify_fingerprint_fragment, getContainer());
View actionNo = view.findViewById(R.id.certify_fingerprint_button_no);
View actionYes = view.findViewById(R.id.certify_fingerprint_button_yes);
TextView actionNo = (TextView) view.findViewById(R.id.certify_fingerprint_button_no);
mActionYes = (TextView) view.findViewById(R.id.certify_fingerprint_button_yes);
mFingerprint = (TextView) view.findViewById(R.id.certify_fingerprint_fingerprint);
mIntro = (TextView) view.findViewById(R.id.certify_fingerprint_intro);
mHeader = (TextView) view.findViewById(R.id.certify_fingerprint_fingerprint_header);
actionNo.setOnClickListener(new View.OnClickListener() {
@Override
@ -89,7 +92,7 @@ public class CertifyFingerprintFragment extends LoaderFragment implements
getActivity().finish();
}
});
actionYes.setOnClickListener(new View.OnClickListener() {
mActionYes.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
certify(mDataUri);
@ -109,10 +112,12 @@ public class CertifyFingerprintFragment extends LoaderFragment implements
getActivity().finish();
return;
}
mEnableWordConfirm = getArguments().getBoolean(ARG_ENABLE_WORD_CONFIRM);
mEnablePhrasesConfirm = getArguments().getBoolean(ARG_ENABLE_PHRASES_CONFIRM);
if (mEnableWordConfirm) {
mIntro.setText(R.string.certify_fingerprint_text_words);
if (mEnablePhrasesConfirm) {
mIntro.setText(R.string.certify_fingerprint_text_phrases);
mHeader.setText(R.string.section_phrases);
mActionYes.setText(R.string.btn_match_phrases);
}
loadData(dataUri);
@ -162,7 +167,7 @@ public class CertifyFingerprintFragment extends LoaderFragment implements
if (data.moveToFirst()) {
byte[] fingerprintBlob = data.getBlob(INDEX_UNIFIED_FINGERPRINT);
if (mEnableWordConfirm) {
if (mEnablePhrasesConfirm) {
displayWordConfirm(fingerprintBlob);
} else {
displayHexConfirm(fingerprintBlob);

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 254 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 277 B

View file

@ -1,155 +1,107 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/certify_fingerprint_buttons_divider">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/certify_fingerprint_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/certify_fingerprint_text" />
<android.support.v7.widget.CardView
android:id="@+id/certify_fingerprint_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:cardBackgroundColor="?attr/colorCardViewBackground"
app:cardUseCompatPadding="true"
app:cardCornerRadius="4dp"
android:layout_gravity="top">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
style="@style/CardViewHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_fingerprint" />
<TextView
android:id="@+id/certify_fingerprint_fingerprint"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textSize="20sp"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:typeface="monospace"
android:gravity="center_vertical" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:id="@+id/certify_fingerprint_buttons">
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/certify_fingerprint_button_no"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:id="@+id/certify_fingerprint_intro"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/btn_no"
android:minHeight="?android:attr/listPreferredItemHeight"
android:gravity="center_vertical"
android:clickable="true"
style="?android:attr/borderlessButtonStyle"
android:layout_gravity="center_vertical" />
android:layout_marginBottom="32dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:text="@string/certify_fingerprint_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="1dp"
android:layout_height="match_parent"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/certify_fingerprint_button_yes"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
<android.support.v7.widget.CardView
android:id="@+id/certify_fingerprint_card"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="@string/btn_match"
android:minHeight="?android:attr/listPreferredItemHeight"
android:drawablePadding="8dp"
android:gravity="center_vertical"
android:clickable="true"
style="?android:attr/borderlessButtonStyle"
android:layout_gravity="center_vertical" />
android:layout_gravity="top"
app:cardBackgroundColor="?attr/colorCardViewBackground"
app:cardCornerRadius="4dp"
app:cardElevation="8dp"
app:cardUseCompatPadding="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/certify_fingerprint_fingerprint_header"
style="@style/CardViewHeader"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/label_fingerprint" />
<TextView
android:id="@+id/certify_fingerprint_fingerprint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:paddingBottom="24dp"
android:paddingLeft="16dp"
android:paddingRight="16dp"
android:paddingTop="16dp"
android:textSize="18sp"
android:typeface="monospace" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/certify_fingerprint_button_no"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/android_red_dark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:clickable="true"
android:drawableLeft="@drawable/ic_close_black_24dp"
android:drawablePadding="8dp"
android:gravity="left|center_vertical"
android:minHeight="48dp"
android:text="@string/btn_not_matching"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
<View
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider" />
<TextView
android:id="@+id/certify_fingerprint_button_yes"
style="?android:attr/borderlessButtonStyle"
android:textColor="@color/android_green_dark"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_weight="1"
android:clickable="true"
android:drawableLeft="@drawable/ic_check_black_24dp"
android:drawablePadding="8dp"
android:gravity="left|center_vertical"
android:minHeight="48dp"
android:text="@string/btn_match"
android:textAllCaps="true"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</android.support.v7.widget.CardView>
</LinearLayout>
<View
android:id="@+id/certify_fingerprint_buttons_divider2"
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"
android:layout_alignBottom="@+id/certify_fingerprint_buttons_text"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
<TextView
android:id="@+id/certify_fingerprint_buttons_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="24dp"
android:layout_marginRight="24dp"
android:paddingTop="8dp"
android:paddingBottom="8dp"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/certify_fingerprint_text2"
android:layout_above="@+id/certify_fingerprint_buttons"
android:layout_centerHorizontal="true" />
<View
android:id="@+id/certify_fingerprint_buttons_divider"
android:layout_width="match_parent"
android:layout_height="1dip"
android:background="?android:attr/listDivider"
android:layout_alignTop="@+id/certify_fingerprint_buttons_text"
android:layout_marginLeft="16dp"
android:layout_marginRight="16dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true" />
</RelativeLayout>
</ScrollView>

View file

@ -41,7 +41,7 @@
android:id="@+id/menu_key_view_certify_fingerprint_word"
app:showAsAction="never"
android:visible="false"
android:title="@string/menu_certify_fingerprint_word" />
android:title="@string/menu_certify_fingerprint_phrases" />
<item
android:id="@+id/menu_key_view_add_linked_identity"

View file

@ -62,6 +62,7 @@
<string name="section_share_key">"Key"</string>
<string name="section_key_server">"Keyserver"</string>
<string name="section_fingerprint">"Fingerprint"</string>
<string name="section_phrases">"Phrases"</string>
<string name="section_encrypt">"Encrypt"</string>
<string name="section_decrypt">"Decrypt / Verify"</string>
<string name="section_current_expiry">"Current expiry"</string>
@ -83,6 +84,7 @@
<string name="btn_back">"Back"</string>
<string name="btn_no">"No"</string>
<string name="btn_match">"Fingerprints match"</string>
<string name="btn_match_phrases">"Phrases match"</string>
<string name="btn_share_encrypted_signed">"Encrypt/sign and share text"</string>
<string name="btn_copy_encrypted_signed">"Encrypt/sign and copy text"</string>
<string name="btn_view_cert_key">"View certification key"</string>
@ -99,6 +101,7 @@
<string name="btn_add_keyserver">"Add"</string>
<string name="btn_save_default">"Save as default"</string>
<string name="btn_saved">"Saved!"</string>
<string name="btn_not_matching">"Doesn't match"</string>
<!-- menu -->
<string name="menu_preferences">"Settings"</string>
@ -115,7 +118,7 @@
<string name="menu_update_all_keys">"Update all keys"</string>
<string name="menu_advanced">"Extended information"</string>
<string name="menu_certify_fingerprint">"Confirm via fingerprint"</string>
<string name="menu_certify_fingerprint_word">"Confirm via phrases"</string>
<string name="menu_certify_fingerprint_phrases">"Confirm via phrases"</string>
<string name="menu_share_log">"Share Log"</string>
<string name="menu_keyserver_add">"Add"</string>
@ -1448,8 +1451,7 @@
<string name="section_uids_to_certify">"Identities for "</string>
<string name="certify_text">"The keys you are importing contain “identities”: names and email addresses. Select exactly those for confirmation which match what you expected."</string>
<string name="certify_fingerprint_text">"Compare the fingerprint, character by character, with the one displayed on your partners device."</string>
<string name="certify_fingerprint_text_words">"Compare the phrases with the ones displayed on your partners device."</string>
<string name="certify_fingerprint_text2">"Do the fingerprints match?"</string>
<string name="certify_fingerprint_text_phrases">"Compare the phrases with the ones displayed on your partners device."</string>
<string name="label_revocation">"Revocation Reason"</string>
<string name="label_cert_type">"Type"</string>
<string name="error_key_not_found">"Key not found!"</string>