Java Code Examples for org.telegram.ui.Components.RecyclerListView#Holder
The following examples show how to use
org.telegram.ui.Components.RecyclerListView#Holder .
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: ProfileActivity.java From TelePlus-Android with GNU General Public License v2.0 | 6 votes |
private void checkListViewScroll() { if (listView.getChildCount() <= 0 || openAnimationInProgress) return; View child = listView.getChildAt(0); RecyclerListView.Holder holder = (RecyclerListView.Holder) listView.findContainingViewHolder(child); int top = child.getTop(); int newOffset = 0; if (top >= 0 && holder != null && holder.getAdapterPosition() == 0) newOffset = top; if (extraHeight != newOffset) { extraHeight = newOffset; topView.invalidate(); if (playProfileAnimation) allowProfileAnimation = extraHeight != 0; needLayout(); } }
Example 2
Source File: SettingsActivity.java From Telegram with GNU General Public License v2.0 | 6 votes |
private void checkListViewScroll() { if (listView.getVisibility() != View.VISIBLE || listView.getChildCount() <= 0 || openAnimationInProgress || writeButton.getVisibility() != View.VISIBLE) { return; } View child = listView.getChildAt(0); RecyclerListView.Holder holder = (RecyclerListView.Holder) listView.findContainingViewHolder(child); int top = child.getTop(); int newOffset = 0; if (top >= 0 && holder != null && holder.getAdapterPosition() == 0) { newOffset = top; } if (extraHeight != newOffset) { extraHeight = newOffset; topView.invalidate(); needLayout(); } }
Example 3
Source File: ChatUsersActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ManageChatUserCell(mContext, 2, true); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); ((ManageChatUserCell) view).setDelegate((cell, click) -> { TLObject object = getItem((Integer) cell.getTag()); if (object instanceof TLRPC.ChatParticipant) { TLRPC.ChatParticipant participant = (TLRPC.ChatParticipant) getItem((Integer) cell.getTag()); return createMenuForParticipant(participant, !click); } else { return false; } }); return new RecyclerListView.Holder(view); }
Example 4
Source File: ChannelEditActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ManageChatUserCell(mContext, 8, true); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); ((ManageChatUserCell) view).setDelegate((cell, click) -> createMenuForParticipant(null, getItem((Integer) cell.getTag()), !click)); return new RecyclerListView.Holder(view); }
Example 5
Source File: AudioSelectActivity.java From TelePlus-Android with GNU General Public License v2.0 | 5 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { AudioCell view = new AudioCell(mContext); view.setDelegate(new AudioCell.AudioCellDelegate() { @Override public void startedPlayingAudio(MessageObject messageObject) { playingAudio = messageObject; } }); return new RecyclerListView.Holder(view); }
Example 6
Source File: TooManyCommunitiesActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new GroupCreateUserCell(parent.getContext(), true, 0, false)); }
Example 7
Source File: SetAdminsActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new UserCell(mContext, 1, 2, false)); }
Example 8
Source File: ThemePreviewActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { PatternCell view = new PatternCell(mContext, maxWallpaperSize, new PatternCell.PatternCellDelegate() { @Override public TLRPC.TL_wallPaper getSelectedPattern() { return selectedPattern; } @Override public int getPatternColor() { return patternColor; } @Override public int getBackgroundColor() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundColor; } int defaultBackground = Theme.getDefaultAccentColor(Theme.key_chat_wallpaper); int backgroundOverrideColor = (int) accent.backgroundOverrideColor; return backgroundOverrideColor != 0 ? backgroundOverrideColor : defaultBackground; } @Override public int getBackgroundGradientColor() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundGradientColor; } int defaultBackgroundGradient = Theme.getDefaultAccentColor(Theme.key_chat_wallpaper_gradient_to); int backgroundGradientOverrideColor = (int) accent.backgroundGradientOverrideColor; return backgroundGradientOverrideColor != 0 ? backgroundGradientOverrideColor : defaultBackgroundGradient; } @Override public int getBackgroundGradientAngle() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundRotation; } return accent.backgroundRotation; } }); return new RecyclerListView.Holder(view); }
Example 9
Source File: CountrySelectActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new TextSettingsCell(mContext)); }
Example 10
Source File: ThemePreviewActivity.java From Telegram with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { PatternCell view = new PatternCell(mContext, maxWallpaperSize, new PatternCell.PatternCellDelegate() { @Override public TLRPC.TL_wallPaper getSelectedPattern() { return selectedPattern; } @Override public int getPatternColor() { return patternColor; } @Override public int getBackgroundColor() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundColor; } int defaultBackground = Theme.getDefaultAccentColor(Theme.key_chat_wallpaper); int backgroundOverrideColor = (int) accent.backgroundOverrideColor; return backgroundOverrideColor != 0 ? backgroundOverrideColor : defaultBackground; } @Override public int getBackgroundGradientColor() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundGradientColor; } int defaultBackgroundGradient = Theme.getDefaultAccentColor(Theme.key_chat_wallpaper_gradient_to); int backgroundGradientOverrideColor = (int) accent.backgroundGradientOverrideColor; return backgroundGradientOverrideColor != 0 ? backgroundGradientOverrideColor : defaultBackgroundGradient; } @Override public int getBackgroundGradientAngle() { if (screenType == SCREEN_TYPE_CHANGE_BACKGROUND) { return backgroundRotation; } return accent.backgroundRotation; } }); return new RecyclerListView.Holder(view); }
Example 11
Source File: LanguageSelectActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@NonNull @Override public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new LanguageCell(mContext, false)); }
Example 12
Source File: WallpapersListActivity.java From Telegram with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ColorCell(mContext); return new RecyclerListView.Holder(view); }
Example 13
Source File: ChatLinkActivity.java From Telegram with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ManageChatUserCell(mContext, 6, 2, false); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); return new RecyclerListView.Holder(view); }
Example 14
Source File: NotificationsExceptionsActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ProfileSearchCell(mContext); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); return new RecyclerListView.Holder(view); }
Example 15
Source File: ThemesHorizontalListCell.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new InnerThemeView(mContext)); }
Example 16
Source File: DialogsSearchAdapter.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new HintDialogCell(mContext); view.setLayoutParams(new RecyclerView.LayoutParams(AndroidUtilities.dp(80), AndroidUtilities.dp(86))); return new RecyclerListView.Holder(view); }
Example 17
Source File: StickersAdapter.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { StickerCell view = new StickerCell(mContext); return new RecyclerListView.Holder(view); }
Example 18
Source File: ChatLinkActivity.java From Telegram-FOSS with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { View view = new ManageChatUserCell(mContext, 6, 2, false); view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite)); return new RecyclerListView.Holder(view); }
Example 19
Source File: SetAdminsActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { return new RecyclerListView.Holder(new UserCell(mContext, 1, 2, false)); }
Example 20
Source File: WallpapersActivity.java From TelePlus-Android with GNU General Public License v2.0 | 4 votes |
@Override public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) { WallpaperCell view = new WallpaperCell(mContext); return new RecyclerListView.Holder(view); }