Search in sources :

Example 1 with GroupCallTextCell

use of org.telegram.ui.Cells.GroupCallTextCell in project Telegram-FOSS by Telegram-FOSS-Team.

the class UsersAlertBase method setColorProgress.

protected void setColorProgress(float progress) {
    colorProgress = progress;
    backgroundColor = AndroidUtilities.getOffsetColor(Theme.getColor(keyInviteMembersBackground), Theme.getColor(keyListViewBackground), progress, 1.0f);
    shadowDrawable.setColorFilter(new PorterDuffColorFilter(backgroundColor, PorterDuff.Mode.MULTIPLY));
    frameLayout.setBackgroundColor(backgroundColor);
    navBarColor = backgroundColor;
    listView.setGlowColor(backgroundColor);
    int color = AndroidUtilities.getOffsetColor(Theme.getColor(keyLastSeenTextUnscrolled), Theme.getColor(keyLastSeenText), progress, 1.0f);
    // 
    int color2 = AndroidUtilities.getOffsetColor(Theme.getColor(keySearchIconUnscrolled), Theme.getColor(keySearchIcon), progress, 1.0f);
    for (int a = 0, N = listView.getChildCount(); a < N; a++) {
        View child = listView.getChildAt(a);
        if (child instanceof GroupCallTextCell) {
            GroupCallTextCell cell = (GroupCallTextCell) child;
            cell.setColors(color, color);
        } else if (child instanceof GroupCallUserCell) {
            GroupCallUserCell cell = (GroupCallUserCell) child;
            cell.setGrayIconColor(shadow.getTag() != null ? keySearchIcon : keySearchIconUnscrolled, color2);
        }
    }
    containerView.invalidate();
    listView.invalidate();
    container.invalidate();
}
Also used : GroupCallTextCell(org.telegram.ui.Cells.GroupCallTextCell) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) SuppressLint(android.annotation.SuppressLint) GroupCallUserCell(org.telegram.ui.Cells.GroupCallUserCell)

Example 2 with GroupCallTextCell

use of org.telegram.ui.Cells.GroupCallTextCell in project Telegram-FOSS by Telegram-FOSS-Team.

the class GroupCallActivity method setColorProgress.

