diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/presenter/TransferPresenter.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/presenter/TransferPresenter.java index 18b862200..b04e7f3f0 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/presenter/TransferPresenter.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/presenter/TransferPresenter.java @@ -65,7 +65,8 @@ import org.sufficientlysecure.keychain.util.Log; @RequiresApi(api = VERSION_CODES.LOLLIPOP) public class TransferPresenter implements KeyTransferCallback, LoaderCallbacks>, OnClickTransferKeyListener, OnClickImportKeyListener { - public static final String BACKSTACK_TAG_TRANSFER = "transfer"; + private static final String BACKSTACK_TAG_TRANSFER = "transfer"; + private final Context context; private final TransferMvpView view; private final LoaderManager loaderManager; @@ -74,12 +75,14 @@ public class TransferPresenter implements KeyTransferCallback, LoaderCallbacks + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package org.sufficientlysecure.keychain.ui.transfer.view; @@ -22,7 +39,7 @@ import org.sufficientlysecure.keychain.ui.util.recyclerview.DividerItemDecoratio public class ReceivedSecretKeyList extends RecyclerView { private static final int STATE_INVISIBLE = 0; - private static final int STATE_BUTTON = 1; + // private static final int STATE_BUTTON = 1; // used in TransferSecretKeyList private static final int STATE_PROGRESS = 2; private static final int STATE_TRANSFERRED = 3; private static final int STATE_IMPORT_BUTTON = 4; diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferFragment.java index 29bb6b2d7..028cb2581 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferFragment.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferFragment.java @@ -1,5 +1,5 @@ /* - * Copyright (C) 2015 Dominik Schürmann + * Copyright (C) 2017 Vincent Breitmoser * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -160,8 +160,9 @@ public class TransferFragment extends Fragment implements TransferMvpView { @Override public void showConnectionEstablished(String hostname) { - vConnectionStatusText1.setText("Connected to: " + hostname); - vConnectionStatusText2.setText("Connected to: " + hostname); + String statusText = getString(R.string.transfer_status_connected, hostname); + vConnectionStatusText1.setText(statusText); + vConnectionStatusText2.setText(statusText); vTransferAnimator.setDisplayedChild(VIEW_CONNECTED); } @@ -172,8 +173,8 @@ public class TransferFragment extends Fragment implements TransferMvpView { @Override public void showViewDisconnected() { - vConnectionStatusText1.setText("Disconnected!"); - vConnectionStatusText2.setText("Disconnected!"); + vConnectionStatusText1.setText(R.string.transfer_status_disconnected); + vConnectionStatusText2.setText(R.string.transfer_status_disconnected); } @Override @@ -221,17 +222,17 @@ public class TransferFragment extends Fragment implements TransferMvpView { @Override public void showErrorBadKey() { - Notify.create(getActivity(), "Failed reading incoming key!", Style.ERROR).show(); + Notify.create(getActivity(), R.string.transfer_error_read_incoming, Style.ERROR).show(); } @Override public void showErrorConnectionFailed() { - Notify.create(getActivity(), "Connection failed!", Style.ERROR).show(); + Notify.create(getActivity(), R.string.transfer_error_connect, Style.ERROR).show(); } @Override public void showErrorListenFailed() { - Notify.create(getActivity(), "Error setting up server!", Style.ERROR).show(); + Notify.create(getActivity(), R.string.transfer_error_listen, Style.ERROR).show(); } @Override diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferSecretKeyList.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferSecretKeyList.java index affe566a1..1f8407309 100644 --- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferSecretKeyList.java +++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/transfer/view/TransferSecretKeyList.java @@ -1,3 +1,20 @@ +/* + * Copyright (C) 2017 Vincent Breitmoser + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + package org.sufficientlysecure.keychain.ui.transfer.view; @@ -28,7 +45,7 @@ public class TransferSecretKeyList extends RecyclerView { private static final int STATE_BUTTON = 1; private static final int STATE_PROGRESS = 2; private static final int STATE_TRANSFERRED = 3; - private static final int STATE_IMPORT_BUTTON = 4; + // private static final int STATE_IMPORT_BUTTON = 4; // used in ReceivedSecretKeyList public TransferSecretKeyList(Context context) { diff --git a/OpenKeychain/src/main/res/drawable-hdpi/ic_send_24dp.png b/OpenKeychain/src/main/res/drawable-hdpi/ic_send_24dp.png new file mode 100644 index 000000000..efb0c3432 Binary files /dev/null and b/OpenKeychain/src/main/res/drawable-hdpi/ic_send_24dp.png differ diff --git a/OpenKeychain/src/main/res/drawable-mdpi/ic_send_24dp.png b/OpenKeychain/src/main/res/drawable-mdpi/ic_send_24dp.png new file mode 100644 index 000000000..e352a5495 Binary files /dev/null and b/OpenKeychain/src/main/res/drawable-mdpi/ic_send_24dp.png differ diff --git a/OpenKeychain/src/main/res/drawable-xhdpi/ic_send_24dp.png b/OpenKeychain/src/main/res/drawable-xhdpi/ic_send_24dp.png new file mode 100644 index 000000000..eb7220029 Binary files /dev/null and b/OpenKeychain/src/main/res/drawable-xhdpi/ic_send_24dp.png differ diff --git a/OpenKeychain/src/main/res/drawable-xxhdpi/ic_send_24dp.png b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_send_24dp.png new file mode 100644 index 000000000..65fdc289d Binary files /dev/null and b/OpenKeychain/src/main/res/drawable-xxhdpi/ic_send_24dp.png differ diff --git a/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_send_24dp.png b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_send_24dp.png new file mode 100644 index 000000000..43a1b4899 Binary files /dev/null and b/OpenKeychain/src/main/res/drawable-xxxhdpi/ic_send_24dp.png differ diff --git a/OpenKeychain/src/main/res/layout/key_transfer_item.xml b/OpenKeychain/src/main/res/layout/key_transfer_item.xml index d008a8ed5..dfe8a63c0 100644 --- a/OpenKeychain/src/main/res/layout/key_transfer_item.xml +++ b/OpenKeychain/src/main/res/layout/key_transfer_item.xml @@ -56,7 +56,7 @@ android:outAnimation="@anim/fade_out" android:inAnimation="@anim/fade_in" android:id="@+id/transfer_state" - custom:initialView="04"> + custom:initialView="01"> @@ -94,7 +94,7 @@ android:layout_height="wrap_content" android:padding="8dp" android:id="@+id/button_import" - android:text="Import" + android:text="@string/button_import" /> diff --git a/OpenKeychain/src/main/res/layout/transfer_fragment.xml b/OpenKeychain/src/main/res/layout/transfer_fragment.xml index 45d826c13..364451c5c 100644 --- a/OpenKeychain/src/main/res/layout/transfer_fragment.xml +++ b/OpenKeychain/src/main/res/layout/transfer_fragment.xml @@ -33,8 +33,9 @@ android:layout_gravity="center_horizontal" android:layout_margin="8dp" android:id="@+id/button_scan" - android:text="Scan" + android:text="@string/button_scan" android:drawableLeft="@drawable/ic_qrcode_white_24dp" + android:drawableTint="@color/md_black_1000" android:drawablePadding="8dp" /> @@ -43,7 +44,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margin="8dp" - android:text="Scan with either device to establish a secure connection for device setup." + android:text="@string/transfer_scan_explanation" android:textAppearance="?android:attr/textAppearanceMedium" /> @@ -58,7 +59,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="16dp" - android:text="Connection status:" + android:text="@string/connection_status" android:textAppearance="?android:attr/textAppearanceMedium" /> @@ -104,7 +105,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginTop="16dp" - android:text="Connection status:" + android:text="@string/connection_status" android:textAppearance="?android:attr/textAppearanceMedium" /> @@ -161,7 +162,7 @@ android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_margin="8dp" - android:text="This feature can only be used on Wifi." + android:text="@string/transfer_scan_only_wifi" android:textAppearance="?android:attr/textAppearanceMedium" /> diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml index 3cbb268de..7c34fcb88 100644 --- a/OpenKeychain/src/main/res/values/strings.xml +++ b/OpenKeychain/src/main/res/values/strings.xml @@ -1889,4 +1889,17 @@ Forget + "Scan" + "Scan with either device to establish a secure connection for device setup." + "Connection status:" + "Available keys for fransfer" + "Received keys" + "This feature can only be used on Wifi." + "Import" + "Connected to %s" + "Disconnected!" + "Failed reading incoming key!" + "Connection failed!" + "Error waiting for connection!" + diff --git a/graphics/drawables/ic_send.svg b/graphics/drawables/ic_send.svg new file mode 100644 index 000000000..c43d9b45e --- /dev/null +++ b/graphics/drawables/ic_send.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/graphics/update-drawables.sh b/graphics/update-drawables.sh index ec4f972ed..f377a00b0 100755 --- a/graphics/update-drawables.sh +++ b/graphics/update-drawables.sh @@ -22,7 +22,7 @@ SRC_DIR=./drawables/ #inkscape -w 512 -h 512 -e "$PLAY_DIR/$NAME.png" $NAME.svg -for NAME in "ic_cloud_unknown" "ic_cloud_off" "ic_wifi_lock" "broken_heart" "ic_cloud_search" "ic_action_encrypt_file" "ic_action_encrypt_text" "ic_action_verified_cutout" "ic_action_encrypt_copy" "ic_action_encrypt_paste" "ic_action_encrypt_save" "ic_action_encrypt_share" "status_lock_closed" "status_lock_error" "status_lock_open" "status_signature_expired_cutout" "status_signature_invalid_cutout" "status_signature_revoked_cutout" "status_signature_unknown_cutout" "status_signature_unverified_cutout" "status_signature_verified_cutout" "key_flag_authenticate" "key_flag_certify" "key_flag_encrypt" "key_flag_sign" "yubi_icon" "ic_stat_notify" "status_signature_verified_inner" "link" "octo_link" +for NAME in "ic_send" "ic_cloud_unknown" "ic_cloud_off" "ic_wifi_lock" "broken_heart" "ic_cloud_search" "ic_action_encrypt_file" "ic_action_encrypt_text" "ic_action_verified_cutout" "ic_action_encrypt_copy" "ic_action_encrypt_paste" "ic_action_encrypt_save" "ic_action_encrypt_share" "status_lock_closed" "status_lock_error" "status_lock_open" "status_signature_expired_cutout" "status_signature_invalid_cutout" "status_signature_revoked_cutout" "status_signature_unknown_cutout" "status_signature_unverified_cutout" "status_signature_verified_cutout" "key_flag_authenticate" "key_flag_certify" "key_flag_encrypt" "key_flag_sign" "yubi_icon" "ic_stat_notify" "status_signature_verified_inner" "link" "octo_link" do echo $NAME inkscape -w 24 -h 24 -e "$MDPI_DIR/${NAME}_24dp.png" "$SRC_DIR/$NAME.svg"