Rebrand experimental settings as hidden features

This commit is contained in:
Jakob Nixdorf 2017-10-18 07:20:34 +02:00
parent b702592157
commit 69e13bef79
No known key found for this signature in database
GPG key ID: BE99BF86574A7DBC
5 changed files with 23 additions and 24 deletions

View file

@ -111,14 +111,14 @@ public class AboutActivity extends BaseActivity {
if (currentToast != null && taps <= 7)
currentToast.cancel();
if (taps > 3 && taps < 7)
if (taps >= 3 && taps <= 7)
currentToast = Toast.makeText(getBaseContext(), String.valueOf(taps), Toast.LENGTH_SHORT);
if (taps == 7) {
if (settings.getExperimental())
currentToast = Toast.makeText(getBaseContext(), R.string.about_toast_experimental_enabled, Toast.LENGTH_LONG);
if (settings.getHiddenFeatures())
currentToast = Toast.makeText(getBaseContext(), R.string.about_toast_hidden_features_enabled, Toast.LENGTH_LONG);
else
enableExperimental();
enableHiddenFeatures();
}
if (currentToast != null)
@ -224,15 +224,15 @@ public class AboutActivity extends BaseActivity {
});
}
private void enableExperimental() {
private void enableHiddenFeatures() {
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle(R.string.about_title_experimental)
.setMessage(R.string.about_dialog_experimental)
builder.setTitle(R.string.about_title_hidden_features)
.setMessage(R.string.about_dialog_hidden_features)
.setPositiveButton(android.R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
settings.setExperimental(true);
Toast.makeText(getBaseContext(), R.string.about_toast_experimental, Toast.LENGTH_LONG).show();
settings.setHiddenFeatures(true);
Toast.makeText(getBaseContext(), R.string.about_toast_hidden_features, Toast.LENGTH_LONG).show();
}
})
.setNegativeButton(android.R.string.cancel, new DialogInterface.OnClickListener() {

View file

@ -107,7 +107,7 @@ public class MainActivity extends BaseActivity
final ArrayAdapter<Entry.OTPType> typeAdapter = new ArrayAdapter<>(this, android.R.layout.simple_expandable_list_item_1, Entry.PublicTypes.toArray(new Entry.OTPType[Entry.PublicTypes.size()]));
final ArrayAdapter<Entry.OTPType> fullTypeAdapter = new ArrayAdapter<>(this, android.R.layout.simple_expandable_list_item_1, Entry.OTPType.values());
if (settings.getExperimental())
if (settings.getHiddenFeatures())
typeInput.setAdapter(fullTypeAdapter);
else
typeInput.setAdapter(typeAdapter);

View file

@ -214,12 +214,12 @@ public class Settings {
setBoolean(R.string.settings_key_security_backup_warning, value);
}
public boolean getExperimental() {
return getBoolean(R.string.settings_key_experimental, false);
public boolean getHiddenFeatures() {
return getBoolean(R.string.settings_key_hidden_features, false);
}
public void setExperimental(boolean value) {
setBoolean(R.string.settings_key_experimental, value);
public void setHiddenFeatures(boolean value) {
setBoolean(R.string.settings_key_hidden_features, value);
}
public SortMode getSortMode() {

View file

@ -25,7 +25,7 @@
<string name="settings_key_security_backup_warning" translatable="false">pref_security_backup_warning_shown</string>
<string name="settings_key_sort_mode" translatable="false">pref_sort_mode</string>
<string name="settings_key_experimental" translatable="false">pref_experimental</string>
<string name="settings_key_hidden_features" translatable="false">pref_hidden_features</string>
<!-- Default values -->
<string name="settings_default_auth" translatable="false">none</string>

View file

@ -38,13 +38,12 @@
<string name="about_desc_report_bugs">Report bugs or request new features</string>
<string name="about_desc_translate">Help to translate andOTP to your language</string>
<string name="about_title_experimental">Enable experimental settings</string>
<string name="about_dialog_experimental">Are you sure you want to enable the experimental
settings? Those settings are mostly non-standard OTP algorithms which were implemented on
special request. There is no official support for those algorithms and there are certain
limitations to them, please read the approriate GitHub issue to learn about them. You are on
your own on figuring out how to get the shared secrets for those accounts, please do not ask
about this!</string>
<string name="about_toast_experimental">Experimental settings enabled</string>
<string name="about_toast_experimental_enabled">Experimental settings already enabled</string>
<string name="about_title_hidden_features">Hidden features</string>
<string name="about_dialog_hidden_features">Are you sure you want to enable the hidden features?
Most of them are non-standard OTP algorithms which were implemented on special request.
They are <b>not officially supported</b> and can come with <b>certain limitations</b>,
please read (and understand) the page about "Hidden features" in the Github wiki to learn
more before using them.</string>
<string name="about_toast_hidden_features">Hidden features enabled</string>
<string name="about_toast_hidden_features_enabled">Hidden features already enabled</string>
</resources>