Java Code Examples for org.telegram.tgnet.TLRPC#InputStickerSet

The following examples show how to use org.telegram.tgnet.TLRPC#InputStickerSet . 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: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void openSet(TLRPC.InputStickerSet set) {
    if (set == null) {
        return;
    }
    listener.onShowStickerSet(null, set);
}
 
Example 2
Source File: StickersAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public StickersAlert(Context context, BaseFragment baseFragment, TLRPC.InputStickerSet set, TLRPC.TL_messages_stickerSet loadedSet, StickersAlertDelegate stickersAlertDelegate) {
    super(context, false);
    delegate = stickersAlertDelegate;
    inputStickerSet = set;
    stickerSet = loadedSet;
    parentFragment = baseFragment;
    loadStickerSet();
    init(context);
}
 
Example 3
Source File: StickersSearchAdapter.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public void installStickerSet(TLRPC.InputStickerSet inputSet) {
    for (int i = 0; i < serverPacks.size(); i++) {
        final TLRPC.StickerSetCovered setCovered = serverPacks.get(i);
        if (setCovered.set.id == inputSet.id) {
            installStickerSet(setCovered, null);
            break;
        }
    }
}
 
Example 4
Source File: StickersAlert.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public StickersAlert(Context context, BaseFragment baseFragment, TLRPC.InputStickerSet set, TLRPC.TL_messages_stickerSet loadedSet, StickersAlertDelegate stickersAlertDelegate) {
    super(context, false);
    delegate = stickersAlertDelegate;
    inputStickerSet = set;
    stickerSet = loadedSet;
    parentFragment = baseFragment;
    loadStickerSet();
    init(context);
}
 
Example 5
Source File: ImageLocation.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
private static ImageLocation getForPhoto(TLRPC.FileLocation location, int size, TLRPC.Photo photo, TLRPC.Document document, TLRPC.InputPeer photoPeer, boolean photoPeerBig, int dc_id, TLRPC.InputStickerSet stickerSet, String thumbSize) {
    if (location == null || photo == null && photoPeer == null && stickerSet == null && document == null) {
        return null;
    }
    ImageLocation imageLocation = new ImageLocation();
    imageLocation.dc_id = dc_id;
    imageLocation.photo = photo;
    imageLocation.currentSize = size;
    imageLocation.photoPeer = photoPeer;
    imageLocation.photoPeerBig = photoPeerBig;
    imageLocation.stickerSet = stickerSet;
    if (location instanceof TLRPC.TL_fileLocationToBeDeprecated) {
        imageLocation.location = (TLRPC.TL_fileLocationToBeDeprecated) location;
        if (photo != null) {
            imageLocation.file_reference = photo.file_reference;
            imageLocation.access_hash = photo.access_hash;
            imageLocation.photoId = photo.id;
            imageLocation.thumbSize = thumbSize;
        } else if (document != null) {
            imageLocation.file_reference = document.file_reference;
            imageLocation.access_hash = document.access_hash;
            imageLocation.documentId = document.id;
            imageLocation.thumbSize = thumbSize;
        }
    } else {
        imageLocation.location = new TLRPC.TL_fileLocationToBeDeprecated();
        imageLocation.location.local_id = location.local_id;
        imageLocation.location.volume_id = location.volume_id;
        imageLocation.location.secret = location.secret;
        imageLocation.dc_id = location.dc_id;
        imageLocation.file_reference = location.file_reference;
        imageLocation.key = location.key;
        imageLocation.iv = location.iv;
        imageLocation.access_hash = location.secret;
    }
    return imageLocation;
}
 
Example 6
Source File: StickersSearchAdapter.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void installStickerSet(TLRPC.InputStickerSet inputSet) {
    for (int i = 0; i < serverPacks.size(); i++) {
        final TLRPC.StickerSetCovered setCovered = serverPacks.get(i);
        if (setCovered.set.id == inputSet.id) {
            installStickerSet(setCovered, null);
            break;
        }
    }
}
 
Example 7
Source File: ImageLocation.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
private static ImageLocation getForPhoto(TLRPC.FileLocation location, int size, TLRPC.Photo photo, TLRPC.Document document, TLRPC.InputPeer photoPeer, boolean photoPeerBig, int dc_id, TLRPC.InputStickerSet stickerSet, String thumbSize) {
    if (location == null || photo == null && photoPeer == null && stickerSet == null && document == null) {
        return null;
    }
    ImageLocation imageLocation = new ImageLocation();
    imageLocation.dc_id = dc_id;
    imageLocation.photo = photo;
    imageLocation.currentSize = size;
    imageLocation.photoPeer = photoPeer;
    imageLocation.photoPeerBig = photoPeerBig;
    imageLocation.stickerSet = stickerSet;
    if (location instanceof TLRPC.TL_fileLocationToBeDeprecated) {
        imageLocation.location = (TLRPC.TL_fileLocationToBeDeprecated) location;
        if (photo != null) {
            imageLocation.file_reference = photo.file_reference;
            imageLocation.access_hash = photo.access_hash;
            imageLocation.photoId = photo.id;
            imageLocation.thumbSize = thumbSize;
        } else if (document != null) {
            imageLocation.file_reference = document.file_reference;
            imageLocation.access_hash = document.access_hash;
            imageLocation.documentId = document.id;
            imageLocation.thumbSize = thumbSize;
        }
    } else {
        imageLocation.location = new TLRPC.TL_fileLocationToBeDeprecated();
        imageLocation.location.local_id = location.local_id;
        imageLocation.location.volume_id = location.volume_id;
        imageLocation.location.secret = location.secret;
        imageLocation.dc_id = location.dc_id;
        imageLocation.file_reference = location.file_reference;
        imageLocation.key = location.key;
        imageLocation.iv = location.iv;
        imageLocation.access_hash = location.secret;
    }
    return imageLocation;
}
 
