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;
}
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;
}
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;
}
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));
}
}
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;
}
Aggregations