Loading packages/SystemUI/src/com/android/systemui/volume/ZenRadioLayout.java +31 −0 Original line number Diff line number Diff line Loading @@ -46,9 +46,16 @@ public class ZenRadioLayout extends LinearLayout { throw new IllegalStateException("Expected matching children"); } boolean hasChanges = false; View lastView = null; for (int i = 0; i < size; i++) { View radio = radioGroup.getChildAt(i); View content = radioContent.getChildAt(i); if (lastView != null) { radio.setAccessibilityTraversalAfter(lastView.getId()); } View contentClick = findFirstClickable(content); if (contentClick != null) contentClick.setAccessibilityTraversalAfter(radio.getId()); lastView = findLastClickable(content); if (radio.getLayoutParams().height != content.getMeasuredHeight()) { hasChanges = true; radio.getLayoutParams().height = content.getMeasuredHeight(); Loading @@ -59,4 +66,28 @@ public class ZenRadioLayout extends LinearLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } private View findFirstClickable(View content) { if (content.isClickable()) return content; if (content instanceof ViewGroup) { ViewGroup group = (ViewGroup) content; for (int i = 0; i < group.getChildCount(); i++) { View v = findFirstClickable(group.getChildAt(i)); if (v != null) return v; } } return null; } private View findLastClickable(View content) { if (content.isClickable()) return content; if (content instanceof ViewGroup) { ViewGroup group = (ViewGroup) content; for (int i = group.getChildCount() - 1; i >= 0; i--) { View v = findLastClickable(group.getChildAt(i)); if (v != null) return v; } } return null; } } Loading
packages/SystemUI/src/com/android/systemui/volume/ZenRadioLayout.java +31 −0 Original line number Diff line number Diff line Loading @@ -46,9 +46,16 @@ public class ZenRadioLayout extends LinearLayout { throw new IllegalStateException("Expected matching children"); } boolean hasChanges = false; View lastView = null; for (int i = 0; i < size; i++) { View radio = radioGroup.getChildAt(i); View content = radioContent.getChildAt(i); if (lastView != null) { radio.setAccessibilityTraversalAfter(lastView.getId()); } View contentClick = findFirstClickable(content); if (contentClick != null) contentClick.setAccessibilityTraversalAfter(radio.getId()); lastView = findLastClickable(content); if (radio.getLayoutParams().height != content.getMeasuredHeight()) { hasChanges = true; radio.getLayoutParams().height = content.getMeasuredHeight(); Loading @@ -59,4 +66,28 @@ public class ZenRadioLayout extends LinearLayout { super.onMeasure(widthMeasureSpec, heightMeasureSpec); } } private View findFirstClickable(View content) { if (content.isClickable()) return content; if (content instanceof ViewGroup) { ViewGroup group = (ViewGroup) content; for (int i = 0; i < group.getChildCount(); i++) { View v = findFirstClickable(group.getChildAt(i)); if (v != null) return v; } } return null; } private View findLastClickable(View content) { if (content.isClickable()) return content; if (content instanceof ViewGroup) { ViewGroup group = (ViewGroup) content; for (int i = group.getChildCount() - 1; i >= 0; i--) { View v = findLastClickable(group.getChildAt(i)); if (v != null) return v; } } return null; } }