ImportKeys: Add basic key importing
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<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">
|
||||
|
||||
<data>
|
||||
|
||||
@@ -9,12 +11,11 @@
|
||||
alias="i"
|
||||
type="org.sufficientlysecure.keychain.ui.ImportKeysListFragment" />
|
||||
|
||||
<variable
|
||||
name="status"
|
||||
type="int" />
|
||||
<variable name="status" type="int" />
|
||||
<variable name="advanced" type="boolean" />
|
||||
</data>
|
||||
|
||||
<FrameLayout
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/md_grey_100">
|
||||
@@ -22,23 +23,60 @@
|
||||
<ProgressBar
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_centerInParent="true"
|
||||
android:visibility="@{status == i.STATUS_LOADING ? View.VISIBLE : View.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.support.v7.widget.RecyclerView
|
||||
android:id="@+id/recycler_view"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_above="@+id/toolbar_bottom"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="8dp"
|
||||
android:scrollbars="vertical"
|
||||
android:visibility="@{status == i.STATUS_LOADED ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<android.support.v7.widget.Toolbar
|
||||
android:id="@+id/toolbar_bottom"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:text="@string/error_nothing_import"
|
||||
android:visibility="@{status == i.STATUS_EMPTY ? View.VISIBLE : View.GONE}" />
|
||||
</FrameLayout>
|
||||
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
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<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/menu_import_all_keys"
|
||||
android:textColor="#ffffffff" />
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</android.support.v7.widget.Toolbar>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
</layout>
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
<import type="android.view.View" />
|
||||
<import type="org.sufficientlysecure.keychain.keyimport.ImportKeysListEntry" />
|
||||
|
||||
<variable name="advanced" type="boolean" />
|
||||
<variable name="nonInteractive" type="boolean" />
|
||||
<variable name="entry" type="ImportKeysListEntry" />
|
||||
</data>
|
||||
@@ -76,11 +77,17 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="8dp"
|
||||
android:visibility="@{(!advanced || nonInteractive) ? View.VISIBLE : View.GONE}" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="8dp"
|
||||
android:visibility="@{nonInteractive ? View.GONE : View.VISIBLE}">
|
||||
android:visibility="@{(!advanced || nonInteractive) ? View.GONE : View.VISIBLE}">
|
||||
|
||||
<Button
|
||||
android:id="@+id/import_key"
|
||||
@@ -109,20 +116,27 @@
|
||||
</RelativeLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/extra_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:visibility="gone">
|
||||
android:visibility="@{advanced ? View.VISIBLE : View.GONE}">
|
||||
|
||||
<include
|
||||
layout="@layout/import_keys_list_item_extra"
|
||||
app:entry="@{entry}" />
|
||||
<LinearLayout
|
||||
android:id="@+id/extra_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:animateLayoutChanges="true"
|
||||
android:orientation="vertical"
|
||||
android:paddingBottom="24dp"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="16dp"
|
||||
android:paddingTop="16dp"
|
||||
android:visibility="gone">
|
||||
|
||||
<include
|
||||
layout="@layout/import_keys_list_item_extra"
|
||||
app:entry="@{entry}" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
12
OpenKeychain/src/main/res/menu/import_keys_list_fragment.xml
Normal file
12
OpenKeychain/src/main/res/menu/import_keys_list_fragment.xml
Normal file
@@ -0,0 +1,12 @@
|
||||
<?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,6 +128,7 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user