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


Java TLRPC.TL_messages_stickerSet方法代码示例

本文整理汇总了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));
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:26,代码来源:StickerSetCell.java

示例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();
    }
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:17,代码来源:StickersActivity.java

示例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;
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:24,代码来源:EmojiView.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:12,代码来源:StickersQuery.java

示例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;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:12,代码来源:StickersQuery.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:11,代码来源:StickersActivity.java

示例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();
    }
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:33,代码来源:StickersActivity.java

示例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();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:39,代码来源:StickerMasksView.java

示例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);
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:11,代码来源:StickersActivity.java

示例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;
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:16,代码来源:EmojiView.java

示例11: getStickerSetByName

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.TL_messages_stickerSet getStickerSetByName(String name) {
    return stickerSetsByName.get(name);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:StickersQuery.java

示例12: getStickerSetById

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public static TLRPC.TL_messages_stickerSet getStickerSetById(Long id) {
    return stickerSetsById.get(id);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:4,代码来源:StickersQuery.java

示例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;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:5,代码来源:StickersQuery.java

示例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();
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:42,代码来源:StickerMasksView.java

示例15: getPositionForPack

import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public int getPositionForPack(TLRPC.TL_messages_stickerSet stickerSet) {
    return packStartRow.get(stickerSet) * stickersPerRow;
}
 
开发者ID:pooyafaroka,项目名称:PlusGram,代码行数:4,代码来源:StickerMasksView.java


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