ImportKeys: Use the parsed key id and move it in extra part
This commit is contained in:
@@ -236,6 +236,8 @@ public class ImportKeysAdapter extends RecyclerView.Adapter<ImportKeysAdapter.Vi
|
|||||||
|
|
||||||
ImportKeysListEntry entry = mData.get(mCurrent);
|
ImportKeysListEntry entry = mData.get(mCurrent);
|
||||||
|
|
||||||
|
entry.setKeyId(keyRing.getMasterKeyId());
|
||||||
|
|
||||||
ArrayList<String> realUserIdsPlusKeybase = keyRing.getUnorderedUserIds();
|
ArrayList<String> realUserIdsPlusKeybase = keyRing.getUnorderedUserIds();
|
||||||
realUserIdsPlusKeybase.addAll(entry.getKeybaseUserIds());
|
realUserIdsPlusKeybase.addAll(entry.getKeybaseUserIds());
|
||||||
entry.setUserIds(realUserIdsPlusKeybase);
|
entry.setUserIds(realUserIdsPlusKeybase);
|
||||||
|
|||||||
@@ -17,20 +17,16 @@ import java.util.Map;
|
|||||||
|
|
||||||
public class ImportKeysExtraBindings {
|
public class ImportKeysExtraBindings {
|
||||||
|
|
||||||
@BindingAdapter({"app:keyId", "app:keyRevokedOrExpired"})
|
@BindingAdapter({"app:keyId"})
|
||||||
public static void setKeyId(TextView textView, String keyId, boolean revokedOrExpired) {
|
public static void setKeyId(TextView textView, String keyId) {
|
||||||
Context context = textView.getContext();
|
|
||||||
|
|
||||||
if (keyId == null)
|
if (keyId == null)
|
||||||
keyId = "";
|
keyId = "";
|
||||||
|
|
||||||
textView.setText(KeyFormattingUtils.beautifyKeyIdWithPrefix(keyId));
|
textView.setText(KeyFormattingUtils.beautifyKeyIdWithPrefix(keyId));
|
||||||
textView.setTextColor(ImportKeysBindingsUtils.getColor(context, revokedOrExpired));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@BindingAdapter({"app:keyUserIds", "app:keyRevokedOrExpired", "app:query"})
|
@BindingAdapter({"app:keyUserIds", "app:query"})
|
||||||
public static void setUserIds(LinearLayout linearLayout, ArrayList userIds,
|
public static void setUserIds(LinearLayout linearLayout, ArrayList userIds, String query) {
|
||||||
boolean revokedOrExpired, String query) {
|
|
||||||
|
|
||||||
linearLayout.removeAllViews();
|
linearLayout.removeAllViews();
|
||||||
|
|
||||||
@@ -49,12 +45,7 @@ public class ImportKeysExtraBindings {
|
|||||||
R.layout.import_keys_list_entry_user_id, null);
|
R.layout.import_keys_list_entry_user_id, null);
|
||||||
uidView.setText(highlighter.highlight(name));
|
uidView.setText(highlighter.highlight(name));
|
||||||
uidView.setPadding(0, 0, FormattingUtils.dpToPx(context, 8), 0);
|
uidView.setPadding(0, 0, FormattingUtils.dpToPx(context, 8), 0);
|
||||||
|
uidView.setTextColor(FormattingUtils.getColorFromAttr(context, R.attr.colorText));
|
||||||
if (revokedOrExpired) {
|
|
||||||
uidView.setTextColor(context.getResources().getColor(R.color.key_flag_gray));
|
|
||||||
} else {
|
|
||||||
uidView.setTextColor(FormattingUtils.getColorFromAttr(context, R.attr.colorText));
|
|
||||||
}
|
|
||||||
linearLayout.addView(uidView);
|
linearLayout.addView(uidView);
|
||||||
|
|
||||||
for (String email : emails) {
|
for (String email : emails) {
|
||||||
@@ -64,12 +55,7 @@ public class ImportKeysExtraBindings {
|
|||||||
FormattingUtils.dpToPx(context, 16), 0,
|
FormattingUtils.dpToPx(context, 16), 0,
|
||||||
FormattingUtils.dpToPx(context, 8), 0);
|
FormattingUtils.dpToPx(context, 8), 0);
|
||||||
emailView.setText(highlighter.highlight(email));
|
emailView.setText(highlighter.highlight(email));
|
||||||
|
emailView.setTextColor(FormattingUtils.getColorFromAttr(context, R.attr.colorText));
|
||||||
if (revokedOrExpired) {
|
|
||||||
emailView.setTextColor(context.getResources().getColor(R.color.key_flag_gray));
|
|
||||||
} else {
|
|
||||||
emailView.setTextColor(FormattingUtils.getColorFromAttr(context, R.attr.colorText));
|
|
||||||
}
|
|
||||||
linearLayout.addView(emailView);
|
linearLayout.addView(emailView);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,12 +42,6 @@
|
|||||||
android:layout_toLeftOf="@+id/status"
|
android:layout_toLeftOf="@+id/status"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<TextView
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:text="@{entry.algorithm}"
|
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
@@ -127,10 +121,7 @@
|
|||||||
|
|
||||||
<include
|
<include
|
||||||
layout="@layout/import_keys_list_item_extra"
|
layout="@layout/import_keys_list_item_extra"
|
||||||
app:keyIdHex="@{entry.keyIdHex}"
|
app:entry="@{entry}" />
|
||||||
app:keyUserIds="@{entry.sortedUserIds}"
|
|
||||||
app:query="@{entry.query}"
|
|
||||||
app:revokedOrExpired="@{entry.revokedOrExpired}" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -2,12 +2,9 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<data>
|
<data>
|
||||||
<import type="java.util.ArrayList" />
|
<import type="org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry" />
|
||||||
|
|
||||||
<variable name="keyIdHex" type="String" />
|
<variable name="entry" type="ImportKeysListEntry" />
|
||||||
<variable name="keyUserIds" type="ArrayList" />
|
|
||||||
<variable name="query" type="String" />
|
|
||||||
<variable name="revokedOrExpired" type="boolean" />
|
|
||||||
</data>
|
</data>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@@ -19,17 +16,38 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
app:keyId="@{keyIdHex}"
|
android:textColor="?attr/colorText"
|
||||||
app:keyRevokedOrExpired="@{revokedOrExpired}" />
|
app:keyId="@{entry.keyIdHex}" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="4dp"
|
android:layout_marginTop="4dp"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
app:keyRevokedOrExpired="@{revokedOrExpired}"
|
app:keyUserIds="@{entry.sortedUserIds}"
|
||||||
app:keyUserIds="@{keyUserIds}"
|
app:query="@{entry.query}" />
|
||||||
app:query="@{query}" />
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="4dp">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:text="@string/label_algorithm_colon"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="?attr/colorText" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginLeft="8dp"
|
||||||
|
android:text="@{entry.algorithm}"
|
||||||
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
|
android:textColor="?attr/colorText" />
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
|
|||||||
@@ -149,6 +149,7 @@
|
|||||||
<string name="label_passphrase_again">"Repeat Password"</string>
|
<string name="label_passphrase_again">"Repeat Password"</string>
|
||||||
<string name="label_show_passphrase">"Show Password"</string>
|
<string name="label_show_passphrase">"Show Password"</string>
|
||||||
<string name="label_algorithm">"Algorithm"</string>
|
<string name="label_algorithm">"Algorithm"</string>
|
||||||
|
<string name="label_algorithm_colon">"Algorithm:"</string>
|
||||||
<string name="label_ascii_armor">"File ASCII Armor"</string>
|
<string name="label_ascii_armor">"File ASCII Armor"</string>
|
||||||
<string name="label_file_ascii_armor">"Enable ASCII Armor"</string>
|
<string name="label_file_ascii_armor">"Enable ASCII Armor"</string>
|
||||||
<string name="label_write_version_header">"Let others know that you're using OpenKeychain"</string>
|
<string name="label_write_version_header">"Let others know that you're using OpenKeychain"</string>
|
||||||
|
|||||||
Reference in New Issue
Block a user