Only show collapse handle when the bottom widgets picker is scrollable

Test: Go to contact bottom widgets picker. No collapse handle is
      shown because the content isn't scrollable. Go to Google calendar
      bottom widget picker. Collapse handle is hown because the content
      is scrollable.
Bug: 185134663
Change-Id: Ic6109c055a072aa1cf3521f829833fd5f4cece0f
This commit is contained in:
Steven Ng 2021-05-06 17:39:49 +01:00
parent c9744631f4
commit 57347bd6b7
2 changed files with 3 additions and 0 deletions

View File

@ -15,10 +15,12 @@
-->
<merge xmlns:android="http://schemas.android.com/apk/res/android">
<View
android:id="@+id/collapse_handle"
android:layout_width="48dp"
android:layout_height="2dp"
android:layout_gravity="center_horizontal"
android:layout_marginBottom="16dp"
android:visibility="gone"
android:background="?android:attr/textColorSecondary"/>
<TextView
style="@style/TextHeadline"

View File

@ -118,6 +118,7 @@ public class WidgetsBottomSheet extends BaseWidgetSheet implements Insettable {
ViewGroup.LayoutParams layoutParams = widgetsTableScrollView.getLayoutParams();
layoutParams.height = mMaxTableHeight;
widgetsTableScrollView.setLayoutParams(layoutParams);
findViewById(R.id.collapse_handle).setVisibility(VISIBLE);
}
}