Search in sources :

Example 1 with ManageChatUserCell

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

the class ChatUsersActivity method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    ThemeDescription.ThemeDescriptionDelegate cellDelegate = () -> {
        if (listView != null) {
            int count = listView.getChildCount();
            for (int a = 0; a < count; a++) {
                View child = listView.getChildAt(a);
                if (child instanceof ManageChatUserCell) {
                    ((ManageChatUserCell) child).update(0);
                }
            }
        }
    };
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { HeaderCell.class, ManageChatUserCell.class, ManageChatTextCell.class, TextCheckCell2.class, TextSettingsCell.class, ChooseView.class }, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundGray));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { View.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { TextInfoPrivacyCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextInfoPrivacyCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText4));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { ShadowSectionCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HeaderCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { GraySectionCell.class }, new String[] { "textView" }, null, null, null, Theme.key_graySectionText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { GraySectionCell.class }, null, null, null, Theme.key_graySection));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextSettingsCell.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteValueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "valueTextView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText2));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2Track));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCheckCell2.class }, new String[] { "checkBox" }, null, null, null, Theme.key_switch2TrackChecked));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "nameTextView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusOnlineColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlueText));
    themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_undo_background));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoImageView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoTextView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "infoTextView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "textPaint" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "progressPaint" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_IMAGECOLOR, new Class[] { UndoView.class }, new String[] { "leftImageView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayIcon));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueButton));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueIcon));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { StickerEmptyView.class }, new String[] { "title" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { StickerEmptyView.class }, new String[] { "subtitle" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(emptyView.title, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(emptyView.subtitle, ThemeDescription.FLAG_TEXTCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, null, Theme.avatarDrawables, null, Theme.key_avatar_text));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundRed));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundOrange));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundViolet));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundGreen));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundCyan));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundBlue));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundPink));
    return themeDescriptions;
}
Also used : ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) GraySectionCell(org.telegram.ui.Cells.GraySectionCell) HeaderCell(org.telegram.ui.Cells.HeaderCell) ArrayList(java.util.ArrayList) TextInfoPrivacyCell(org.telegram.ui.Cells.TextInfoPrivacyCell) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) TextCheckCell2(org.telegram.ui.Cells.TextCheckCell2) StickerEmptyView(org.telegram.ui.Components.StickerEmptyView) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) UndoView(org.telegram.ui.Components.UndoView) TextView(android.widget.TextView) StickerEmptyView(org.telegram.ui.Components.StickerEmptyView) FlickerLoadingView(org.telegram.ui.Components.FlickerLoadingView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) TextSettingsCell(org.telegram.ui.Cells.TextSettingsCell) UndoView(org.telegram.ui.Components.UndoView) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell)

Example 2 with ManageChatUserCell

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

the class PeopleNearbyActivity method createView.

