Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1c2b6c45 authored by Kevin's avatar Kevin
Browse files

Add recycler view for recents Go

Add recycler view to view hierarchy for recents Go to hold the list of
recent tasks.

Bug: 114136250
Test: Manual test, see view in place
Change-Id: I255bb4a7737726b0e211b52aec3f2fb8f4723513
parent fd6d850d
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
@@ -18,13 +18,11 @@
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center">
    <!-- TODO(114136250): Remove this temporary placeholder view for Go recents -->
    <TextView
    android:orientation="vertical">
    <androidx.recyclerview.widget.RecyclerView
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/recent_task_recycler_view"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:text="Stub!"
        android:textSize="40sp"/>
        android:scrollbars="none"/>
</com.android.quickstep.views.IconRecentsView>
 No newline at end of file
+14 −1
Original line number Diff line number Diff line
@@ -15,12 +15,19 @@
 */
package com.android.quickstep.views;

import static androidx.recyclerview.widget.LinearLayoutManager.VERTICAL;

import android.content.Context;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.view.ViewDebug;
import android.widget.FrameLayout;

import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.android.launcher3.R;
import com.android.quickstep.RecentsModel;
import com.android.quickstep.TaskAdapter;
import com.android.systemui.shared.recents.model.Task;

@@ -72,19 +79,25 @@ public final class IconRecentsView extends FrameLayout {

    // TODO: Write a recents task list observer that creates/updates tasks and signals task adapter.
    private static final ArrayList<Task> DUMMY_TASK_LIST = new ArrayList<>();
    private final Context mContext;

    private float mTranslationYFactor;
    private TaskAdapter mTaskAdapter;
    private RecyclerView mTaskRecyclerView;

    public IconRecentsView(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        mTaskAdapter = new TaskAdapter(DUMMY_TASK_LIST);
        // TODO: Hook task adapter up to recycler view.
        mTaskRecyclerView = findViewById(R.id.recent_task_recycler_view);
        mTaskRecyclerView.setAdapter(mTaskAdapter);
        mTaskRecyclerView.setLayoutManager(
                new LinearLayoutManager(mContext, VERTICAL, true /* reverseLayout */));
    }

    public void setTranslationYFactor(float translationFactor) {