• Home
Name Date Size #Lines LOC

..--

base/03-May-2024-600332

common/03-May-2024-1,4741,158

hidden/03-May-2024-29690

res/03-May-2024-2,214820

README.mdD03-May-20243.4 KiB7656

README.md

1# How to use this directory
2
3First thing to note, it's imperative that the application and all activities
4inherit from the styles outlined in theme/base. If an Activity doesn\'t specify
5a style for it's theme, it automatically inherits one from the Application. And
6this hierarchy continues: Application > Activity > Fragment > View > View > ...
7
8## theme/base
9
10This is where the base application themes, activity themes and application wide
11style attributes live.
12
13What is an attribute? There are three types (depending on how you want to define
14them):
15
16*   Legacy Android attributes (android:colorPrimary). These are defined by the
17    Android framework and they exist to allow developers easily custom Android
18    provided widgets.
19
20*   Appcompat Android attributes (colorPrimary). There are also defined by the
21    Android framework but they only exist to customize AppCompat widgets. After
22    the framework was more mature, the team realized that they needed to add
23    more customization to their widgets, so they created the AppCompat variant
24    with all of the same attributes plus some. *Note:* Unfortunately our app
25    uses both Legacy Widgets and AppCompat widgets, so when you define an
26    AppCompat attribute in a style, be sure to also define the Legacy version as
27    well if it exists.
28
29*   Custom application attributes (colorIcon). It goes without saying that the
30    names can't collide with the framework attributes. These attributes server
31    to satisfy what the framework doesn't. For example, the framework doesn't
32    provide an attribute to tint all of your ImageViews (why would it?), so we
33    created the colorIcon attribute to apply to all ImageViews that show quantum
34    icons/assets that need to be tinted.
35
36Styles in this package follow a naming convention of inheritance:
37
38*   Dialer. and Dialer.NoActionBar are the two root themes that should be used
39    to add sdk specific features (like coloring the Android nav bar).
40
41*   Dialer.ThemeBase.ActionBar and Dialer.ThemeBase.NoActionBar are great
42    starting points for Activity style's to inherit from if they need specific
43    customizations.
44
45*   Dialer.ThemeBase.ActionBar.* and Dialer.ThemeBase.NoActionBar.* are
46    specialized app themes intended to change the entire look of the app. For
47    example, Dialer.ThemeBase.NoActionBar.Dark is used for a dark mode theme. If
48    you create a custom theme for an activity, be sure your customization will
49    work for all themes. See dialer/dialpadview/theme for an example.
50
51## theme/common
52
53This is a dumping ground for shared resources. Some examples of what should live
54here:
55
56*   Colors that can't be theme'd (there aren't many of those, so you probably
57    won't do that).
58*   Drawables, images, animations, dimensions, styles, ect. that can be (or are)
59    used throughout the entire app without the need for customization. If you
60    want to customize a specific style for one use case, feel free to override
61    it and store it in your own resource directory.
62
63## theme/private
64
65This package is only visible to theme/base. Things you should never do:
66
67*   Reference anything in here.
68*   Duplicate the resources from this directory into another.
69
70Things you should do:
71
72*   Add colors that are common throughout the entire app and need be themed. For
73    example, text colors, background colors and app primary and accent colors.
74    Each color you add needs to exist in each color_*.xml file where *
75    represents an app theme like 'dark' or 'light'.
76