Using spring layout for widget sheet

Bug: 72811152
Change-Id: Ifd4ade7327589871532288eb2982cf5b4f084979
This commit is contained in:
Sunny Goyal 2018-03-09 11:09:20 -08:00
parent 5c143255a5
commit 016d7e93c1
3 changed files with 9 additions and 5 deletions

View File

@ -31,21 +31,22 @@
android:id="@+id/widgets_list_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="false"
/>
android:clipToPadding="false" />
<!-- Fast scroller popup -->
<TextView
android:id="@+id/fast_scroller_popup"
style="@style/FastScrollerPopup"
android:layout_gravity="top|end"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/fastscroll_popup_margin" />
<com.android.launcher3.views.RecyclerViewFastScroller
android:id="@+id/fast_scroller"
android:layout_width="@dimen/fastscroll_width"
android:layout_height="match_parent"
android:layout_gravity="end"
android:layout_alignParentEnd="true"
android:layout_alignParentTop="true"
android:layout_marginEnd="@dimen/fastscroll_end_margin" />
</com.android.launcher3.views.TopRoundedCornerView>
</com.android.launcher3.widget.WidgetsFullSheet>

View File

@ -29,7 +29,7 @@ import com.android.launcher3.util.Themes;
/**
* View with top rounded corners.
*/
public class TopRoundedCornerView extends FrameLayout {
public class TopRoundedCornerView extends SpringRelativeLayout {
private final RectF mRect = new RectF();
private final Path mClipPath = new Path();

View File

@ -70,6 +70,9 @@ public class WidgetsFullSheet extends BaseWidgetSheet
mRecyclerView.setAdapter(mAdapter);
mAdapter.setApplyBitmapDeferred(true, mRecyclerView);
TopRoundedCornerView springLayout = (TopRoundedCornerView) mContent;
springLayout.addSpringView(R.id.widgets_list_view);
mRecyclerView.setEdgeEffectFactory(springLayout.createEdgeEffectFactory());
onWidgetsBound();
}