public ThemeStyleSet copy() { ThemeStyleSet themeStyleSet = new ThemeStyleSet(); themeStyleSet.styles.addAll(this.styles); return themeStyleSet; }
@HiddenApi @Implementation public Number createTheme() { synchronized (nativeThemes) { long nativePtr = nextInternalThemeId++; nativeThemes.put(nativePtr, new NativeTheme(new ThemeStyleSet())); return castNativePtr(nativePtr); } }
@Before public void setUp() throws Exception { themeStyleSet = new ThemeStyleSet(); }
private Style resolveStyle(@Nonnull ResName themeStyleName, Style themeStyleSet) { TypedResource themeStyleResource = resourceTable.getValue(themeStyleName, config); if (themeStyleResource == null) return null; StyleData themeStyleData = (StyleData) themeStyleResource.getData(); if (themeStyleSet == null) { themeStyleSet = new ThemeStyleSet(); } return new StyleResolver(resourceTable, legacyShadowOf(AssetManager.getSystem()).getResourceTable(), themeStyleData, themeStyleSet, themeStyleName, config); }
@Test public void shouldFindAttributesFromAnAppliedStyle() throws Exception { themeStyleSet = new ThemeStyleSet(); themeStyleSet.apply(createStyle("style1", createAttribute("string1", "string1 value from style1"), createAttribute("string2", "string2 value from style1") ), false); themeStyleSet.apply(createStyle("style2", createAttribute("string2", "string2 value from style2")), false); assertThat(themeStyleSet.getAttrValue(attrName("string1")).value).isEqualTo("string1 value from style1"); assertThat(themeStyleSet.getAttrValue(attrName("string2")).value).isEqualTo("string2 value from style1"); }
public ThemeStyleSet copy() { ThemeStyleSet themeStyleSet = new ThemeStyleSet(); themeStyleSet.styles.addAll(this.styles); return themeStyleSet; }
public ThemeStyleSet copy() { ThemeStyleSet themeStyleSet = new ThemeStyleSet(); themeStyleSet.styles.addAll(this.styles); return themeStyleSet; }
@HiddenApi @Implementation public Number createTheme() { synchronized (nativeThemes) { long nativePtr = nextInternalThemeId++; nativeThemes.put(nativePtr, new NativeTheme(new ThemeStyleSet())); return castNativePtr(nativePtr); } }
@HiddenApi @Implementation public Number createTheme() { synchronized (nativeThemes) { long nativePtr = nextInternalThemeId++; nativeThemes.put(nativePtr, new NativeTheme(new ThemeStyleSet())); return castNativePtr(nativePtr); } }
@HiddenApi @Implementation public Number createTheme() { synchronized (nativeThemes) { long nativePtr = nextInternalThemeId++; nativeThemes.put(nativePtr, new NativeTheme(new ThemeStyleSet())); return castNativePtr(nativePtr); } }
Style resolveStyle(@NotNull ResName themeStyleName, Style themeStyleSet) { TypedResource themeStyleResource = resourceLoader.getValue(themeStyleName, RuntimeEnvironment.getQualifiers()); if (themeStyleResource == null) return null; StyleData themeStyleData = (StyleData) themeStyleResource.getData(); if (themeStyleSet == null) { themeStyleSet = new ThemeStyleSet(); } return new StyleResolver(resourceLoader, themeStyleData, themeStyleSet, themeStyleName, RuntimeEnvironment.getQualifiers()); }
private Style resolveStyle(@Nonnull ResName themeStyleName, Style themeStyleSet) { TypedResource themeStyleResource = resourceTable.getValue(themeStyleName, config); if (themeStyleResource == null) return null; StyleData themeStyleData = (StyleData) themeStyleResource.getData(); if (themeStyleSet == null) { themeStyleSet = new ThemeStyleSet(); } return new StyleResolver(resourceTable, legacyShadowOf(AssetManager.getSystem()).getResourceTable(), themeStyleData, themeStyleSet, themeStyleName, config); }
private Style resolveStyle(@NotNull ResName themeStyleName, Style themeStyleSet) { TypedResource themeStyleResource = resourceTable.getValue(themeStyleName, RuntimeEnvironment.getQualifiers()); if (themeStyleResource == null) return null; StyleData themeStyleData = (StyleData) themeStyleResource.getData(); if (themeStyleSet == null) { themeStyleSet = new ThemeStyleSet(); } return new StyleResolver(resourceTable, shadowOf(AssetManager.getSystem()).getResourceTable(), themeStyleData, themeStyleSet, themeStyleName, RuntimeEnvironment.getQualifiers()); }
private Style resolveStyle(@Nonnull ResName themeStyleName, Style themeStyleSet) { TypedResource themeStyleResource = resourceTable.getValue(themeStyleName, RuntimeEnvironment.getQualifiers()); if (themeStyleResource == null) return null; StyleData themeStyleData = (StyleData) themeStyleResource.getData(); if (themeStyleSet == null) { themeStyleSet = new ThemeStyleSet(); } return new StyleResolver(resourceTable, shadowOf(AssetManager.getSystem()).getResourceTable(), themeStyleData, themeStyleSet, themeStyleName, RuntimeEnvironment.getQualifiers()); }