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

Commit 447adc2e authored by mattsziklay's avatar mattsziklay
Browse files

Update indicator color and task radius.

Updates the dragged task radius to 28dp and the indicator's color to be
system based.

Bug: 331809027
Test: Manual
Change-Id: I32012dd843e93441c35d142e9b0e327796a2b890
parent 213ba354
Loading
Loading
Loading
Loading
+16 −6
Original line number Diff line number Diff line
@@ -14,9 +14,19 @@
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->
<shape android:shape="rectangle"
       xmlns:android="http://schemas.android.com/apk/res/android">
    <solid android:color="#bf309fb5" />
    <corners android:radius="20dp" />
    <stroke android:width="1dp" color="#A00080FF"/>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:androidprv="http://schemas.android.com/apk/prv/res/android">
    <item android:id="@+id/indicator_solid">
        <shape android:shape="rectangle">
            <solid android:color="?androidprv:attr/materialColorPrimaryContainer" />
            <corners android:radius="28dp" />
        </shape>
    </item>
    <item android:id="@+id/indicator_stroke">
        <shape android:shape="rectangle">
            <corners android:radius="28dp" />
            <stroke android:width="1dp"
                android:color="?androidprv:attr/materialColorPrimaryContainer"/>
        </shape>
    </item>
</layer-list>
+3 −0
Original line number Diff line number Diff line
@@ -550,6 +550,9 @@
    for corner drags without transition. -->
    <dimen name="desktop_mode_split_from_desktop_height">100dp</dimen>

    <!-- The corner radius of a task that was dragged from fullscreen. -->
    <dimen name="desktop_mode_dragged_task_radius">28dp</dimen>

    <!-- The acceptable area ratio of fg icon area/bg icon area, i.e. (72 x 72) / (108 x 108) -->
    <item type="dimen" format="float" name="splash_icon_enlarge_foreground_threshold">0.44</item>
    <!-- Scaling factor applied to splash icons without provided background i.e. (192 / 160) -->
+8 −2
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.graphics.PixelFormat;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.Region;
import android.graphics.drawable.LayerDrawable;
import android.util.DisplayMetrics;
import android.view.SurfaceControl;
import android.view.SurfaceControlViewHost;
@@ -311,7 +312,8 @@ public class DesktopModeVisualIndicator {
    private static class VisualIndicatorAnimator extends ValueAnimator {
        private static final int FULLSCREEN_INDICATOR_DURATION = 200;
        private static final float FULLSCREEN_SCALE_ADJUSTMENT_PERCENT = 0.015f;
        private static final float INDICATOR_FINAL_OPACITY = 0.7f;
        private static final float INDICATOR_FINAL_OPACITY = 0.35f;
        private static final int MAXIMUM_OPACITY = 255;

        /** Determines how this animator will interact with the view's alpha:
         *  Fade in, fade out, or no change to alpha
@@ -455,7 +457,11 @@ public class DesktopModeVisualIndicator {
         * @param fraction current animation fraction
         */
        private void updateIndicatorAlpha(float fraction, View view) {
            view.setAlpha(fraction * INDICATOR_FINAL_OPACITY);
            final LayerDrawable drawable = (LayerDrawable) view.getBackground();
            drawable.findDrawableByLayerId(R.id.indicator_stroke)
                    .setAlpha((int) (MAXIMUM_OPACITY * fraction));
            drawable.findDrawableByLayerId(R.id.indicator_solid)
                    .setAlpha((int) (MAXIMUM_OPACITY * fraction * INDICATOR_FINAL_OPACITY));
        }

        /**
+3 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ import android.graphics.PointF
import android.graphics.Rect
import android.view.MotionEvent
import android.view.SurfaceControl
import com.android.internal.policy.ScreenDecorationsUtils
import com.android.wm.shell.R

/**
 * Creates an animator to shrink and position task after a user drags a fullscreen task from
@@ -39,7 +39,8 @@ class MoveToDesktopAnimator @JvmOverloads constructor(
            .setDuration(ANIMATION_DURATION.toLong())
            .apply {
                val t = SurfaceControl.Transaction()
                val cornerRadius = ScreenDecorationsUtils.getWindowCornerRadius(context)
                val cornerRadius = context.resources
                    .getDimensionPixelSize(R.dimen.desktop_mode_dragged_task_radius).toFloat()
                addUpdateListener {
                    setTaskPosition(mostRecentInput.x, mostRecentInput.y)
                    t.setScale(taskSurface, scale, scale)