Documente Academic
Documente Profesional
Documente Cultură
Chaitanya Varier
University of Waterloo
1. Context
5. Conclusion
1
Context
Motivation
”I’m afraid I have some bad news. Our users want a new UI.”
2
Motivation (contd.)
Your skin starts turning paler and paler, and your blood starts
curdling as you cringe at the thought of having to refactor the entire
app from the ground-up.
But little did you realize that your boss actually said,
3
Motivation
4
Approach 1: The UiModeManager
The UiModeManager
5
The UiModeManager (contd.)
Advantages:
Disadvantages:
6
Approach 2: Programmatic
Theming
Programmatic Theming
7
Programmatic Theming (contd.)
8
Programmatic Theming (contd.)
We’d then use our interface to notify a ThemeEngine class when each
Activity and Fragment is ready to be themed (during its lifecycle).
Upon being given a ready signal, we would apply our View hierarchy
traversal algorithm.
9
Programmatic Theming (contd.)
Advantages:
Disadvantages:
10
Approach 3: Styles and Custom
Attributes
Styles and Custom Attributes
Styles provide encapsulation and let the developer abstract away the
UI’s appearance from its function.
11
Styles and Custom Attributes (contd.)
Advantages:
Disadvantages:
12
Styles and Custom Attributes (contd.)
13
Conclusion
Conclusion
14
Questions?
14