diff --git a/OpenPGP-Keychain/res/layout/key_list_public_fragment.xml b/OpenPGP-Keychain/res/layout/key_list_public_fragment.xml
index 2aca81cd6..06719749c 100644
--- a/OpenPGP-Keychain/res/layout/key_list_public_fragment.xml
+++ b/OpenPGP-Keychain/res/layout/key_list_public_fragment.xml
@@ -1,5 +1,5 @@
-
@@ -16,13 +16,55 @@
android:paddingRight="32dp"
android:scrollbarStyle="outsideOverlay" />
-
+ android:orientation="vertical"
+ android:visibility="gone" >
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/OpenPGP-Keychain/res/values/strings.xml b/OpenPGP-Keychain/res/values/strings.xml
index 62beb64f7..792f2cc85 100644
--- a/OpenPGP-Keychain/res/values/strings.xml
+++ b/OpenPGP-Keychain/res/values/strings.xml
@@ -104,7 +104,7 @@
Beam settings
Cancel
Encrypt to…
-
+
Sign
Message
@@ -354,11 +354,18 @@
QR Code %1$d of %2$d
Share with NFC
+
- 1 key selected.
- %d keys selected.
+ No keys available yet…
+ You can start by
+ or
+ creating your own key pair
+ importing public keys.
+
Encrypt to this contact
diff --git a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java
index d9fa0948a..b5ca0269d 100644
--- a/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java
+++ b/OpenPGP-Keychain/src/org/sufficientlysecure/keychain/ui/KeyListPublicFragment.java
@@ -46,8 +46,10 @@ import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
+import android.view.View.OnClickListener;
import android.widget.AbsListView.MultiChoiceModeListener;
import android.widget.AdapterView;
+import android.widget.Button;
import android.widget.ListView;
/**
@@ -57,16 +59,44 @@ import android.widget.ListView;
public class KeyListPublicFragment extends Fragment implements AdapterView.OnItemClickListener,
LoaderManager.LoaderCallbacks {
- // private KeyListPublicActivity mKeyListPublicActivity;
private KeyListPublicAdapter mAdapter;
private StickyListHeadersListView mStickyList;
+ // empty layout
+ private Button mButtonEmptyCreate;
+ private Button mButtonEmptyImport;
+
/**
* Load custom layout with StickyListView from library
*/
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
View view = inflater.inflate(R.layout.key_list_public_fragment, container, false);
+
+ mButtonEmptyCreate = (Button) view.findViewById(R.id.key_list_empty_button_create);
+ mButtonEmptyCreate.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Intent intent = new Intent(getActivity(), EditKeyActivity.class);
+ intent.setAction(EditKeyActivity.ACTION_CREATE_KEY);
+ intent.putExtra(EditKeyActivity.EXTRA_GENERATE_DEFAULT_KEYS, true);
+ intent.putExtra(EditKeyActivity.EXTRA_USER_IDS, ""); // show user id view
+ startActivityForResult(intent, 0);
+ }
+ });
+
+ mButtonEmptyImport = (Button) view.findViewById(R.id.key_list_empty_button_import);
+ mButtonEmptyImport.setOnClickListener(new OnClickListener() {
+
+ @Override
+ public void onClick(View v) {
+ Intent intentImportFromFile = new Intent(getActivity(), ImportKeysActivity.class);
+ intentImportFromFile.setAction(ImportKeysActivity.ACTION_IMPORT_KEY);
+ startActivityForResult(intentImportFromFile, Id.request.import_from_qr_code);
+ }
+ });
+
return view;
}