Loading res/xml/game_driver_settings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ </PreferenceCategory> <com.android.settingslib.widget.FooterPreference android:key="footer_preference" android:key="game_driver_footer" android:title="@string/game_driver_footer_text" android:selectable="false" settings:controller="com.android.settings.development.gamedriver.GameDriverFooterPreferenceController"> Loading res/xml/night_display_settings.xml +15 −11 Original line number Diff line number Diff line Loading @@ -53,7 +53,11 @@ settings:controller="com.android.settings.display.NightDisplayActivationPreferenceController"/> <PreferenceCategory android:key="night_display_footer_category"> <com.android.settingslib.widget.FooterPreference /> <com.android.settingslib.widget.FooterPreference android:key="night_display_footer" android:title="@string/night_display_text" android:selectable="false" settings:controller="com.android.settings.display.NightDisplayFooterPreferenceController"/> </PreferenceCategory> </PreferenceScreen> No newline at end of file res/xml/time_zone_prefs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ android:title="@string/date_time_set_timezone_title" android:summary="@string/summary_placeholder" /> <com.android.settingslib.widget.FooterPreference android:key="footer_preference" android:key="timezone_footer" settings:controller="com.android.settings.datetime.timezone.TimeZoneInfoPreferenceController" /> </PreferenceCategory> Loading src/com/android/settings/datetime/timezone/TimeZoneInfoPreferenceController.java +7 −15 Original line number Diff line number Diff line Loading @@ -29,20 +29,19 @@ import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; import com.android.settings.R; import com.android.settingslib.widget.FooterPreference; import com.android.settings.core.BasePreferenceController; import java.util.Date; public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceController { public class TimeZoneInfoPreferenceController extends BasePreferenceController { private static final String PREFERENCE_KEY = FooterPreference.KEY_FOOTER; @VisibleForTesting Date mDate; private TimeZoneInfo mTimeZoneInfo; private final DateFormat mDateFormat; public TimeZoneInfoPreferenceController(Context context) { super(context, PREFERENCE_KEY); public TimeZoneInfoPreferenceController(Context context, String key) { super(context, key); mDateFormat = DateFormat.getDateInstance(SimpleDateFormat.LONG); mDateFormat.setContext(DisplayContext.CAPITALIZATION_NONE); mDate = new Date(); Loading @@ -50,24 +49,18 @@ public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceCont @Override public int getAvailabilityStatus() { return AVAILABLE; return mTimeZoneInfo != null ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE; } @Override public void updateState(Preference preference) { CharSequence formattedTimeZone = mTimeZoneInfo == null ? "" : formatInfo(mTimeZoneInfo); preference.setTitle(formattedTimeZone); preference.setVisible(mTimeZoneInfo != null); public CharSequence getSummary() { return mTimeZoneInfo == null ? "" : formatInfo(mTimeZoneInfo); } public void setTimeZoneInfo(TimeZoneInfo timeZoneInfo) { mTimeZoneInfo = timeZoneInfo; } public TimeZoneInfo getTimeZoneInfo() { return mTimeZoneInfo; } private CharSequence formatOffsetAndName(TimeZoneInfo item) { String name = item.getGenericName(); if (name == null) { Loading Loading @@ -130,5 +123,4 @@ public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceCont } while (transition != null); return transition; } } src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceController.java +5 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.Looper; import android.provider.Settings; import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; Loading @@ -48,8 +47,8 @@ public class GameDriverFooterPreferenceController extends BasePreferenceControll private FooterPreference mPreference; public GameDriverFooterPreferenceController(Context context) { super(context, FooterPreference.KEY_FOOTER); public GameDriverFooterPreferenceController(Context context, String key) { super(context, key); mContentResolver = context.getContentResolver(); mGameDriverContentObserver = new GameDriverContentObserver(new Handler(Looper.getMainLooper()), this); Loading Loading @@ -80,11 +79,6 @@ public class GameDriverFooterPreferenceController extends BasePreferenceControll mGameDriverContentObserver.unregister(mContentResolver); } @Override public void updateState(Preference preference) { preference.setVisible(isAvailable()); } @Override public void onGameDriverContentChanged() { updateState(mPreference); Loading Loading
res/xml/game_driver_settings.xml +1 −1 Original line number Diff line number Diff line Loading @@ -37,7 +37,7 @@ </PreferenceCategory> <com.android.settingslib.widget.FooterPreference android:key="footer_preference" android:key="game_driver_footer" android:title="@string/game_driver_footer_text" android:selectable="false" settings:controller="com.android.settings.development.gamedriver.GameDriverFooterPreferenceController"> Loading
res/xml/night_display_settings.xml +15 −11 Original line number Diff line number Diff line Loading @@ -53,7 +53,11 @@ settings:controller="com.android.settings.display.NightDisplayActivationPreferenceController"/> <PreferenceCategory android:key="night_display_footer_category"> <com.android.settingslib.widget.FooterPreference /> <com.android.settingslib.widget.FooterPreference android:key="night_display_footer" android:title="@string/night_display_text" android:selectable="false" settings:controller="com.android.settings.display.NightDisplayFooterPreferenceController"/> </PreferenceCategory> </PreferenceScreen> No newline at end of file
res/xml/time_zone_prefs.xml +1 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,7 @@ android:title="@string/date_time_set_timezone_title" android:summary="@string/summary_placeholder" /> <com.android.settingslib.widget.FooterPreference android:key="footer_preference" android:key="timezone_footer" settings:controller="com.android.settings.datetime.timezone.TimeZoneInfoPreferenceController" /> </PreferenceCategory> Loading
src/com/android/settings/datetime/timezone/TimeZoneInfoPreferenceController.java +7 −15 Original line number Diff line number Diff line Loading @@ -29,20 +29,19 @@ import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; import com.android.settings.R; import com.android.settingslib.widget.FooterPreference; import com.android.settings.core.BasePreferenceController; import java.util.Date; public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceController { public class TimeZoneInfoPreferenceController extends BasePreferenceController { private static final String PREFERENCE_KEY = FooterPreference.KEY_FOOTER; @VisibleForTesting Date mDate; private TimeZoneInfo mTimeZoneInfo; private final DateFormat mDateFormat; public TimeZoneInfoPreferenceController(Context context) { super(context, PREFERENCE_KEY); public TimeZoneInfoPreferenceController(Context context, String key) { super(context, key); mDateFormat = DateFormat.getDateInstance(SimpleDateFormat.LONG); mDateFormat.setContext(DisplayContext.CAPITALIZATION_NONE); mDate = new Date(); Loading @@ -50,24 +49,18 @@ public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceCont @Override public int getAvailabilityStatus() { return AVAILABLE; return mTimeZoneInfo != null ? AVAILABLE_UNSEARCHABLE : UNSUPPORTED_ON_DEVICE; } @Override public void updateState(Preference preference) { CharSequence formattedTimeZone = mTimeZoneInfo == null ? "" : formatInfo(mTimeZoneInfo); preference.setTitle(formattedTimeZone); preference.setVisible(mTimeZoneInfo != null); public CharSequence getSummary() { return mTimeZoneInfo == null ? "" : formatInfo(mTimeZoneInfo); } public void setTimeZoneInfo(TimeZoneInfo timeZoneInfo) { mTimeZoneInfo = timeZoneInfo; } public TimeZoneInfo getTimeZoneInfo() { return mTimeZoneInfo; } private CharSequence formatOffsetAndName(TimeZoneInfo item) { String name = item.getGenericName(); if (name == null) { Loading Loading @@ -130,5 +123,4 @@ public class TimeZoneInfoPreferenceController extends BaseTimeZonePreferenceCont } while (transition != null); return transition; } }
src/com/android/settings/development/gamedriver/GameDriverFooterPreferenceController.java +5 −11 Original line number Diff line number Diff line Loading @@ -26,7 +26,6 @@ import android.os.Looper; import android.provider.Settings; import androidx.annotation.VisibleForTesting; import androidx.preference.Preference; import androidx.preference.PreferenceScreen; import com.android.settings.core.BasePreferenceController; Loading @@ -48,8 +47,8 @@ public class GameDriverFooterPreferenceController extends BasePreferenceControll private FooterPreference mPreference; public GameDriverFooterPreferenceController(Context context) { super(context, FooterPreference.KEY_FOOTER); public GameDriverFooterPreferenceController(Context context, String key) { super(context, key); mContentResolver = context.getContentResolver(); mGameDriverContentObserver = new GameDriverContentObserver(new Handler(Looper.getMainLooper()), this); Loading Loading @@ -80,11 +79,6 @@ public class GameDriverFooterPreferenceController extends BasePreferenceControll mGameDriverContentObserver.unregister(mContentResolver); } @Override public void updateState(Preference preference) { preference.setVisible(isAvailable()); } @Override public void onGameDriverContentChanged() { updateState(mPreference); Loading