add button to hide autofill info text in Group activity, closes #311
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user