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

Commit d3e90ea4 authored by Mady Mellor's avatar Mady Mellor
Browse files

Slight adjustments to gradient shown when dragging to dismiss

- Adjusted the height
- Gave the asset a 90% alpha and set it as the background programmatically

Test: manual, have a PIP drag it around, note the gradient appearance
Change-Id: I7bc3262f6813f737da62201cdce6a14046f3e754
parent 256794f0
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="@dimen/pip_dismiss_gradient_height"
    android:background="@drawable/pip_dismiss_scrim"
    android:alpha="0">

    <TextView
+1 −1
Original line number Diff line number Diff line
@@ -743,7 +743,7 @@
    <dimen name="recents_fast_fling_velocity">600dp</dimen>

    <!-- The height of the gradient indicating the dismiss edge when moving a PIP. -->
    <dimen name="pip_dismiss_gradient_height">196dp</dimen>
    <dimen name="pip_dismiss_gradient_height">176dp</dimen>

    <!-- The bottom margin of the PIP drag to dismiss info text shown when moving a PIP. -->
    <dimen name="pip_dismiss_text_bottom_margin">24dp</dimen>
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ import android.graphics.PixelFormat;
import android.graphics.Point;
import android.graphics.PointF;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
@@ -72,6 +73,11 @@ public class PipDismissViewController {
            mDismissView.setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE);
            mDismissView.forceHasOverlappingRendering(false);

            // Set the gradient background
            Drawable gradient = mContext.getResources().getDrawable(R.drawable.pip_dismiss_scrim);
            gradient.setAlpha((int) (255 * 0.85f));
            mDismissView.setBackground(gradient);

            // Adjust bottom margins of the text
            View text = mDismissView.findViewById(R.id.pip_dismiss_text);
            FrameLayout.LayoutParams tlp = (FrameLayout.LayoutParams) text.getLayoutParams();