Implemented Pull2Refresh in the KeyListFragment

Added KeyUpdateHelper and extended ProviderHelper for better fingerprint collection
Added a class for handling the list in the swipe2refresh layout that prevents scrolling bugs
Added Pull2Refresh to the KeyListFragment
This commit is contained in:
Daniel Albert
2014-09-12 15:49:29 +02:00
parent 40c81c9429
commit fd5e5afc9f
5 changed files with 272 additions and 80 deletions

View File

@@ -1,82 +1,78 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
<org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/key_list_swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<!--rebuild functionality of ListFragment -->
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
android:id="@+id/key_list_list"
<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:drawSelectorOnTop="true"
android:fastScrollEnabled="true"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="32dp"
android:scrollbarStyle="outsideOverlay" />
<LinearLayout
android:id="@+id/key_list_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical"
android:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="match_parent">
<se.emilsjolander.stickylistheaders.StickyListHeadersListView
android:id="@+id/key_list_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
android:drawSelectorOnTop="true"
android:fastScrollEnabled="true"
android:paddingBottom="16dp"
android:paddingLeft="16dp"
android:paddingRight="32dp"
android:scrollbarStyle="outsideOverlay" />
<LinearLayout
android:id="@+id/key_list_empty"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:text="@string/key_list_empty_text1"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:gravity="center"
android:text="@string/key_list_empty_text2"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/key_list_empty_button_create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_create"
android:drawableLeft="@drawable/ic_action_new_account"
android:drawablePadding="8dp"
android:background="@drawable/button_edgy"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:gravity="center"
android:text="@string/key_list_empty_text3"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/key_list_empty_button_import"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_import"
android:drawableLeft="@drawable/ic_action_collection"
android:drawablePadding="8dp"
android:background="@drawable/button_edgy" />
</LinearLayout>
</FrameLayout>
android:orientation="vertical"
android:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="@string/key_list_empty_text1"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text=""
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:gravity="center"
android:text="@string/key_list_empty_text2"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/key_list_empty_button_create"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_create"
android:drawableLeft="@drawable/ic_action_new_account"
android:drawablePadding="8dp"
android:background="@drawable/button_edgy"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:gravity="center"
android:text="@string/key_list_empty_text3"
android:textAppearance="?android:attr/textAppearanceSmall" />
<Button
android:id="@+id/key_list_empty_button_import"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_margin="4dp"
android:textSize="14sp"
android:text="@string/key_list_empty_button_import"
android:drawableLeft="@drawable/ic_action_collection"
android:drawablePadding="8dp"
android:background="@drawable/button_edgy" />
</LinearLayout>
</FrameLayout>
</org.sufficientlysecure.keychain.ui.widget.ListAwareSwipeRefreshLayout>