Loading res/values/styles.xml +1 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ <style name="RequestRoleViewCheckbox"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:minHeight">40dp</item> <item name="android:minHeight">?android:listPreferredItemHeightSmall</item> <item name="android:paddingStart">16dp</item> <item name="android:textAppearance">@style/android:TextAppearance.Material.Subhead</item> </style> Loading src/com/android/packageinstaller/role/ui/CheckableLinearLayout.java +22 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.packageinstaller.role.ui; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.Checkable; import android.widget.LinearLayout; Loading Loading @@ -71,6 +73,7 @@ public class CheckableLinearLayout extends LinearLayout implements Checkable { mChecked = checked; refreshDrawableState(); updateChildrenChecked(); } @Override Loading @@ -87,4 +90,23 @@ public class CheckableLinearLayout extends LinearLayout implements Checkable { } return state; } private void updateChildrenChecked() { updateChildrenChecked(this, mChecked); } // We call setChecked() on checkable children so that accessibility can get the correct state. private static void updateChildrenChecked(@NonNull ViewGroup viewGroup, boolean checked) { int count = viewGroup.getChildCount(); for (int i = 0; i < count; i++) { View child = viewGroup.getChildAt(i); if (child.isDuplicateParentStateEnabled()) { if (child instanceof Checkable) { ((Checkable) child).setChecked(checked); } else if (child instanceof ViewGroup) { updateChildrenChecked((ViewGroup) child, checked); } } } } } Loading
res/values/styles.xml +1 −1 Original line number Diff line number Diff line Loading @@ -703,7 +703,7 @@ <style name="RequestRoleViewCheckbox"> <item name="android:layout_width">match_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:minHeight">40dp</item> <item name="android:minHeight">?android:listPreferredItemHeightSmall</item> <item name="android:paddingStart">16dp</item> <item name="android:textAppearance">@style/android:TextAppearance.Material.Subhead</item> </style> Loading
src/com/android/packageinstaller/role/ui/CheckableLinearLayout.java +22 −0 Original line number Diff line number Diff line Loading @@ -18,6 +18,8 @@ package com.android.packageinstaller.role.ui; import android.content.Context; import android.util.AttributeSet; import android.view.View; import android.view.ViewGroup; import android.widget.Checkable; import android.widget.LinearLayout; Loading Loading @@ -71,6 +73,7 @@ public class CheckableLinearLayout extends LinearLayout implements Checkable { mChecked = checked; refreshDrawableState(); updateChildrenChecked(); } @Override Loading @@ -87,4 +90,23 @@ public class CheckableLinearLayout extends LinearLayout implements Checkable { } return state; } private void updateChildrenChecked() { updateChildrenChecked(this, mChecked); } // We call setChecked() on checkable children so that accessibility can get the correct state. private static void updateChildrenChecked(@NonNull ViewGroup viewGroup, boolean checked) { int count = viewGroup.getChildCount(); for (int i = 0; i < count; i++) { View child = viewGroup.getChildAt(i); if (child.isDuplicateParentStateEnabled()) { if (child instanceof Checkable) { ((Checkable) child).setChecked(checked); } else if (child instanceof ViewGroup) { updateChildrenChecked((ViewGroup) child, checked); } } } } }