Skip to content

Commit

Permalink
add functions for pip option
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishan09811 authored Feb 23, 2024
1 parent 41c6ebc commit 00d71d2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public void onCreatePreferences(@Nullable Bundle savedInstanceState, @Nullable S
setActivityTitle(R.string.advanced_options);

setItemClick("performanceMonitor", pref -> GlobalConfig.set(GlobalConfig.KEY_SHOW_PERFORMANCE_OVERLAY, ((SwitchPreferenceCompat) pref).isChecked()));
setItemClick("pictureInPicture", pref -> GlobalConfig.set(GlobalConfig.KEY_PICTURE_IN_PICTURE, ((SwitchPreferenceCompat) pref).isChecked()));
setItemClick("shaderJit", pref -> GlobalConfig.set(GlobalConfig.KEY_SHADER_JIT, ((SwitchPreferenceCompat) pref).isChecked()));
setItemClick("loggerService", pref -> {
boolean checked = ((SwitchPreferenceCompat) pref).isChecked();
Expand All @@ -43,7 +44,13 @@ public void onResume() {

private void refresh() {
((SwitchPreferenceCompat) findPreference("performanceMonitor")).setChecked(GlobalConfig.get(GlobalConfig.KEY_SHOW_PERFORMANCE_OVERLAY));
((SwitchPreferenceCompat) findPreference("pictureInPicture")).setChecked(GlobalConfig.get(GlobalConfig.KEY_PICTURE_IN_PICTURE));
((SwitchPreferenceCompat) findPreference("loggerService")).setChecked(GlobalConfig.get(GlobalConfig.KEY_LOGGER_SERVICE));
((SwitchPreferenceCompat) findPreference("shaderJit")).setChecked(GlobalConfig.get(GlobalConfig.KEY_SHADER_JIT));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
((SwitchPreferenceCompat) findPreference("pictureInPicture").setEnabled(true));
} else {
((SwitchPreferenceCompat) findPreference("pictureInPicture").setEnabled(false));
((SwitchPreferenceCompat) findPreference("pictureInPicture").setSummary("Your Device isn't supported this feature"));
}
}

0 comments on commit 00d71d2

Please sign in to comment.