本文整理汇总了Java中org.telegram.tgnet.TLRPC.Photo方法的典型用法代码示例。如果您正苦于以下问题:Java TLRPC.Photo方法的具体用法?Java TLRPC.Photo怎么用?Java TLRPC.Photo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.telegram.tgnet.TLRPC
的用法示例。
在下文中一共展示了TLRPC.Photo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StickersAlert
import org.telegram.tgnet.TLRPC; //导入方法依赖的package包/类
public StickersAlert(Context context, TLRPC.Photo photo) {
super(context, false);
parentActivity = (Activity) context;
if (Build.VERSION.SDK_INT >= 11) {
setDisableBackground(true);
}
TLRPC.TL_messages_getAttachedStickers req = new TLRPC.TL_messages_getAttachedStickers();
TLRPC.TL_inputStickeredMediaPhoto inputStickeredMediaPhoto = new TLRPC.TL_inputStickeredMediaPhoto();
inputStickeredMediaPhoto.id = new TLRPC.TL_inputPhoto();
inputStickeredMediaPhoto.id.id = photo.id;
inputStickeredMediaPhoto.id.access_hash = photo.access_hash;
req.media = inputStickeredMediaPhoto;
reqId = ConnectionsManager.getInstance().sendRequest(req, new RequestDelegate() {
@Override
public void run(final TLObject response, final TLRPC.TL_error error) {
AndroidUtilities.runOnUIThread(new Runnable() {
@Override
public void run() {
reqId = 0;
if (error == null) {
TLRPC.Vector vector = (TLRPC.Vector) response;
if (vector.objects.isEmpty()) {
dismiss();
} else if (vector.objects.size() == 1) {
TLRPC.StickerSetCovered set = (TLRPC.StickerSetCovered) vector.objects.get(0);
inputStickerSet = new TLRPC.TL_inputStickerSetID();
inputStickerSet.id = set.set.id;
inputStickerSet.access_hash = set.set.access_hash;
loadStickerSet();
} else {
stickerSetCovereds = new ArrayList<>();
for (int a = 0; a < vector.objects.size(); a++) {
stickerSetCovereds.add((TLRPC.StickerSetCovered) vector.objects.get(a));
}
gridView.setLayoutParams(LayoutHelper.createFrame(LayoutHelper.MATCH_PARENT, LayoutHelper.MATCH_PARENT, Gravity.TOP | Gravity.LEFT, 0, 0, 0, 48));
titleTextView.setVisibility(View.GONE);
shadow[0].setVisibility(View.GONE);
adapter.notifyDataSetChanged();
}
} else {
Toast.makeText(getContext(), LocaleController.getString("ErrorOccurred", R.string.ErrorOccurred) + "\n" + error.text, Toast.LENGTH_SHORT).show();
dismiss();
}
}
});
}
});
init(context);
}