org.telegram.ui.Components.CombinedDrawable Java Examples

The following examples show how to use org.telegram.ui.Components.CombinedDrawable. 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: StatisticActivity.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
private void recolorRecyclerItem(View child) {
    if (child instanceof ChartCell) {
        ((ChartCell) child).recolor();
    }

    if (child instanceof ShadowSectionCell) {
        Drawable shadowDrawable = Theme.getThemedDrawable(ApplicationLoader.applicationContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow);
        Drawable background = new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundGray));
        CombinedDrawable combinedDrawable = new CombinedDrawable(background, shadowDrawable, 0, 0);
        combinedDrawable.setFullsize(true);
        child.setBackground(combinedDrawable);
    }

    if (child instanceof OverviewCell) {
        ((OverviewCell) child).updateColors();
    }
}
 
Example #2
Source File: StatisticActivity.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
private void recolorRecyclerItem(View child) {
    if (child instanceof ChartCell) {
        ((ChartCell) child).recolor();
    }

    if (child instanceof ShadowSectionCell) {
        Drawable shadowDrawable = Theme.getThemedDrawable(ApplicationLoader.applicationContext, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow);
        Drawable background = new ColorDrawable(Theme.getColor(Theme.key_windowBackgroundGray));
        CombinedDrawable combinedDrawable = new CombinedDrawable(background, shadowDrawable, 0, 0);
        combinedDrawable.setFullsize(true);
        child.setBackground(combinedDrawable);
    }

    if (child instanceof OverviewCell) {
        ((OverviewCell) child).updateColors();
    }
}
 
Example #3
Source File: AudioCell.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void setPlayDrawable(boolean play) {
    Drawable circle = Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(46), Theme.getColor(Theme.key_musicPicker_buttonBackground), Theme.getColor(Theme.key_musicPicker_buttonBackground));
    Drawable drawable = getResources().getDrawable(play ? R.drawable.audiosend_pause : R.drawable.audiosend_play);
    drawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_musicPicker_buttonIcon), PorterDuff.Mode.MULTIPLY));
    CombinedDrawable combinedDrawable = new CombinedDrawable(circle, drawable);
    combinedDrawable.setCustomSize(AndroidUtilities.dp(46), AndroidUtilities.dp(46));
    playButton.setBackgroundDrawable(combinedDrawable);
}
 
Example #4
Source File: AudioCell.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
private void setPlayDrawable(boolean play) {
    Drawable circle = Theme.createSimpleSelectorCircleDrawable(AndroidUtilities.dp(46), Theme.getColor(Theme.key_musicPicker_buttonBackground), Theme.getColor(Theme.key_musicPicker_buttonBackground));
    Drawable drawable = getResources().getDrawable(play ? R.drawable.audiosend_pause : R.drawable.audiosend_play);
    drawable.setColorFilter(new PorterDuffColorFilter(Theme.getColor(Theme.key_musicPicker_buttonIcon), PorterDuff.Mode.MULTIPLY));
    CombinedDrawable combinedDrawable = new CombinedDrawable(circle, drawable);
    combinedDrawable.setCustomSize(AndroidUtilities.dp(46), AndroidUtilities.dp(46));
    playButton.setBackgroundDrawable(combinedDrawable);
}
 
Example #5
Source File: ShadowSectionCell.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public ShadowSectionCell(Context context, int s, int backgroundColor) {
    super(context);
    Drawable shadowDrawable = Theme.getThemedDrawable(context, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow);
    Drawable background = new ColorDrawable(backgroundColor);
    CombinedDrawable combinedDrawable = new CombinedDrawable(background, shadowDrawable, 0, 0);
    combinedDrawable.setFullsize(true);
    setBackgroundDrawable(combinedDrawable);
    size = s;
}
 
Example #6
Source File: ShadowSectionCell.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public ShadowSectionCell(Context context, int s, int backgroundColor) {
    super(context);
    Drawable shadowDrawable = Theme.getThemedDrawable(context, R.drawable.greydivider, Theme.key_windowBackgroundGrayShadow);
    Drawable background = new ColorDrawable(backgroundColor);
    CombinedDrawable combinedDrawable = new CombinedDrawable(background, shadowDrawable, 0, 0);
    combinedDrawable.setFullsize(true);
    setBackgroundDrawable(combinedDrawable);
    size = s;
}