


In the greyscales section, white, black, and grey colors are defined - the naming rule is important. It is not good to make too many sections it is enough to divide simple sections. I divided it into two sections: Greyscales and Quipper colors. If there are designers in your team, it is better to design colors with them. It defines all the colors that are used in our app. In my opinion, colors.xml should be like a color palette. When you refactor resources, it’s better to start to modify colors and dimens first. There is a dependency between styles, and colors, and dimens.įor example, this text caption style depends on grey colors in colors.xml and 12 dp in 1.3 line spacing in dimens.xml. Finally, I changed drawable names, such as icons, images, and selectors. Next, I extracted themes.xml from styles.xml, then created and applied a new styles.xml. Styles and drawables depend on them (as I discovered later). Refactoring Stepsįirst, I modified colors.xml and dimens.xml because they are the most primitive resources in Android. These complex resources made development speed slower and made it hard to keep unification of the design.

In the case of our app, there were many similar tables and styles, no naming rules, and many colors and dimens were written directly. Today, I want to talk about how I refactored.Īfter this session maybe you can imagine how you can refactor resources in your app, and judge if you have to refactor resources or not. After some trial and error, I found the best way to manage the resources. When I joined Quipper, there were different similar styles XML and complex colors XML. Some features are different but almost appear the same. They are the same code, but divided by product flavor. We have two products for many countries: StudySapuri for Japan, and Quipper for Global (Indonesia, Philippine, and Mexico). It was a hard task because the resources were lawless: some text was written out directly, there were so many colors and styles… Also, the structure of our app makes resources more complex. I joined Quipper Limited last June, and I helped change their design two times in eight months. I sometimes create private projects, including the DroidKaigi 2017 official conference app. I’m Yusuke Konishi, and I work at Quipper Limited.
