Java Code Examples for org.telegram.ui.ActionBar.Theme#setDrawableColor()

The following examples show how to use org.telegram.ui.ActionBar.Theme#setDrawableColor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ChatAttachAlertPhotoLayout.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
@Override
void checkColors() {
    if (cameraIcon != null) {
        cameraIcon.invalidate();
    }
    Theme.setDrawableColor(cameraDrawable, Theme.getColor(Theme.key_dialogCameraIcon));
    progressView.setTextColor(Theme.getColor(Theme.key_emptyListPlaceholder));
    gridView.setGlowColor(Theme.getColor(Theme.key_dialogScrollGlow));
    RecyclerView.ViewHolder holder = gridView.findViewHolderForAdapterPosition(0);
    if (holder != null && holder.itemView instanceof PhotoAttachCameraCell) {
        ((PhotoAttachCameraCell) holder.itemView).getImageView().setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogCameraIcon), PorterDuff.Mode.MULTIPLY));
    }

    dropDown.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    dropDownContainer.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
    dropDownContainer.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), true);
    dropDownContainer.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
    Theme.setDrawableColor(dropDownDrawable, Theme.getColor(Theme.key_dialogTextBlack));
}
 
Example 2
Source File: ChatAttachAlertPhotoLayout.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
@Override
void checkColors() {
    if (cameraIcon != null) {
        cameraIcon.invalidate();
    }
    Theme.setDrawableColor(cameraDrawable, Theme.getColor(Theme.key_dialogCameraIcon));
    progressView.setTextColor(Theme.getColor(Theme.key_emptyListPlaceholder));
    gridView.setGlowColor(Theme.getColor(Theme.key_dialogScrollGlow));
    RecyclerView.ViewHolder holder = gridView.findViewHolderForAdapterPosition(0);
    if (holder != null && holder.itemView instanceof PhotoAttachCameraCell) {
        ((PhotoAttachCameraCell) holder.itemView).getImageView().setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogCameraIcon), PorterDuff.Mode.MULTIPLY));
    }

    dropDown.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));
    dropDownContainer.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
    dropDownContainer.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), true);
    dropDownContainer.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
    Theme.setDrawableColor(dropDownDrawable, Theme.getColor(Theme.key_dialogTextBlack));
}
 
Example 3
Source File: ThemesHorizontalListCell.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void setTheme(Theme.ThemeInfo theme, boolean last, boolean first) {
    themeInfo = theme;
    isFirst = first;
    isLast = last;
    accentId = theme.currentAccentId;
    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) button.getLayoutParams();
    layoutParams.leftMargin = AndroidUtilities.dp(isFirst ? 22 + 27 : 27);
    button.setLayoutParams(layoutParams);
    placeholderAlpha = 0.0f;

    if (themeInfo.pathToFile != null && !themeInfo.previewParsed) {
        themeInfo.setPreviewInColor(Theme.getDefaultColor(Theme.key_chat_inBubble));
        themeInfo.setPreviewOutColor(Theme.getDefaultColor(Theme.key_chat_outBubble));
        File file = new File(themeInfo.pathToFile);
        boolean fileExists = file.exists();
        boolean parsed = fileExists && parseTheme();
        if ((!parsed || !fileExists) && themeInfo.info != null) {
            if (themeInfo.info.document != null) {
                themeInfo.themeLoaded = false;
                placeholderAlpha = 1.0f;
                loadingDrawable = getResources().getDrawable(R.drawable.msg_theme).mutate();
                Theme.setDrawableColor(loadingDrawable, loadingColor = Theme.getColor(Theme.key_windowBackgroundWhiteGrayText7));
                if (!fileExists) {
                    String name = FileLoader.getAttachFileName(themeInfo.info.document);
                    if (!loadingThemes.containsKey(name)) {
                        loadingThemes.put(name, themeInfo);
                        FileLoader.getInstance(themeInfo.account).loadFile(themeInfo.info.document, themeInfo.info, 1, 1);
                    }
                }
            } else {
                loadingDrawable = getResources().getDrawable(R.drawable.preview_custom).mutate();
                Theme.setDrawableColor(loadingDrawable, loadingColor = Theme.getColor(Theme.key_windowBackgroundWhiteGrayText7));
            }
        }
    }
    applyTheme();
}
 
