Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ */ package com.android.wm.shell.bubbles; package com.android.wm.shell.bubbles; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import android.annotation.DrawableRes; import android.annotation.DrawableRes; import android.annotation.Nullable; import android.annotation.Nullable; import android.content.Context; import android.content.Context; Loading @@ -35,7 +37,6 @@ import android.widget.ImageView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.R; import com.android.wm.shell.R; import com.android.wm.shell.shared.animation.Interpolators; import com.android.wm.shell.shared.animation.Interpolators; Loading Loading @@ -132,7 +133,7 @@ public class BadgedImageView extends ConstraintLayout { private void getOutline(Outline outline) { private void getOutline(Outline outline) { final int bubbleSize = mPositioner.getBubbleSize(); final int bubbleSize = mPositioner.getBubbleSize(); final int normalizedSize = IconNormalizer.getNormalizedCircleSize(bubbleSize); final int normalizedSize = Math.round(ICON_VISIBLE_AREA_FACTOR * bubbleSize); final int inset = (bubbleSize - normalizedSize) / 2; final int inset = (bubbleSize - normalizedSize) / 2; outline.setOval(inset, inset, inset + normalizedSize, inset + normalizedSize); outline.setOval(inset, inset, inset + normalizedSize, inset + normalizedSize); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.wm.shell.bubbles; package com.android.wm.shell.bubbles; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES; import android.content.Context; import android.content.Context; Loading @@ -31,7 +32,6 @@ import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.internal.protolog.ProtoLog; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.Flags; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.R; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; Loading Loading @@ -557,8 +557,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { public float getPointerPosition(float bubblePosition) { public float getPointerPosition(float bubblePosition) { // TODO: I don't understand why it works but it does - why normalized in portrait // TODO: I don't understand why it works but it does - why normalized in portrait // & not in landscape? Am I missing ~2dp in the portrait expandedViewY calculation? // & not in landscape? Am I missing ~2dp in the portrait expandedViewY calculation? final float normalizedSize = IconNormalizer.getNormalizedCircleSize( final float normalizedSize = Math.round(ICON_VISIBLE_AREA_FACTOR * getBubbleSize()); getBubbleSize()); return showBubblesVertically() return showBubblesVertically() ? bubblePosition + (getBubbleSize() / 2f) ? bubblePosition + (getBubbleSize() / 2f) : bubblePosition + (normalizedSize / 2f) - mPointerWidth; : bubblePosition + (normalizedSize / 2f) - mPointerWidth; Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BadgedImageView.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -15,6 +15,8 @@ */ */ package com.android.wm.shell.bubbles; package com.android.wm.shell.bubbles; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import android.annotation.DrawableRes; import android.annotation.DrawableRes; import android.annotation.Nullable; import android.annotation.Nullable; import android.content.Context; import android.content.Context; Loading @@ -35,7 +37,6 @@ import android.widget.ImageView; import androidx.constraintlayout.widget.ConstraintLayout; import androidx.constraintlayout.widget.ConstraintLayout; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.DotRenderer; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.R; import com.android.wm.shell.R; import com.android.wm.shell.shared.animation.Interpolators; import com.android.wm.shell.shared.animation.Interpolators; Loading Loading @@ -132,7 +133,7 @@ public class BadgedImageView extends ConstraintLayout { private void getOutline(Outline outline) { private void getOutline(Outline outline) { final int bubbleSize = mPositioner.getBubbleSize(); final int bubbleSize = mPositioner.getBubbleSize(); final int normalizedSize = IconNormalizer.getNormalizedCircleSize(bubbleSize); final int normalizedSize = Math.round(ICON_VISIBLE_AREA_FACTOR * bubbleSize); final int inset = (bubbleSize - normalizedSize) / 2; final int inset = (bubbleSize - normalizedSize) / 2; outline.setOval(inset, inset, inset + normalizedSize, inset + normalizedSize); outline.setOval(inset, inset, inset + normalizedSize, inset + normalizedSize); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubblePositioner.java +2 −3 Original line number Original line Diff line number Diff line Loading @@ -16,6 +16,7 @@ package com.android.wm.shell.bubbles; package com.android.wm.shell.bubbles; import static com.android.launcher3.icons.IconNormalizer.ICON_VISIBLE_AREA_FACTOR; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES; import static com.android.wm.shell.protolog.ShellProtoLogGroup.WM_SHELL_BUBBLES; import android.content.Context; import android.content.Context; Loading @@ -31,7 +32,6 @@ import androidx.annotation.NonNull; import androidx.annotation.VisibleForTesting; import androidx.annotation.VisibleForTesting; import com.android.internal.protolog.ProtoLog; import com.android.internal.protolog.ProtoLog; import com.android.launcher3.icons.IconNormalizer; import com.android.wm.shell.Flags; import com.android.wm.shell.Flags; import com.android.wm.shell.R; import com.android.wm.shell.R; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; Loading Loading @@ -557,8 +557,7 @@ public class BubblePositioner implements BubbleDropTargetBoundsProvider { public float getPointerPosition(float bubblePosition) { public float getPointerPosition(float bubblePosition) { // TODO: I don't understand why it works but it does - why normalized in portrait // TODO: I don't understand why it works but it does - why normalized in portrait // & not in landscape? Am I missing ~2dp in the portrait expandedViewY calculation? // & not in landscape? Am I missing ~2dp in the portrait expandedViewY calculation? final float normalizedSize = IconNormalizer.getNormalizedCircleSize( final float normalizedSize = Math.round(ICON_VISIBLE_AREA_FACTOR * getBubbleSize()); getBubbleSize()); return showBubblesVertically() return showBubblesVertically() ? bubblePosition + (getBubbleSize() / 2f) ? bubblePosition + (getBubbleSize() / 2f) : bubblePosition + (normalizedSize / 2f) - mPointerWidth; : bubblePosition + (normalizedSize / 2f) - mPointerWidth; Loading