Fix toggle widget can be switched under overlapped view am: 4794b798c4

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Settings/+/12124562

Change-Id: I7d6b33b80c948337b1526fd0becfbe87d535895b
This commit is contained in:
Sunny Shao
2020-07-10 07:09:48 +00:00
committed by Automerger Merge Worker
3 changed files with 6 additions and 3 deletions

View File

@@ -36,7 +36,8 @@ public class AppSwitchPreference extends SwitchPreference {
super.onBindViewHolder(holder);
final View switchView = holder.findViewById(android.R.id.switch_widget);
if (switchView != null) {
switchView.setFilterTouchesWhenObscured(true);
final View rootView = switchView.getRootView();
rootView.setFilterTouchesWhenObscured(true);
}
}
}

View File

@@ -52,7 +52,8 @@ public class FilterTouchesRestrictedSwitchPreference extends RestrictedSwitchPre
super.onBindViewHolder(holder);
final View switchView = holder.findViewById(android.R.id.switch_widget);
if (switchView != null) {
switchView.setFilterTouchesWhenObscured(true);
final View rootView = switchView.getRootView();
rootView.setFilterTouchesWhenObscured(true);
}
}
}

View File

@@ -50,7 +50,8 @@ public class FilterTouchesSwitchPreference extends SwitchPreference {
super.onBindViewHolder(holder);
final View switchView = holder.findViewById(android.R.id.switch_widget);
if (switchView != null) {
switchView.setFilterTouchesWhenObscured(true);
final View rootView = switchView.getRootView();
rootView.setFilterTouchesWhenObscured(true);
}
}
}