Example 4
Source File: ColorPicker.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void provideThemeDescriptions(List<ThemeDescription> arrayList) {
    for (int a = 0; a < colorEditText.length; a++) {
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_CURSORCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_HINTTEXTCOLOR | ThemeDescription.FLAG_PROGRESSBAR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
    }
    arrayList.add(new ThemeDescription(clearButton, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    arrayList.add(new ThemeDescription(clearButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_dialogButtonSelector));
    arrayList.add(new ThemeDescription(exchangeButton, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    arrayList.add(new ThemeDescription(exchangeButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_dialogButtonSelector));
    if (menuItem != null) {
        ThemeDescription.ThemeDescriptionDelegate delegate = () -> {
            menuItem.setIconColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
            Theme.setDrawableColor(menuItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));
            menuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
            menuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItemIcon), true);
            menuItem.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
        };
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_dialogButtonSelector));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuItem));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuItemIcon));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuBackground));
    }
}
 
Example 5
Source File: SeekBarView.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void setColors(int inner, int outer) {
    innerPaint1.setColor(inner);
    outerPaint1.setColor(outer);
    if (hoverDrawable != null) {
        Theme.setDrawableColor(hoverDrawable, Color.argb(40, Color.red(outer), Color.green(outer), Color.blue(outer)));
    }
}
 
Example 6
Source File: ThemesHorizontalListCell.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public void setTheme(Theme.ThemeInfo theme, boolean last, boolean first) {
    themeInfo = theme;
    isFirst = first;
    isLast = last;
    accentId = theme.currentAccentId;
    FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) button.getLayoutParams();
    layoutParams.leftMargin = AndroidUtilities.dp(isFirst ? 22 + 27 : 27);
    button.setLayoutParams(layoutParams);
    placeholderAlpha = 0.0f;

    if (themeInfo.pathToFile != null && !themeInfo.previewParsed) {
        themeInfo.setPreviewInColor(Theme.getDefaultColor(Theme.key_chat_inBubble));
        themeInfo.setPreviewOutColor(Theme.getDefaultColor(Theme.key_chat_outBubble));
        File file = new File(themeInfo.pathToFile);
        boolean fileExists = file.exists();
        boolean parsed = fileExists && parseTheme();
        if ((!parsed || !fileExists) && themeInfo.info != null) {
            if (themeInfo.info.document != null) {
                themeInfo.themeLoaded = false;
                placeholderAlpha = 1.0f;
                loadingDrawable = getResources().getDrawable(R.drawable.msg_theme).mutate();
                Theme.setDrawableColor(loadingDrawable, loadingColor = Theme.getColor(Theme.key_windowBackgroundWhiteGrayText7));
                if (!fileExists) {
                    String name = FileLoader.getAttachFileName(themeInfo.info.document);
                    if (!loadingThemes.containsKey(name)) {
                        loadingThemes.put(name, themeInfo);
                        FileLoader.getInstance(themeInfo.account).loadFile(themeInfo.info.document, themeInfo.info, 1, 1);
                    }
                }
            } else {
                loadingDrawable = getResources().getDrawable(R.drawable.preview_custom).mutate();
                Theme.setDrawableColor(loadingDrawable, loadingColor = Theme.getColor(Theme.key_windowBackgroundWhiteGrayText7));
            }
        }
    }
    applyTheme();
}
 
Example 7
Source File: ColorPicker.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public void provideThemeDescriptions(List<ThemeDescription> arrayList) {
    for (int a = 0; a < colorEditText.length; a++) {
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_CURSORCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_HINTTEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteHintText));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_HINTTEXTCOLOR | ThemeDescription.FLAG_PROGRESSBAR, null, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_windowBackgroundWhiteInputField));
        arrayList.add(new ThemeDescription(colorEditText[a], ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_windowBackgroundWhiteInputFieldActivated));
    }
    arrayList.add(new ThemeDescription(clearButton, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    arrayList.add(new ThemeDescription(clearButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_dialogButtonSelector));
    arrayList.add(new ThemeDescription(exchangeButton, ThemeDescription.FLAG_IMAGECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    arrayList.add(new ThemeDescription(exchangeButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_dialogButtonSelector));
    if (menuItem != null) {
        ThemeDescription.ThemeDescriptionDelegate delegate = () -> {
            menuItem.setIconColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
            Theme.setDrawableColor(menuItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));
            menuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
            menuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItemIcon), true);
            menuItem.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
        };
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_windowBackgroundWhiteBlackText));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_dialogButtonSelector));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuItem));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuItemIcon));
        arrayList.add(new ThemeDescription(menuItem, 0, null, null, null, delegate, Theme.key_actionBarDefaultSubmenuBackground));
    }
}
 
