use of com.android.tools.idea.editors.theme.datamodels.ConfiguredThemeEditorStyle in project android by JetBrains.
the class ConfiguredThemeEditorStyleTest method testThemeOverride.
/**
* Test that the main theme will override the one from the library
*/
public void testThemeOverride() {
VirtualFile virtualFile = myFixture.copyFileToProject("themeEditor/themeEditorStyle/styles.xml", "res/values/styles.xml");
myFixture.copyFileToProject("themeEditor/themeEditorStyle/styles_1.xml", "additionalModules/moduleA/res/values/styles.xml");
ConfigurationManager configurationManager = myFacet.getConfigurationManager();
Configuration configuration = configurationManager.getConfiguration(virtualFile);
ThemeResolver resolver = new ThemeResolver(configuration);
ConfiguredThemeEditorStyle theme = resolver.getTheme("AppTheme");
assertNotNull(theme);
assertEquals(1, theme.getParentNames().size());
// We expect only the main app parent to be available
assertEquals("ATheme", theme.getParentNames().iterator().next().getElement());
}
Aggregations