blob: 5fa270ecfb3f5862e3ca559047afe49b8e7169cd [file] [log] [blame] [view]
Theresa Wellingtonb0767a72019-10-01 00:17:461# Chrome for Android UI
2
3## Ramping-up
4
5Android has a number of [developer guides](https://developer.android.com/guide) that are helpful for getting ramped up on general Android development. We recommend reading the following as primers for developing UI:
6
7 * [Application fundamentals](https://developer.android.com/guide/components/fundamentals)
8 * [Providing resources](https://developer.android.com/guide/topics/resources/providing-resources.html)
9 * [Layouts](https://developer.android.com/guide/topics/ui/declaring-layout)
10 * [Introduction to activities](https://developer.android.com/guide/components/activities/intro-activities)
11
12
13## Colors and text styles
14
15Chrome for Android has a color palette defined in [//ui/android/java/res/values/color_palette.xml](/ui/android/java/res/values/color_palette.xml) and a set of reusable semantic colors defined in [//ui/android/java/res/values/colors.xml](/ui/android/java/res/values/colors.xml). The semantic colors from colors.xml should be used to ensure colors adapt properly for dark mode and can be consistently and easily updated during product-wide visual refreshes.
16
17For more information on selecting the right color, see [Night Mode on Chrome Android](night_mode.md).
18
19## Widgets
20
21The Chromium code base contains a number of wrappers around Android classes (to smooth over bugs or save on binary size) and many UI widgets that provide Chrome-specific behavior and/or styling.
22
23These can be found in [//chrome/browser/ui/android/widget/](/chrome/browser/ui/android/widget/), [//ui/android/](/ui/android/), and [//chrome/android/java/src/org/chromium/chrome/browser/widget/](/chrome/android/java/src/org/chromium/chrome/browser/widget/). There is an ongoing effort to consolidate all widgets in //chrome/browser/ui/android/widget/.
24
25## MVC
26
27UI development should follow a modified Model-View-Controller pattern. MVC base classes live in [//ui/android/java/src/org/chromium/ui/modelutil](/ui/android/java/src/org/chromium/ui/modelutil/).
28
29The following guides introduce MVC in Chrome for Android:
30
31 * [So, you want to do MVC...](mvc_architecture_tutorial.md)
32 * [Simple Lists in MVC Land](mvc_simple_list_tutorial.md)
33 * [Simple RecyclerView use in MVC](mvc_simple_recycler_view_tutorial.md)
34 * [So, you want to test MVC...](mvc_testing.md)