Example 8
Source File: TrendingStickersLayout.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public void showStickerSet(TLRPC.StickerSet pack, TLRPC.InputStickerSet inputStickerSet) {
    if (pack != null) {
        inputStickerSet = new TLRPC.TL_inputStickerSetID();
        inputStickerSet.access_hash = pack.access_hash;
        inputStickerSet.id = pack.id;
    }
    if (inputStickerSet != null) {
        showStickerSet(inputStickerSet);
    }
}
 
Example 9
Source File: StickersAlert.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
public StickersAlert(Context context, BaseFragment baseFragment, TLRPC.InputStickerSet set, TLRPC.TL_messages_stickerSet loadedSet, StickersAlertDelegate stickersAlertDelegate) {
    super(context, false);
    delegate = stickersAlertDelegate;
    inputStickerSet = set;
    stickerSet = loadedSet;
    parentFragment = baseFragment;
    loadStickerSet();
    init(context);
}
 
Example 10
Source File: StickersAlert.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
public StickersAlert(Context context, BaseFragment baseFragment, TLRPC.InputStickerSet set, TLRPC.TL_messages_stickerSet loadedSet, StickersAlertDelegate stickersAlertDelegate) {
    super(context, false);
    delegate = stickersAlertDelegate;
    inputStickerSet = set;
    stickerSet = loadedSet;
    parentFragment = baseFragment;
    loadStickerSet();
    init(context);
}
 
Example 11
Source File: TrendingStickersLayout.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
private void showStickerSet(TLRPC.InputStickerSet inputStickerSet) {
    final StickersAlert.StickersAlertDelegate stickersAlertDelegate;
    if (delegate.canSendSticker()) {
        stickersAlertDelegate = new StickersAlert.StickersAlertDelegate() {
            @Override
            public void onStickerSelected(TLRPC.Document sticker, Object parent, boolean clearsInputField, boolean notify, int scheduleDate) {
                delegate.onStickerSelected(sticker, parent, clearsInputField, notify, scheduleDate);
            }

            @Override
            public boolean canSchedule() {
                return delegate.canSchedule();
            }

            @Override
            public boolean isInScheduleMode() {
                return delegate.isInScheduleMode();
            }
        };
    } else {
        stickersAlertDelegate = null;
    }
    final StickersAlert stickersAlert = new StickersAlert(getContext(), parentFragment, inputStickerSet, null, stickersAlertDelegate);
    stickersAlert.setShowTooltipWhenToggle(false);
    stickersAlert.setInstallDelegate(new StickersAlert.StickersAlertInstallDelegate() {
        @Override
        public void onStickerSetInstalled() {
            if (listView.getAdapter() == adapter) {
                for (int i = 0; i < adapter.sets.size(); i++) {
                    final TLRPC.StickerSetCovered setCovered = adapter.sets.get(i);
                    if (setCovered.set.id == inputStickerSet.id) {
                        adapter.installStickerSet(setCovered, null);
                        break;
                    }
                }
            } else {
                searchAdapter.installStickerSet(inputStickerSet);
            }
        }

        @Override
        public void onStickerSetUninstalled() {
        }
    });
    parentFragment.showDialog(stickersAlert);
}
 
Example 12
Source File: StickerMasksAlert.java    From Telegram with GNU General Public License v2.0 2 votes vote down vote up
@Override
public void openSet(TLRPC.InputStickerSet set, boolean clearsInputField) {

}
 
Example 13
Source File: StickerMasksAlert.java    From Telegram-FOSS with GNU General Public License v2.0 2 votes vote down vote up
@Override
public void openSet(TLRPC.InputStickerSet set, boolean clearsInputField) {

}
 
Example 14
Source File: StickersAlert.java    From Telegram-FOSS with GNU General Public License v2.0 2 votes vote down vote up
@Override
public void openSet(TLRPC.InputStickerSet set, boolean clearsInputField) {

}
 
Example 15
Source File: ContentPreviewViewer.java    From Telegram-FOSS with GNU General Public License v2.0 votes vote down vote up
void openSet(TLRPC.InputStickerSet set, boolean clearInputField); 
Example 16
Source File: ContentPreviewViewer.java    From Telegram with GNU General Public License v2.0 votes vote down vote up
void openSet(TLRPC.InputStickerSet set, boolean clearInputField); 
Example 17
Source File: StickerPreviewViewer.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void openSet(TLRPC.InputStickerSet set); 
Example 18
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void onShowStickerSet(TLRPC.StickerSet stickerSet, TLRPC.InputStickerSet inputStickerSet); 
Example 19
Source File: StickerPreviewViewer.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void openSet(TLRPC.InputStickerSet set); 
Example 20
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 votes vote down vote up
void onShowStickerSet(TLRPC.StickerSet stickerSet, TLRPC.InputStickerSet inputStickerSet);