Example 8
Source File: SeekBarView.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public void setColors(int inner, int outer) {
    innerPaint1.setColor(inner);
    outerPaint1.setColor(outer);
    if (hoverDrawable != null) {
        Theme.setDrawableColor(hoverDrawable, Color.argb(40, Color.red(outer), Color.green(outer), Color.blue(outer)));
    }
}
 
Example 9
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void updateUIColors() {
    if (AndroidUtilities.isInMultiwindow) {
        getBackground().setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelBackground), PorterDuff.Mode.MULTIPLY));
    } else {
        setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
        emojiTab.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }

    if (searchEditTextContainer != null) {
        searchEditTextContainer.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (dotPaint != null) {
        dotPaint.setColor(Theme.getColor(Theme.key_chat_emojiPanelNewTrending));
    }
    if (stickersGridView != null) {
        stickersGridView.setGlowColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (trendingGridView != null) {
        trendingGridView.setGlowColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (stickersEmptyView != null) {
        stickersEmptyView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelEmptyText));
    }
    if (stickersTab != null) {
        stickersTab.setIndicatorColor(Theme.getColor(Theme.key_chat_emojiPanelStickerPackSelector));
        stickersTab.setUnderlineColor(Theme.getColor(Theme.key_chat_emojiPanelStickerPackSelector));
        stickersTab.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (pagerSlidingTabStrip != null) {
        pagerSlidingTabStrip.setIndicatorColor(Theme.getColor(Theme.key_chat_emojiPanelIconSelector));
        pagerSlidingTabStrip.setUnderlineColor(Theme.getColor(Theme.key_chat_emojiPanelShadowLine));
    }
    if (backspaceButton != null) {
        backspaceButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelBackspace), PorterDuff.Mode.MULTIPLY));
    }
    if (searchIconImageView != null) {
        clearSearchImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelIcon), PorterDuff.Mode.MULTIPLY));
    }
    if (shadowLine != null) {
        shadowLine.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelShadowLine));
    }
    if (noRecentTextView != null) {
        noRecentTextView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelEmptyText));
    }
    if (mediaBanTooltip != null) {
        ((ShapeDrawable) mediaBanTooltip.getBackground()).getPaint().setColor(Theme.getColor(Theme.key_chat_gifSaveHintBackground));
        mediaBanTooltip.setTextColor(Theme.getColor(Theme.key_chat_gifSaveHintText));
    }
    if (stickersCounter != null) {
        stickersCounter.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelBadgeText));
        Theme.setDrawableColor(stickersCounter.getBackground(), Theme.getColor(Theme.key_chat_emojiPanelBadgeBackground));
        stickersCounter.invalidate();
    }

    Theme.setDrawableColorByKey(stickersDrawable, Theme.key_chat_emojiPanelIcon);
    for (int a = 0; a < icons.length - 1; a++) {
        Theme.setEmojiDrawableColor(icons[a], Theme.getColor(Theme.key_chat_emojiPanelIcon), false);
        Theme.setEmojiDrawableColor(icons[a], Theme.getColor(Theme.key_chat_emojiPanelIconSelected), true);
    }
    if (searchBackground != null) {
        Theme.setDrawableColorByKey(searchBackground.getBackground(), Theme.key_chat_emojiSearchBackground);
        searchBackground.invalidate();
    }
}
 
