Chris Banes | 3795dec | 2014-07-28 10:46:20 +0100 | [diff] [blame] | 1 | ========================================== |
| 2 | |
| 3 | appcompat themes structure |
| 4 | |
| 5 | ========================================== |
| 6 | |
| 7 | The themes structure in appcompat is complex since we |
| 8 | need to deal with attributes and styles which are available |
| 9 | at differing platform versions. |
| 10 | |
| 11 | The structure is as so: |
| 12 | |
| 13 | <- denote inherits from. |
| 14 | |
| 15 | --------------------- |
| 16 | Fourth level themes (Platform) |
| 17 | --------------------- |
| 18 | These are the base themes and allow us to switch out the framework base |
| 19 | theme automatically. These should setup the framework theme ready so |
| 20 | that they are the theme is mostly the same on all platform versions. |
| 21 | |
| 22 | Example: |
| 23 | values-v11/ |
| 24 | Platform.AppCompat <- android:Theme.Holo |
| 25 | |
| 26 | |
| 27 | --------------------- |
| 28 | Third level |
| 29 | --------------------- |
| 30 | Platform specific themes which inherit from the previous platform version. These allows us |
| 31 | to build up the theme across platforms. These themes do most of the work. |
| 32 | |
| 33 | Example: |
| 34 | (various) values/ values-v21/ |
| 35 | Platform.AppCompat <- Base.V7.Theme.AppCompat <- Base.V21.Theme.AppCompat |
| 36 | |
| 37 | |
| 38 | --------------------- |
| 39 | Second level |
| 40 | --------------------- |
| 41 | There are the themes which are pointers to the correct third level theme. |
| 42 | They can also be used to set attributes for that specific platform (and platforms up until the |
| 43 | next declaration). |
| 44 | |
| 45 | Because of this, every time there is a third level theme set, there should be a second level |
| 46 | theme pointing to it. This is so that devices do not use themes from newer and unavailable |
| 47 | platforms. |
| 48 | |
| 49 | Names: Theme.Base.AppCompat, Theme.Base.AppCompat.Light and Theme.Base.AppCompat.Light.DarkActionBar |
| 50 | |
| 51 | Example: |
| 52 | values-v21/ |
| 53 | Theme.V21.Base.AppCompat <- Theme.Base.AppCompat |
| 54 | |
| 55 | --------------------- |
| 56 | Top level themes |
| 57 | --------------------- |
| 58 | These are the themes to be used directly by developers. These inherit from |
| 59 | the second level relevant second level theme below. |
| 60 | |
| 61 | Names: Theme.AppCompat, Theme.AppCompat.Light and Theme.AppCompat.Light.DarkActionBar |
| 62 | |
| 63 | Example: |
| 64 | values/ |
| 65 | Theme.AppCompat <- Theme.Base.AppCompat |