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"
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
style="@style/KeyboardArea">
|
style="@style/KeyboardArea">
|
||||||
|
|
||||||
|
<HorizontalScrollView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/suggestion_view"
|
android:id="@+id/suggestion_view"
|
||||||
style="@style/KeyboardRow.Header">
|
style="@style/KeyboardRow.Header">
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
</HorizontalScrollView>
|
||||||
|
|
||||||
<LinearLayout style="@style/KeyboardRow">
|
<LinearLayout style="@style/KeyboardRow">
|
||||||
<TextView
|
<TextView
|
||||||
|
|||||||
@@ -16,7 +16,6 @@
|
|||||||
|
|
||||||
package com.example.android.autofillkeyboard;
|
package com.example.android.autofillkeyboard;
|
||||||
|
|
||||||
import android.content.res.Resources;
|
|
||||||
import android.inputmethodservice.InputMethodService;
|
import android.inputmethodservice.InputMethodService;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@@ -101,7 +100,7 @@ public class AutofillImeService extends InputMethodService {
|
|||||||
getResources().getResourceName(R.style.GreenTheme)).build());
|
getResources().getResourceName(R.style.GreenTheme)).build());
|
||||||
|
|
||||||
return new InlineSuggestionsRequest.Builder(presentationSpecs)
|
return new InlineSuggestionsRequest.Builder(presentationSpecs)
|
||||||
.setMaxSuggestionCount(2)
|
.setMaxSuggestionCount(6)
|
||||||
.build();
|
.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!
|
* 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
|
@Override
|
||||||
public void onFillRequest(FillRequest request, CancellationSignal cancellationSignal,
|
public void onFillRequest(FillRequest request, CancellationSignal cancellationSignal,
|
||||||
|
|||||||
Reference in New Issue
Block a user