Add toast to inform the user of inline suggestions in the keyboard

This commit is contained in:
J-Jamet
2021-01-09 15:02:29 +01:00
parent b62996a57c
commit f3b814388d
2 changed files with 5 additions and 0 deletions

View File

@@ -36,6 +36,7 @@ import android.view.autofill.AutofillManager
import android.view.autofill.AutofillValue import android.view.autofill.AutofillValue
import android.view.inputmethod.InlineSuggestionsRequest import android.view.inputmethod.InlineSuggestionsRequest
import android.widget.RemoteViews import android.widget.RemoteViews
import android.widget.Toast
import androidx.annotation.RequiresApi import androidx.annotation.RequiresApi
import androidx.autofill.inline.UiVersions import androidx.autofill.inline.UiVersions
import androidx.autofill.inline.v1.InlineSuggestionUi import androidx.autofill.inline.v1.InlineSuggestionUi
@@ -204,6 +205,9 @@ object AutofillHelper {
// New Response // New Response
val inlineSuggestionsRequest = activity.intent?.getParcelableExtra<InlineSuggestionsRequest?>(EXTRA_INLINE_SUGGESTIONS_REQUEST) val inlineSuggestionsRequest = activity.intent?.getParcelableExtra<InlineSuggestionsRequest?>(EXTRA_INLINE_SUGGESTIONS_REQUEST)
val response = buildResponse(activity, entriesInfo, result, inlineSuggestionsRequest) val response = buildResponse(activity, entriesInfo, result, inlineSuggestionsRequest)
if (inlineSuggestionsRequest != null) {
Toast.makeText(activity.applicationContext, R.string.autofill_inline_suggestions_keyboard, Toast.LENGTH_LONG).show()
}
val mReplyIntent = Intent() val mReplyIntent = Intent()
Log.d(activity.javaClass.name, "Successed Autofill auth.") Log.d(activity.javaClass.name, "Successed Autofill auth.")
mReplyIntent.putExtra( mReplyIntent.putExtra(

View File

@@ -445,6 +445,7 @@
<string name="autofill_block">Block autofill</string> <string name="autofill_block">Block autofill</string>
<string name="autofill_block_restart">Restart the app containing the form to activate the blocking.</string> <string name="autofill_block_restart">Restart the app containing the form to activate the blocking.</string>
<string name="autofill_read_only_save">Data save is not allowed for a database opened as read-only.</string> <string name="autofill_read_only_save">Data save is not allowed for a database opened as read-only.</string>
<string name="autofill_inline_suggestions_keyboard">Inline autofill suggestions has been added to your keyboard.</string>
<string name="allow_no_password_title">Allow no master key</string> <string name="allow_no_password_title">Allow no master key</string>
<string name="allow_no_password_summary">Allows tapping the \"Open\" button if no credentials are selected</string> <string name="allow_no_password_summary">Allows tapping the \"Open\" button if no credentials are selected</string>
<string name="delete_entered_password_title">Delete password</string> <string name="delete_entered_password_title">Delete password</string>