@Override
public View createView(Context context) {
    actionBar.setBackButtonImage(R.drawable.ic_ab_back);
    actionBar.setBackgroundDrawable(null);
    actionBar.setTitleColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText));
    actionBar.setItemsColor(Theme.getColor(Theme.key_windowBackgroundWhiteBlackText), false);
    actionBar.setItemsBackgroundColor(Theme.getColor(Theme.key_listSelector), false);
    actionBar.setCastShadows(false);
    actionBar.setAddToContainer(false);
    actionBar.setOccupyStatusBar(Build.VERSION.SDK_INT >= 21 && !AndroidUtilities.isTablet());
    actionBar.setTitle(LocaleController.getString("PeopleNearby", R.string.PeopleNearby));
    actionBar.getTitleTextView().setAlpha(0.0f);
    if (!AndroidUtilities.isTablet()) {
        actionBar.showActionModeTop();
    }
    actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {

        @Override
        public void onItemClick(int id) {
            if (id == -1) {
                finishFragment();
            }
        }
    });
    fragmentView = new FrameLayout(context) {

        @Override
        protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
            FrameLayout.LayoutParams layoutParams = (FrameLayout.LayoutParams) actionBarBackground.getLayoutParams();
            layoutParams.height = ActionBar.getCurrentActionBarHeight() + (actionBar.getOccupyStatusBar() ? AndroidUtilities.statusBarHeight : 0) + AndroidUtilities.dp(3);
            super.onMeasure(widthMeasureSpec, heightMeasureSpec);
        }

        @Override
        protected void onLayout(boolean changed, int left, int top, int right, int bottom) {
            super.onLayout(changed, left, top, right, bottom);
            checkScroll(false);
        }
    };
    fragmentView.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundGray));
    fragmentView.setTag(Theme.key_windowBackgroundGray);
    FrameLayout frameLayout = (FrameLayout) fragmentView;
    listView = new RecyclerListView(context);
    listView.setGlowColor(0);
    listView.setLayoutManager(layoutManager = new LinearLayoutManager(context, LinearLayoutManager.VERTICAL, false));
    listView.setAdapter(listViewAdapter = new ListAdapter(context));
    listView.setVerticalScrollbarPosition(LocaleController.isRTL ? RecyclerListView.SCROLLBAR_POSITION_LEFT : RecyclerListView.SCROLLBAR_POSITION_RIGHT);
    frameLayout.addView(listView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT));
    itemAnimator = new DefaultItemAnimator() {

        @Override
        protected long getAddAnimationDelay(long removeDuration, long moveDuration, long changeDuration) {
            return removeDuration;
        }
    };
    listView.setOnItemClickListener((view, position) -> {
        if (getParentActivity() == null) {
            return;
        }
        if (position >= usersStartRow && position < usersEndRow) {
            if (view instanceof ManageChatUserCell) {
                ManageChatUserCell cell = (ManageChatUserCell) view;
                TLRPC.TL_peerLocated peerLocated = users.get(position - usersStartRow);
                Bundle args1 = new Bundle();
                args1.putLong("user_id", peerLocated.peer.user_id);
                if (cell.hasAvatarSet()) {
                    args1.putBoolean("expandPhoto", true);
                }
                args1.putInt("nearby_distance", peerLocated.distance);
                MessagesController.getInstance(currentAccount).ensureMessagesLoaded(peerLocated.peer.user_id, 0, null);
                presentFragment(new ProfileActivity(args1));
            }
        } else if (position >= chatsStartRow && position < chatsEndRow) {
            TLRPC.TL_peerLocated peerLocated = chats.get(position - chatsStartRow);
            Bundle args1 = new Bundle();
            long chatId;
            if (peerLocated.peer instanceof TLRPC.TL_peerChat) {
                chatId = peerLocated.peer.chat_id;
            } else {
                chatId = peerLocated.peer.channel_id;
            }
            args1.putLong("chat_id", chatId);
            ChatActivity chatActivity = new ChatActivity(args1);
            presentFragment(chatActivity);
        } else if (position == chatsCreateRow) {
            if (checkingCanCreate || currentGroupCreateAddress == null) {
                loadingDialog = new AlertDialog(getParentActivity(), 3);
                loadingDialog.setOnCancelListener(dialog -> loadingDialog = null);
                loadingDialog.show();
                return;
            }
            openGroupCreate();
        } else if (position == showMeRow) {
            UserConfig userConfig = getUserConfig();
            if (showingMe) {
                userConfig.sharingMyLocationUntil = 0;
                userConfig.saveConfig(false);
                sendRequest(false, 2);
                updateRows(null);
            } else {
                AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
                builder.setTitle(LocaleController.getString("MakeMyselfVisibleTitle", R.string.MakeMyselfVisibleTitle));
                builder.setMessage(LocaleController.getString("MakeMyselfVisibleInfo", R.string.MakeMyselfVisibleInfo));
                builder.setPositiveButton(LocaleController.getString("OK", R.string.OK), (dialog, which) -> {
                    userConfig.sharingMyLocationUntil = 0x7fffffff;
                    userConfig.saveConfig(false);
                    sendRequest(false, 1);
                    updateRows(null);
                });
                builder.setNegativeButton(LocaleController.getString("Cancel", R.string.Cancel), null);
                showDialog(builder.create());
            }
            userConfig.saveConfig(false);
        } else if (position == showMoreRow) {
            expanded = true;
            DiffCallback diffCallback = new DiffCallback();
            diffCallback.saveCurrentState();
            updateRows(diffCallback);
        }
    });
    listView.setOnScrollListener(new RecyclerView.OnScrollListener() {

        @Override
        public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
            checkScroll(true);
        }
    });
    actionBarBackground = new View(context) {

        private Paint paint = new Paint();

        @Override
        protected void onDraw(Canvas canvas) {
            paint.setColor(Theme.getColor(Theme.key_windowBackgroundWhite));
            int h = getMeasuredHeight() - AndroidUtilities.dp(3);
            canvas.drawRect(0, 0, getMeasuredWidth(), h, paint);
            parentLayout.drawHeaderShadow(canvas, h);
        }
    };
    actionBarBackground.setAlpha(0.0f);
    frameLayout.addView(actionBarBackground, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
    frameLayout.addView(actionBar, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT));
    undoView = new UndoView(context);
    frameLayout.addView(undoView, LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.WRAP_CONTENT, Gravity.BOTTOM | Gravity.LEFT, 8, 0, 8, 8));
    updateRows(null);
    return fragmentView;
}
Also used : AlertDialog(org.telegram.ui.ActionBar.AlertDialog) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) Bundle(android.os.Bundle) FrameLayout(android.widget.FrameLayout) ImageView(android.widget.ImageView) AndroidUtilities(org.telegram.messenger.AndroidUtilities) Animator(android.animation.Animator) LocationController(org.telegram.messenger.LocationController) RadialProgressView(org.telegram.ui.Components.RadialProgressView) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) View(android.view.View) Canvas(android.graphics.Canvas) RecyclerView(androidx.recyclerview.widget.RecyclerView) DiffUtil(androidx.recyclerview.widget.DiffUtil) ObjectAnimator(android.animation.ObjectAnimator) UndoView(org.telegram.ui.Components.UndoView) BaseFragment(org.telegram.ui.ActionBar.BaseFragment) AnimatorListenerAdapter(android.animation.AnimatorListenerAdapter) ViewGroup(android.view.ViewGroup) NotificationCenter(org.telegram.messenger.NotificationCenter) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) UserConfig(org.telegram.messenger.UserConfig) TextView(android.widget.TextView) Paint(android.graphics.Paint) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) Location(android.location.Location) Context(android.content.Context) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell) SparseIntArray(android.util.SparseIntArray) Theme(org.telegram.ui.ActionBar.Theme) SystemClock(android.os.SystemClock) LocaleController(org.telegram.messenger.LocaleController) HeaderCell(org.telegram.ui.Cells.HeaderCell) AlertsCreator(org.telegram.ui.Components.AlertsCreator) ArrayList(java.util.ArrayList) TLRPC(org.telegram.tgnet.TLRPC) ActionBar(org.telegram.ui.ActionBar.ActionBar) AnimatorSet(android.animation.AnimatorSet) MessageObject(org.telegram.messenger.MessageObject) BuildVars(org.telegram.messenger.BuildVars) Build(android.os.Build) R(org.telegram.messenger.R) LayoutHelper(org.telegram.ui.Components.LayoutHelper) FileLog(org.telegram.messenger.FileLog) ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) MessagesController(org.telegram.messenger.MessagesController) Gravity(android.view.Gravity) TypedValue(android.util.TypedValue) ShareLocationDrawable(org.telegram.ui.Components.ShareLocationDrawable) ChatObject(org.telegram.messenger.ChatObject) AlertDialog(org.telegram.ui.ActionBar.AlertDialog) RecyclerListView(org.telegram.ui.Components.RecyclerListView) ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) RecyclerListView(org.telegram.ui.Components.RecyclerListView) LinearLayoutManager(androidx.recyclerview.widget.LinearLayoutManager) DefaultItemAnimator(androidx.recyclerview.widget.DefaultItemAnimator) TLRPC(org.telegram.tgnet.TLRPC) UndoView(org.telegram.ui.Components.UndoView) ActionBar(org.telegram.ui.ActionBar.ActionBar) Bundle(android.os.Bundle) Canvas(android.graphics.Canvas) Paint(android.graphics.Paint) UserConfig(org.telegram.messenger.UserConfig) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) UndoView(org.telegram.ui.Components.UndoView) TextView(android.widget.TextView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) Paint(android.graphics.Paint) FrameLayout(android.widget.FrameLayout) RecyclerView(androidx.recyclerview.widget.RecyclerView)

