Loading packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java +9 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ public class ButtonDispatcher { mViews.clear(); } void addView(View view, boolean landscape) { addView(view); if (view instanceof ButtonInterface) { ((ButtonInterface) view).setLandscape(landscape); } } void addView(View view) { mViews.add(view); view.setOnClickListener(mClickListener); Loading Loading @@ -178,5 +185,7 @@ public class ButtonDispatcher { void setImageDrawable(@Nullable Drawable drawable); void abortCurrentGesture(); void setLandscape(boolean landscape); } } packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java +4 −4 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi params.width = (int) (params.width * size); } parent.addView(v); addToDispatchers(v); addToDispatchers(v, landscape); View lastView = landscape ? mLastRot90 : mLastRot0; if (lastView != null) { v.setAccessibilityTraversalAfter(lastView.getId()); Loading Loading @@ -327,16 +327,16 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi return buttonSpec.substring(0, buttonSpec.indexOf(SIZE_MOD_START)); } private void addToDispatchers(View v) { private void addToDispatchers(View v, boolean landscape) { if (mButtonDispatchers != null) { final int indexOfKey = mButtonDispatchers.indexOfKey(v.getId()); if (indexOfKey >= 0) { mButtonDispatchers.valueAt(indexOfKey).addView(v); mButtonDispatchers.valueAt(indexOfKey).addView(v, landscape); } else if (v instanceof ViewGroup) { final ViewGroup viewGroup = (ViewGroup)v; final int N = viewGroup.getChildCount(); for (int i = 0; i < N; i++) { addToDispatchers(viewGroup.getChildAt(i)); addToDispatchers(viewGroup.getChildAt(i), landscape); } } } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +5 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,11 @@ public class KeyButtonView extends ImageView implements ButtonDispatcher.ButtonI public void setImageDrawable(@Nullable Drawable drawable) { super.setImageDrawable(drawable); } @Override public void setLandscape(boolean landscape) { //no op } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/phone/ButtonDispatcher.java +9 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,13 @@ public class ButtonDispatcher { mViews.clear(); } void addView(View view, boolean landscape) { addView(view); if (view instanceof ButtonInterface) { ((ButtonInterface) view).setLandscape(landscape); } } void addView(View view) { mViews.add(view); view.setOnClickListener(mClickListener); Loading Loading @@ -178,5 +185,7 @@ public class ButtonDispatcher { void setImageDrawable(@Nullable Drawable drawable); void abortCurrentGesture(); void setLandscape(boolean landscape); } }
packages/SystemUI/src/com/android/systemui/statusbar/phone/NavigationBarInflaterView.java +4 −4 Original line number Diff line number Diff line Loading @@ -280,7 +280,7 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi params.width = (int) (params.width * size); } parent.addView(v); addToDispatchers(v); addToDispatchers(v, landscape); View lastView = landscape ? mLastRot90 : mLastRot0; if (lastView != null) { v.setAccessibilityTraversalAfter(lastView.getId()); Loading Loading @@ -327,16 +327,16 @@ public class NavigationBarInflaterView extends FrameLayout implements TunerServi return buttonSpec.substring(0, buttonSpec.indexOf(SIZE_MOD_START)); } private void addToDispatchers(View v) { private void addToDispatchers(View v, boolean landscape) { if (mButtonDispatchers != null) { final int indexOfKey = mButtonDispatchers.indexOfKey(v.getId()); if (indexOfKey >= 0) { mButtonDispatchers.valueAt(indexOfKey).addView(v); mButtonDispatchers.valueAt(indexOfKey).addView(v, landscape); } else if (v instanceof ViewGroup) { final ViewGroup viewGroup = (ViewGroup)v; final int N = viewGroup.getChildCount(); for (int i = 0; i < N; i++) { addToDispatchers(viewGroup.getChildAt(i)); addToDispatchers(viewGroup.getChildAt(i), landscape); } } } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/KeyButtonView.java +5 −0 Original line number Diff line number Diff line Loading @@ -265,6 +265,11 @@ public class KeyButtonView extends ImageView implements ButtonDispatcher.ButtonI public void setImageDrawable(@Nullable Drawable drawable) { super.setImageDrawable(drawable); } @Override public void setLandscape(boolean landscape) { //no op } }