Improved SectionedCursorAdapter, added support for the dummy key item view.
This commit is contained in:
47
OpenKeychain/src/main/res/layout/key_list_dummy.xml
Normal file
47
OpenKeychain/src/main/res/layout/key_list_dummy.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:focusable="true"
|
||||
android:background="?android:selectableItemBackground">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingStart="8dp"
|
||||
android:paddingRight="4dp"
|
||||
android:paddingEnd="4dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="You don't have any keys yet!"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:text="Click here to create or import one."
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_key_plus_grey600_24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
@@ -1,115 +1,140 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
<FrameLayout
|
||||
xmlns:fab="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
xmlns:custom="http://schemas.android.com/apk/res-auto"
|
||||
>
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
<!--rebuild functionality of ListFragment -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@android:id/progress"
|
||||
android:orientation="vertical"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center">
|
||||
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@+id/key_list_list"
|
||||
<ProgressBar
|
||||
style="?android:attr/progressBarStyleLarge"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@android:id/widget_frame"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone">
|
||||
|
||||
<!--rebuild functionality of ListFragment -->
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="32dp"
|
||||
android:scrollbarStyle="outsideOverlay" />
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/key_list_empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="240dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true"
|
||||
>
|
||||
<android.support.v7.widget.RecyclerView
|
||||
android:id="@android:id/list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:paddingLeft="16dp"
|
||||
android:paddingRight="32dp"
|
||||
android:clipToPadding="false"
|
||||
android:scrollbarStyle="outsideOverlay" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
<LinearLayout
|
||||
android:id="@android:id/empty"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="240dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/key_list_empty_text1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
android:orientation="vertical"
|
||||
android:animateLayoutChanges="true" >
|
||||
|
||||
<org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/search_container"
|
||||
android:inAnimation="@anim/fade_in_delayed"
|
||||
android:outAnimation="@anim/fade_out"
|
||||
android:measureAllChildren="true"
|
||||
custom:initialView="1">
|
||||
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<Button
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:id="@+id/search_button"
|
||||
android:gravity="center"
|
||||
tools:text="@string/btn_search_for_query"
|
||||
/>
|
||||
android:text="@string/key_list_empty_text1"
|
||||
android:textAppearance="?android:attr/textAppearanceLarge" />
|
||||
|
||||
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
||||
<org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:id="@+id/search_container"
|
||||
android:inAnimation="@anim/fade_in_delayed"
|
||||
android:outAnimation="@anim/fade_out"
|
||||
android:measureAllChildren="true"
|
||||
custom:initialView="1">
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
<Space
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionsMenu
|
||||
android:id="@+id/fab_main"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
fab:fab_addButtonColorNormal="?attr/colorPrimary"
|
||||
fab:fab_addButtonColorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_addButtonSize="normal"
|
||||
fab:fab_addButtonPlusIconColor="@color/icons"
|
||||
fab:fab_expandDirection="up"
|
||||
fab:fab_labelStyle="@style/FabMenuStyle"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
>
|
||||
<Button
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="24dp"
|
||||
android:id="@+id/search_button"
|
||||
android:gravity="center"
|
||||
tools:text="@string/btn_search_for_query"/>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_qr_code"
|
||||
</org.sufficientlysecure.keychain.ui.widget.ToolableViewAnimator>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionsMenu
|
||||
android:id="@+id/fab_main"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_qrcode_white_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_qr_code"
|
||||
fab:fab_size="mini" />
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_alignParentBottom="true"
|
||||
fab:fab_addButtonColorNormal="?attr/colorPrimary"
|
||||
fab:fab_addButtonColorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_addButtonSize="normal"
|
||||
fab:fab_addButtonPlusIconColor="@color/icons"
|
||||
fab:fab_expandDirection="up"
|
||||
fab:fab_labelStyle="@style/FabMenuStyle"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_marginEnd="16dp">
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_cloud"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_cloud_search_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_search"
|
||||
fab:fab_size="mini" />
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_qr_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_qrcode_white_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_qr_code"
|
||||
fab:fab_size="mini" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_cloud"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_cloud_search_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_search"
|
||||
fab:fab_size="mini" />
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_file"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_folder_white_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_import"
|
||||
fab:fab_size="mini" />
|
||||
|
||||
</com.getbase.floatingactionbutton.FloatingActionsMenu>
|
||||
</RelativeLayout>
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<com.getbase.floatingactionbutton.FloatingActionButton
|
||||
android:id="@+id/fab_add_file"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
fab:fab_icon="@drawable/ic_folder_white_24dp"
|
||||
fab:fab_colorNormal="?attr/colorPrimary"
|
||||
fab:fab_colorPressed="?attr/colorPrimaryDark"
|
||||
fab:fab_title="@string/key_list_fab_import"
|
||||
fab:fab_size="mini" />
|
||||
|
||||
</com.getbase.floatingactionbutton.FloatingActionsMenu>
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -12,25 +12,23 @@
|
||||
super:slm_section_sectionManager="linear"
|
||||
tools:ignore="ResAuto">
|
||||
|
||||
<TextView
|
||||
style="@style/SectionHeader"
|
||||
android:id="@+id/stickylist_header_text"
|
||||
<TextView style="@style/SectionHeader"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|left"
|
||||
android:text="header text" />
|
||||
android:text="@string/my_keys" />
|
||||
|
||||
<TextView
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:text="key count"
|
||||
android:id="@+id/contacts_num"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_marginRight="8dp"
|
||||
android:visibility="gone"
|
||||
android:textColor="@android:color/darker_gray" />
|
||||
android:layout_marginLeft="8dp"
|
||||
android:textColor="@android:color/darker_gray"
|
||||
tools:text="11 Keys"/>
|
||||
|
||||
</RelativeLayout>
|
||||
22
OpenKeychain/src/main/res/layout/key_list_header_public.xml
Normal file
22
OpenKeychain/src/main/res/layout/key_list_header_public.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:super="http://schemas.android.com/apk/lib-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?android:colorBackground"
|
||||
|
||||
super:slm_headerDisplay="sticky|inline"
|
||||
super:slm_section_sectionManager="linear"
|
||||
tools:ignore="ResAuto">
|
||||
|
||||
<TextView style="@style/SectionHeader"
|
||||
android:id="@android:id/text1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="start|left"
|
||||
tools:text="A" />
|
||||
|
||||
</FrameLayout>
|
||||
@@ -1,63 +1,17 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?android:attr/listPreferredItemHeight"
|
||||
android:gravity="center_vertical"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:orientation="horizontal"
|
||||
android:descendantFocusability="blocksDescendants"
|
||||
android:focusable="false">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/key_list_item_dummy"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal"
|
||||
android:focusable="true"
|
||||
android:visibility="gone"
|
||||
android:background="?android:selectableItemBackground"
|
||||
tools:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dip"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_weight="1"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="8dp"
|
||||
android:paddingRight="4dp"
|
||||
android:paddingTop="4dp"
|
||||
android:paddingBottom="4dp"
|
||||
>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="You don't have any keys yet!"
|
||||
android:textAppearance="?android:attr/textAppearanceMedium" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:text="Click here to create or import one."
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
android:src="@drawable/ic_key_plus_grey600_24dp"
|
||||
/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/key_list_item_data"
|
||||
android:layout_width="0dip"
|
||||
@@ -83,7 +37,7 @@
|
||||
android:id="@+id/key_list_item_email"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
tools:text="user@example.com"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall" />
|
||||
@@ -92,12 +46,11 @@
|
||||
android:id="@+id/key_list_item_creation"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:singleLine="true"
|
||||
android:maxLines="1"
|
||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||
android:visibility="gone"
|
||||
tools:visibility="visible"
|
||||
tools:text="Created on 10/10/2010 10:00"
|
||||
/>
|
||||
tools:text="Created on 10/10/2010 10:00" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -134,7 +87,6 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:padding="16dp"
|
||||
tools:src="@drawable/status_signature_revoked_cutout_24dp"
|
||||
/>
|
||||
tools:src="@drawable/status_signature_revoked_cutout_24dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
Reference in New Issue
Block a user