Home
last modified time | relevance | path

Searched refs:theme (Results 1 – 25 of 181) sorted by relevance

12345678

/frameworks/base/libs/androidfw/tests/
DTheme_test.cpp67 std::unique_ptr<Theme> theme = assetmanager.NewTheme(); in TEST_F() local
68 EXPECT_EQ(0u, theme->GetChangingConfigurations()); in TEST_F()
69 EXPECT_EQ(&assetmanager, theme->GetAssetManager()); in TEST_F()
70 EXPECT_FALSE(theme->GetAttribute(app::R::attr::attr_one).has_value()); in TEST_F()
77 std::unique_ptr<Theme> theme = assetmanager.NewTheme(); in TEST_F() local
78 ASSERT_TRUE(theme->ApplyStyle(app::R::style::StyleOne).has_value()); in TEST_F()
80 auto value = theme->GetAttribute(app::R::attr::attr_one); in TEST_F()
86 value = theme->GetAttribute(app::R::attr::attr_two); in TEST_F()
97 std::unique_ptr<Theme> theme = assetmanager.NewTheme(); in TEST_F() local
98 ASSERT_TRUE(theme->ApplyStyle(app::R::style::StyleTwo).has_value()); in TEST_F()
[all …]
DTheme_bench.cpp41 auto theme = assets.NewTheme(); in BM_ThemeApplyStyleFramework() local
42 theme->ApplyStyle(kStyleId, false /* force */); in BM_ThemeApplyStyleFramework()
58 std::unique_ptr<ResTable::Theme> theme{new ResTable::Theme(res_table)}; in BM_ThemeApplyStyleFrameworkOld() local
59 theme->applyStyle(kStyleId, false /* force */); in BM_ThemeApplyStyleFrameworkOld()
70 auto theme = assets.NewTheme(); in BM_ThemeGetAttribute() local
71 theme->ApplyStyle(kStyleId, false /* force */); in BM_ThemeGetAttribute()
74 theme->GetAttribute(kAttrId); in BM_ThemeGetAttribute()
84 std::unique_ptr<ResTable::Theme> theme{new ResTable::Theme(res_table)}; in BM_ThemeGetAttributeOld() local
85 theme->applyStyle(kStyleId, false /* force */); in BM_ThemeGetAttributeOld()
91 theme->getAttribute(kAttrId, &value, &flags); in BM_ThemeGetAttributeOld()
DAttributeResolution_bench.cpp66 std::unique_ptr<Theme> theme = assetmanager.NewTheme(); in BM_ApplyStyle() local
67 theme->ApplyStyle(app::R::style::StyleTwo); in BM_ApplyStyle()
76 ApplyStyle(theme.get(), &xml_tree, 0u /*def_style_attr*/, 0u /*def_style_res*/, attrs.data(), in BM_ApplyStyle()
140 std::unique_ptr<Theme> theme = assetmanager.NewTheme(); in BM_ApplyStyleFramework() local
141 theme->ApplyStyle(Theme_Material_Light); in BM_ApplyStyleFramework()
162 ApplyStyle(theme.get(), &xml_tree, 0x01010084u /*def_style_attr*/, 0u /*def_style_res*/, in BM_ApplyStyleFramework()
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/util/
DThemeResolver.java72 public int resolve(@Nullable String theme) { in resolve() argument
73 return resolve(theme, /* suppressDayNight= */ false); in resolve()
77 private int resolve(@Nullable String theme, boolean suppressDayNight) { in resolve() argument
79 useDayNight && !suppressDayNight ? getDayNightThemeRes(theme) : getThemeRes(theme); in resolve()
84 if (oldestSupportedTheme != null && compareThemes(theme, oldestSupportedTheme) < 0) { in resolve()
102 private static int getDayNightThemeRes(@Nullable String theme) { in getDayNightThemeRes() argument
103 if (theme != null) { in getDayNightThemeRes()
104 switch (theme) { in getDayNightThemeRes()
129 private static int getThemeRes(@Nullable String theme) { in getThemeRes() argument
130 if (theme != null) { in getThemeRes()
[all …]
DWizardManagerHelper.java247 final String theme = intent.getStringExtra(EXTRA_THEME); in isLightTheme() local
248 return isLightTheme(theme, def); in isLightTheme()
260 public static boolean isLightTheme(String theme, boolean def) { in isLightTheme() argument
261 if (THEME_HOLO_LIGHT.equals(theme) in isLightTheme()
262 || THEME_MATERIAL_LIGHT.equals(theme) in isLightTheme()
263 || THEME_GLIF_LIGHT.equals(theme) in isLightTheme()
264 || THEME_GLIF_V2_LIGHT.equals(theme) in isLightTheme()
265 || THEME_GLIF_V3_LIGHT.equals(theme)) { in isLightTheme()
267 } else if (THEME_HOLO.equals(theme) in isLightTheme()
268 || THEME_MATERIAL.equals(theme) in isLightTheme()
[all …]
/frameworks/base/core/java/android/app/
DPresentation.java192 public Presentation(Context outerContext, Display display, int theme) { in Presentation() argument
193 this(outerContext, display, theme, INVALID_WINDOW_TYPE); in Presentation()
217 public Presentation(@NonNull Context outerContext, @NonNull Display display, int theme, in Presentation() argument
219 super(createPresentationContext(outerContext, display, theme, type), theme, false); in Presentation() local
314 int theme) { in createPresentationContext() argument
315 return createPresentationContext(outerContext, display, theme, INVALID_WINDOW_TYPE); in createPresentationContext()
319 Context outerContext, Display display, int theme, @WindowType int type) { in createPresentationContext() argument
329 if (theme == 0) { in createPresentationContext()
333 theme = outValue.resourceId; in createPresentationContext()
335 return new ContextThemeWrapper(windowContext, theme); in createPresentationContext()
/frameworks/base/core/java/android/view/
DContextThemeWrapper.java80 public ContextThemeWrapper(Context base, Resources.Theme theme) { in ContextThemeWrapper() argument
82 mTheme = theme; in ContextThemeWrapper()
156 public void setTheme(@Nullable Resources.Theme theme) { in setTheme() argument
157 mTheme = theme; in setTheme()
202 protected void onApplyThemeResource(Resources.Theme theme, int resId, boolean first) { in onApplyThemeResource() argument
203 theme.applyStyle(resId, true); in onApplyThemeResource()
211 final Resources.Theme theme = getBaseContext().getTheme(); in initializeTheme() local
212 if (theme != null) { in initializeTheme()
213 mTheme.setTo(theme); in initializeTheme()
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/items/
DButtonItem.java42 private int theme = R.style.SuwButtonItem; field in ButtonItem
56 theme = a.getResourceId(R.styleable.SuwButtonItem_android_theme, R.style.SuwButtonItem); in ButtonItem()
79 public void setTheme(int theme) { in setTheme() argument
80 this.theme = theme; in setTheme()
86 return theme; in getTheme()
123 if (theme != 0) { in createButton()
124 context = new ContextThemeWrapper(context, theme); in createButton()
/frameworks/base/libs/androidfw/
DAttributeResolution.cpp66 base::expected<const ResolvedBag*, NullOrIOError> GetStyleBag(Theme* theme, in GetStyleBag() argument
72 std::optional<AssetManager2::SelectedValue> value = theme->GetAttribute(theme_attribute_resid); in GetStyleBag()
75 auto result = theme->GetAssetManager()->ResolveBag(*value); in GetStyleBag()
84 return theme->GetAssetManager()->GetBag(fallback_resid); in GetStyleBag()
90 base::expected<const ResolvedBag*, NullOrIOError> GetXmlStyleBag(Theme* theme, in GetXmlStyleBag() argument
106 if (std::optional<AssetManager2::SelectedValue> result = theme->GetAttribute(value.data)) { in GetXmlStyleBag()
108 return theme->GetAssetManager()->ResolveBag(*result); in GetXmlStyleBag()
113 return theme->GetAssetManager()->GetBag(value.data); in GetXmlStyleBag()
121 base::expected<std::monostate, IOError> ResolveAttrs(Theme* theme, uint32_t def_style_attr, in ResolveAttrs() argument
126 DEBUG_LOG("APPLY STYLE: theme=0x%p defStyleAttr=0x%x defStyleRes=0x%x", theme, def_style_attr, in ResolveAttrs()
[all …]
/frameworks/base/core/java/android/animation/
DAnimatorInflater.java104 public static Animator loadAnimator(Resources resources, Theme theme, int id) in loadAnimator() argument
106 return loadAnimator(resources, theme, id, 1); in loadAnimator()
110 public static Animator loadAnimator(Resources resources, Theme theme, int id, in loadAnimator() argument
114 Animator animator = animatorCache.getInstance(id, resources, theme); in loadAnimator()
126 animator = createAnimatorFromXml(resources, theme, parser, pathErrorScale); in loadAnimator()
134 animatorCache.put(id, theme, constantState); in loadAnimator()
136 animator = constantState.newInstance(resources, theme); in loadAnimator()
162 final Theme theme = context.getTheme(); in loadStateListAnimator() local
163 StateListAnimator animator = cache.getInstance(id, resources, theme); in loadStateListAnimator()
176 cache.put(id, theme, constantState); in loadStateListAnimator()
[all …]
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/template/
DButtonFooterMixin.java68 public Button addButton(CharSequence text, @StyleRes int theme) { in addButton() argument
69 Button button = createThemedButton(context, theme); in addButton()
84 public Button addButton(@StringRes int text, @StyleRes int theme) { in addButton() argument
85 Button button = createThemedButton(context, theme); in addButton()
163 private Button createThemedButton(Context context, @StyleRes int theme) { in createThemedButton() argument
166 LayoutInflater inflater = LayoutInflater.from(new ContextThemeWrapper(context, theme)); in createThemedButton()
/frameworks/base/packages/SystemUI/tests/src/com/android/systemui/theme/
DThemeOverlayApplierTest.java16 package com.android.systemui.theme;
18 import static com.android.systemui.theme.ThemeOverlayApplier.ANDROID_PACKAGE;
19 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ACCENT_COLOR;
20 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_FONT;
21 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ICON_ANDROID;
22 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ICON_LAUNCHER;
23 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ICON_SETTINGS;
24 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ICON_SYSUI;
25 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_ICON_THEME_PICKER;
26 import static com.android.systemui.theme.ThemeOverlayApplier.OVERLAY_CATEGORY_SHAPE;
[all …]
/frameworks/layoutlib/bridge/src/android/content/res/
DComplexColor_Accessor.java36 @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) in createGradientColorFromXmlInner() argument
38 return GradientColor.createFromXmlInner(r, parser, attrs, theme); in createGradientColorFromXmlInner()
42 @NonNull XmlPullParser parser, @NonNull AttributeSet attrs, @Nullable Theme theme) in createColorStateListFromXmlInner() argument
44 return ColorStateList.createFromXmlInner(r, parser, attrs, theme); in createColorStateListFromXmlInner()
/frameworks/opt/setupwizard/library/main/src/com/android/setupwizardlib/view/
DNavigationBar.java62 int theme = attributes.getResourceId(suwNavBarTheme, 0); in getNavbarTheme() local
63 if (theme == 0) { in getNavbarTheme()
71 theme = isDarkBg ? R.style.SuwNavBarThemeDark : R.style.SuwNavBarThemeLight; in getNavbarTheme()
74 return theme; in getNavbarTheme()
78 final int theme = getNavbarTheme(context); in getThemedContext() local
79 return new ContextThemeWrapper(context, theme); in getThemedContext()
/frameworks/base/core/java/com/android/internal/graphics/drawable/
DAnimationScaleListDrawable.java78 @NonNull AttributeSet attrs, @Nullable Theme theme) in inflate() argument
80 final TypedArray a = obtainAttributes(r, theme, attrs, in inflate()
85 inflateChildElements(r, parser, attrs, theme); in inflate()
94 @NonNull AttributeSet attrs, @Nullable Theme theme) in inflateChildElements() argument
112 final TypedArray a = obtainAttributes(r, theme, attrs, in inflateChildElements()
127 dr = Drawable.createFromXmlInner(r, parser, attrs, theme); in inflateChildElements()
239 public void applyTheme(@NonNull Theme theme) { in applyTheme() argument
240 super.applyTheme(theme); in applyTheme()
/frameworks/base/core/java/android/widget/
DResourceCursorAdapter.java114 public void setDropDownViewTheme(Resources.Theme theme) { in setDropDownViewTheme() argument
115 super.setDropDownViewTheme(theme); in setDropDownViewTheme()
117 if (theme == null) { in setDropDownViewTheme()
119 } else if (theme == mInflater.getContext().getTheme()) { in setDropDownViewTheme()
122 final Context context = new ContextThemeWrapper(mContext, theme); in setDropDownViewTheme()
/frameworks/base/core/java/android/service/wallpaper/
DWallpaperSettingsActivity.java40 Resources.Theme theme = getTheme(); in onCreate() local
42 theme.applyStyle(com.android.internal.R.style.PreviewWallpaperSettings, true); in onCreate()
44 theme.applyStyle(com.android.internal.R.style.ActiveWallpaperSettings, true); in onCreate()
/frameworks/base/graphics/java/android/graphics/drawable/
DLevelListDrawable.java88 public void inflate(Resources r, XmlPullParser parser, AttributeSet attrs, Theme theme) in inflate() argument
90 super.inflate(r, parser, attrs, theme); in inflate()
93 inflateChildElements(r, parser, attrs, theme); in inflate()
97 Theme theme) throws XmlPullParserException, IOException { in inflateChildElements() argument
115 TypedArray a = obtainAttributes(r, theme, attrs, in inflateChildElements()
134 dr = r.getDrawable(drawableRes, theme); in inflateChildElements()
144 dr = Drawable.createFromXmlInner(r, parser, attrs, theme); in inflateChildElements()
DDrawableInflater.java79 @NonNull Resources resources, @Nullable Theme theme, @DrawableRes int id) { in loadDrawable() argument
80 return resources.getDrawable(id, theme); in loadDrawable()
116 @NonNull AttributeSet attrs, @Nullable Theme theme) in inflateFromXml() argument
118 return inflateFromXmlForDensity(name, parser, attrs, 0, theme); in inflateFromXml()
127 @NonNull AttributeSet attrs, int density, @Nullable Theme theme) in inflateFromXmlForDensity() argument
145 drawable.inflate(mRes, parser, attrs, theme); in inflateFromXmlForDensity()
DAnimatedStateListDrawable.java379 @NonNull AttributeSet attrs, @Nullable Theme theme) in inflate() argument
382 r, theme, attrs, R.styleable.AnimatedStateListDrawable); in inflate()
388 inflateChildElements(r, parser, attrs, theme); in inflate()
394 public void applyTheme(@Nullable Theme theme) { in applyTheme() argument
395 super.applyTheme(theme); in applyTheme()
402 final TypedArray a = theme.resolveAttributes( in applyTheme()
439 Theme theme) throws XmlPullParserException, IOException { in inflateChildElements() argument
456 parseItem(r, parser, attrs, theme); in inflateChildElements()
458 parseTransition(r, parser, attrs, theme); in inflateChildElements()
464 @NonNull AttributeSet attrs, @Nullable Theme theme) in parseTransition() argument
[all …]
/frameworks/base/core/java/android/content/res/
DConfigurationBoundResourceCache.java43 public T getInstance(long key, Resources resources, Resources.Theme theme) { in getInstance() argument
44 final ConstantState<T> entry = get(key, theme); in getInstance()
46 return entry.newInstance(resources, theme); in getInstance()
DThemedResourceCache.java49 public void put(long key, @Nullable Theme theme, @NonNull T entry) { in put() argument
50 put(key, theme, entry, true); in put()
63 public void put(long key, @Nullable Theme theme, @NonNull T entry, boolean usesTheme) { in put() argument
73 entries = getThemedLocked(theme, true); in put()
89 public T get(long key, @Nullable Theme theme) { in get() argument
95 final LongSparseArray<WeakReference<T>> themedEntries = getThemedLocked(theme, false); in get()
DDrawableCache.java42 public Drawable getInstance(long key, Resources resources, Resources.Theme theme) { in getInstance() argument
43 final Drawable.ConstantState entry = get(key, theme); in getInstance()
45 return entry.newDrawable(resources, theme); in getInstance()
/frameworks/opt/setupwizard/library/test/instrumentation/src/com/android/setupwizardlib/test/
DItemLayoutTest.java62 for (int theme : themes) { in data()
64 params.add(new Object[] {theme, layout}); in data()
74 public ItemLayoutTest(int theme, int layout) { in ItemLayoutTest() argument
75 mContext = new ContextThemeWrapper(getTargetContext(), theme); in ItemLayoutTest()
/frameworks/base/core/java/android/view/animation/
DAnimationUtils.java368 …public static Interpolator loadInterpolator(Resources res, Theme theme, int id) throws NotFoundExc… in loadInterpolator() argument
372 return createInterpolatorFromXml(res, theme, parser); in loadInterpolator()
390 …private static Interpolator createInterpolatorFromXml(Resources res, Theme theme, XmlPullParser pa… in createInterpolatorFromXml() argument
413 interpolator = new AccelerateInterpolator(res, theme, attrs); in createInterpolatorFromXml()
415 interpolator = new DecelerateInterpolator(res, theme, attrs); in createInterpolatorFromXml()
419 interpolator = new CycleInterpolator(res, theme, attrs); in createInterpolatorFromXml()
421 interpolator = new AnticipateInterpolator(res, theme, attrs); in createInterpolatorFromXml()
423 interpolator = new OvershootInterpolator(res, theme, attrs); in createInterpolatorFromXml()
425 interpolator = new AnticipateOvershootInterpolator(res, theme, attrs); in createInterpolatorFromXml()
429 interpolator = new PathInterpolator(res, theme, attrs); in createInterpolatorFromXml()

12345678