@@ -78,6 +78,7 @@ public class LauncherSettingPage extends FCLCommonPage implements View.OnClickLi
7878 private FCLButton clearCache ;
7979 private FCLButton exportLog ;
8080 private FCLButton requestAudioRecord ;
81+ private FCLSwitch autoExitLauncher ;
8182 private FCLButton theme ;
8283 private FCLButton theme2 ;
8384 private FCLButton ltBackground ;
@@ -112,11 +113,13 @@ public LauncherSettingPage(Context context, int id, FCLUILayout parent, int resI
112113 @ Override
113114 public void onCreate () {
114115 super .onCreate ();
116+ SharedPreferences sharedPreferences = getActivity ().getSharedPreferences ("launcher" , MODE_PRIVATE );
115117 language = findViewById (R .id .language );
116118 checkUpdate = findViewById (R .id .check_update );
117119 clearCache = findViewById (R .id .clear_cache );
118120 exportLog = findViewById (R .id .export_log );
119121 requestAudioRecord = findViewById (R .id .request_audio_record );
122+ autoExitLauncher = findViewById (R .id .auto_exit_launcher );
120123 theme = findViewById (R .id .theme );
121124 theme2 = findViewById (R .id .theme2 );
122125 ltBackground = findViewById (R .id .background_lt );
@@ -184,6 +187,9 @@ public void onCreate() {
184187 language .setSelection (LocaleUtils .getLanguage (getContext ()));
185188 language .setOnItemSelectedListener (this );
186189
190+ autoExitLauncher .setChecked (sharedPreferences .getBoolean ("autoExitLauncher" , false ));
191+ autoExitLauncher .setOnCheckedChangeListener (this );
192+
187193 ignoreNotch .setChecked (ThemeEngine .getInstance ().getTheme ().isFullscreen ());
188194 ignoreNotch .setOnCheckedChangeListener (this );
189195
@@ -195,7 +201,6 @@ public void onCreate() {
195201 animationSpeed .progressProperty ().bindBidirectional (ThemeEngine .getInstance ().getTheme ().animationSpeedProperty ());
196202 ThemeEngine .getInstance ().getTheme ().animationSpeedProperty ().addListener (observable -> Theme .saveTheme (getContext (), ThemeEngine .getInstance ().getTheme ()));
197203
198- SharedPreferences sharedPreferences = getActivity ().getSharedPreferences ("launcher" , MODE_PRIVATE );
199204 vibrationDuration .setProgress (sharedPreferences .getInt ("vibrationDuration" , 100 ));
200205 vibrationDuration .addProgressListener ();
201206 vibrationDuration .progressProperty ().addListener (observable -> {
@@ -529,15 +534,17 @@ public void onNothingSelected(AdapterView<?> parent) {
529534
530535 @ Override
531536 public void onCheckedChanged (CompoundButton buttonView , boolean isChecked ) {
537+ SharedPreferences sharedPreferences = getActivity ().getSharedPreferences ("launcher" , MODE_PRIVATE );
532538 if (buttonView == ignoreNotch ) {
533539 ThemeEngine .getInstance ().applyAndSave (getContext (), getActivity ().getWindow (), isChecked );
534540 getActivity ().getWindow ().setFlags (WindowManager .LayoutParams .FLAG_LAYOUT_IN_SCREEN , WindowManager .LayoutParams .FLAG_LAYOUT_IN_SCREEN );
535541 } else if (buttonView == closeSkinModel ) {
536542 ThemeEngine .getInstance ().getTheme ().setiIgnoreSkinContainer (isChecked );
537543 Theme .saveTheme (getContext (), ThemeEngine .getInstance ().getTheme ());
538544 } else if (buttonView == disableFullscreenInput ) {
539- SharedPreferences sharedPreferences = getActivity ().getSharedPreferences ("launcher" , MODE_PRIVATE );
540545 sharedPreferences .edit ().putBoolean ("disableFullscreenInput" , isChecked ).apply ();
546+ } else if (buttonView == autoExitLauncher ) {
547+ sharedPreferences .edit ().putBoolean ("autoExitLauncher" , isChecked ).apply ();
541548 }
542549 }
543550}
0 commit comments