当前位置: 首页>>代码示例>>Java>>正文


Java RecyclerListView.Holder方法代码示例

本文整理汇总了Java中org.telegram.ui.Components.RecyclerListView.Holder方法的典型用法代码示例。如果您正苦于以下问题:Java RecyclerListView.Holder方法的具体用法?Java RecyclerListView.Holder怎么用?Java RecyclerListView.Holder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.telegram.ui.Components.RecyclerListView的用法示例。


在下文中一共展示了RecyclerListView.Holder方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkListViewScroll

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
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();
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:22,代码来源:ProfileActivity.java

示例2: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@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(new ManageChatUserCell.ManageChatUserCellDelegate() {
        @Override
        public boolean onOptionsButtonCheck(ManageChatUserCell cell, boolean 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);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:19,代码来源:ChatUsersActivity.java

示例3: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch (viewType) {
        case 0:
            view = new GroupCreateSectionCell(context);
            break;
        default:
            view = new GroupCreateUserCell(context, true);
            break;
    }
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:14,代码来源:GroupCreateActivity.java

示例4: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch (viewType) {
        case 0:
            view = new GroupCreateSectionCell(context);
            break;
        default:
            view = new GroupCreateUserCell(context, false);
            break;
    }
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:14,代码来源:GroupCreateFinalActivity.java

示例5: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@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);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:12,代码来源:AudioSelectActivity.java

示例6: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch (viewType) {
        case 0:
            view = new ManageChatUserCell(mContext, 2, selectType == 0);
            view.setBackgroundColor(Theme.getColor(Theme.key_windowBackgroundWhite));
            ((ManageChatUserCell) view).setDelegate(new ManageChatUserCell.ManageChatUserCellDelegate() {
                @Override
                public boolean onOptionsButtonCheck(ManageChatUserCell cell, boolean click) {
                    TLObject object = getItem((Integer) cell.getTag());
                    if (object instanceof TLRPC.ChannelParticipant) {
                        TLRPC.ChannelParticipant participant = (TLRPC.ChannelParticipant) getItem((Integer) cell.getTag());
                        return createMenuForParticipant(participant, !click);
                    } else {
                        return false;
                    }
                }
            });
            break;
        case 1:
        default:
            view = new GraySectionCell(mContext);
            break;
    }
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:28,代码来源:ChannelUsersActivity.java

示例7: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch (viewType) {
        case 1:
            view = new InviteTextCell(context);
            ((InviteTextCell) view).setTextAndIcon(LocaleController.getString("ShareTelegram", R.string.ShareTelegram), R.drawable.share);
            break;
        default:
            view = new InviteUserCell(context, true);
            break;
    }
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:15,代码来源:InviteContactsActivity.java

示例8: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@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(new ManageChatUserCell.ManageChatUserCellDelegate() {
        @Override
        public boolean onOptionsButtonCheck(ManageChatUserCell cell, boolean click) {
            return createMenuForParticipant(null, getItem((Integer) cell.getTag()), !click);
        }
    });
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:13,代码来源:ChannelEditActivity.java

示例9: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    return new RecyclerListView.Holder(new LanguageCell(mContext, false));
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:5,代码来源:LanguageSelectActivity.java

示例10: onPause

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public void onPause() {
    super.onPause();
    AndroidUtilities.cancelRunOnUIThread(readRunnable);
    MediaController.getInstance().stopRaiseToEarSensors(this);
    paused = true;
    wasPaused = true;
    NotificationsController.getInstance().setOpenedDialogId(0);
    CharSequence draftMessage = null;
    MessageObject replyMessage = null;
    boolean searchWebpage = true;
    if (!ignoreAttachOnPause && chatActivityEnterView != null && bottomOverlayChat.getVisibility() != View.VISIBLE) {
        chatActivityEnterView.onPause();
        replyMessage = replyingMessageObject;
        if (!chatActivityEnterView.isEditingMessage()) {
            CharSequence text = AndroidUtilities.getTrimmedString(chatActivityEnterView.getFieldText());
            if (!TextUtils.isEmpty(text) && !TextUtils.equals(text, "@gif")) {
                draftMessage = text;
            }
        }
        searchWebpage = chatActivityEnterView.isMessageWebPageSearchEnabled();
        chatActivityEnterView.setFieldFocused(false);
    }
    if (chatAttachAlert != null) {
        if (!ignoreAttachOnPause){
            chatAttachAlert.onPause();
        } else {
            ignoreAttachOnPause = false;
        }
    }
    CharSequence[] message = new CharSequence[] {draftMessage};
    ArrayList<TLRPC.MessageEntity> entities = MessagesQuery.getEntities(message);
    DraftQuery.saveDraft(dialog_id, message[0], entities, replyMessage != null ? replyMessage.messageOwner : null, !searchWebpage);

    MessagesController.getInstance().cancelTyping(0, dialog_id);

    if (!pausedOnLastMessage) {
        SharedPreferences.Editor editor = ApplicationLoader.applicationContext.getSharedPreferences("Notifications", Activity.MODE_PRIVATE).edit();
        int messageId = 0;
        int offset = 0;
        if (chatLayoutManager != null) {
            int position = chatLayoutManager.findFirstVisibleItemPosition();
            if (position != 0) {
                RecyclerListView.Holder holder = (RecyclerListView.Holder) chatListView.findViewHolderForAdapterPosition(position);
                if (holder != null) {
                    if (holder.itemView instanceof ChatMessageCell) {
                        messageId = ((ChatMessageCell) holder.itemView).getMessageObject().getId();
                    } else if (holder.itemView instanceof ChatActionCell) {
                        messageId = ((ChatActionCell) holder.itemView).getMessageObject().getId();
                    }
                    if (messageId != 0) {
                        offset = holder.itemView.getBottom() - chatListView.getMeasuredHeight();
                        FileLog.d("save offset = " + offset + " for mid " + messageId);
                    }
                }
            }
        }
        if (messageId != 0) {
            editor.putInt("diditem" + dialog_id, messageId);
            editor.putInt("diditemo" + dialog_id, offset);
        } else {
            pausedOnLastMessage = true;
            editor.remove("diditem" + dialog_id);
            editor.remove("diditemo" + dialog_id);
        }
        editor.commit();
    }

    if (currentUser != null) {
        chatLeaveTime = System.currentTimeMillis();
        updateInformationForScreenshotDetector();
    }
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:74,代码来源:ChatActivity.java

示例11: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view;
    switch (viewType) {
        case 0:
            PhotoPickerPhotoCell cell = new PhotoPickerPhotoCell(mContext, false);
            cell.checkFrame.setOnClickListener(new View.OnClickListener() {
                @Override
                public void onClick(View v) {
                    Object photoEntry = ((View) v.getParent()).getTag();
                    int idx = imagesArrLocals.indexOf(photoEntry);
                    if (idx >= 0) {
                        int num = placeProvider.setPhotoChecked(idx, getCurrentVideoEditedInfo());
                        boolean checked = placeProvider.isPhotoChecked(idx);
                        if (idx == currentIndex) {
                            checkImageView.setChecked(false, true);
                        }
                        if (num >= 0) {
                            if (placeProvider.allowGroupPhotos()) {
                                num++;
                            }
                            selectedPhotosAdapter.notifyItemRemoved(num);
                        }
                        updateSelectedCount();
                    }
                }
            });
            view = cell;
            break;
        case 1:
        default:
            ImageView imageView = new ImageView(mContext) {
                @Override
                protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
                    super.onMeasure(MeasureSpec.makeMeasureSpec(AndroidUtilities.dp(66), MeasureSpec.EXACTLY), MeasureSpec.makeMeasureSpec(MeasureSpec.getSize(heightMeasureSpec), MeasureSpec.EXACTLY));
                }
            };
            imageView.setScaleType(ImageView.ScaleType.CENTER);
            imageView.setImageResource(R.drawable.photos_group);
            view = imageView;
            break;
    }
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:45,代码来源:PhotoViewer.java

示例12: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    return new RecyclerListView.Holder(new LocationCell(mContext));
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:5,代码来源:LocationActivitySearchAdapter.java

示例13: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup viewGroup, int i) {
    StickerCell view = new StickerCell(mContext);
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:6,代码来源:StickersAdapter.java

示例14: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    View view = new HintDialogCell(mContext);
    view.setLayoutParams(new RecyclerView.LayoutParams(AndroidUtilities.dp(80), AndroidUtilities.dp(100)));
    return new RecyclerListView.Holder(view);
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:7,代码来源:DialogsSearchAdapter.java

示例15: onCreateViewHolder

import org.telegram.ui.Components.RecyclerListView; //导入方法依赖的package包/类
@Override
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
    return new RecyclerListView.Holder(new UserCell(mContext, 1, 2, false));
}
 
开发者ID:DrKLO,项目名称:Telegram,代码行数:5,代码来源:SetAdminsActivity.java


注:本文中的org.telegram.ui.Components.RecyclerListView.Holder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。