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

Commit df62ee6e authored by Miranda Kephart's avatar Miranda Kephart
Browse files

Add flag for scrolling screenshots

Adds a flag to control whether scrolling is enabled, separately
from the new UI flow. Currently this just controls whether the
'Extend' chip is shown.

Bug: 147424031
Test: tested with flag on and off to ensure expected behavior
Change-Id: I6fba301b058e783083d40f28366dfb4a6af4495b
parent 7161734f
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -350,7 +350,12 @@ public final class SystemUiDeviceConfigFlags {
     * (boolean) Whether screenshot flow going to the corner (instead of shown in a notification)
     * is enabled.
     */
    public static final String SCREENSHOT_CORNER_FLOW = "screenshot_corner_flow";
    public static final String SCREENSHOT_CORNER_FLOW = "enable_screenshot_corner_flow";

    /**
     * (boolean) Whether scrolling screenshots are enabled.
     */
    public static final String SCREENSHOT_SCROLLING_ENABLED = "enable_screenshot_scrolling";

    private SystemUiDeviceConfigFlags() {
    }
+13 −7
Original line number Diff line number Diff line
@@ -16,9 +16,11 @@

package com.android.systemui.screenshot;

import static android.provider.DeviceConfig.NAMESPACE_SYSTEMUI;
import static android.view.View.VISIBLE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;

import static com.android.internal.config.sysui.SystemUiDeviceConfigFlags.SCREENSHOT_SCROLLING_ENABLED;
import static com.android.systemui.statusbar.phone.StatusBar.SYSTEM_DIALOG_REASON_SCREENSHOT;

import android.animation.Animator;
@@ -48,6 +50,7 @@ import android.os.Looper;
import android.os.Message;
import android.os.PowerManager;
import android.os.UserHandle;
import android.provider.DeviceConfig;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.Slog;
@@ -540,6 +543,8 @@ public class GlobalScreenshot {
            });
            mActionsView.addView(actionChip);
        }

        if (DeviceConfig.getBoolean(NAMESPACE_SYSTEMUI, SCREENSHOT_SCROLLING_ENABLED, false)) {
            TextView scrollChip = (TextView) inflater.inflate(
                    R.layout.global_screenshot_action_chip, mActionsView, false);
            Toast scrollNotImplemented = Toast.makeText(
@@ -547,6 +552,7 @@ public class GlobalScreenshot {
            scrollChip.setText("Scroll"); // TODO (mkephart): add resource and translate
            scrollChip.setOnClickListener(v -> scrollNotImplemented.show());
            mActionsView.addView(scrollChip);
        }

        ValueAnimator animator = ValueAnimator.ofFloat(0, 1);
        mActionsView.setY(mDisplayMetrics.heightPixels);