Example 10
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
public void updateUIColors() {
    if (AndroidUtilities.isInMultiwindow) {
        getBackground().setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelBackground), PorterDuff.Mode.MULTIPLY));
    } else {
        setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
        emojiTab.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }

    if (searchEditTextContainer != null) {
        searchEditTextContainer.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (dotPaint != null) {
        dotPaint.setColor(Theme.getColor(Theme.key_chat_emojiPanelNewTrending));
    }
    if (stickersGridView != null) {
        stickersGridView.setGlowColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (trendingGridView != null) {
        trendingGridView.setGlowColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (stickersEmptyView != null) {
        stickersEmptyView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelEmptyText));
    }
    if (stickersTab != null) {
        stickersTab.setIndicatorColor(Theme.getColor(Theme.key_chat_emojiPanelStickerPackSelector));
        stickersTab.setUnderlineColor(Theme.getColor(Theme.key_chat_emojiPanelStickerPackSelector));
        stickersTab.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelBackground));
    }
    if (pagerSlidingTabStrip != null) {
        pagerSlidingTabStrip.setIndicatorColor(Theme.getColor(Theme.key_chat_emojiPanelIconSelector));
        pagerSlidingTabStrip.setUnderlineColor(Theme.getColor(Theme.key_chat_emojiPanelShadowLine));
    }
    if (backspaceButton != null) {
        backspaceButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelBackspace), PorterDuff.Mode.MULTIPLY));
    }
    if (searchIconImageView != null) {
        clearSearchImageView.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_chat_emojiPanelIcon), PorterDuff.Mode.MULTIPLY));
    }
    if (shadowLine != null) {
        shadowLine.setBackgroundColor(Theme.getColor(Theme.key_chat_emojiPanelShadowLine));
    }
    if (noRecentTextView != null) {
        noRecentTextView.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelEmptyText));
    }
    if (mediaBanTooltip != null) {
        ((ShapeDrawable) mediaBanTooltip.getBackground()).getPaint().setColor(Theme.getColor(Theme.key_chat_gifSaveHintBackground));
        mediaBanTooltip.setTextColor(Theme.getColor(Theme.key_chat_gifSaveHintText));
    }
    if (stickersCounter != null) {
        stickersCounter.setTextColor(Theme.getColor(Theme.key_chat_emojiPanelBadgeText));
        Theme.setDrawableColor(stickersCounter.getBackground(), Theme.getColor(Theme.key_chat_emojiPanelBadgeBackground));
        stickersCounter.invalidate();
    }

    Theme.setDrawableColorByKey(stickersDrawable, Theme.key_chat_emojiPanelIcon);
    for (int a = 0; a < icons.length - 1; a++) {
        Theme.setEmojiDrawableColor(icons[a], Theme.getColor(Theme.key_chat_emojiPanelIcon), false);
        Theme.setEmojiDrawableColor(icons[a], Theme.getColor(Theme.key_chat_emojiPanelIconSelected), true);
    }
    if (searchBackground != null) {
        Theme.setDrawableColorByKey(searchBackground.getBackground(), Theme.key_chat_emojiSearchBackground);
        searchBackground.invalidate();
    }
}
 
Example 11
Source File: ChatAttachAlert.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
public void checkColors() {
    if (buttonsRecyclerView == null) {
        return;
    }
    int count = buttonsRecyclerView.getChildCount();
    for (int a = 0; a < count; a++) {
        applyAttachButtonColors(buttonsRecyclerView.getChildAt(a));
    }
    selectedTextView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));

    doneItem.getTextView().setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueHeader));

    selectedMenuItem.setIconColor(Theme.getColor(Theme.key_dialogTextBlack));
    Theme.setDrawableColor(selectedMenuItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));
    selectedMenuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
    selectedMenuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), true);
    selectedMenuItem.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));

    searchItem.setIconColor(Theme.getColor(Theme.key_dialogTextBlack));
    Theme.setDrawableColor(searchItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));

    commentTextView.updateColors();

    if (sendPopupLayout != null) {
        for (int a = 0; a < itemCells.length; a++) {
            if (itemCells[a] != null) {
                itemCells[a].setColors(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), Theme.getColor(Theme.key_actionBarDefaultSubmenuItemIcon));
                itemCells[a].setSelectorColor(Theme.getColor(Theme.key_dialogButtonSelector));
            }
        }
        sendPopupLayout.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
        if (sendPopupWindow != null && sendPopupWindow.isShowing()) {
            sendPopupLayout.invalidate();
        }
    }

    Theme.setSelectorDrawableColor(writeButtonDrawable, Theme.getColor(Theme.key_dialogFloatingButton), false);
    Theme.setSelectorDrawableColor(writeButtonDrawable, Theme.getColor(Build.VERSION.SDK_INT >= 21 ? Theme.key_dialogFloatingButtonPressed : Theme.key_dialogFloatingButton), true);
    writeButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogFloatingIcon), PorterDuff.Mode.MULTIPLY));

    actionBarShadow.setBackgroundColor(Theme.getColor(Theme.key_dialogShadowLine));

    buttonsRecyclerView.setGlowColor(Theme.getColor(Theme.key_dialogScrollGlow));
    buttonsRecyclerView.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));

    frameLayout2.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));

    selectedCountView.invalidate();

    actionBar.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));
    actionBar.setItemsColor(Theme.getColor(Theme.key_dialogTextBlack), false);
    actionBar.setItemsBackgroundColor(Theme.getColor(Theme.key_dialogButtonSelector), false);
    actionBar.setTitleColor(Theme.getColor(Theme.key_dialogTextBlack));

    Theme.setDrawableColor(shadowDrawable, Theme.getColor(Theme.key_dialogBackground));

    containerView.invalidate();

    for (int a = 0; a < layouts.length; a++) {
        if (layouts[a] != null) {
            layouts[a].checkColors();
        }
    }
}
 
