ImportKeys: Use single card for importing all keys
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<data>
|
||||
|
||||
<import type="android.view.View" />
|
||||
|
||||
<import
|
||||
alias="i"
|
||||
type="org.sufficientlysecure.keychain.ui.ImportKeysListFragment" />
|
||||
<import type="android.view.View" alias="V" />
|
||||
<import type="org.sufficientlysecure.keychain.ui.ImportKeysListFragment" alias="i" />
|
||||
|
||||
<variable name="status" type="int" />
|
||||
<variable name="advanced" type="boolean" />
|
||||
@@ -24,59 +19,42 @@
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="@{status == i.STATUS_LOADING ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{status == i.STATUS_LOADING ? V.VISIBLE : V.GONE}" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerInParent="true"
|
||||
android:text="@string/error_nothing_import"
|
||||
android:visibility="@{status == i.STATUS_EMPTY ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{status == i.STATUS_EMPTY ? V.VISIBLE : V.GONE}" />
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/toolbar_bottom"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:scrollbars="vertical"
|
||||
android:visibility="@{status == i.STATUS_LOADED ? View.VISIBLE : View.GONE}" />
|
||||
android:visibility="@{status == i.STATUS_LOADED ? V.VISIBLE : V.GONE}">
|
||||
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="?attr/colorPrimary"
|
||||
android:elevation="4dp"
|
||||
android:minHeight="?attr/actionBarSize"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
android:visibility="@{!advanced && (status == i.STATUS_LOADED) ? View.VISIBLE : View.GONE}"
|
||||
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
|
||||
tools:ignore="UnusedAttribute">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="@{advanced ? V.GONE : V.VISIBLE}">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/import_keys"
|
||||
style="@style/TextAppearance.Widget.AppCompat.Toolbar.Subtitle"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:drawablePadding="8dp"
|
||||
android:drawableRight="@drawable/ic_file_download_white_24dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/btn_import_all"
|
||||
android:textAllCaps="true"
|
||||
android:textColor="?android:attr/textColorPrimary" />
|
||||
<include
|
||||
android:id="@+id/basic"
|
||||
layout="@layout/import_keys_list_item_basic" />
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scrollbars="vertical"
|
||||
android:visibility="@{advanced ? V.VISIBLE : V.GONE}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<import type="android.view.View" alias="V" />
|
||||
<import type="org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry" />
|
||||
|
||||
<variable name="advanced" type="boolean" />
|
||||
<variable name="nonInteractive" type="boolean" />
|
||||
<variable name="entry" type="ImportKeysListEntry" />
|
||||
</data>
|
||||
@@ -77,18 +76,11 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- This empty layout is needed to get correct bottom padding in basic mode -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:visibility="@{(!advanced || nonInteractive) ? V.VISIBLE : V.GONE}" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:visibility="@{(!advanced || nonInteractive) ? V.GONE : V.VISIBLE}">
|
||||
android:visibility="@{nonInteractive ? V.GONE : V.VISIBLE}">
|
||||
|
||||
<Button
|
||||
android:id="@+id/import_key"
|
||||
@@ -105,8 +97,7 @@
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="@{advanced ? V.VISIBLE : V.GONE}">
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/extra_container"
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
<import type="android.view.View" alias="V" />
|
||||
|
||||
<variable name="nonInteractive" type="boolean" />
|
||||
<variable name="number" type="int" />
|
||||
</data>
|
||||
|
||||
<android.support.v7.widget.CardView xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
card_view:cardCornerRadius="2dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="24dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="16dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{@string/import_found_keys(number)}"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:padding="8dp"
|
||||
android:visibility="@{nonInteractive ? V.GONE : V.VISIBLE}">
|
||||
|
||||
<Button
|
||||
android:id="@+id/import_keys"
|
||||
style="@style/CardViewActionButton"
|
||||
android:text="@string/btn_import_keys" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/list_keys"
|
||||
style="@style/CardViewActionButton"
|
||||
android:text="@string/btn_list_keys" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</android.support.v7.widget.CardView>
|
||||
|
||||
</layout>
|
||||
@@ -1,12 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<item
|
||||
android:id="@+id/basic"
|
||||
android:title="@string/menu_basic" />
|
||||
|
||||
<item
|
||||
android:id="@+id/advanced"
|
||||
android:title="@string/menu_advanced" />
|
||||
|
||||
</menu>
|
||||
@@ -128,8 +128,6 @@
|
||||
<string name="menu_select_all">"Select all"</string>
|
||||
<string name="menu_export_all_keys">"Export all keys"</string>
|
||||
<string name="menu_update_all_keys">"Update all keys"</string>
|
||||
<string name="menu_basic">"Basic"</string>
|
||||
<string name="menu_advanced">"Advanced"</string>
|
||||
<string name="menu_certify_fingerprint">"Confirm with fingerprint"</string>
|
||||
<string name="menu_certify_fingerprint_phrases">"Confirm with phrases"</string>
|
||||
<string name="menu_share_log">"Share log"</string>
|
||||
@@ -526,7 +524,7 @@
|
||||
<string name="import_tab_cloud">"Key Search"</string>
|
||||
<string name="import_tab_direct">"File/Clipboard"</string>
|
||||
<string name="import_tab_qr_code">"QR Code/NFC"</string>
|
||||
<string name="import_import">"Import selected keys"</string>
|
||||
<string name="import_found_keys">"Found %1$d keys"</string>
|
||||
<string name="import_qr_code_wrong">"QR Code malformed! Please try again!"</string>
|
||||
<string name="import_qr_code_fp">"Fingerprint is malformed or too short!"</string>
|
||||
<string name="import_qr_code_too_short_fingerprint">"Fingerprint is too short!"</string>
|
||||
@@ -1574,7 +1572,8 @@
|
||||
<string name="security_token_create">"Hold Security Token against the back of your device."</string>
|
||||
<string name="security_token_reset_or_import">"This Security Token already contains a key. You can import the key using the cloud or reset the Security Token."</string>
|
||||
<string name="btn_import">"Import"</string>
|
||||
<string name="btn_import_all">"Import all"</string>
|
||||
<string name="btn_import_keys">"Import keys"</string>
|
||||
<string name="btn_list_keys">"List keys"</string>
|
||||
<string name="btn_reset">"Reset"</string>
|
||||
<string name="security_token_import_radio">"Import key"</string>
|
||||
<string name="security_token_reset_radio">"Reset Security Token"</string>
|
||||
|
||||
Reference in New Issue
Block a user