add button to hide autofill info text in Group activity, closes #311

This commit is contained in:
Philipp Crocoll
2018-03-26 20:27:30 +02:00
parent b0aa706c07
commit 61ef383c38
3 changed files with 25 additions and 3 deletions

2
.gitignore vendored
View File

@@ -158,3 +158,5 @@ src/java/KP2ASoftkeyboard_AS/build/generated/mockable-android-23.jar
*.rawproto
src/java/Keepass2AndroidPluginSDK2/build/generated/mockable-Google-Inc.-Google-APIs-23.jar
/src/.vs
/src/JavaFileStorageBindings/Jars/JavaFileStorage-release.aar
/src/PluginSdkBinding/Jars/app-debug.aar

View File

@@ -339,6 +339,17 @@ namespace keepass2android
};
}
_prefs.Edit().PutBoolean(autofillservicewasenabled_prefskey, false).Commit();
if (FindViewById(Resource.Id.info_dont_show_autofill_again) != null)
{
FindViewById(Resource.Id.info_dont_show_autofill_again).Click += (sender, args) =>
{
_prefs.Edit().PutBoolean(autofillservicewasenabled_prefskey, true).Commit();
UpdateAutofillInfo();
};
}
if (FindViewById(Resource.Id.fabCancelAddNew) != null)
{
FindViewById(Resource.Id.fabAddNew).Click += (sender, args) =>
@@ -545,6 +556,8 @@ namespace keepass2android
return _prefs.GetBoolean("InfoTextDisabled_" + infoTextKey, false);
}
const string autofillservicewasenabled_prefskey = "AutofillServiceWasEnabled";
private void UpdateAutofillInfo()
{
bool canShowAutofillInfo = false;
@@ -553,16 +566,15 @@ namespace keepass2android
!((AutofillManager)GetSystemService(Java.Lang.Class.FromType(typeof(AutofillManager))))
.IsAutofillSupported))
{
const string autofillservicewasenabled = "AutofillServiceWasEnabled";
if (!((AutofillManager)GetSystemService(Java.Lang.Class.FromType(typeof(AutofillManager))))
.HasEnabledAutofillServices)
{
if (!_prefs.GetBoolean(autofillservicewasenabled, false))
if (!_prefs.GetBoolean(autofillservicewasenabled_prefskey, false))
canShowAutofillInfo = true;
}
else
{
_prefs.Edit().PutBoolean(autofillservicewasenabled, true).Commit();
_prefs.Edit().PutBoolean(autofillservicewasenabled_prefskey, true).Commit();
}
}

View File

@@ -76,6 +76,14 @@
android:text="@string/show_autofill_help"
style="@style/BottomBarButton" />
</RelativeLayout>
<Button
android:id="@+id/info_dont_show_autofill_again"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingTop="4dp"
android:text="@string/dont_show_again"
style="@style/BottomBarButton" />
</LinearLayout>
<LinearLayout
android:id="@+id/notification_info_android8_infotext"