22
33import androidx .annotation .Nullable ;
44import androidx .preference .Preference ;
5+ import androidx .preference .PreferenceCategory ;
56import androidx .preference .SwitchPreferenceCompat ;
67
78import io .github .sspanak .tt9 .R ;
@@ -25,6 +26,7 @@ public class AppearanceScreen extends ScreenWithPreviewKeyboardHeaderFragment {
2526 protected void onCreate () {
2627 super .onCreate ();
2728 createMainSection ();
29+ createUnfoldedAppearanceSection ();
2830 createHacksSection ();
2931 enablePreviewOnChange ();
3032 resetFontSize (true );
@@ -46,11 +48,6 @@ protected void createMainSection() {
4648 return ;
4749 }
4850
49- UnfoldedAppearanceLink unfoldedLink = findPreference (UnfoldedAppearanceLink .NAME );
50- if (unfoldedLink != null ) {
51- unfoldedLink .populate (activity );
52- }
53-
5451 (new ItemStatusIcon (findPreference (ItemStatusIcon .NAME ), activity .getSettings ())).populate ();
5552 (new ItemSuggestionSmoothScroll (findPreference (ItemSuggestionSmoothScroll .NAME ), activity .getSettings ())).populate ();
5653
@@ -133,6 +130,24 @@ protected void createMainSection() {
133130 }
134131
135132
133+ private void createUnfoldedAppearanceSection () {
134+ if (activity == null ) {
135+ return ;
136+ }
137+
138+
139+ UnfoldedAppearanceLink unfoldedLink = findPreference (UnfoldedAppearanceLink .NAME );
140+ if (unfoldedLink != null ) {
141+ unfoldedLink .populate (activity );
142+ }
143+
144+ PreferenceCategory category = findPreference ("category_unfolded_appearance" );
145+ if (category != null ) {
146+ category .setVisible (unfoldedLink != null && unfoldedLink .isVisible ());
147+ }
148+ }
149+
150+
136151 private void createHacksSection () {
137152 if (activity == null ) {
138153 return ;
0 commit comments