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

Commit 2384beb3 authored by Chilun Huang's avatar Chilun Huang
Browse files

Use the icon size of starting surface for split decor

Use a fixed icon size and fit to centor scale for split decor to avoid
unexpected icon size. Also sync the same icon size to drop zone area.

Bug: 228928242
Test: Manual resize the split and check the icon size.
      Manual drag to split and check the icon size.
Change-Id: Idaf523810e3913a22787925817b6013464818147
parent 9b7c98ce
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -20,9 +20,10 @@
    android:layout_width="match_parent">

    <ImageView android:id="@+id/split_resizing_icon"
               android:layout_height="wrap_content"
               android:layout_width="wrap_content"
               android:layout_height="@*android:dimen/starting_surface_icon_size"
               android:layout_width="@*android:dimen/starting_surface_icon_size"
               android:layout_gravity="center"
               android:scaleType="fitCenter"
               android:padding="0dp"
               android:visibility="gone"
               android:background="@null"/>
+6 −3
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.FloatProperty;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;
@@ -110,10 +111,12 @@ public class DropZoneView extends FrameLayout {
        mColorDrawable = new ColorDrawable();
        setBackgroundDrawable(mColorDrawable);

        final int iconSize = context.getResources().getDimensionPixelSize(
                com.android.internal.R.dimen.starting_surface_icon_size);
        mSplashScreenView = new ImageView(context);
        mSplashScreenView.setScaleType(ImageView.ScaleType.CENTER);
        addView(mSplashScreenView, new FrameLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.MATCH_PARENT));
        mSplashScreenView.setScaleType(ImageView.ScaleType.FIT_CENTER);
        addView(mSplashScreenView,
                new FrameLayout.LayoutParams(iconSize, iconSize, Gravity.CENTER));
        mSplashScreenView.setAlpha(0f);

        mMarginView = new MarginView(context);