File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
app/src/main/java/me/zhanghai/android/textselectionwebsearch Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change 66package me .zhanghai .android .textselectionwebsearch ;
77
88import android .content .SharedPreferences ;
9+ import android .os .Build ;
910import android .os .Bundle ;
1011import android .preference .Preference ;
1112import android .preference .PreferenceActivity ;
1213import android .preference .PreferenceScreen ;
1314import android .text .TextUtils ;
15+ import android .view .ViewGroup ;
1416
1517import androidx .annotation .NonNull ;
1618import androidx .annotation .Nullable ;
@@ -27,6 +29,14 @@ public class SettingsActivity extends PreferenceActivity
2729 protected void onCreate (@ Nullable Bundle savedInstanceState ) {
2830 super .onCreate (savedInstanceState );
2931
32+ if (Build .VERSION .SDK_INT == Build .VERSION_CODES .VANILLA_ICE_CREAM ) {
33+ // Work around the issue that the fix for edge-to-edge enforcement
34+ // https://android.googlesource.com/platform/frameworks/base/+/213033ecf41f17aebd766abfa7af7c789f245ff7
35+ // is only available on V QPR2 and above.
36+ final ViewGroup contentView = requireViewById (android .R .id .content );
37+ contentView .getChildAt (0 ).setFitsSystemWindows (true );
38+ }
39+
3040 addPreferencesFromResource (R .xml .settings );
3141
3242 // android.R.attr.preferenceListStyle isn't a public API.
You can’t perform that action at this time.
0 commit comments