Don't clip recents items with system bars

In order for items to go under the system bars, we have the recents view
consume the insets by setting padding to the recyclerview instead of
setting the margins with it. Then, we ensure the recycler view does not
clip to padding so that items are still visible even when scrolled past.

Bug: 131626311
Test: Manual test; items go under system bars
Change-Id: Iecbab537b8f9e2993ad5f74f87ba2e0c56fb0f63
This commit is contained in:
Kevin 2019-04-26 11:32:31 -07:00
parent dd165d2d7c
commit 0448ab6d7d
2 changed files with 9 additions and 2 deletions

View File

@ -24,7 +24,8 @@
android:layout_width="@dimen/recents_list_width"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:scrollbars="none"/>
android:scrollbars="none"
android:clipToPadding="false"/>
<TextView
android:id="@+id/recent_task_empty_view"
android:layout_width="match_parent"

View File

@ -54,6 +54,7 @@ import androidx.recyclerview.widget.RecyclerView.ItemDecoration;
import androidx.recyclerview.widget.RecyclerView.OnChildAttachStateChangeListener;
import com.android.launcher3.BaseActivity;
import com.android.launcher3.Insettable;
import com.android.launcher3.R;
import com.android.quickstep.ContentFillItemAnimator;
import com.android.quickstep.RecentsModel;
@ -74,7 +75,7 @@ import java.util.Optional;
* Root view for the icon recents view. Acts as the main interface to the rest of the Launcher code
* base.
*/
public final class IconRecentsView extends FrameLayout {
public final class IconRecentsView extends FrameLayout implements Insettable {
public static final FloatProperty<IconRecentsView> CONTENT_ALPHA =
new FloatProperty<IconRecentsView>("contentAlpha") {
@ -518,4 +519,9 @@ public final class IconRecentsView extends FrameLayout {
});
mLayoutAnimation.start();
}
@Override
public void setInsets(Rect insets) {
mTaskRecyclerView.setPadding(insets.left, insets.top, insets.right, insets.bottom);
}
}