Support contextual suggestion

- add a suggestion layout
- add an interface to get fragment in suggestion feature provider
- remove the first preference category of homepage IA to align its top
  with the bottom of the search box

Bug: 173768418
Test: robotest
Change-Id: I784e3eef29ca474c4c89f07b916c6500fabbf7d4
This commit is contained in:
Jason Chiu
2020-11-20 17:16:41 +08:00
parent 3932b07365
commit bd854ccd10
8 changed files with 148 additions and 40 deletions

View File

@@ -57,6 +57,41 @@
android:layout_height="wrap_content"
android:touchscreenBlocksFocus="false"
android:keyboardNavigationCluster="false">
<include layout="@layout/search_bar"/>
<LinearLayout
android:id="@+id/app_bar_container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
app:layout_scrollFlags="scroll|enterAlways|enterAlwaysCollapsed">
<LinearLayout
android:id="@+id/contextual_suggestion_content"
android:layout_width="match_parent"
android:layout_height="@dimen/suggestion_height"
android:paddingHorizontal="@dimen/suggestion_padding_horizontal"
android:paddingBottom="@dimen/suggestion_padding_bottom"
android:orientation="vertical"
android:gravity="bottom"
android:visibility="gone">
<TextView
android:id="@+id/suggestion_title"
android:text="@string/settings_label"
style="@style/ContextualSuggestionText"/>
<Button
android:id="@+id/suggestion_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/suggestion_button_margin_top"
android:paddingHorizontal="@dimen/suggestion_button_padding_horizontal"
android:visibility="gone"
style="@style/ActionPrimaryButton"/>
</LinearLayout>
<include layout="@layout/search_bar"/>
</LinearLayout>
</com.google.android.material.appbar.AppBarLayout>
</androidx.coordinatorlayout.widget.CoordinatorLayout>