aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitmodules4
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java58
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java12
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java17
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java78
-rw-r--r--OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java1
-rw-r--r--OpenKeychain/src/main/res/layout/add_subkey_dialog.xml83
-rw-r--r--OpenKeychain/src/main/res/layout/create_key_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/decrypt_files_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/decrypt_text_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml53
-rw-r--r--OpenKeychain/src/main/res/layout/encrypt_files_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/encrypt_text_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/import_keys_activity.xml2
-rw-r--r--OpenKeychain/src/main/res/layout/passphrase_dialog.xml27
-rw-r--r--OpenKeychain/src/main/res/values-large/dimens.xml3
-rw-r--r--OpenKeychain/src/main/res/values-v21/dimens.xml1
-rw-r--r--OpenKeychain/src/main/res/values/dimens.xml1
-rw-r--r--OpenKeychain/src/main/res/values/strings.xml5
19 files changed, 221 insertions, 134 deletions
diff --git a/.gitmodules b/.gitmodules
index 8238c3f80..1577e4f83 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -19,9 +19,11 @@
[submodule "extern/minidns"]
path = extern/minidns
url = https://github.com/open-keychain/minidns.git
+ ignore = dirty
[submodule "extern/TokenAutoComplete"]
path = extern/TokenAutoComplete
url = https://github.com/open-keychain/TokenAutoComplete
[submodule "extern/safeslinger-exchange"]
path = extern/safeslinger-exchange
- url = https://github.com/open-keychain/exchange-android
+ url = https://github.com/open-keychain/exchange-android
+ ignore = dirty
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java
index d5ca08936..bb669f6b8 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/PassphraseDialogActivity.java
@@ -46,6 +46,7 @@ import org.sufficientlysecure.keychain.R;
import org.sufficientlysecure.keychain.compatibility.DialogFragmentWorkaround;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKey;
import org.sufficientlysecure.keychain.pgp.CanonicalizedSecretKeyRing;
+import org.sufficientlysecure.keychain.pgp.KeyRing;
import org.sufficientlysecure.keychain.pgp.exception.PgpGeneralException;
import org.sufficientlysecure.keychain.pgp.exception.PgpKeyNotFoundException;
import org.sufficientlysecure.keychain.provider.CachedPublicKeyRing;
@@ -149,6 +150,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
public static class PassphraseDialogFragment extends DialogFragment implements TextView.OnEditorActionListener {
private EditText mPassphraseEditText;
+ private TextView mPassphraseText;
private View mInput, mProgress;
private CanonicalizedSecretKeyRing mSecretRing = null;
@@ -167,7 +169,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
// if the dialog is displayed from the application class, design is missing
// hack to get holo design (which is not automatically applied due to activity's Theme.NoDisplay
ContextThemeWrapper theme = new ContextThemeWrapper(activity,
- R.style.Theme_AppCompat_Light);
+ R.style.Theme_AppCompat_Light_Dialog);
mSubKeyId = getArguments().getLong(EXTRA_SUBKEY_ID);
mServiceIntent = getArguments().getParcelable(EXTRA_DATA);
@@ -176,13 +178,30 @@ public class PassphraseDialogActivity extends FragmentActivity {
alert.setTitle(R.string.title_unlock);
+ LayoutInflater inflater = LayoutInflater.from(theme);
+ View view = inflater.inflate(R.layout.passphrase_dialog, null);
+ alert.setView(view);
+
+ mPassphraseText = (TextView) view.findViewById(R.id.passphrase_text);
+ mPassphraseEditText = (EditText) view.findViewById(R.id.passphrase_passphrase);
+ mInput = view.findViewById(R.id.input);
+ mProgress = view.findViewById(R.id.progress);
+
+ alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
+
+ @Override
+ public void onClick(DialogInterface dialog, int id) {
+ dialog.cancel();
+ }
+ });
+
String userId;
CanonicalizedSecretKey.SecretKeyType keyType = CanonicalizedSecretKey.SecretKeyType.PASSPHRASE;
+ String message;
if (mSubKeyId == Constants.key.symmetric || mSubKeyId == Constants.key.none) {
- alert.setMessage(R.string.passphrase_for_symmetric_encryption);
+ message = getString(R.string.passphrase_for_symmetric_encryption);
} else {
- String message;
try {
ProviderHelper helper = new ProviderHelper(activity);
mSecretRing = helper.getCanonicalizedSecretKeyRing(
@@ -191,7 +210,13 @@ public class PassphraseDialogActivity extends FragmentActivity {
// above can't be statically verified to have been set in all cases because
// the catch clause doesn't return.
try {
- userId = mSecretRing.getPrimaryUserIdWithFallback();
+ String mainUserId = mSecretRing.getPrimaryUserIdWithFallback();
+ String[] mainUserIdSplit = KeyRing.splitUserId(mainUserId);
+ if (mainUserIdSplit[0] != null) {
+ userId = mainUserIdSplit[0];
+ } else {
+ userId = getString(R.string.user_id_no_name);
+ }
} catch (PgpKeyNotFoundException e) {
userId = null;
}
@@ -228,33 +253,16 @@ public class PassphraseDialogActivity extends FragmentActivity {
alert.setCancelable(false);
return alert.create();
}
-
- alert.setMessage(message);
}
- LayoutInflater inflater = LayoutInflater.from(theme);
- View view = inflater.inflate(R.layout.passphrase_dialog, null);
- alert.setView(view);
-
- mPassphraseEditText = (EditText) view.findViewById(R.id.passphrase_passphrase);
- mInput = view.findViewById(R.id.input);
- mProgress = view.findViewById(R.id.progress);
-
- alert.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {
-
- @Override
- public void onClick(DialogInterface dialog, int id) {
- dialog.cancel();
- }
- });
-
+ mPassphraseText.setText(message);
if (keyType == CanonicalizedSecretKey.SecretKeyType.PATTERN) {
// start pattern dialog and show progress circle here...
// Intent patternActivity = new Intent(getActivity(), LockPatternActivity.class);
// patternActivity.putExtra(LockPatternActivity.EXTRA_PATTERN, "123");
// startActivityForResult(patternActivity, REQUEST_CODE_ENTER_PATTERN);
- mInput.setVisibility(View.GONE);
+ mInput.setVisibility(View.INVISIBLE);
mProgress.setVisibility(View.VISIBLE);
} else {
// Hack to open keyboard.
@@ -322,7 +330,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
return;
}
- mInput.setVisibility(View.GONE);
+ mInput.setVisibility(View.INVISIBLE);
mProgress.setVisibility(View.VISIBLE);
positive.setEnabled(false);
@@ -364,7 +372,7 @@ public class PassphraseDialogActivity extends FragmentActivity {
mPassphraseEditText.setText("");
mPassphraseEditText.setError(getString(R.string.wrong_passphrase));
mInput.setVisibility(View.VISIBLE);
- mProgress.setVisibility(View.GONE);
+ mProgress.setVisibility(View.INVISIBLE);
positive.setEnabled(true);
return;
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
index d5376cbdc..0b1d39fc1 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/AddSubkeyDialogFragment.java
@@ -137,12 +137,10 @@ public class AddSubkeyDialogFragment extends DialogFragment {
}
});
- if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.HONEYCOMB) {
- // date picker works based on default time zone
- Calendar minDateCal = Calendar.getInstance(TimeZone.getDefault());
- minDateCal.add(Calendar.DAY_OF_YEAR, 1); // at least one day after creation (today)
- mExpiryDatePicker.setMinDate(minDateCal.getTime().getTime());
- }
+ // date picker works based on default time zone
+ Calendar minDateCal = Calendar.getInstance(TimeZone.getDefault());
+ minDateCal.add(Calendar.DAY_OF_YEAR, 1); // at least one day after creation (today)
+ mExpiryDatePicker.setMinDate(minDateCal.getTime().getTime());
{
ArrayList<Choice<Algorithm>> choices = new ArrayList<>();
@@ -283,7 +281,7 @@ public class AddSubkeyDialogFragment extends DialogFragment {
// For EC keys, add a curve
if (algorithm == Algorithm.ECDH || algorithm == Algorithm.ECDSA) {
curve = ((Choice<Curve>) mCurveSpinner.getSelectedItem()).getId();
- // Otherwise, get a keysize
+ // Otherwise, get a keysize
} else {
keySize = getProperKeyLength(algorithm, getSelectedKeyLength());
}
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java
index d405b1dda..794af5b15 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/CustomAlertDialogBuilder.java
@@ -1,3 +1,20 @@
+/*
+ * Copyright (C) 2014 Dominik Schürmann <dominik@dominikschuermann.de>
+ *
+ * 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 <http://www.gnu.org/licenses/>.
+ */
+
package org.sufficientlysecure.keychain.ui.dialog;
import android.app.AlertDialog;
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
index fc618c9eb..37e05a61d 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/EditSubkeyExpiryDialogFragment.java
@@ -25,11 +25,14 @@ import android.os.Message;
import android.os.Messenger;
import android.os.RemoteException;
import android.support.v4.app.DialogFragment;
+import android.text.format.DateFormat;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.DatePicker;
+import android.widget.LinearLayout;
+import android.widget.TextView;
import org.sufficientlysecure.keychain.Constants;
import org.sufficientlysecure.keychain.R;
@@ -97,61 +100,64 @@ public class EditSubkeyExpiryDialogFragment extends DialogFragment {
final CheckBox noExpiry = (CheckBox) view.findViewById(R.id.edit_subkey_expiry_no_expiry);
final DatePicker datePicker = (DatePicker) view.findViewById(R.id.edit_subkey_expiry_date_picker);
+ final TextView currentExpiry = (TextView) view.findViewById(R.id.edit_subkey_expiry_current_expiry);
+ final LinearLayout expiryLayout = (LinearLayout) view.findViewById(R.id.edit_subkey_expiry_layout);
noExpiry.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
@Override
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
if (isChecked) {
- datePicker.setVisibility(View.GONE);
+ expiryLayout.setVisibility(View.GONE);
} else {
- datePicker.setVisibility(View.VISIBLE);
+ expiryLayout.setVisibility(View.VISIBLE);
}
}
});
- // init date picker with default selected date
if (expiry == 0L) {
noExpiry.setChecked(true);
- datePicker.setVisibility(View.GONE);
-
- Calendar todayCal = Calendar.getInstance(TimeZone.getDefault());
- if (creationCal.after(todayCal)) {
- // Note: This is just for the rare cases where creation is _after_ today
-
- // set it to creation date +1 day (don't set it to creationCal, it would break crash
- // datePicker.setMinDate() execution with IllegalArgumentException
- Calendar creationCalPlusOne = (Calendar) creationCal.clone();
- creationCalPlusOne.add(Calendar.DAY_OF_YEAR, 1);
- datePicker.init(
- creationCalPlusOne.get(Calendar.YEAR),
- creationCalPlusOne.get(Calendar.MONTH),
- creationCalPlusOne.get(Calendar.DAY_OF_MONTH),
- null
- );
-
- } else {
- // normally, just init with today
- datePicker.init(
- todayCal.get(Calendar.YEAR),
- todayCal.get(Calendar.MONTH),
- todayCal.get(Calendar.DAY_OF_MONTH),
- null
- );
- }
+ expiryLayout.setVisibility(View.GONE);
+
+ currentExpiry.setText(R.string.btn_no_date);
} else {
noExpiry.setChecked(false);
- datePicker.setVisibility(View.VISIBLE);
+ expiryLayout.setVisibility(View.VISIBLE);
+
+ // convert from UTC to time zone of device
+ Calendar expiryCalTimeZone = (Calendar) expiryCal.clone();
+ expiryCalTimeZone.setTimeZone(TimeZone.getDefault());
+ currentExpiry.setText(DateFormat.getDateFormat(
+ getActivity()).format(expiryCalTimeZone.getTime()));
+ }
+
+ // date picker works based on default time zone
+ Calendar todayCal = Calendar.getInstance(TimeZone.getDefault());
+ if (creationCal.after(todayCal)) {
+ // NOTE: This is just for the rare cases where creation is _after_ today
+ // Min Date: Creation date + 1 day
- // set date picker to current expiry
+ Calendar creationCalPlusOne = (Calendar) creationCal.clone();
+ creationCalPlusOne.add(Calendar.DAY_OF_YEAR, 1);
+ datePicker.setMinDate(creationCalPlusOne.getTime().getTime());
datePicker.init(
- expiryCal.get(Calendar.YEAR),
- expiryCal.get(Calendar.MONTH),
- expiryCal.get(Calendar.DAY_OF_MONTH),
+ creationCalPlusOne.get(Calendar.YEAR),
+ creationCalPlusOne.get(Calendar.MONTH),
+ creationCalPlusOne.get(Calendar.DAY_OF_MONTH),
null
);
- }
+ } else {
+ // Min Date: today + 1 day
- datePicker.setMinDate(creationCal.getTime().getTime());
+ // at least one day after creation (today)
+ todayCal.add(Calendar.DAY_OF_YEAR, 1);
+ datePicker.setMinDate(todayCal.getTime().getTime());
+ datePicker.init(
+ todayCal.get(Calendar.YEAR),
+ todayCal.get(Calendar.MONTH),
+ todayCal.get(Calendar.DAY_OF_MONTH),
+ null
+ );
+ }
alert.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
diff --git a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
index a05719072..a3ffe250b 100644
--- a/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
+++ b/OpenKeychain/src/main/java/org/sufficientlysecure/keychain/ui/dialog/SetPassphraseDialogFragment.java
@@ -92,7 +92,6 @@ public class SetPassphraseDialogFragment extends DialogFragment implements OnEdi
CustomAlertDialogBuilder alert = new CustomAlertDialogBuilder(activity);
alert.setTitle(title);
- alert.setMessage(R.string.enter_passphrase_twice);
LayoutInflater inflater = activity.getLayoutInflater();
View view = inflater.inflate(R.layout.passphrase_repeat_dialog, null);
diff --git a/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
index d32b1496f..4b5058a81 100644
--- a/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
+++ b/OpenKeychain/src/main/res/layout/add_subkey_dialog.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
@@ -90,42 +91,6 @@
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
- <TableRow
- android:layout_marginTop="8dp"
- android:layout_marginBottom="8dp">
-
- <TextView
- android:id="@+id/label_expiry"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:layout_gravity="center_vertical"
- android:paddingRight="10dip"
- android:text="@string/label_expiry" />
-
- <CheckBox
- android:id="@+id/add_subkey_no_expiry"
- android:checked="true"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/btn_no_date" />
-
- </TableRow>
-
- <TableRow
- android:id="@+id/add_subkey_expiry_row"
- android:visibility="gone">
-
- <DatePicker
- android:id="@+id/add_subkey_expiry_date_picker"
- android:layout_span="2"
- android:layout_gravity="center_horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:spinnersShown="true"
- android:calendarViewShown="false" />
-
- </TableRow>
-
<TableRow>
<TextView
@@ -190,6 +155,52 @@
android:text="@string/flag_authenticate" />
</TableRow>
+ <TableRow
+ android:layout_marginTop="8dp"
+ android:layout_marginBottom="8dp">
+
+ <TextView
+ android:id="@+id/label_expiry"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_gravity="center_vertical"
+ android:paddingRight="10dip"
+ android:text="@string/label_expiry" />
+
+ <CheckBox
+ android:id="@+id/add_subkey_no_expiry"
+ android:checked="true"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:text="@string/btn_no_date" />
+
+ </TableRow>
+
+ <TableRow
+ android:id="@+id/add_subkey_expiry_row"
+ android:visibility="gone">
+
+ <!--
+ Use Spinner style DatePicker, not the full calendar view
+ Android < 5:
+ android:spinnersShown="true"
+ android:calendarViewShown="false"
+ Android >= 5:
+ android:datePickerMode="spinner"
+ -->
+ <DatePicker
+ android:id="@+id/add_subkey_expiry_date_picker"
+ android:layout_span="2"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ tools:ignore="UnusedAttribute"
+ android:datePickerMode="spinner"
+ android:spinnersShown="true"
+ android:calendarViewShown="false" />
+
+ </TableRow>
+
</TableLayout>
</ScrollView> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/create_key_activity.xml b/OpenKeychain/src/main/res/layout/create_key_activity.xml
index b9d5206a1..ecf69e640 100644
--- a/OpenKeychain/src/main/res/layout/create_key_activity.xml
+++ b/OpenKeychain/src/main/res/layout/create_key_activity.xml
@@ -14,7 +14,7 @@
<FrameLayout
android:layout_below="@id/toolbar_include"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent">
diff --git a/OpenKeychain/src/main/res/layout/decrypt_files_activity.xml b/OpenKeychain/src/main/res/layout/decrypt_files_activity.xml
index 06c1dda7b..3cf4a9e7b 100644
--- a/OpenKeychain/src/main/res/layout/decrypt_files_activity.xml
+++ b/OpenKeychain/src/main/res/layout/decrypt_files_activity.xml
@@ -14,7 +14,7 @@
<LinearLayout
android:layout_below="@id/toolbar_include"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/decrypt_text_activity.xml b/OpenKeychain/src/main/res/layout/decrypt_text_activity.xml
index a692b3681..da4aa7099 100644
--- a/OpenKeychain/src/main/res/layout/decrypt_text_activity.xml
+++ b/OpenKeychain/src/main/res/layout/decrypt_text_activity.xml
@@ -14,7 +14,7 @@
<LinearLayout
android:layout_below="@id/toolbar_include"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml b/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
index a692db574..38dc03627 100644
--- a/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
+++ b/OpenKeychain/src/main/res/layout/edit_subkey_expiry_dialog.xml
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
android:orientation="vertical"
android:paddingTop="16dp"
android:paddingBottom="16dp"
@@ -15,13 +16,49 @@
android:layout_height="wrap_content"
android:text="@string/btn_no_date" />
- <DatePicker
- android:id="@+id/edit_subkey_expiry_date_picker"
- android:layout_gravity="center_horizontal"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:spinnersShown="true"
- android:calendarViewShown="false" />
- <!-- Hide calendarView in tablets because of the unix warparound bug. -->
+ <LinearLayout
+ android:id="@+id/edit_subkey_expiry_layout"
+ android:orientation="vertical"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent">
+
+ <TextView
+ style="@style/SectionHeader"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/section_current_expiry" />
+
+ <TextView
+ android:id="@+id/edit_subkey_expiry_current_expiry"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ android:padding="8dp"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content" />
+
+ <TextView
+ style="@style/SectionHeader"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:text="@string/section_new_expiry" />
+
+ <!--
+ Use Spinner style DatePicker, not the full calendar view
+ Android < 5:
+ android:spinnersShown="true"
+ android:calendarViewShown="false"
+ Android >= 5:
+ android:datePickerMode="spinner"
+ -->
+ <!-- Hide calendarView in tablets because of the unix warparound bug. -->
+ <DatePicker
+ android:id="@+id/edit_subkey_expiry_date_picker"
+ android:layout_gravity="center_horizontal"
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ tools:ignore="UnusedAttribute"
+ android:datePickerMode="spinner"
+ android:spinnersShown="true"
+ android:calendarViewShown="false" />
+ </LinearLayout>
</LinearLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/layout/encrypt_files_activity.xml b/OpenKeychain/src/main/res/layout/encrypt_files_activity.xml
index 168e6d0be..f9efd81b4 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_files_activity.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_files_activity.xml
@@ -15,7 +15,7 @@
android:layout_below="@id/toolbar_include"
android:id="@+id/content_frame"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/encrypt_text_activity.xml b/OpenKeychain/src/main/res/layout/encrypt_text_activity.xml
index fd7fd6672..67f17fa81 100644
--- a/OpenKeychain/src/main/res/layout/encrypt_text_activity.xml
+++ b/OpenKeychain/src/main/res/layout/encrypt_text_activity.xml
@@ -15,7 +15,7 @@
android:layout_below="@id/toolbar_include"
android:id="@+id/content_frame"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/import_keys_activity.xml b/OpenKeychain/src/main/res/layout/import_keys_activity.xml
index 4af173409..6ac0b468c 100644
--- a/OpenKeychain/src/main/res/layout/import_keys_activity.xml
+++ b/OpenKeychain/src/main/res/layout/import_keys_activity.xml
@@ -14,7 +14,7 @@
<LinearLayout
android:layout_below="@id/toolbar_include"
android:fitsSystemWindows="true"
- android:layout_marginTop="-25dp"
+ android:layout_marginTop="@dimen/minus_statusbar_height"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
diff --git a/OpenKeychain/src/main/res/layout/passphrase_dialog.xml b/OpenKeychain/src/main/res/layout/passphrase_dialog.xml
index 2ca5199fd..d2e85633f 100644
--- a/OpenKeychain/src/main/res/layout/passphrase_dialog.xml
+++ b/OpenKeychain/src/main/res/layout/passphrase_dialog.xml
@@ -1,16 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:paddingLeft="16dp"
- android:paddingRight="16dp"
+ android:paddingTop="16dp"
+ android:paddingBottom="16dp"
+ android:paddingLeft="24dp"
+ android:paddingRight="24dp"
android:orientation="vertical">
<LinearLayout
+ android:id="@+id/input"
android:layout_width="match_parent"
android:layout_height="wrap_content"
- android:orientation="horizontal"
- android:id="@+id/input">
+ android:orientation="vertical">
+
+ <TextView
+ android:id="@+id/passphrase_text"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ android:textAppearance="@style/TextAppearance.AppCompat.Medium"
+ android:text="@string/enter_passphrase" />
<EditText
android:id="@+id/passphrase_passphrase"
@@ -26,11 +35,12 @@
</LinearLayout>
<LinearLayout
+ android:id="@+id/progress"
+ android:layout_centerInParent="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
- android:id="@+id/progress"
- android:visibility="gone">
+ android:visibility="invisible">
<ProgressBar
style="?android:attr/progressBarStyle"
@@ -42,11 +52,10 @@
style="?android:attr/textAppearanceMedium"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
- android:paddingLeft="8dp"
android:padding="4dp"
android:text="@string/label_unlock"
android:layout_gravity="center_vertical" />
</LinearLayout>
-</LinearLayout> \ No newline at end of file
+</RelativeLayout> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values-large/dimens.xml b/OpenKeychain/src/main/res/values-large/dimens.xml
deleted file mode 100644
index 045e125f3..000000000
--- a/OpenKeychain/src/main/res/values-large/dimens.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<resources>
-</resources>
diff --git a/OpenKeychain/src/main/res/values-v21/dimens.xml b/OpenKeychain/src/main/res/values-v21/dimens.xml
index 7e07ae0f9..f06cbbb80 100644
--- a/OpenKeychain/src/main/res/values-v21/dimens.xml
+++ b/OpenKeychain/src/main/res/values-v21/dimens.xml
@@ -8,4 +8,5 @@
<!-- 120dp + statusbar_height -->
<dimen name="big_toolbar">141dp</dimen>
<dimen name="huge_toolbar">243dp</dimen>
+ <dimen name="minus_statusbar_height">-25dp</dimen>
</resources> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/dimens.xml b/OpenKeychain/src/main/res/values/dimens.xml
index 434a0a171..2aae06e2e 100644
--- a/OpenKeychain/src/main/res/values/dimens.xml
+++ b/OpenKeychain/src/main/res/values/dimens.xml
@@ -4,4 +4,5 @@
<dimen name="statusbar_height">0dp</dimen>
<dimen name="big_toolbar">120dp</dimen>
<dimen name="huge_toolbar">222dp</dimen>
+ <dimen name="minus_statusbar_height">0dp</dimen>
</resources> \ No newline at end of file
diff --git a/OpenKeychain/src/main/res/values/strings.xml b/OpenKeychain/src/main/res/values/strings.xml
index ca6ce1f7d..29b955bb4 100644
--- a/OpenKeychain/src/main/res/values/strings.xml
+++ b/OpenKeychain/src/main/res/values/strings.xml
@@ -67,6 +67,8 @@
<string name="section_certs">"Certificates"</string>
<string name="section_encrypt">"Encrypt"</string>
<string name="section_decrypt">"Decrypt"</string>
+ <string name="section_current_expiry">"Current expiry"</string>
+ <string name="section_new_expiry">"New expiry"</string>
<!-- button -->
<string name="btn_decrypt_verify_file">"Decrypt, verify, and save file"</string>
@@ -226,7 +228,6 @@
<string name="no_file_selected">"Select a file first."</string>
<string name="encrypt_sign_successful">"Successfully signed and/or encrypted."</string>
<string name="encrypt_sign_clipboard_successful">"Successfully signed and/or encrypted to clipboard."</string>
- <string name="enter_passphrase_twice">"Enter the passphrase twice."</string>
<string name="select_encryption_key">"Select at least one encryption key."</string>
<string name="select_encryption_or_signature_key">"Select at least one encryption key or a signature key."</string>
<string name="specify_file_to_encrypt_to">"Please specify which file to encrypt to.\nWARNING: File will be overwritten if it exists."</string>
@@ -1027,7 +1028,7 @@
<string name="msg_vl_clear_meta_file">"Filename: %s"</string>
<string name="msg_vl_clear_meta_mime">"MIME type: %s"</string>
<string name="msg_vl_clear_meta_time">"Modification time: %s"</string>
- <string name="msg_vl_clear_meta_size">"Filesize: %s"</string>
+ <string name="msg_vl_clear_meta_size">"File size: %s"</string>
<string name="msg_vl_clear_signature_check">"Verifying signature data"</string>
<string name="msg_vl_error_integrity_check">"Integrity check error!"</string>
<string name="msg_vl_ok">"OK"</string>