Example 3 with ManageChatUserCell

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

the class PeopleNearbyActivity method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    ThemeDescription.ThemeDescriptionDelegate cellDelegate = () -> {
        if (listView != null) {
            int count = listView.getChildCount();
            for (int a = 0; a < count; a++) {
                View child = listView.getChildAt(a);
                if (child instanceof ManageChatUserCell) {
                    ((ManageChatUserCell) child).update(0);
                }
            }
        }
    };
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { ManageChatUserCell.class, ManageChatTextCell.class, HeaderCell.class, TextView.class, HintInnerCell.class }, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundGray));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(actionBarBackground, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { View.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { ShadowSectionCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HeaderCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_PROGRESSBAR, new Class[] { HeaderCellProgress.class }, new String[] { "progressView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "nameTextView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusOnlineColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, null, Theme.avatarDrawables, null, Theme.key_avatar_text));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundRed));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundOrange));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundViolet));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundGreen));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundCyan));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundBlue));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundPink));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_USEBACKGROUNDDRAWABLE, new Class[] { HintInnerCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_chats_archiveBackground));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HintInnerCell.class }, new String[] { "messageTextView" }, null, null, null, Theme.key_chats_message));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayIcon));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueButton));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueIcon));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteRedText5));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteRedText5));
    themeDescriptions.add(new ThemeDescription(undoView, ThemeDescription.FLAG_BACKGROUNDFILTER, null, null, null, null, Theme.key_undo_background));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoImageView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "undoTextView" }, null, null, null, Theme.key_undo_cancelColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "infoTextView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "subinfoTextView" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "textPaint" }, null, null, null, Theme.key_undo_infoColor));
    themeDescriptions.add(new ThemeDescription(undoView, 0, new Class[] { UndoView.class }, new String[] { "progressPaint" }, null, null, null, Theme.key_undo_infoColor));
    return themeDescriptions;
}
Also used : ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) HeaderCell(org.telegram.ui.Cells.HeaderCell) ArrayList(java.util.ArrayList) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) ImageView(android.widget.ImageView) RadialProgressView(org.telegram.ui.Components.RadialProgressView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) UndoView(org.telegram.ui.Components.UndoView) TextView(android.widget.TextView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) UndoView(org.telegram.ui.Components.UndoView) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell) TextView(android.widget.TextView)