Example 12
Source File: SeekBarView.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
public void setOuterColor(int color) {
    outerPaint1.setColor(color);
    if (hoverDrawable != null) {
        Theme.setDrawableColor(hoverDrawable, Color.argb(40, Color.red(color), Color.green(color), Color.blue(color)));
    }
}
 
Example 13
Source File: PhotoViewerCaptionEnterView.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
public void updateColors() {
    Theme.setDrawableColor(drawable, Theme.getColor(Theme.key_dialogFloatingButton));
    Theme.setDrawableColor(checkDrawable, Theme.getColor(Theme.key_dialogFloatingIcon));
}
 
Example 14
Source File: ChatAttachAlert.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
public void checkColors() {
    if (buttonsRecyclerView == null) {
        return;
    }
    int count = buttonsRecyclerView.getChildCount();
    for (int a = 0; a < count; a++) {
        applyAttachButtonColors(buttonsRecyclerView.getChildAt(a));
    }
    selectedTextView.setTextColor(Theme.getColor(Theme.key_dialogTextBlack));

    doneItem.getTextView().setTextColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlueHeader));

    selectedMenuItem.setIconColor(Theme.getColor(Theme.key_dialogTextBlack));
    Theme.setDrawableColor(selectedMenuItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));
    selectedMenuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), false);
    selectedMenuItem.setPopupItemsColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), true);
    selectedMenuItem.redrawPopup(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));

    searchItem.setIconColor(Theme.getColor(Theme.key_dialogTextBlack));
    Theme.setDrawableColor(searchItem.getBackground(), Theme.getColor(Theme.key_dialogButtonSelector));

    commentTextView.updateColors();

    if (sendPopupLayout != null) {
        for (int a = 0; a < itemCells.length; a++) {
            if (itemCells[a] != null) {
                itemCells[a].setColors(Theme.getColor(Theme.key_actionBarDefaultSubmenuItem), Theme.getColor(Theme.key_actionBarDefaultSubmenuItemIcon));
                itemCells[a].setSelectorColor(Theme.getColor(Theme.key_dialogButtonSelector));
            }
        }
        sendPopupLayout.setBackgroundColor(Theme.getColor(Theme.key_actionBarDefaultSubmenuBackground));
        if (sendPopupWindow != null && sendPopupWindow.isShowing()) {
            sendPopupLayout.invalidate();
        }
    }

    Theme.setSelectorDrawableColor(writeButtonDrawable, Theme.getColor(Theme.key_dialogFloatingButton), false);
    Theme.setSelectorDrawableColor(writeButtonDrawable, Theme.getColor(Build.VERSION.SDK_INT >= 21 ? Theme.key_dialogFloatingButtonPressed : Theme.key_dialogFloatingButton), true);
    writeButton.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_dialogFloatingIcon), PorterDuff.Mode.MULTIPLY));

    actionBarShadow.setBackgroundColor(Theme.getColor(Theme.key_dialogShadowLine));

    buttonsRecyclerView.setGlowColor(Theme.getColor(Theme.key_dialogScrollGlow));
    buttonsRecyclerView.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));

    frameLayout2.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));

    selectedCountView.invalidate();

    actionBar.setBackgroundColor(Theme.getColor(Theme.key_dialogBackground));
    actionBar.setItemsColor(Theme.getColor(Theme.key_dialogTextBlack), false);
    actionBar.setItemsBackgroundColor(Theme.getColor(Theme.key_dialogButtonSelector), false);
    actionBar.setTitleColor(Theme.getColor(Theme.key_dialogTextBlack));

    Theme.setDrawableColor(shadowDrawable, Theme.getColor(Theme.key_dialogBackground));

    containerView.invalidate();

    for (int a = 0; a < layouts.length; a++) {
        if (layouts[a] != null) {
            layouts[a].checkColors();
        }
    }
}
 
Example 15
Source File: SeekBarView.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
public void setOuterColor(int color) {
    outerPaint1.setColor(color);
    if (hoverDrawable != null) {
        Theme.setDrawableColor(hoverDrawable, Color.argb(40, Color.red(color), Color.green(color), Color.blue(color)));
    }
}
 
Example 16
Source File: PhotoViewerCaptionEnterView.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
public void updateColors() {
    Theme.setDrawableColor(drawable, Theme.getColor(Theme.key_dialogFloatingButton));
    Theme.setDrawableColor(checkDrawable, Theme.getColor(Theme.key_dialogFloatingIcon));
}