Generalize AllAppsStretchLayout

This commit is contained in:
Suphon Thanakornpakapong committed 2021-10-12 22:59:49 +07:00
1 parent 66f4e7fee6
commit 10c20fe3e0
3 files changed
+6 -8

No files matched your search

@@ -9,14 +9,14 @@ import androidx.recyclerview.widget.RecyclerView
import com.android.launcher3.R
import com.android.launcher3.Utilities
open class AllAppsStretchLayout @JvmOverloads constructor(
open class StretchRecyclerViewContainer @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : StretchRelativeLayout(context, attrs, defStyleAttr) {
private val childEffect = StretchEdgeEffect(context, { invalidate() }, { postInvalidateOnAnimation() })
override fun drawChild(canvas: Canvas, child: View, drawingTime: Long): Boolean {
if (Utilities.ATLEAST_S || child.id != R.id.apps_list_view) {
if (Utilities.ATLEAST_S || child !is RecyclerView) {
return super.drawChild(canvas, child, drawingTime)
}
@@ -75,17 +75,15 @@ import com.android.launcher3.util.ItemInfoMatcher;
import com.android.launcher3.util.Themes;
import com.android.launcher3.views.RecyclerViewFastScroller;
import com.android.launcher3.views.ScrimView;
import com.android.launcher3.views.SpringRelativeLayout;
import com.android.launcher3.workprofile.PersonalWorkSlidingTabStrip.OnActivePageChangedListener;
import com.google.android.material.math.MathUtils;
import app.lawnchair.allapps.LawnchairAlphabeticalAppsList;
import app.lawnchair.ui.AllAppsStretchLayout;
import app.lawnchair.ui.StretchRecyclerViewContainer;
/**
* The all apps view container.
*/
public class AllAppsContainerView extends AllAppsStretchLayout implements DragSource,
public class AllAppsContainerView extends StretchRecyclerViewContainer implements DragSource,
Insettable, OnDeviceProfileChangeListener, OnActivePageChangedListener,
ScrimView.ScrimDrawingController {
@@ -23,12 +23,12 @@ import android.util.AttributeSet;
import com.android.launcher3.util.Themes;
import app.lawnchair.ui.StretchRelativeLayout;
import app.lawnchair.ui.StretchRecyclerViewContainer;
/**
* View with top rounded corners.
*/
public class TopRoundedCornerView extends StretchRelativeLayout {
public class TopRoundedCornerView extends StretchRecyclerViewContainer {
private final RectF mRect = new RectF();
private final Path mClipPath = new Path();