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

Commit e4e41ba4 authored by Jiaquan He's avatar Jiaquan He
Browse files

Add a configuration for Grid-baseed Recents.

This commit adds a configuration to enable or disable grid layouts of
task views in Recents. The configured value is defined by a system
property ro.recents.grid.

Change-Id: I6ff55c60a41b5185ae10d18692170711056595ef
parent a0207a16
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.Resources;
import android.content.res.Resources;
import android.graphics.Rect;
import android.graphics.Rect;


import android.os.SystemProperties;
import com.android.systemui.R;
import com.android.systemui.R;
import com.android.systemui.recents.misc.SystemServicesProxy;
import com.android.systemui.recents.misc.SystemServicesProxy;


@@ -58,6 +59,10 @@ public class RecentsConfiguration {
    public boolean fakeShadows;
    public boolean fakeShadows;
    public int svelteLevel;
    public int svelteLevel;


    // Whether this product supports Grid-based Recents. If this is field is set to true, then
    // Recents will layout task views in a grid mode when there's enough space in the screen.
    public boolean isGridEnabled;

    public RecentsConfiguration(Context context) {
    public RecentsConfiguration(Context context) {
        // Load only resources that can not change after the first load either through developer
        // Load only resources that can not change after the first load either through developer
        // settings or via multi window
        // settings or via multi window
@@ -66,6 +71,7 @@ public class RecentsConfiguration {
        Resources res = appContext.getResources();
        Resources res = appContext.getResources();
        fakeShadows = res.getBoolean(R.bool.config_recents_fake_shadows);
        fakeShadows = res.getBoolean(R.bool.config_recents_fake_shadows);
        svelteLevel = res.getInteger(R.integer.recents_svelte_level);
        svelteLevel = res.getInteger(R.integer.recents_svelte_level);
        isGridEnabled = SystemProperties.getBoolean("ro.recents.grid", false);


        float screenDensity = context.getResources().getDisplayMetrics().density;
        float screenDensity = context.getResources().getDisplayMetrics().density;
        smallestWidth = ssp.getDeviceSmallestWidth();
        smallestWidth = ssp.getDeviceSmallestWidth();