diff options
Diffstat (limited to 'OpenKeychain/src/main')
-rw-r--r-- | OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java | 56 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/drawable-hdpi/ic_folder_white_24dp.png | bin | 0 -> 224 bytes | |||
-rw-r--r-- | OpenKeychain/src/main/res/drawable-mdpi/ic_folder_white_24dp.png | bin | 0 -> 206 bytes | |||
-rw-r--r-- | OpenKeychain/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png | bin | 0 -> 273 bytes | |||
-rw-r--r-- | OpenKeychain/src/main/res/drawable-xxhdpi/ic_folder_white_24dp.png | bin | 0 -> 342 bytes | |||
-rw-r--r-- | OpenKeychain/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png | bin | 0 -> 504 bytes | |||
-rw-r--r-- | OpenKeychain/src/main/res/drawable/qrcode.xml | 8 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/layout/key_list_fragment.xml | 7 | ||||
-rw-r--r-- | OpenKeychain/src/main/res/menu/key_list.xml | 16 |
9 files changed, 54 insertions, 33 deletions
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java index 079ebb729..0f4b0278b 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/KeyListFragment.java @@ -56,6 +56,8 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.TextView; +import com.getbase.floatingactionbutton.FloatingActionButton; + import org.sufficientlysecure.keychain.Constants; import org.sufficientlysecure.keychain.R; import org.sufficientlysecure.keychain.operations.results.ConsolidateResult; @@ -105,6 +107,10 @@ public class KeyListFragment extends LoaderFragment private String mQuery; private SearchView mSearchView; + private FloatingActionButton mFabQrCode; + private FloatingActionButton mFabCloud; + private FloatingActionButton mFabFile; + @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); @@ -123,6 +129,29 @@ public class KeyListFragment extends LoaderFragment mStickyList = (StickyListHeadersListView) view.findViewById(R.id.key_list_list); mStickyList.setOnItemClickListener(this); + mFabQrCode = (FloatingActionButton) view.findViewById(R.id.fab_add_qr_code); + mFabCloud = (FloatingActionButton) view.findViewById(R.id.fab_add_cloud); + mFabFile = (FloatingActionButton) view.findViewById(R.id.fab_add_file); + + mFabQrCode.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + scanQrCode(); + } + }); + mFabCloud.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + searchCloud(); + } + }); + mFabFile.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + importFile(); + } + }); + mSwipeRefreshLayout = (ListAwareSwipeRefreshLayout) view.findViewById(R.id.key_list_swipe_container); mSwipeRefreshLayout.setOnRefreshListener(new NoScrollableSwipeRefreshLayout.OnRefreshListener() { @Override @@ -496,26 +525,11 @@ public class KeyListFragment extends LoaderFragment @Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { - case R.id.menu_key_list_add: - Intent scanQrCode = new Intent(getActivity(), QrCodeScanActivity.class); - scanQrCode.setAction(QrCodeScanActivity.ACTION_SCAN_WITH_RESULT); - startActivityForResult(scanQrCode, 0); - return true; - - case R.id.menu_key_list_search_cloud: - searchCloud(); - return true; case R.id.menu_key_list_create: createKey(); return true; - case R.id.menu_key_list_import_existing_key: - Intent intentImportExisting = new Intent(getActivity(), ImportKeysActivity.class); - intentImportExisting.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN); - startActivityForResult(intentImportExisting, 0); - return true; - case R.id.menu_key_list_export: mExportHelper.showExportKeysDialog(null, Constants.Path.APP_DIR_FILE, true); return true; @@ -587,6 +601,18 @@ public class KeyListFragment extends LoaderFragment startActivity(importIntent); } + private void scanQrCode() { + Intent scanQrCode = new Intent(getActivity(), QrCodeScanActivity.class); + scanQrCode.setAction(QrCodeScanActivity.ACTION_SCAN_WITH_RESULT); + startActivityForResult(scanQrCode, 0); + } + + private void importFile() { + Intent intentImportExisting = new Intent(getActivity(), ImportKeysActivity.class); + intentImportExisting.setAction(ImportKeysActivity.ACTION_IMPORT_KEY_FROM_FILE_AND_RETURN); + startActivityForResult(intentImportExisting, 0); + } + private void createKey() { Intent intent = new Intent(getActivity(), CreateKeyActivity.class); startActivityForResult(intent, 0); diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_folder_white_24dp.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_folder_white_24dp.png Binary files differnew file mode 100644 index 000000000..9f5c75609 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-hdpi/ic_folder_white_24dp.png diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_folder_white_24dp.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_folder_white_24dp.png Binary files differnew file mode 100644 index 000000000..1c5797c9e --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-mdpi/ic_folder_white_24dp.png diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png Binary files differnew file mode 100644 index 000000000..e5f54cef0 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xhdpi/ic_folder_white_24dp.png diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_folder_white_24dp.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_folder_white_24dp.png Binary files differnew file mode 100644 index 000000000..0d1ac4876 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_folder_white_24dp.png diff --git a/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png Binary files differnew file mode 100644 index 000000000..7a3c198ee --- /dev/null +++ b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_folder_white_24dp.png diff --git a/OpenKeychain/src/main/res/drawable/qrcode.xml b/OpenKeychain/src/main/res/drawable/qrcode.xml new file mode 100644 index 000000000..87eb7d485 --- /dev/null +++ b/OpenKeychain/src/main/res/drawable/qrcode.xml @@ -0,0 +1,8 @@ +<!-- drawable/qrcode.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+ android:height="24dp"
+ android:width="24dp"
+ android:viewportWidth="24"
+ android:viewportHeight="24">
+ <path android:fillColor="#fff" android:pathData="M5,5H7V7H5V5M1,1H11V11H1V1M3,3V9H9V3H3M5,17H7V19H5V17M1,13H11V23H1V13M3,15V21H9V15H3M17,5H19V7H17V5M13,1H23V11H13V1M15,3V9H21V3H15M13,13H17V15H19V13H23V15H19V17H23V23H19V21H15V23H13V21H15V19H13V13M21,21V19H19V21H21M19,17H17V15H15V19H19V17Z" />
+</vector>
\ No newline at end of file diff --git a/OpenKeychain/src/main/res/layout/key_list_fragment.xml b/OpenKeychain/src/main/res/layout/key_list_fragment.xml index 0c3c6404a..290e56872 100644 --- a/OpenKeychain/src/main/res/layout/key_list_fragment.xml +++ b/OpenKeychain/src/main/res/layout/key_list_fragment.xml @@ -63,18 +63,20 @@ android:layout_marginEnd="16dp"> <com.getbase.floatingactionbutton.FloatingActionButton - android:id="@+id/fab_add_cloud" + android:id="@+id/fab_add_qr_code" android:layout_width="wrap_content" android:layout_height="wrap_content" + fab:fab_icon="@drawable/qrcode" fab:fab_colorNormal="@color/fab" fab:fab_colorPressed="@color/fab_pressed" fab:fab_title="Scan QR Code" fab:fab_size="mini" /> <com.getbase.floatingactionbutton.FloatingActionButton - android:id="@+id/fab_add_qr_code" + android:id="@+id/fab_add_cloud" android:layout_width="wrap_content" android:layout_height="wrap_content" + fab:fab_icon="@drawable/ic_cloud_search_24px" fab:fab_colorNormal="@color/fab" fab:fab_colorPressed="@color/fab_pressed" fab:fab_title="Search Cloud" @@ -84,6 +86,7 @@ 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="@color/fab" fab:fab_colorPressed="@color/fab_pressed" fab:fab_title="Import from File" diff --git a/OpenKeychain/src/main/res/menu/key_list.xml b/OpenKeychain/src/main/res/menu/key_list.xml index fef449463..386a9d46e 100644 --- a/OpenKeychain/src/main/res/menu/key_list.xml +++ b/OpenKeychain/src/main/res/menu/key_list.xml @@ -10,17 +10,6 @@ app:showAsAction="collapseActionView|always" /> <item - android:id="@+id/menu_key_list_search_cloud" - android:icon="@drawable/ic_cloud_search_24px" - android:title="@string/menu_search_cloud" - app:showAsAction="never" /> - - <item - android:id="@+id/menu_key_list_add" - android:title="@string/import_qr_code_button" - app:showAsAction="never" /> - - <item android:id="@+id/menu_key_list_export" android:title="@string/menu_export_all_keys" app:showAsAction="never" /> @@ -31,11 +20,6 @@ app:showAsAction="never" /> <item - android:id="@+id/menu_key_list_import_existing_key" - android:title="@string/menu_import_existing_key" - app:showAsAction="never" /> - - <item android:id="@+id/menu_key_list_debug_cons" android:title="Debug / Consolidate" android:visible="false" |