tree: 4e529d1b224cc782555fca41c575f5141091e196 [path history] [tgz]
  1. android/
  2. DEPS
  3. DIR_METADATA
  4. OWNERS
  5. README.md
components/browser_ui/settings/README.md

Chromium for Android Settings

Getting Started

The Android developer Settings guide is the best place to start before contributing to Chromium for Android's settings.

Helper Classes

Many common utility functions that are useful for developing settings screens in Chromium for Android can be found in //components/browser_ui/settings/android.

Widgets

The widget subdirectory contains a number of extensions of AndroidX Preference classes that provide Chromium-specific behavior (like Managed preferences) or common Chromium UI components (like buttons).

The base Preference classes included in the AndroidX Preference library can also be used directly in Chromium for Android Settings screens.

Naming conventions

Historically, the term “preferences” is heavily overloaded in Chromium for Android. Some disambiguations are already conventional in Chromium for Android, but are not always applied consistently, so we document those usages explicitly below.

Because the screens shown above tend to be informally referred to as “Settings” (and are labeled as such in the application), going forward we will prefer the term “Settings” in code over “Preferences” to refer to classes and target names dealing with these UIs.

More information see go/clank-preferences-refactor.

“Preferences” UsageDisambiguation
Activity name, as in Preferences.javaUse “Settings” i.e. SettingsActivity
Preference fragment, extending PreferenceFragmentSuffix with ‘Settings’.Fragment suffix is still also acceptable i.e. ‘SettingsFragment’
Individual preferences, extending androidx.preference.PreferenceNo change, adhere to Android conventions
Collection of individual preferences in XML, used with addPreferencesFromResource()No change, adhere to Android conventions
Android SharedPreferences, as in android.content.SharedPreferencesAlways keep “Shared” prefix
Chrome Native preferences, as in components/prefs/pref_service.hAlways refer to with the abbreviated “prefs”, adhering to Chrome conventions