Java Code Examples for org.telegram.messenger.Emoji#sortEmoji()

The following examples show how to use org.telegram.messenger.Emoji#sortEmoji() . 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 6 votes vote down vote up
@Override
public void setVisibility(int visibility) {
    super.setVisibility(visibility);
    if (visibility != GONE) {
        Emoji.sortEmoji();
        adapters.get(0).notifyDataSetChanged();
        if (stickersGridAdapter != null) {
            NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.stickersDidLoaded);
            NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.recentDocumentsDidLoaded);
            updateStickerTabs();
            reloadStickersAdapter();
            if (gifsGridView != null && gifsGridView.getVisibility() == VISIBLE && listener != null) {
                listener.onGifTab(pager != null && pager.getCurrentItem() >= 6);
            }
        }
        if (trendingGridAdapter != null) {
            trendingLoaded = false;
            trendingGridAdapter.notifyDataSetChanged();
        }
        checkDocuments(true);
        checkDocuments(false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_IMAGE, true, true, false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_IMAGE, false, true, false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_FAVE, false, true, false);
    }
}
 
Example 2
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
@Override
public void setVisibility(int visibility) {
    super.setVisibility(visibility);
    if (visibility != GONE) {
        Emoji.sortEmoji();
        adapters.get(0).notifyDataSetChanged();
        if (stickersGridAdapter != null) {
            NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.stickersDidLoaded);
            NotificationCenter.getInstance(currentAccount).addObserver(this, NotificationCenter.recentDocumentsDidLoaded);
            updateStickerTabs();
            reloadStickersAdapter();
            if (gifsGridView != null && gifsGridView.getVisibility() == VISIBLE && listener != null) {
                listener.onGifTab(pager != null && pager.getCurrentItem() >= 6);
            }
        }
        if (trendingGridAdapter != null) {
            trendingLoaded = false;
            trendingGridAdapter.notifyDataSetChanged();
        }
        checkDocuments(true);
        checkDocuments(false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_IMAGE, true, true, false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_IMAGE, false, true, false);
        DataQuery.getInstance(currentAccount).loadRecents(DataQuery.TYPE_FAVE, false, true, false);
    }
}
 
Example 3
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void addEmojiToRecent(String code) {
    if (!Emoji.isValidEmoji(code)) {
        return;
    }
    Emoji.addRecentEmoji(code);
    if (getVisibility() != VISIBLE || pager.getCurrentItem() != 0) {
        Emoji.sortEmoji();
    }
    Emoji.saveRecentEmoji();
    adapters.get(0).notifyDataSetChanged();
}
 
Example 4
Source File: EmojiView.java    From TelePlus-Android with GNU General Public License v2.0 5 votes vote down vote up
public void addEmojiToRecent(String code) {
    if (!Emoji.isValidEmoji(code)) {
        return;
    }
    Emoji.addRecentEmoji(code);
    if (getVisibility() != VISIBLE || pager.getCurrentItem() != 0) {
        Emoji.sortEmoji();
    }
    Emoji.saveRecentEmoji();
    adapters.get(0).notifyDataSetChanged();
}