Loading packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java +3 −3 Original line number Diff line number Diff line Loading @@ -182,9 +182,9 @@ public class AccessibilityFloatingMenuController implements if (mFloatingMenu == null) { if (mFeatureFlags.isEnabled(A11Y_FLOATING_MENU_FLING_SPRING_ANIMATIONS)) { final Display defaultDisplay = mDisplayManager.getDisplay(DEFAULT_DISPLAY); mFloatingMenu = new MenuViewLayerController( mContext.createWindowContext(defaultDisplay, TYPE_NAVIGATION_BAR_PANEL, /* options= */ null), mWindowManager, final Context windowContext = mContext.createWindowContext(defaultDisplay, TYPE_NAVIGATION_BAR_PANEL, /* options= */ null); mFloatingMenu = new MenuViewLayerController(windowContext, mWindowManager, mAccessibilityManager); } else { mFloatingMenu = new AccessibilityFloatingMenu(mContext); Loading packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DismissAnimationController.java +2 −14 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.systemui.accessibility.floatingmenu; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.ComponentCallbacks; import android.content.res.Configuration; import android.view.MotionEvent; import androidx.annotation.NonNull; Loading @@ -34,7 +32,7 @@ import com.android.wm.shell.common.magnetictarget.MagnetizedObject; * Controls the interaction between {@link MagnetizedObject} and * {@link MagnetizedObject.MagneticTarget}. */ class DismissAnimationController implements ComponentCallbacks { class DismissAnimationController { private static final float COMPLETELY_OPAQUE = 1.0f; private static final float COMPLETELY_TRANSPARENT = 0.0f; private static final float CIRCLE_VIEW_DEFAULT_SCALE = 1.0f; Loading Loading @@ -105,16 +103,6 @@ class DismissAnimationController implements ComponentCallbacks { mMagnetizedObject.addTarget(magneticTarget); } @Override public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); } @Override public void onLowMemory() { // Do nothing } void showDismissView(boolean show) { if (show) { mDismissView.show(); Loading Loading @@ -165,7 +153,7 @@ class DismissAnimationController implements ComponentCallbacks { } } private void updateResources() { void updateResources() { final float maxDismissSize = mDismissView.getResources().getDimensionPixelSize( R.dimen.dismiss_circle_size); mMinDismissSize = mDismissView.getResources().getDimensionPixelSize( Loading packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuEduTooltipView.java +22 −4 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.View.MeasureSpec.AT_MOST; import static android.view.View.MeasureSpec.UNSPECIFIED; import android.annotation.SuppressLint; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -48,7 +49,7 @@ import com.android.systemui.recents.TriangleShape; * . It's just shown on the left or right of the anchor view. */ @SuppressLint("ViewConstructor") class MenuEduTooltipView extends FrameLayout { class MenuEduTooltipView extends FrameLayout implements ComponentCallbacks { private int mFontSize; private int mTextViewMargin; private int mTextViewPadding; Loading @@ -73,9 +74,7 @@ class MenuEduTooltipView extends FrameLayout { } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); updateMessageView(); updateArrowView(); Loading @@ -83,6 +82,25 @@ class MenuEduTooltipView extends FrameLayout { updateLocationAndVisibility(); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); getContext().registerComponentCallbacks(this); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); } void show(CharSequence message) { mMessageView.setText(message); Loading packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java +12 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.util.TypedValue.COMPLEX_UNIT_PX; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import android.annotation.IntDef; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Configuration; Loading @@ -33,6 +34,8 @@ import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import com.android.settingslib.Utils; import com.android.systemui.R; Loading @@ -44,7 +47,7 @@ import java.lang.annotation.RetentionPolicy; * the {@link MenuView}. */ class MenuMessageView extends LinearLayout implements ViewTreeObserver.OnComputeInternalInsetsListener { ViewTreeObserver.OnComputeInternalInsetsListener, ComponentCallbacks { private final TextView mTextView; private final Button mUndoButton; Loading Loading @@ -73,12 +76,15 @@ class MenuMessageView extends LinearLayout implements } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading @@ -93,6 +99,7 @@ class MenuMessageView extends LinearLayout implements updateResources(); getContext().registerComponentCallbacks(this); getViewTreeObserver().addOnComputeInternalInsetsListener(this); } Loading @@ -100,6 +107,7 @@ class MenuMessageView extends LinearLayout implements protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); getViewTreeObserver().removeOnComputeInternalInsetsListener(this); } Loading packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java +22 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.accessibility.floatingmenu; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import android.annotation.SuppressLint; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.Configuration; import android.graphics.PointF; Loading Loading @@ -46,7 +47,7 @@ import java.util.List; */ @SuppressLint("ViewConstructor") class MenuView extends FrameLayout implements ViewTreeObserver.OnComputeInternalInsetsListener { ViewTreeObserver.OnComputeInternalInsetsListener, ComponentCallbacks { private static final int INDEX_MENU_ITEM = 0; private final List<AccessibilityTarget> mTargetFeatures = new ArrayList<>(); private final AccessibilityTargetAdapter mAdapter; Loading Loading @@ -106,14 +107,31 @@ class MenuView extends FrameLayout implements } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { loadLayoutResources(); mTargetFeaturesView.setOverScrollMode(mMenuViewAppearance.getMenuScrollMode()); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); getContext().registerComponentCallbacks(this); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); } void setOnTargetFeaturesChangeListener(OnTargetFeaturesChangeListener listener) { mFeaturesChangeListener = listener; } Loading Loading
packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/AccessibilityFloatingMenuController.java +3 −3 Original line number Diff line number Diff line Loading @@ -182,9 +182,9 @@ public class AccessibilityFloatingMenuController implements if (mFloatingMenu == null) { if (mFeatureFlags.isEnabled(A11Y_FLOATING_MENU_FLING_SPRING_ANIMATIONS)) { final Display defaultDisplay = mDisplayManager.getDisplay(DEFAULT_DISPLAY); mFloatingMenu = new MenuViewLayerController( mContext.createWindowContext(defaultDisplay, TYPE_NAVIGATION_BAR_PANEL, /* options= */ null), mWindowManager, final Context windowContext = mContext.createWindowContext(defaultDisplay, TYPE_NAVIGATION_BAR_PANEL, /* options= */ null); mFloatingMenu = new MenuViewLayerController(windowContext, mWindowManager, mAccessibilityManager); } else { mFloatingMenu = new AccessibilityFloatingMenu(mContext); Loading
packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/DismissAnimationController.java +2 −14 Original line number Diff line number Diff line Loading @@ -19,8 +19,6 @@ package com.android.systemui.accessibility.floatingmenu; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; import android.animation.ValueAnimator; import android.content.ComponentCallbacks; import android.content.res.Configuration; import android.view.MotionEvent; import androidx.annotation.NonNull; Loading @@ -34,7 +32,7 @@ import com.android.wm.shell.common.magnetictarget.MagnetizedObject; * Controls the interaction between {@link MagnetizedObject} and * {@link MagnetizedObject.MagneticTarget}. */ class DismissAnimationController implements ComponentCallbacks { class DismissAnimationController { private static final float COMPLETELY_OPAQUE = 1.0f; private static final float COMPLETELY_TRANSPARENT = 0.0f; private static final float CIRCLE_VIEW_DEFAULT_SCALE = 1.0f; Loading Loading @@ -105,16 +103,6 @@ class DismissAnimationController implements ComponentCallbacks { mMagnetizedObject.addTarget(magneticTarget); } @Override public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); } @Override public void onLowMemory() { // Do nothing } void showDismissView(boolean show) { if (show) { mDismissView.show(); Loading Loading @@ -165,7 +153,7 @@ class DismissAnimationController implements ComponentCallbacks { } } private void updateResources() { void updateResources() { final float maxDismissSize = mDismissView.getResources().getDimensionPixelSize( R.dimen.dismiss_circle_size); mMinDismissSize = mDismissView.getResources().getDimensionPixelSize( Loading
packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuEduTooltipView.java +22 −4 Original line number Diff line number Diff line Loading @@ -21,6 +21,7 @@ import static android.view.View.MeasureSpec.AT_MOST; import static android.view.View.MeasureSpec.UNSPECIFIED; import android.annotation.SuppressLint; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.Configuration; import android.content.res.Resources; Loading Loading @@ -48,7 +49,7 @@ import com.android.systemui.recents.TriangleShape; * . It's just shown on the left or right of the anchor view. */ @SuppressLint("ViewConstructor") class MenuEduTooltipView extends FrameLayout { class MenuEduTooltipView extends FrameLayout implements ComponentCallbacks { private int mFontSize; private int mTextViewMargin; private int mTextViewPadding; Loading @@ -73,9 +74,7 @@ class MenuEduTooltipView extends FrameLayout { } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); updateMessageView(); updateArrowView(); Loading @@ -83,6 +82,25 @@ class MenuEduTooltipView extends FrameLayout { updateLocationAndVisibility(); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); getContext().registerComponentCallbacks(this); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); } void show(CharSequence message) { mMessageView.setText(message); Loading
packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuMessageView.java +12 −4 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ import static android.util.TypedValue.COMPLEX_UNIT_PX; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import android.annotation.IntDef; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.ColorStateList; import android.content.res.Configuration; Loading @@ -33,6 +34,8 @@ import android.widget.FrameLayout; import android.widget.LinearLayout; import android.widget.TextView; import androidx.annotation.NonNull; import com.android.settingslib.Utils; import com.android.systemui.R; Loading @@ -44,7 +47,7 @@ import java.lang.annotation.RetentionPolicy; * the {@link MenuView}. */ class MenuMessageView extends LinearLayout implements ViewTreeObserver.OnComputeInternalInsetsListener { ViewTreeObserver.OnComputeInternalInsetsListener, ComponentCallbacks { private final TextView mTextView; private final Button mUndoButton; Loading Loading @@ -73,12 +76,15 @@ class MenuMessageView extends LinearLayout implements } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { updateResources(); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); Loading @@ -93,6 +99,7 @@ class MenuMessageView extends LinearLayout implements updateResources(); getContext().registerComponentCallbacks(this); getViewTreeObserver().addOnComputeInternalInsetsListener(this); } Loading @@ -100,6 +107,7 @@ class MenuMessageView extends LinearLayout implements protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); getViewTreeObserver().removeOnComputeInternalInsetsListener(this); } Loading
packages/SystemUI/src/com/android/systemui/accessibility/floatingmenu/MenuView.java +22 −4 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ package com.android.systemui.accessibility.floatingmenu; import static android.view.ViewGroup.LayoutParams.WRAP_CONTENT; import android.annotation.SuppressLint; import android.content.ComponentCallbacks; import android.content.Context; import android.content.res.Configuration; import android.graphics.PointF; Loading Loading @@ -46,7 +47,7 @@ import java.util.List; */ @SuppressLint("ViewConstructor") class MenuView extends FrameLayout implements ViewTreeObserver.OnComputeInternalInsetsListener { ViewTreeObserver.OnComputeInternalInsetsListener, ComponentCallbacks { private static final int INDEX_MENU_ITEM = 0; private final List<AccessibilityTarget> mTargetFeatures = new ArrayList<>(); private final AccessibilityTargetAdapter mAdapter; Loading Loading @@ -106,14 +107,31 @@ class MenuView extends FrameLayout implements } @Override protected void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); public void onConfigurationChanged(@NonNull Configuration newConfig) { loadLayoutResources(); mTargetFeaturesView.setOverScrollMode(mMenuViewAppearance.getMenuScrollMode()); } @Override public void onLowMemory() { // Do nothing. } @Override protected void onAttachedToWindow() { super.onAttachedToWindow(); getContext().registerComponentCallbacks(this); } @Override protected void onDetachedFromWindow() { super.onDetachedFromWindow(); getContext().unregisterComponentCallbacks(this); } void setOnTargetFeaturesChangeListener(OnTargetFeaturesChangeListener listener) { mFeaturesChangeListener = listener; } Loading