Example 4 with ManageChatUserCell

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

the class MessageStatisticActivity method recolorRecyclerItem.

private void recolorRecyclerItem(View child) {
    if (child instanceof ManageChatUserCell) {
        ((ManageChatUserCell) child).update(0);
    } else if (child instanceof StatisticActivity.BaseChartCell) {
        ((StatisticActivity.BaseChartCell) child).recolor();
        child.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
    } else 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);
    } else if (child instanceof ChartHeaderView) {
        ((ChartHeaderView) child).recolor();
    } else if (child instanceof OverviewCell) {
        ((OverviewCell) child).updateColors();
        child.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
    }
    if (child instanceof EmptyCell) {
        child.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
    }
}
Also used : ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) ShadowSectionCell(org.telegram.ui.Cells.ShadowSectionCell) ColorDrawable(android.graphics.drawable.ColorDrawable) CombinedDrawable(org.telegram.ui.Components.CombinedDrawable) ColorDrawable(android.graphics.drawable.ColorDrawable) Drawable(android.graphics.drawable.Drawable) CombinedDrawable(org.telegram.ui.Components.CombinedDrawable) BackDrawable(org.telegram.ui.ActionBar.BackDrawable) EmptyCell(org.telegram.ui.Cells.EmptyCell) ChartHeaderView(org.telegram.ui.Charts.view_data.ChartHeaderView)

Example 5 with ManageChatUserCell

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

the class ManageLinksActivity method getThemeDescriptions.

