Interface DynamicLocale


public interface DynamicLocale
An interface to implement the dynamic locale throughout the app.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Constant value for the Hindi locale.
    static final String
    Constant value for the Indonesian locale.
    static final String
    Constant value for the Portuguese locale.
    static final String
    Constant value for the Russian locale.
    static final String
    Constant value for the Spanish locale.
    static final String
    Dynamic locale splitter to separate language, country, etc.
    static final String
    Constant value for the system locale.
    static final String
    Constant value for the Turkish locale.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the default locale to be used if no dynamic locale support is provided.
    float
    Returns the font scale to be applied.
    Returns the locale to be applied.
    Returns an array of supported locales.
    setLocale(Context context)
    Apply the locale according to the configuration.
  • Field Details

  • Method Details

    • getSupportedLocales

      @Nullable String[] getSupportedLocales()
      Returns an array of supported locales.
      Returns:
      The array of supported locales.
      See Also:
    • getDefaultLocale

      @NonNull Locale getDefaultLocale(@NonNull Context context)
      Returns the default locale to be used if no dynamic locale support is provided.
      Parameters:
      context - The context to get configuration.
      Returns:
      The default locale to be used if no dynamic locale support is provided.
      See Also:
    • getLocale

      @Nullable Locale getLocale()
      Returns the locale to be applied.
      Returns:
      The locale to be applied.
      See Also:
    • setLocale

      @NonNull Context setLocale(@NonNull Context context)
      Apply the locale according to the configuration.
      Parameters:
      context - The context to set the locale.
      Returns:
      The modified context after applying the locale.
    • getFontScale

      float getFontScale()
      Returns the font scale to be applied.
      Returns:
      The font scale to be applied.