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

Commit 06998835 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add recycler view for recents Go" into ub-launcher3-master

parents 7ceb6f35 1c2b6c45
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) {