LocalePreferences

Provides friendly APIs to get the user's locale preferences. The data can refer to external/cldr/common/main/en.xml.

Types

Link copied to clipboard
open class CalendarType
APIs to get the user's preference of Calendar.
Link copied to clipboard
open class FirstDayOfWeek
APIs to get the user's preference of the first day of week.
Link copied to clipboard
open class HourCycle
APIs to get the user's preference of the hour cycle.
Link copied to clipboard
open class TemperatureUnit
APIs to get the user's preference of temperature unit.

Functions

Link copied to clipboard
Return the user's preference of the calendar type which is from getDefault.
open fun getCalendarType(resolved: Boolean): String
Return the user's preference of the calendar type which is from getDefault, e.g.
Return the calendar type of the inputted Locale.
open fun getCalendarType(@NonNull locale: Locale, resolved: Boolean): String
Return the calendar type of the inputted Locale, e.g.
Link copied to clipboard
Return the user's preference of the first day of week which is from getDefault.
Return the user's preference of the first day of week which is from getDefault, e.g.
Return the first day of week of the inputted Locale.
open fun getFirstDayOfWeek(@NonNull locale: Locale, resolved: Boolean): String
Return the first day of week of the inputted Locale, e.g.
Link copied to clipboard
Return the user's preference of the hour cycle which is from getDefault.
open fun getHourCycle(resolved: Boolean): String
Return the user's preference of the hour cycle which is from getDefault, e.g.
open fun getHourCycle(@NonNull locale: Locale, resolved: Boolean): String
Return the hour cycle setting of the inputted Locale.
Link copied to clipboard
Return the user's preference of the temperature unit which is from getDefault.
Return the user's preference of the temperature unit which is from getDefault, e.g.
open fun getTemperatureUnit(@NonNull locale: Locale, resolved: Boolean): String
Return the temperature unit of the inputted Locale.