@Override
public ArrayList<ThemeDescription> getThemeDescriptions() {
    ArrayList<ThemeDescription> themeDescriptions = new ArrayList<>();
    ThemeDescription.ThemeDescriptionDelegate cellDelegate = () -> {
        if (listView != null) {
            int count = listView.getChildCount();
            for (int a = 0; a < count; a++) {
                View child = listView.getChildAt(a);
                if (child instanceof ManageChatUserCell) {
                    ((ManageChatUserCell) child).update(0);
                }
                if (child instanceof LinkActionView) {
                    ((LinkActionView) child).updateColors();
                }
            }
        }
        if (inviteLinkBottomSheet != null) {
            inviteLinkBottomSheet.updateColors();
        }
    };
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CELLBACKGROUNDCOLOR, new Class[] { HeaderCell.class, TextCell.class, LinkActionView.class, LinkCell.class }, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundGray));
    themeDescriptions.add(new ThemeDescription(fragmentView, ThemeDescription.FLAG_BACKGROUND | ThemeDescription.FLAG_CHECKTAG, null, null, null, null, Theme.key_windowBackgroundWhite));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_BACKGROUND, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_LISTGLOWCOLOR, null, null, null, null, Theme.key_actionBarDefault));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_ITEMSCOLOR, null, null, null, null, Theme.key_actionBarDefaultIcon));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_TITLECOLOR, null, null, null, null, Theme.key_actionBarDefaultTitle));
    themeDescriptions.add(new ThemeDescription(actionBar, ThemeDescription.FLAG_AB_SELECTORCOLOR, null, null, null, null, Theme.key_actionBarDefaultSelector));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_SELECTOR, null, null, null, null, Theme.key_listSelector));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { View.class }, Theme.dividerPaint, null, null, Theme.key_divider));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { TextInfoPrivacyCell.class }, null, null, null, Theme.key_windowBackgroundGrayShadow));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextInfoPrivacyCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText4));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "nameTextView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, new String[] { "statusOnlineColor" }, null, null, cellDelegate, Theme.key_windowBackgroundWhiteBlueText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { ManageChatUserCell.class }, null, Theme.avatarDrawables, null, Theme.key_avatar_text));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundRed));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundOrange));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundViolet));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundGreen));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundCyan));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundBlue));
    themeDescriptions.add(new ThemeDescription(null, 0, null, null, null, cellDelegate, Theme.key_avatar_backgroundPink));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HintInnerCell.class }, new String[] { "messageTextView" }, null, null, null, Theme.key_chats_message));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_chats_unreadCounterMuted));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueButton));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_CHECKTAG, new Class[] { ManageChatTextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueIcon));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueText2));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_BACKGROUNDFILTER, new Class[] { TextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_switchTrackChecked));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { TextCell.class }, new String[] { "imageView" }, null, null, null, Theme.key_checkboxCheck));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { HeaderCell.class }, new String[] { "textView" }, null, null, null, Theme.key_windowBackgroundWhiteBlueHeader));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { LinkCell.class }, new String[] { "titleView" }, null, null, null, Theme.key_windowBackgroundWhiteBlackText));
    themeDescriptions.add(new ThemeDescription(listView, 0, new Class[] { LinkCell.class }, new String[] { "subtitleView" }, null, null, null, Theme.key_windowBackgroundWhiteGrayText));
    themeDescriptions.add(new ThemeDescription(listView, ThemeDescription.FLAG_IMAGECOLOR, new Class[] { LinkCell.class }, new String[] { "optionsView" }, null, null, null, Theme.key_stickers_menu));
    return themeDescriptions;
}
Also used : LinkActionView(org.telegram.ui.Components.LinkActionView) ManageChatUserCell(org.telegram.ui.Cells.ManageChatUserCell) HeaderCell(org.telegram.ui.Cells.HeaderCell) ArrayList(java.util.ArrayList) TextInfoPrivacyCell(org.telegram.ui.Cells.TextInfoPrivacyCell) ThemeDescription(org.telegram.ui.ActionBar.ThemeDescription) ImageView(android.widget.ImageView) View(android.view.View) RecyclerView(androidx.recyclerview.widget.RecyclerView) TextView(android.widget.TextView) LinkActionView(org.telegram.ui.Components.LinkActionView) SimpleTextView(org.telegram.ui.ActionBar.SimpleTextView) BackupImageView(org.telegram.ui.Components.BackupImageView) FlickerLoadingView(org.telegram.ui.Components.FlickerLoadingView) RecyclerListView(org.telegram.ui.Components.RecyclerListView) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell) ManageChatTextCell(org.telegram.ui.Cells.ManageChatTextCell)

Aggregations

ManageChatUserCell (org.telegram.ui.Cells.ManageChatUserCell)7 View (android.view.View)6 RecyclerView (androidx.recyclerview.widget.RecyclerView)6 ArrayList (java.util.ArrayList)6 ThemeDescription (org.telegram.ui.ActionBar.ThemeDescription)6 ManageChatTextCell (org.telegram.ui.Cells.ManageChatTextCell)6 RecyclerListView (org.telegram.ui.Components.RecyclerListView)6 TextView (android.widget.TextView)5 HeaderCell (org.telegram.ui.Cells.HeaderCell)5 ShadowSectionCell (org.telegram.ui.Cells.ShadowSectionCell)5 ImageView (android.widget.ImageView)4 RadialProgressView (org.telegram.ui.Components.RadialProgressView)3 UndoView (org.telegram.ui.Components.UndoView)3 TextInfoPrivacyCell (org.telegram.ui.Cells.TextInfoPrivacyCell)2 BackupImageView (org.telegram.ui.Components.BackupImageView)2 EmptyTextProgressView (org.telegram.ui.Components.EmptyTextProgressView)2 Animator (android.animation.Animator)1 AnimatorListenerAdapter (android.animation.AnimatorListenerAdapter)1 AnimatorSet (android.animation.AnimatorSet)1 ObjectAnimator (android.animation.ObjectAnimator)1