Search in sources :

Example 1 with PhotoPickerPhotoCell

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

the class PhotoViewer method updateColors.

public void updateColors() {
    int color = getThemedColor(Theme.key_dialogFloatingButton);
    if (pickerViewSendButton != null) {
        Drawable drawable = pickerViewSendButton.getBackground();
        Theme.setSelectorDrawableColor(drawable, color, false);
        Theme.setSelectorDrawableColor(drawable, getThemedColor(Build.VERSION.SDK_INT >= 21 ? Theme.key_dialogFloatingButtonPressed : Theme.key_dialogFloatingButton), true);
        pickerViewSendButton.setColorFilter(new PorterDuffColorFilter(getThemedColor(Theme.key_dialogFloatingIcon), PorterDuff.Mode.MULTIPLY));
    }
    if (checkImageView != null) {
        checkImageView.setColor(getThemedColor(Theme.key_dialogFloatingButton), 0xffffffff);
    }
    PorterDuffColorFilter filter = new PorterDuffColorFilter(color, PorterDuff.Mode.MULTIPLY);
    if (timeItem != null && timeItem.getColorFilter() != null) {
        timeItem.setColorFilter(filter);
    }
    if (paintItem != null && paintItem.getColorFilter() != null) {
        paintItem.setColorFilter(filter);
    }
    if (cropItem != null && cropItem.getColorFilter() != null) {
        cropItem.setColorFilter(filter);
    }
    if (tuneItem != null && tuneItem.getColorFilter() != null) {
        tuneItem.setColorFilter(filter);
    }
    if (rotateItem != null && rotateItem.getColorFilter() != null) {
        rotateItem.setColorFilter(filter);
    }
    if (mirrorItem != null && mirrorItem.getColorFilter() != null) {
        mirrorItem.setColorFilter(filter);
    }
    if (editorDoneLayout != null) {
        editorDoneLayout.doneButton.setTextColor(color);
    }
    if (qualityPicker != null) {
        qualityPicker.doneButton.setTextColor(color);
    }
    if (photoPaintView != null) {
        photoPaintView.updateColors();
    }
    if (photoFilterView != null) {
        photoFilterView.updateColors();
    }
    if (captionEditText != null) {
        captionEditText.updateColors();
    }
    if (videoTimelineView != null) {
        videoTimelineView.invalidate();
    }
    if (selectedPhotosListView != null) {
        int count = selectedPhotosListView.getChildCount();
        for (int a = 0; a < count; a++) {
            View view = selectedPhotosListView.getChildAt(a);
            if (view instanceof PhotoPickerPhotoCell) {
                ((PhotoPickerPhotoCell) view).updateColors();
            }
        }
    }
    if (masksAlert != null) {
        masksAlert.updateColors(true);
    }
}
Also used : PhotoPickerPhotoCell(org.telegram.ui.Cells.PhotoPickerPhotoCell) AnimatedFileDrawable(org.telegram.ui.Components.AnimatedFileDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) CombinedDrawable(org.telegram.ui.Components.CombinedDrawable) GradientDrawable(android.graphics.drawable.GradientDrawable) VideoForwardDrawable(org.telegram.ui.Components.VideoForwardDrawable) BitmapDrawable(android.graphics.drawable.BitmapDrawable) OtherDocumentPlaceholderDrawable(org.telegram.ui.Components.OtherDocumentPlaceholderDrawable) PlayPauseDrawable(org.telegram.ui.Components.PlayPauseDrawable) RLottieDrawable(org.telegram.ui.Components.RLottieDrawable) PorterDuffColorFilter(android.graphics.PorterDuffColorFilter) PhotoCropView(org.telegram.ui.Components.PhotoCropView) PhotoViewerWebView(org.telegram.ui.Components.PhotoViewerWebView) CropView(org.telegram.ui.Components.Crop.CropView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) SpoilersTextView(org.telegram.ui.Components.spoilers.SpoilersTextView) NestedScrollView(androidx.core.widget.NestedScrollView) RecyclerView(androidx.recyclerview.widget.RecyclerView) PipVideoView(org.telegram.ui.Components.PipVideoView) BackupImageView(org.telegram.ui.Components.BackupImageView) TextureView(android.view.TextureView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) PhotoViewerCaptionEnterView(org.telegram.ui.Components.PhotoViewerCaptionEnterView) UndoView(org.telegram.ui.Components.UndoView) VideoEditTextureView(org.telegram.ui.Components.VideoEditTextureView) GroupedPhotosListView(org.telegram.ui.Components.GroupedPhotosListView) PhotoPaintView(org.telegram.ui.Components.PhotoPaintView) ClippingImageView(org.telegram.ui.Components.ClippingImageView) View(android.view.View) TextView(android.widget.TextView) VideoTimelinePlayView(org.telegram.ui.Components.VideoTimelinePlayView) PhotoFilterView(org.telegram.ui.Components.PhotoFilterView) Paint(android.graphics.Paint) TextPaint(android.text.TextPaint) SuppressLint(android.annotation.SuppressLint)

Aggregations

SuppressLint (android.annotation.SuppressLint)1 Paint (android.graphics.Paint)1 PorterDuffColorFilter (android.graphics.PorterDuffColorFilter)1 BitmapDrawable (android.graphics.drawable.BitmapDrawable)1 ColorDrawable (android.graphics.drawable.ColorDrawable)1 Drawable (android.graphics.drawable.Drawable)1 GradientDrawable (android.graphics.drawable.GradientDrawable)1 TextPaint (android.text.TextPaint)1 TextureView (android.view.TextureView)1 View (android.view.View)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 NestedScrollView (androidx.core.widget.NestedScrollView)1 RecyclerView (androidx.recyclerview.widget.RecyclerView)1 SimpleTextView (org.telegram.ui.ActionBar.SimpleTextView)1 PhotoPickerPhotoCell (org.telegram.ui.Cells.PhotoPickerPhotoCell)1 AnimatedFileDrawable (org.telegram.ui.Components.AnimatedFileDrawable)1 BackupImageView (org.telegram.ui.Components.BackupImageView)1 ClippingImageView (org.telegram.ui.Components.ClippingImageView)1 CombinedDrawable (org.telegram.ui.Components.CombinedDrawable)1