private void setColorProgress(float progress) {
    colorProgress = progress;
    float finalColorProgress = colorProgress;
    float finalColorProgress2 = Math.max(colorProgress, renderersContainer == null ? 0 : renderersContainer.progressToFullscreenMode);
    backgroundColor = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_actionBarUnscrolled), Theme.getColor(Theme.key_voipgroup_actionBar), finalColorProgress, 1.0f);
    actionBarBackground.setBackgroundColor(backgroundColor);
    otherItem.redrawPopup(0xff232A33);
    shadowDrawable.setColorFilter(new PorterDuffColorFilter(backgroundColor, PorterDuff.Mode.MULTIPLY));
    navBarColor = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_actionBarUnscrolled), Theme.getColor(Theme.key_voipgroup_actionBar), finalColorProgress2, 1.0f);
    int color = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_listViewBackgroundUnscrolled), Theme.getColor(Theme.key_voipgroup_listViewBackground), finalColorProgress, 1.0f);
    listViewBackgroundPaint.setColor(color);
    listView.setGlowColor(color);
    if (muteButtonState == MUTE_BUTTON_STATE_CONNECTING || isGradientState(muteButtonState)) {
        muteButton.invalidate();
    }
    if (buttonsBackgroundGradientView != null) {
        gradientColors[0] = backgroundColor;
        gradientColors[1] = Color.TRANSPARENT;
        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
            buttonsBackgroundGradient.setColors(gradientColors);
        } else {
            buttonsBackgroundGradientView.setBackground(buttonsBackgroundGradient = new GradientDrawable(GradientDrawable.Orientation.BOTTOM_TOP, gradientColors));
        }
        buttonsBackgroundGradientView2.setBackgroundColor(gradientColors[0]);
    }
    color = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_leaveButton), Theme.getColor(Theme.key_voipgroup_leaveButtonScrolled), finalColorProgress, 1.0f);
    leaveButton.setBackgroundColor(color, color);
    color = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_lastSeenTextUnscrolled), Theme.getColor(Theme.key_voipgroup_lastSeenText), finalColorProgress, 1.0f);
    int color2 = AndroidUtilities.getOffsetColor(Theme.getColor(Theme.key_voipgroup_mutedIconUnscrolled), Theme.getColor(Theme.key_voipgroup_mutedIcon), finalColorProgress, 1.0f);
    for (int a = 0, N = listView.getChildCount(); a < N; a++) {
        View child = listView.getChildAt(a);
        if (child instanceof GroupCallTextCell) {
            GroupCallTextCell cell = (GroupCallTextCell) child;
            cell.setColors(color2, color);
        } else if (child instanceof GroupCallUserCell) {
            GroupCallUserCell cell = (GroupCallUserCell) child;
            cell.setGrayIconColor(actionBar.getTag() != null ? Theme.key_voipgroup_mutedIcon : Theme.key_voipgroup_mutedIconUnscrolled, color2);
        } else if (child instanceof GroupCallInvitedCell) {
            GroupCallInvitedCell cell = (GroupCallInvitedCell) child;
            cell.setGrayIconColor(actionBar.getTag() != null ? Theme.key_voipgroup_mutedIcon : Theme.key_voipgroup_mutedIconUnscrolled, color2);
        }
    }
    containerView.invalidate();
    listView.invalidate();
    container.invalidate();
}
Also used : GroupCallTextCell(org.telegram.ui.Cells.GroupCallTextCell) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) ProfileGalleryView(org.telegram.ui.Components.ProfileGalleryView) UndoView(org.telegram.ui.Components.UndoView) HintView(org.telegram.ui.Components.HintView) GroupCallMiniTextureView(org.telegram.ui.Components.voip.GroupCallMiniTextureView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) ScrollView(android.widget.ScrollView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) RLottieImageView(org.telegram.ui.Components.RLottieImageView) TextView(android.widget.TextView) BackupImageView(org.telegram.ui.Components.BackupImageView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) Paint(android.graphics.Paint) SuppressLint(android.annotation.SuppressLint) GradientDrawable(android.graphics.drawable.GradientDrawable) GroupCallInvitedCell(org.telegram.ui.Cells.GroupCallInvitedCell) GroupCallUserCell(org.telegram.ui.Cells.GroupCallUserCell)

Aggregations

SuppressLint (android.annotation.SuppressLint)2 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)2 View (android.view.View)2 ImageView (android.widget.ImageView)2 RecyclerView (androidx.recyclerview.widget.RecyclerView)2 GroupCallTextCell (org.telegram.ui.Cells.GroupCallTextCell)2 GroupCallUserCell (org.telegram.ui.Cells.GroupCallUserCell)2 Paint (android.graphics.Paint)1 GradientDrawable (android.graphics.drawable.GradientDrawable)1 ScrollView (android.widget.ScrollView)1 TextView (android.widget.TextView)1 SimpleTextView (org.telegram.ui.ActionBar.SimpleTextView)1 GroupCallInvitedCell (org.telegram.ui.Cells.GroupCallInvitedCell)1 BackupImageView (org.telegram.ui.Components.BackupImageView)1 HintView (org.telegram.ui.Components.HintView)1 ProfileGalleryView (org.telegram.ui.Components.ProfileGalleryView)1 RLottieImageView (org.telegram.ui.Components.RLottieImageView)1 RadialProgressView (org.telegram.ui.Components.RadialProgressView)1 RecyclerListView (org.telegram.ui.Components.RecyclerListView)1 UndoView (org.telegram.ui.Components.UndoView)1