Obtains the button text color from a specific theme.

@param themeResourceId
The resource id of the theme, the color should be obtained from, as an {@link
Integer} value
978071
private void obtainButtonTextColor(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                new int[]{R.attr.materialDialogButtonTextColor});
        ColorStateList colorStateList = typedArray.getColorStateList(0);

        if (colorStateList != null) {
            setButtonTextColor(colorStateList);
        }
    }
195568
public final void setBackground(@DrawableRes final int resourceId) {
        this.background = ContextCompat.getDrawable(getContext(), resourceId);
        this.backgroundBitmap = null;
        this.backgroundId = -1;
        this.backgroundColor = -1;
        adaptBackground();
    }
1056836
public final void setDialogWindowBackground(@DrawableRes final int resourceId) {
        this.dialogWindowBackground = ContextCompat.getDrawable(getContext(), resourceId);
        this.dialogWindowBackgroundBitmap = null;
        this.dialogWindowBackgroundId = resourceId;
    }
722724
public function getTheme($themeId, $fields = ['name', 'slug', 'url'])
    {
        $apiUrl = $this->getEndpoint('themes');
        $apiUrl .= $themeId;

        $params = array(
            'fields' => implode(',', $fields)
        );

        $apiData = $this->apiGet($apiUrl, $params);

        return $this->decodeSingle($apiData);
    }
992192
private void obtainGravity(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogGravity});
        setGravity(typedArray.getInteger(0, Dialog.Gravity.CENTER));
    }
170246
private void obtainMessageColor(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                new int[]{R.attr.materialDialogMessageColor});
        int defaultColor = ThemeUtil
                .getColor(getContext(), themeResourceId, android.R.attr.textColorSecondary);
        setMessageColor(typedArray.getColor(0, defaultColor));
    }
152707
private void obtainTitleColor(final int theme) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(theme, new int[]{android.R.attr.textColorPrimary});
        int textColorPrimary = typedArray.getResourceId(0, 0);
        typedArray.recycle();

        if (textColorPrimary != 0) {
            int titleColor = ContextCompat.getColor(getContext(), textColorPrimary);
            toolbar.setTitleTextColor(titleColor);
        }
    }
1339036
@NonNull
    public IconicsDrawable backgroundColorRes(@ColorRes int colorResId) {
        return backgroundColor(ContextCompat.getColor(mContext, colorResId));
    }
917450
public final void setDialogHeaderBackground(@DrawableRes final int resourceId) {
        this.dialogHeaderBackground = ContextCompat.getDrawable(getContext(), resourceId);
        this.dialogHeaderBackgroundBitmap = null;
        this.dialogHeaderBackgroundId = resourceId;
        this.dialogHeaderBackgroundColor = -1;
    }
510870
protected String determineThemeNameToChoose(final HttpServletRequest request,
                                                final Service service,
                                                final RegisteredService rService) {
        HttpResponse response = null;
        try {
            LOGGER.debug("Service [{}] is configured to use a custom theme [{}]", rService, rService.getTheme());

            val resource = ResourceUtils.getRawResourceFrom(rService.getTheme());
            if (resource instanceof FileSystemResource && resource.exists()) {
                LOGGER.debug("Executing groovy script to determine theme for [{}]", service.getId());
                val result = ScriptingUtils.executeGroovyScript(resource, new Object[]{service, rService,
                    request.getQueryString(), HttpRequestUtils.getRequestHeaders(request), LOGGER}, String.class, true);
                return StringUtils.defaultIfBlank(result, getDefaultThemeName());
            }
            if (resource instanceof UrlResource) {
                val url = resource.getURL().toExternalForm();
                LOGGER.debug("Executing URL [{}] to determine theme for [{}]", url, service.getId());
                response = HttpUtils.executeGet(url, CollectionUtils.wrap("service", service.getId()));
                if (response != null && response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    val result = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
                    return StringUtils.defaultIfBlank(result, getDefaultThemeName());
                }
            }

            val messageSource = new CasThemeResourceBundleMessageSource();
            messageSource.setBasename(rService.getTheme());
            if (messageSource.doGetBundle(rService.getTheme(), request.getLocale()) != null) {
                LOGGER.trace("Found custom theme [{}] for service [{}]", rService.getTheme(), rService);
                return rService.getTheme();
            }
            LOGGER.warn("Custom theme [{}] for service [{}] cannot be located. Falling back to default theme...", rService.getTheme(), rService);
        } catch (final Exception e) {
            LOGGER.error(e.getMessage(), e);
        } finally {
            HttpUtils.close(response);
        }
        return getDefaultThemeName();
    }
103896
function (resourceID) {
            var self = this;
            var stylePath = self.findStatic(resourceID, TemplateHelper.settings.styleExt, self.mergeCss);
            logger.trace('resourceID: %s,\nfindStyle: %s', resourceID, stylePath);
            return stylePath;
        }
425166
@Override
	@Transactional
	public String getResource(String id)
	{
		final TemplateCall call = templater.template("resource_template");

		final ResourceTemplateEntity entity = resourceProvisionService.getOrCreateTemplate(id);

		if (entity == null)
			throw new RestException(404, "No such resource with id: " + id);

		call.set("entity", entity);
		call.set("nonce", nonceStore.getValue());

		return call.process();
	}
1074392
public void setThemeIfCurrentEmpty(String themeName) {
        if (themeName == null || themeName.isEmpty()) return;
        String theme = getTheme();
        if (theme == null || theme.isEmpty()) {
            setTheme(themeName);
        }
    }
247115
private void obtainShowHeader(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme().obtainStyledAttributes(themeResourceId,
                new int[]{R.attr.materialDialogShowHeader});
        showHeader(typedArray.getBoolean(0, false));
    }
21516
private void obtainWidth(@StyleRes final int themeResourceId) {
        TypedArray typedArray = getContext().getTheme()
                .obtainStyledAttributes(themeResourceId, new int[]{R.attr.materialDialogWidth});
        int defaultValue = getContext().getResources().getDimensionPixelSize(R.dimen.dialog_width);

        try {
            setWidth(typedArray.getDimensionPixelSize(0, defaultValue));
        } catch (Resources.NotFoundException | UnsupportedOperationException e) {
            setWidth(typedArray.getInteger(0, defaultValue));
        }
    }
70249
@CallSuper
    protected void obtainStyledAttributes(@StyleRes final int themeResourceId) {
        obtainFullscreen(themeResourceId);
        obtainGravity(themeResourceId);
        obtainWidth(themeResourceId);
        obtainHeight(themeResourceId);
        obtainMaxWidth(themeResourceId);
        obtainMaxHeight(themeResourceId);
        obtainMargin(themeResourceId);
        obtainPadding(themeResourceId);
        obtainFitsSystemWindows(themeResourceId);
        obtainWindowBackground(themeResourceId);
        obtainBackground(themeResourceId);
        obtainMessageColor(themeResourceId);
        obtainTitleColor(themeResourceId);
        obtainIconTintList(themeResourceId);
        obtainScrollableArea(themeResourceId);
        obtainShowDividersOnScroll(themeResourceId);
        obtainDividerColor(themeResourceId);
        obtainDividerMargin(themeResourceId);
    }
242499
public int color(Context ctx, @AttrRes int colorStyle, @ColorRes int colorDefaultRes) {
        //get the color from the holder else from the theme
        int color = color(ctx);
        if (color == 0) {
            return UIUtils.getThemeColorFromAttrOrRes(ctx, colorStyle, colorDefaultRes);
        } else {
            return color;
        }
    }