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

Commit 42822cc3 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8139379 from 9f0d54eb to sc-qpr3-release

Change-Id: I9373153d6e534cdc5d1e5b37b46b682c7bb37c87
parents e4341d32 9f0d54eb
Loading
Loading
Loading
Loading
+16 −5
Original line number Diff line number Diff line
@@ -90,11 +90,12 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ

    private static final String WINDOW_TITLE = "Taskbar";

    private final DeviceProfile mDeviceProfile;
    private final LayoutInflater mLayoutInflater;
    private final TaskbarDragLayer mDragLayer;
    private final TaskbarControllers mControllers;

    private DeviceProfile mDeviceProfile;

    private final WindowManager mWindowManager;
    private final @Nullable RoundedCorner mLeftCorner, mRightCorner;
    private final int mTaskbarHeightForIme;
@@ -125,10 +126,7 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
                Settings.Secure.getUriFor(Settings.Secure.USER_SETUP_COMPLETE), 0);

        final Resources resources = getResources();
        float taskbarIconSize = resources.getDimension(R.dimen.taskbar_icon_size);
        mDeviceProfile.updateIconSize(1, resources);
        float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx;
        mDeviceProfile.updateIconSize(iconScale, resources);
        updateIconSize(resources);

        mTaskbarHeightForIme = resources.getDimensionPixelSize(R.dimen.taskbar_ime_size);

@@ -211,6 +209,19 @@ public class TaskbarActivityContext extends ContextThemeWrapper implements Activ
        mWindowManager.addView(mDragLayer, mWindowLayoutParams);
    }

    /** Updates the Device profile instance to the latest representation of the screen. */
    public void updateDeviceProfile(DeviceProfile dp) {
        mDeviceProfile = dp;
        updateIconSize(getResources());
    }

    private void updateIconSize(Resources resources) {
        float taskbarIconSize = resources.getDimension(R.dimen.taskbar_icon_size);
        mDeviceProfile.updateIconSize(1, resources);
        float iconScale = taskbarIconSize / mDeviceProfile.iconSizePx;
        mDeviceProfile.updateIconSize(iconScale, resources);
    }

    public void onConfigurationChanged(@Config int configChanges) {
        mControllers.onConfigurationChanged(configChanges);
    }
+1 −1
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ public class TaskbarDragController extends DragController<TaskbarActivityContext
            PopupContainerWithArrow<TaskbarActivityContext> popupContainer =
                    mControllers.taskbarPopupController.showForIcon(btv);
            if (popupContainer != null) {
                dragOptions.preDragCondition = popupContainer.createPreDragCondition();
                dragOptions.preDragCondition = popupContainer.createPreDragCondition(false);
            }
        }

+7 −0
Original line number Diff line number Diff line
@@ -110,6 +110,13 @@ public class TaskbarManager implements DisplayController.DisplayInfoChangeListen
                } else {
                    // Config change might be handled without re-creating the taskbar
                    if (mTaskbarActivityContext != null) {
                        DeviceProfile dp = mUserUnlocked
                                ? LauncherAppState.getIDP(mContext).getDeviceProfile(mContext)
                                : null;

                        if (dp != null && dp.isTaskbarPresent) {
                            mTaskbarActivityContext.updateDeviceProfile(dp.copy(mContext));
                        }
                        mTaskbarActivityContext.onConfigurationChanged(configDiff);
                    }
                }
+2 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
import android.icu.text.MessageFormat;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.TextUtils.TruncateAt;
import android.util.AttributeSet;
import android.util.Property;
@@ -785,7 +786,7 @@ public class BubbleTextView extends TextView implements ItemInfoUpdateReceiver,
                    invalidate();
                }
            }
            if (itemInfo.contentDescription != null) {
            if (!TextUtils.isEmpty(itemInfo.contentDescription)) {
                if (itemInfo.isDisabled()) {
                    setContentDescription(getContext().getString(R.string.disabled_app_label,
                            itemInfo.contentDescription));
+2 −1
Original line number Diff line number Diff line
@@ -460,9 +460,10 @@ public final class Utilities {
     * Trims the string, removing all whitespace at the beginning and end of the string.
     * Non-breaking whitespaces are also removed.
     */
    @NonNull
    public static String trim(CharSequence s) {
        if (s == null) {
            return null;
            return "";
        }

        // Just strip any sequence of whitespace or java space characters from the beginning and end
Loading