本文整理汇总了Java中org.telegram.tgnet.TLRPC.TL_messages_stickerSet方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.TL_messages_stickerSet方法的具体用法?Java TLRPC.TL_messages_stickerSet怎么用?Java TLRPC.TL_messages_stickerSet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.TL_messages_stickerSet方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setStickersSet
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void setStickersSet(TLRPC.TL_messages_stickerSet set, boolean divider) {
needDivider = divider;
stickersSet = set;
textView.setText(stickersSet.set.title);
if (stickersSet.set.archived) {
textView.setAlpha(0.5f);
valueTextView.setAlpha(0.5f);
imageView.setAlpha(0.5f);
} else {
textView.setAlpha(1.0f);
valueTextView.setAlpha(1.0f);
imageView.setAlpha(1.0f);
}
ArrayList<TLRPC.Document> documents = set.documents;
if (documents != null && !documents.isEmpty()) {
valueTextView.setText(LocaleController.formatPluralString("Stickers", documents.size()));
TLRPC.Document document = documents.get(0);
if (document.thumb != null && document.thumb.location != null) {
imageView.setImage(document.thumb.location, null, "webp", null);
}
} else {
valueTextView.setText(LocaleController.formatPluralString("Stickers", 0));
}
}
示例2: updateRows
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateRows() {
rowCount = 0;
ArrayList<TLRPC.TL_messages_stickerSet> stickerSets = StickersQuery.getStickerSets();
if (!stickerSets.isEmpty()) {
stickersStartRow = 0;
stickersEndRow = stickerSets.size();
rowCount += stickerSets.size();
} else {
stickersStartRow = -1;
stickersEndRow = -1;
}
stickersInfoRow = rowCount++;
if (listAdapter != null) {
listAdapter.notifyDataSetChanged();
}
}
示例3: onBindViewHolder
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public void onBindViewHolder(RecyclerView.ViewHolder holder, int position) {
switch (holder.getItemViewType()) {
case 0:
TLRPC.Document sticker = cache.get(position);
((StickerEmojiCell) holder.itemView).setSticker(sticker, false);
break;
case 1:
if (position == totalItems) {
int row = (position - 1) / stickersPerRow;
TLRPC.TL_messages_stickerSet pack = rowStartPack.get(row);
if (pack == null) {
((EmptyCell) holder.itemView).setHeight(1);
} else {
int height = pager.getHeight() - (int) Math.ceil(pack.documents.size() / (float) stickersPerRow) * AndroidUtilities.dp(82);
((EmptyCell) holder.itemView).setHeight(height > 0 ? height : 1);
}
} else {
((EmptyCell) holder.itemView).setHeight(AndroidUtilities.dp(82));
}
break;
}
}
示例4: getStickerById
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.Document getStickerById(long id) {
TLRPC.Document document = stickersById.get(id);
if (document != null) {
long setId = getStickerSetId(document);
TLRPC.TL_messages_stickerSet stickerSet = stickerSetsById.get(setId);
if (stickerSet != null && stickerSet.set.disabled) {
return null;
}
}
return document;
}
示例5: calcStickersHash
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private static int calcStickersHash(ArrayList<TLRPC.TL_messages_stickerSet> sets) {
long acc = 0;
for (int a = 0; a < sets.size(); a++) {
TLRPC.StickerSet set = sets.get(a).set;
if (set.archived) {
continue;
}
acc = ((acc * 20261) + 0x80000000L + set.hash) % 0x80000000L;
}
return (int) acc;
}
示例6: getItemId
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public long getItemId(int i) {
if (i >= stickersStartRow && i < stickersEndRow) {
ArrayList<TLRPC.TL_messages_stickerSet> arrayList = StickersQuery.getStickerSets();
return arrayList.get(i).set.id;
} else if (i == stickersInfoRow) {
return Integer.MIN_VALUE;
}
return i;
}
示例7: updateRows
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateRows() {
rowCount = 0;
if (currentType == StickersQuery.TYPE_IMAGE) {
featuredRow = rowCount++;
featuredInfoRow = rowCount++;
masksRow = rowCount++;
masksInfoRow = rowCount++;
archivedRow = rowCount++;
archivedInfoRow = rowCount++;
} else {
featuredRow = -1;
featuredInfoRow = -1;
masksRow = -1;
masksInfoRow = -1;
archivedRow = rowCount++;
archivedInfoRow = rowCount++;
}
ArrayList<TLRPC.TL_messages_stickerSet> stickerSets = StickersQuery.getStickerSets(currentType);
if (!stickerSets.isEmpty()) {
stickersStartRow = rowCount;
stickersEndRow = rowCount + stickerSets.size();
rowCount += stickerSets.size();
stickersShadowRow = rowCount++;
} else {
stickersStartRow = -1;
stickersEndRow = -1;
stickersShadowRow = -1;
}
if (listAdapter != null) {
listAdapter.notifyDataSetChanged();
}
}
示例8: notifyDataSetChanged
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
@Override
public void notifyDataSetChanged() {
int width = getMeasuredWidth();
if (width == 0) {
width = AndroidUtilities.displaySize.x;
}
stickersPerRow = width / AndroidUtilities.dp(72);
stickersLayoutManager.setSpanCount(stickersPerRow);
rowStartPack.clear();
packStartRow.clear();
cache.clear();
totalItems = 0;
ArrayList<TLRPC.TL_messages_stickerSet> packs = stickerSets[currentType];
for (int a = -1; a < packs.size(); a++) {
ArrayList<TLRPC.Document> documents;
TLRPC.TL_messages_stickerSet pack = null;
int startRow = totalItems / stickersPerRow;
if (a == -1) {
documents = recentStickers[currentType];
} else {
pack = packs.get(a);
documents = pack.documents;
packStartRow.put(pack, startRow);
}
if (documents.isEmpty()) {
continue;
}
int count = (int) Math.ceil(documents.size() / (float) stickersPerRow);
for (int b = 0; b < documents.size(); b++) {
cache.put(b + totalItems, documents.get(b));
}
totalItems += count * stickersPerRow;
for (int b = 0; b < count; b++) {
rowStartPack.put(startRow + b, pack);
}
}
super.notifyDataSetChanged();
}
示例9: swapElements
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public void swapElements(int fromIndex, int toIndex) {
if (fromIndex != toIndex) {
needReorder = true;
}
ArrayList<TLRPC.TL_messages_stickerSet> arrayList = StickersQuery.getStickerSets(currentType);
TLRPC.TL_messages_stickerSet from = arrayList.get(fromIndex - stickersStartRow);
arrayList.set(fromIndex - stickersStartRow, arrayList.get(toIndex - stickersStartRow));
arrayList.set(toIndex - stickersStartRow, from);
notifyItemMoved(fromIndex, toIndex);
}
示例10: getTabForPosition
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public int getTabForPosition(int position) {
if (stickersPerRow == 0) {
int width = getMeasuredWidth();
if (width == 0) {
width = AndroidUtilities.displaySize.x;
}
stickersPerRow = width / AndroidUtilities.dp(72);
}
int row = position / stickersPerRow;
TLRPC.TL_messages_stickerSet pack = rowStartPack.get(row);
if (pack == null) {
return recentTabBum;
}
return stickerSets.indexOf(pack) + stickersTabOffset;
}
示例11: getStickerSetByName
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.TL_messages_stickerSet getStickerSetByName(String name) {
return stickerSetsByName.get(name);
}
示例12: getStickerSetById
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.TL_messages_stickerSet getStickerSetById(Long id) {
return stickerSetsById.get(id);
}
示例13: getStickerSetName
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static String getStickerSetName(long setId) {
TLRPC.TL_messages_stickerSet stickerSet = stickerSetsById.get(setId);
return stickerSet != null ? stickerSet.set.short_name : null;
}
示例14: updateStickerTabs
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
private void updateStickerTabs() {
if (scrollSlidingTabStrip == null) {
return;
}
recentTabBum = -2;
stickersTabOffset = 0;
int lastPosition = scrollSlidingTabStrip.getCurrentPosition();
scrollSlidingTabStrip.removeTabs();
if (currentType == StickersQuery.TYPE_IMAGE) {
scrollSlidingTabStrip.addIconTab(R.drawable.ic_masks_msk1);
stickersEmptyView.setText(LocaleController.getString("NoStickers", R.string.NoStickers));
} else {
scrollSlidingTabStrip.addIconTab(R.drawable.ic_masks_sticker1);
stickersEmptyView.setText(LocaleController.getString("NoMasks", R.string.NoMasks));
}
if (!recentStickers[currentType].isEmpty()) {
recentTabBum = stickersTabOffset;
stickersTabOffset++;
scrollSlidingTabStrip.addIconTab(R.drawable.ic_masks_recent);
}
stickerSets[currentType].clear();
ArrayList<TLRPC.TL_messages_stickerSet> packs = StickersQuery.getStickerSets(currentType);
for (int a = 0; a < packs.size(); a++) {
TLRPC.TL_messages_stickerSet pack = packs.get(a);
if (pack.set.archived || pack.documents == null || pack.documents.isEmpty()) {
continue;
}
stickerSets[currentType].add(pack);
}
for (int a = 0; a < stickerSets[currentType].size(); a++) {
scrollSlidingTabStrip.addStickerTab(stickerSets[currentType].get(a).documents.get(0));
}
scrollSlidingTabStrip.updateTabStyles();
if (lastPosition != 0) {
scrollSlidingTabStrip.onPageScrolled(lastPosition, lastPosition);
}
checkPanels();
}
示例15: getPositionForPack
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public int getPositionForPack(TLRPC.TL_messages_stickerSet stickerSet) {
return packStartRow.get(stickerSet) * stickersPerRow;
}