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

Commit ffb90d85 authored by Shamali Patwa's avatar Shamali Patwa Committed by Android (Google) Code Review
Browse files

Merge "Remove unused badge logic on WidgetCell now that we don't show badges." into main

parents 5c8241b4 8f446171
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -35,14 +35,6 @@
            android:layout_height="match_parent"
            android:importantForAccessibility="no"
            android:layout_gravity="fill"/>

        <ImageView
            android:id="@+id/widget_badge"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:importantForAccessibility="no"
            android:layout_gravity="end|bottom"
            android:layout_margin="@dimen/profile_badge_margin"/>
    </com.android.launcher3.widget.WidgetCellPreview>

    <FrameLayout
+0 −1
Original line number Diff line number Diff line
@@ -277,7 +277,6 @@

    <!-- Sizes for managed profile badges -->
    <dimen name="profile_badge_size">24dp</dimen>
    <dimen name="profile_badge_margin">5dp</dimen>
    <dimen name="profile_badge_minimum_top">2dp</dimen>

    <!-- Shadows and outlines -->
+0 −17
Original line number Diff line number Diff line
@@ -26,7 +26,6 @@ import static com.android.launcher3.widget.util.WidgetSizes.getWidgetItemSizePx;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.Drawable;
import android.os.Process;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.util.Log;
@@ -39,7 +38,6 @@ import android.view.ViewPropertyAnimator;
import android.view.accessibility.AccessibilityNodeInfo;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RemoteViews;
import android.widget.TextView;
@@ -88,7 +86,6 @@ public class WidgetCell extends LinearLayout {
    private Size mPreviewContainerSize = new Size(0, 0);
    private FrameLayout mWidgetImageContainer;
    private WidgetImageView mWidgetImage;
    private ImageView mWidgetBadge;
    private TextView mWidgetName;
    private TextView mWidgetDims;
    private TextView mWidgetDescription;
@@ -142,7 +139,6 @@ public class WidgetCell extends LinearLayout {

        mWidgetImageContainer = findViewById(R.id.widget_preview_container);
        mWidgetImage = findViewById(R.id.widget_preview);
        mWidgetBadge = findViewById(R.id.widget_badge);
        mWidgetName = findViewById(R.id.widget_name);
        mWidgetDims = findViewById(R.id.widget_dims);
        mWidgetDescription = findViewById(R.id.widget_description);
@@ -182,8 +178,6 @@ public class WidgetCell extends LinearLayout {
        mWidgetImage.animate().cancel();
        mWidgetImage.setDrawable(null);
        mWidgetImage.setVisibility(View.VISIBLE);
        mWidgetBadge.setImageDrawable(null);
        mWidgetBadge.setVisibility(View.GONE);
        mWidgetName.setText(null);
        mWidgetDims.setText(null);
        mWidgetDescription.setText(null);
@@ -397,17 +391,6 @@ public class WidgetCell extends LinearLayout {
        }
    }

    /** Used to show the badge when the widget is in the recommended section
     */
    public void showBadge() {
        if (Process.myUserHandle().equals(mItem.user)) {
            mWidgetBadge.setVisibility(View.GONE);
        } else {
            mWidgetBadge.setVisibility(View.VISIBLE);
            mWidgetBadge.setImageResource(R.drawable.ic_work_app_badge);
        }
    }

    /**
     * Shows or hides the long description displayed below each widget.
     *
+0 −7
Original line number Diff line number Diff line
@@ -24,8 +24,6 @@ import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.view.View;

import com.android.launcher3.R;

/**
 * View that draws a bitmap horizontally centered. If the image width is greater than the view
 * width, the image is scaled down appropriately.
@@ -33,8 +31,6 @@ import com.android.launcher3.R;
public class WidgetImageView extends View {

    private final RectF mDstRectF = new RectF();
    private final int mBadgeMargin;

    private Drawable mDrawable;

    public WidgetImageView(Context context) {
@@ -47,9 +43,6 @@ public class WidgetImageView extends View {

    public WidgetImageView(Context context, AttributeSet attrs, int defStyle) {
        super(context, attrs, defStyle);

        mBadgeMargin = context.getResources()
                .getDimensionPixelSize(R.dimen.profile_badge_margin);
    }

    /** Set the drawable to use for this view. */