Search in sources :

Example 96 with ThemeDescription

use of org.telegram.ui.ActionBar.ThemeDescription in project Telegram-FOSS by Telegram-FOSS-Team.

the class ColorPicker method provideThemeDescriptions.

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));
    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));
    }
}
Also used : ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) Point(android.graphics.Point) Paint(android.graphics.Paint)

Example 97 with ThemeDescription

use of org.telegram.ui.ActionBar.ThemeDescription in project Telegram-FOSS by Telegram-FOSS-Team.

the class ChatThemeBottomSheet method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ThemeDescription.ThemeDescriptionDelegate descriptionDelegate = new ThemeDescription.ThemeDescriptionDelegate() {

        private boolean isAnimationStarted = false;

        @Override
        public void onAnimationProgress(float progress) {
            if (progress == 0f && !isAnimationStarted) {
                onAnimationStart();
                isAnimationStarted = true;
            }
            setDarkButtonColor(getThemedColor(Theme.key_featuredStickers_addButton));
            setOverlayNavBarColor(getThemedColor(Theme.key_dialogBackground));
            if (isLightDarkChangeAnimation) {
                setItemsAnimationProgress(progress);
            }
            if (progress == 1f && isAnimationStarted) {
                isLightDarkChangeAnimation = false;
                onAnimationEnd();
                isAnimationStarted = false;
            }
        }

        @Override
        public void didSetColor() {
        }
    };
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    themeDescriptions.add(new ThemeDescription(null, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, new Drawable[] { shadowDrawable }, descriptionDelegate, Theme.key_dialogBackground));
    themeDescriptions.add(new ThemeDescription(titleView, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_dialogTextBlack));
    themeDescriptions.add(new ThemeDescription(recyclerView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { ThemeSmallPreviewView.class }, null, null, null, Theme.key_dialogBackgroundGray));
    themeDescriptions.add(new ThemeDescription(applyButton, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_featuredStickers_addButton));
    themeDescriptions.add(new ThemeDescription(applyButton, ThemeDescription.FLAG_BACKGROUNDFILTER | ThemeDescription.FLAG_DRAWABLESELECTEDSTATE, null, null, null, null, Theme.key_featuredStickers_addButtonPressed));
    for (ThemeDescription description : themeDescriptions) {
        description.resourcesProvider = themeDelegate;
    }
    return themeDescriptions;
}
Also used : ArrayList(java.util.ArrayList) Drawable(android.graphics.drawable.Drawable) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription)

Example 98 with ThemeDescription

use of org.telegram.ui.ActionBar.ThemeDescription in project Telegram-FOSS by Telegram-FOSS-Team.

the class TrendingStickersAlert method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    final ArrayList<ThemeDescription> descriptions = new ArrayList<>();
    layout.getThemeDescriptions(descriptions, layout::updateColors);
    descriptions.add(new ThemeDescription(alertContainerView, 0, null, null, new Drawable[] { shadowDrawable }, null, Theme.key_dialogBackground));
    descriptions.add(new ThemeDescription(alertContainerView, 0, null, null, null, null, Theme.key_sheet_scrollUp));
    return descriptions;
}
Also used : ArrayList(java.util.ArrayList) Drawable(android.graphics.drawable.Drawable) GradientDrawable(android.graphics.drawable.GradientDrawable) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription)

Example 99 with ThemeDescription

use of org.telegram.ui.ActionBar.ThemeDescription in project Telegram-FOSS by Telegram-FOSS-Team.

the class TrendingStickersLayout method getThemeDescriptions.

public void getThemeDescriptions(List<ThemeDescription> descriptions, ThemeDescription.ThemeDescriptionDelegate delegate) {
    searchView.getThemeDescriptions(descriptions);
    adapter.getThemeDescriptions(descriptions, listView, delegate);
    searchAdapter.getThemeDescriptions(descriptions, listView, delegate);
    descriptions.add(new ThemeDescription(shadowView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_dialogShadowLine));
    descriptions.add(new ThemeDescription(searchLayout, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_dialogBackground));
}
Also used : ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription)

Example 100 with ThemeDescription

use of org.telegram.ui.ActionBar.ThemeDescription in project Telegram-FOSS by Telegram-FOSS-Team.

the class FeaturedStickerSetCell2 method createThemeDescriptions.

public static void createThemeDescriptions(List<ThemeDescription> descriptions, RecyclerListView listView, ThemeDescription.ThemeDescriptionDelegate delegate) {
    descriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[] { FeaturedStickerSetCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    descriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[] { FeaturedStickerSetCell.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
    descriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[] { FeaturedStickerSetCell.class }, new String[] { "addButton" }, null, null, null, Theme.key_featuredStickers_buttonText));
    descriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_TEXTCOLOR, new Class[] { FeaturedStickerSetCell.class }, new String[] { "delButton" }, null, null, null, Theme.key_featuredStickers_removeButtonText));
    descriptions.add(new ThemeDescription(listView, 0, new Class[] { FeaturedStickerSetCell.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    descriptions.add(new ThemeDescription(null, 0, null, null, null, delegate, Theme.key_featuredStickers_buttonProgress));
    descriptions.add(new ThemeDescription(null, 0, null, null, null, delegate, Theme.key_featuredStickers_addButtonPressed));
}
Also used : ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription)

Aggregations

ThemeDescription (org.telegram.ui.ActionBar.ThemeDescription)106 ArrayList (java.util.ArrayList)92 View (android.view.View)62 RecyclerView (androidx.recyclerview.widget.RecyclerView)57 TextView (android.widget.TextView)48 RecyclerListView (org.telegram.ui.Components.RecyclerListView)47 HeaderCell (org.telegram.ui.Cells.HeaderCell)38 TextInfoPrivacyCell (org.telegram.ui.Cells.TextInfoPrivacyCell)38 ShadowSectionCell (org.telegram.ui.Cells.ShadowSectionCell)36 ImageView (android.widget.ImageView)30 TextSettingsCell (org.telegram.ui.Cells.TextSettingsCell)28 Drawable (android.graphics.drawable.Drawable)25 Paint (android.graphics.Paint)18 TextCheckCell (org.telegram.ui.Cells.TextCheckCell)16 EmptyTextProgressView (org.telegram.ui.Components.EmptyTextProgressView)16 SuppressLint (android.annotation.SuppressLint)14 SimpleTextView (org.telegram.ui.ActionBar.SimpleTextView)13 TextCell (org.telegram.ui.Cells.TextCell)13 BackupImageView (org.telegram.ui.Components.BackupImageView)11 RadialProgressView (org.telegram.ui.Components.RadialProgressView)11