How to make a certain setting blink to show user which setting need to be changed - Android widget

Viewed 312

I work on Android widget with the ConfigActivity. I have there SettingsFragment which extends PreferenceFragmentCompat. In the Settings, I have a setting which leads a user to the to android.provider.Settings.ACTION_DATE_SETTINGS

Is there any way to make one of the setting "blink" to show the user which setting needs to be changed?

I attached two photos of the "blinking" setting in Chrome when the system prompts a user to enable/disable one of the settings. I could not capture the first bit of the "blinking" effect but it starts from a small white dot, similar to when someone tap on the screen when in developer "Show taps" option is enabled.

I've tried to search for: "blink", "flash" the settings for Android but I found nothing. Any help would be appreciated.

Middle part of the "blink" effect

Final part of the "blink" effect

1 Answers
val EXTRA_FRAGMENT_ARG_KEY = ":settings:fragment_args_key"
val EXTRA_SHOW_FRAGMENT_ARGUMENTS = ":settings:show_fragment_args"

val args = bundleOf(
    EXTRA_FRAGMENT_ARG_KEY to "24 hour"
)
val intent = Intent(Settings.ACTION_DATE_SETTINGS).apply {
    putExtra(EXTRA_SHOW_FRAGMENT_ARGUMENTS, args)
}

startActivity(intent)

Titles in "Date & time" settings page and correspond preference keys:

  • Use network-provided time - auto_time
  • Date - date
  • Time - time
  • Use network-provided time zone - auto_zone
  • Time zone - timezone
  • Use locale default - auto_24hour
  • Use 24-hour format - 24 hour

Those preference keys followed AOSP(date_time_prefs.xml), however, OEMs can modify those preference keys on their devices(small possibility), it may be not working on some devices.

References:

Related