diff options
author | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2015-07-19 13:31:00 +0200 |
---|---|---|
committer | Mohamed Zenadi <zeapo@users.noreply.github.com> | 2015-07-19 13:31:00 +0200 |
commit | 7517c650752b89acbfec691265ffda22f325783a (patch) | |
tree | 37e824f7d5e469aeea917b8696deb7380ff86984 /app/src/main/res | |
parent | ea899faa074ee3162186769218c62d3d254ce4ae (diff) | |
parent | 4ec3e1956f38879321b13e753294b9fee1b144bf (diff) |
Merge pull request #103 from wongma7/master
SSH key generator
Diffstat (limited to 'app/src/main/res')
-rw-r--r-- | app/src/main/res/layout/activity_ssh_keygen.xml | 7 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_show_ssh_key.xml | 28 | ||||
-rw-r--r-- | app/src/main/res/layout/fragment_ssh_keygen.xml | 73 | ||||
-rw-r--r-- | app/src/main/res/layout/password_recycler_view.xml | 29 | ||||
-rw-r--r-- | app/src/main/res/values-v21/dimens.xml | 4 | ||||
-rw-r--r-- | app/src/main/res/values/dimens.xml | 1 | ||||
-rw-r--r-- | app/src/main/res/values/strings.xml | 17 | ||||
-rw-r--r-- | app/src/main/res/xml/preference.xml | 6 |
8 files changed, 149 insertions, 16 deletions
diff --git a/app/src/main/res/layout/activity_ssh_keygen.xml b/app/src/main/res/layout/activity_ssh_keygen.xml new file mode 100644 index 00000000..fb3d8a25 --- /dev/null +++ b/app/src/main/res/layout/activity_ssh_keygen.xml @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="utf-8"?> +<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:orientation="vertical" + android:layout_width="match_parent" + android:layout_height="match_parent"> + +</LinearLayout>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_show_ssh_key.xml b/app/src/main/res/layout/fragment_show_ssh_key.xml new file mode 100644 index 00000000..e81ae8c4 --- /dev/null +++ b/app/src/main/res/layout/fragment_show_ssh_key.xml @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical"> + + <TextView + android:id="@+id/public_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_margin="16dp" + android:textIsSelectable="true"/> + + <TextView + android:id="@+id/public_key_tip" + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:layout_marginLeft="16dp" + android:text="@string/ssh_keygen_tip" + android:textAppearance="?android:attr/textAppearanceMedium"/> + + </LinearLayout> +</ScrollView>
\ No newline at end of file diff --git a/app/src/main/res/layout/fragment_ssh_keygen.xml b/app/src/main/res/layout/fragment_ssh_keygen.xml new file mode 100644 index 00000000..321e77d0 --- /dev/null +++ b/app/src/main/res/layout/fragment_ssh_keygen.xml @@ -0,0 +1,73 @@ +<?xml version="1.0" encoding="utf-8"?> +<ScrollView + xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="match_parent"> + + <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:paddingLeft="@dimen/activity_horizontal_margin" + android:paddingRight="@dimen/activity_horizontal_margin" + android:orientation="vertical"> + + <TextView + android:id="@+id/label_length" + android:layout_width="wrap_content" + android:layout_height="48dp" + android:gravity="center_vertical" + android:text="@string/ssh_keygen_length"/> + + <Spinner + android:id="@+id/length" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:spinnerMode="dropdown"/> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:hintTextAppearance="@style/TextAppearance.AppCompat" + android:layout_marginTop="8dp"> + + <EditText + android:id="@+id/passphrase" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/ssh_keygen_passphrase" + android:inputType="textPassword"/> + </android.support.design.widget.TextInputLayout> + + <CheckBox + android:layout_width="wrap_content" + android:layout_height="wrap_content" + android:text="@string/ssh_keygen_show_passphrase" + android:id="@+id/show_passphrase" + android:checked="false" + android:layout_marginTop="8dp"/> + + <android.support.design.widget.TextInputLayout + android:layout_width="match_parent" + android:layout_height="wrap_content" + xmlns:app="http://schemas.android.com/apk/res-auto" + app:hintTextAppearance="@style/TextAppearance.AppCompat" + android:layout_marginTop="8dp"> + <EditText + android:id="@+id/comment" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:hint="@string/ssh_keygen_comment" + android:inputType="textShortMessage"/> + </android.support.design.widget.TextInputLayout> + + <Button + android:id="@+id/generate_ssh_key" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:layout_marginTop="8dp" + android:onClick="generate" + android:text="@string/ssh_keygen_generate"/> + + </LinearLayout> +</ScrollView>
\ No newline at end of file diff --git a/app/src/main/res/layout/password_recycler_view.xml b/app/src/main/res/layout/password_recycler_view.xml index b9a4231f..1b922a17 100644 --- a/app/src/main/res/layout/password_recycler_view.xml +++ b/app/src/main/res/layout/password_recycler_view.xml @@ -1,11 +1,11 @@ <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" - xmlns:tools="http://schemas.android.com/tools" - xmlns:fab="http://schemas.android.com/apk/res-auto" - android:layout_width="match_parent" - android:layout_height="match_parent" - android:orientation="vertical" - tools:context="com.zeapo.pwdstore.PasswordFragment"> + xmlns:tools="http://schemas.android.com/tools" + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="match_parent" + android:layout_height="match_parent" + android:orientation="vertical" + tools:context="com.zeapo.pwdstore.PasswordFragment"> <android.support.v7.widget.RecyclerView android:id="@+id/pass_recycler" @@ -17,17 +17,18 @@ android:paddingTop="@dimen/activity_vertical_margin" android:paddingBottom="@dimen/activity_vertical_margin"/> - <com.melnykov.fab.FloatingActionButton + <android.support.design.widget.FloatingActionButton android:id="@+id/fab" android:src="@drawable/ic_action_new" android:layout_width="wrap_content" android:layout_height="wrap_content" - android:layout_alignParentEnd="true" - android:layout_alignParentRight="true" + android:layout_gravity="bottom|end" + app:elevation="6dp" + app:pressedTranslationZ="12dp" + app:backgroundTint="@color/blue_grey_500" + app:rippleColor="@color/blue_grey_50" + app:borderWidth="0dp" + android:layout_margin="@dimen/fab_compat_margin" android:layout_alignParentBottom="true" - android:layout_margin="@dimen/activity_vertical_margin" - android:onClick="createPassword" - fab:fab_colorNormal="@color/blue_grey_500" - fab:fab_colorPressed="@color/blue_grey_800" - fab:fab_colorRipple="@color/blue_grey_50"/> + android:layout_alignParentRight="true"/> </RelativeLayout> diff --git a/app/src/main/res/values-v21/dimens.xml b/app/src/main/res/values-v21/dimens.xml new file mode 100644 index 00000000..daaecce2 --- /dev/null +++ b/app/src/main/res/values-v21/dimens.xml @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<resources> + <dimen name="fab_compat_margin">16dp</dimen> +</resources>
\ No newline at end of file diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 47c82246..8a517840 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -2,4 +2,5 @@ <!-- Default screen margins, per the Android Design guidelines. --> <dimen name="activity_horizontal_margin">16dp</dimen> <dimen name="activity_vertical_margin">16dp</dimen> + <dimen name="fab_compat_margin">0dp</dimen> </resources> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 1f2ae926..f60e4b15 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -47,8 +47,10 @@ <string name="read_only_dialog_text">You are about to use a read-only repository, you will not be able to push to it</string> <string name="forget_username_dialog_text">Did you forget to specify a username?</string> <string name="set_information_dialog_text">You have to set the information about the server before synchronizing with the server</string> - <string name="ssh_preferences_dialog_text">Please import your SSH key file in the preferences</string> + <string name="ssh_preferences_dialog_text">Please import or generate your SSH key file in the preferences</string> <string name="ssh_preferences_dialog_title">No SSH key</string> + <string name="ssh_preferences_dialog_import">Import</string> + <string name="ssh_preferences_dialog_generate">Generate</string> <string name="passphrase_dialog_title">Authenticate</string> <string name="passphrase_dialog_text">Please provide the passphrase for your SSH key. Leave it empty if there is no passphrase.</string> <string name="password_dialog_text">Please provide the password for this repository</string> @@ -94,7 +96,9 @@ <string name="pref_git_username_title">Username</string> <string name="pref_git_username_hint">username</string> <string name="pref_edit_server_info">Edit git server settings</string> - <string name="pref_ssh_title">Import ssh-key</string> + <string name="pref_ssh_title">Import SSH key</string> + <string name="pref_ssh_keygen_title">Generate SSH key pair</string> + <string name="pref_ssh_see_key_title">View generated public SSH key</string> <string name="pref_git_delete_repo">Delete repository</string> <string name="pref_dialog_delete_title">Clear repository</string> <string name="pref_dialog_delete_msg">Do you want to delete the current password store directory? This will not clear your configuration.</string> @@ -122,6 +126,15 @@ <string name="pwgen_uppercase">Uppercase</string> <string name="pwgen_ambiguous">Ambiguous</string> + <!-- ssh keygen fragment --> + <string name="ssh_keygen_length">Length</string> + <string name="ssh_keygen_passphrase">Passphrase</string> + <string name="ssh_keygen_comment">Comment</string> + <string name="ssh_keygen_generate">Generate</string> + <string name="ssh_keygen_copy">Copy</string> + <string name="ssh_keygen_tip">Provide this public key to your Git server.</string> + <string name="ssh_keygen_show_passphrase">Show passphrase</string> + <!-- Misc --> <string name="dialog_ok">OK</string> <string name="dialog_yes">Yes</string> diff --git a/app/src/main/res/xml/preference.xml b/app/src/main/res/xml/preference.xml index 1ddcde41..67217c9d 100644 --- a/app/src/main/res/xml/preference.xml +++ b/app/src/main/res/xml/preference.xml @@ -8,6 +8,12 @@ android:key="ssh_key" android:title="@string/pref_ssh_title" /> <Preference + android:key="ssh_keygen" + android:title="@string/pref_ssh_keygen_title" /> + <Preference + android:key="ssh_see_key" + android:title="@string/pref_ssh_see_key_title" /> + <Preference android:key="git_delete_repo" android:summary="Deletes local repository" android:title="@string/pref_git_delete_repo" /> |