Home | History | Annotate | Download | only in res

Lines Matching defs:Theme

128     private final ArrayList<WeakReference<Theme>> mThemeRefs = new ArrayList<>();
131 * Returns the most appropriate default theme for the specified target SDK version.
139 * @param curTheme The current theme, or 0 if not specified.
141 * @return A theme resource identifier
146 com.android.internal.R.style.Theme,
253 * and updates all Theme references to new implementations as well.
267 WeakReference<Theme> weakThemeRef = mThemeRefs.get(i);
268 Theme theme = weakThemeRef != null ? weakThemeRef.get() : null;
269 if (theme != null) {
270 theme.setImpl(mResourcesImpl.newThemeImpl(theme.getKey()));
781 * or {@link #getDrawable(int, Theme)} passing the desired theme.</p>
789 * @see #getDrawable(int, Theme)
790 * @deprecated Use {@link #getDrawable(int, Theme)} instead.
796 Log.w(TAG, "Drawable " + getResourceName(id) + " has unresolved theme "
797 + "attributes! Consider using Resources.getDrawable(int, Theme) or "
805 * styled for the specified theme. Various types of objects will be
812 * @param theme The theme used to style the drawable attributes, may be {@code null}.
817 public Drawable getDrawable(@DrawableRes int id, @Nullable Theme theme)
819 return getDrawableForDensity(id, 0, theme);
834 * or {@link #getDrawableForDensity(int, int, Theme)} passing the desired
835 * theme.</p>
847 * @see #getDrawableForDensity(int, int, Theme)
848 * @deprecated Use {@link #getDrawableForDensity(int, int, Theme)} instead.
858 * given screen density in DPI and styled for the specified theme.
866 * This is equivalent to calling {@link #getDrawable(int, Theme)}.
867 * @param theme The theme used to style the drawable attributes, may be {@code null}.
872 public Drawable getDrawableForDensity(@DrawableRes int id, int density, @Nullable Theme theme) {
877 return impl.loadDrawable(this, value, id, density, theme);
884 Drawable loadDrawable(@NonNull TypedValue value, int id, int density, @Nullable Theme theme)
886 return mResourcesImpl.loadDrawable(this, value, id, density, theme);
921 * @deprecated Use {@link #getColor(int, Theme)} instead.
937 * @param theme The theme used to style the color attributes, may be
946 public int getColor(@ColorRes int id, @Nullable Theme theme) throws NotFoundException {
959 final ColorStateList csl = impl.loadColorStateList(this, value, id, theme);
981 * @deprecated Use {@link #getColorStateList(int, Theme)} instead.
989 + "unresolved theme attributes! Consider using "
990 + "Resources.getColorStateList(int, Theme) or "
1005 * @param theme The theme used to style the color attributes, may be
1015 public ColorStateList getColorStateList(@ColorRes int id, @Nullable Theme theme)
1021 return impl.loadColorStateList(this, value, id, theme);
1028 ColorStateList loadColorStateList(@NonNull TypedValue value, int id, @Nullable Theme theme)
1030 return mResourcesImpl.loadColorStateList(this, value, id, theme);
1037 public ComplexColor loadComplexColor(@NonNull TypedValue value, int id, @Nullable Theme theme) {
1038 return mResourcesImpl.loadComplexColor(this, value, id, theme);
1363 * This class holds the current attribute values for a particular theme.
1364 * In other words, a Theme is a set of values for resource attributes;
1368 * <p>The Theme's attributes come into play in two ways: (1) a styled
1369 * attribute can explicit reference a value in the theme through the
1372 * attribute's value in the Theme.
1375 * retrieve XML attributes with style and theme information applied.
1377 public final class Theme {
1380 private Theme() {
1388 * Place new attribute values into the theme. The style resource
1389 * specified by <var>resid</var> will be retrieved from this Theme's
1390 * resources, its values placed into the Theme object.
1394 * the theme will be copied from the system resource; otherwise, if
1395 * any of the style's attributes are already defined in the theme, the
1396 * current values in the theme will be overwritten.
1401 * used in the theme; otherwise, they will only be used
1402 * if not already defined in the theme.
1409 * Set this theme to hold the same contents as the theme
1413 * they have in common will be set in this theme.
1415 * @param other The existing Theme to copy from.
1417 public void setTo(Theme other) {
1423 * <var>Theme</var> which are listed in <var>attrs</var>.
1490 * <li> The base values in this theme.
1503 * @param defStyleAttr An attribute in the current theme that contains a
1510 * in the theme. Can be 0 to not look for defaults.
1526 * Retrieve the values for a set of attributes in the Theme. The
1546 * Retrieve the value of an attribute in the Theme. The contents of
1550 * @param resid The resource identifier of the desired theme
1567 * Gets all of the attribute ids associated with this {@link Theme}. For debugging only.
1569 * @return The int array containing attribute ids associated with this {@link Theme}.
1577 * Returns the resources to which this theme belongs.
1579 * @return Resources to which this theme belongs.
1587 * and styled for the Theme.
1602 * theme (and thus require completely reloading it).
1613 * Print contents of this theme out to the log. For debugging only.
1645 * adjacent Theme data: resource name followed by whether or not it was
1650 @ViewDebug.ExportedProperty(category = "theme", hasAdjacentMapping = true)
1666 * Rebases the theme against the parent Resource object's current
1756 * Generate a new Theme object for this set of Resources. It initially
1759 * @return Theme The newly created Theme container.
1761 public final Theme newTheme() {
1762 Theme theme = new Theme();
1763 theme.setImpl(mResourcesImpl.newThemeImpl());
1765 mThemeRefs.add(new WeakReference<>(theme));
1767 return theme;
1772 * performing styling of them using a theme and/or style resources.
1781 * @see Theme#obtainStyledAttributes(AttributeSet, int[], int, int)
2172 * Obtains styled attributes from the theme, if available, or unstyled
2173 * resources if the theme is null.
2178 Resources res, Theme theme, AttributeSet set, int[] attrs) {
2179 if (theme == null) {
2182 return theme.obtainStyledAttributes(set, attrs, 0, 0);