Scrollable inline suggestions
Increase the number of suggestions for scrolling in the sample autofill service. Add scrollable container for the suggestions in the keyboard suggestion view. Test: manual Change-Id: I4f8a2fe191f4b7e5a70b5370a7bd55a2e9dddc9a
This commit is contained in:
@@ -22,10 +22,14 @@
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
style="@style/KeyboardArea">
|
||||
|
||||
<HorizontalScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
<LinearLayout
|
||||
android:id="@+id/suggestion_view"
|
||||
style="@style/KeyboardRow.Header">
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
<LinearLayout style="@style/KeyboardRow">
|
||||
<TextView
|
||||
|
||||
@@ -16,7 +16,6 @@
|
||||
|
||||
package com.example.android.autofillkeyboard;
|
||||
|
||||
import android.content.res.Resources;
|
||||
import android.inputmethodservice.InputMethodService;
|
||||
import android.os.AsyncTask;
|
||||
import android.os.Handler;
|
||||
@@ -101,7 +100,7 @@ public class AutofillImeService extends InputMethodService {
|
||||
getResources().getResourceName(R.style.GreenTheme)).build());
|
||||
|
||||
return new InlineSuggestionsRequest.Builder(presentationSpecs)
|
||||
.setMaxSuggestionCount(2)
|
||||
.setMaxSuggestionCount(6)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public class InlineFillService extends AutofillService {
|
||||
/**
|
||||
* Number of datasets sent on each request - we're simple, that value is hardcoded in our DNA!
|
||||
*/
|
||||
static final int NUMBER_DATASETS = 4;
|
||||
static final int NUMBER_DATASETS = 6;
|
||||
|
||||
@Override
|
||||
public void onFillRequest(FillRequest request, CancellationSignal cancellationSignal,
|
||||
|
||||
Reference in New Issue
Block a user