Java Code Examples for org.telegram.ui.ActionBar.Theme#isWallpaperMotion()

The following examples show how to use org.telegram.ui.ActionBar.Theme#isWallpaperMotion() . 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: ThemePreviewActivity.java    From Telegram-FOSS with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean onFragmentCreate() {
    NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiDidLoad);
    if (screenType == SCREEN_TYPE_ACCENT_COLOR) {
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetNewWallpapper);
    }
    if (screenType != SCREEN_TYPE_PREVIEW || accent != null) {
        if (SharedConfig.getDevicePerfomanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW) {
            int w = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y);
            int h = Math.max(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y);
            imageFilter = (int) (w / AndroidUtilities.density) + "_" + (int) (h / AndroidUtilities.density) + "_f";
        } else {
            imageFilter = (int) (1080 / AndroidUtilities.density) + "_" + (int) (1920 / AndroidUtilities.density) + "_f";
        }
        maxWallpaperSize = Math.min(1920, Math.max(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y));

        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersNeedReload);
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersDidLoad);
        TAG = DownloadController.getInstance(currentAccount).generateObserverTag();

        if (patterns == null) {
            patterns = new ArrayList<>();
            MessagesStorage.getInstance(currentAccount).getWallpapers();
        }
    } else {
        isMotion = Theme.isWallpaperMotion();
    }

    return super.onFragmentCreate();
}
 
Example 2
Source File: ThemePreviewActivity.java    From Telegram with GNU General Public License v2.0 5 votes vote down vote up
@Override
public boolean onFragmentCreate() {
    NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.emojiDidLoad);
    if (screenType == SCREEN_TYPE_ACCENT_COLOR) {
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.didSetNewWallpapper);
    }
    if (screenType != SCREEN_TYPE_PREVIEW || accent != null) {
        if (SharedConfig.getDevicePerfomanceClass() == SharedConfig.PERFORMANCE_CLASS_LOW) {
            int w = Math.min(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y);
            int h = Math.max(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y);
            imageFilter = (int) (w / AndroidUtilities.density) + "_" + (int) (h / AndroidUtilities.density) + "_f";
        } else {
            imageFilter = (int) (1080 / AndroidUtilities.density) + "_" + (int) (1920 / AndroidUtilities.density) + "_f";
        }
        maxWallpaperSize = Math.min(1920, Math.max(AndroidUtilities.displaySize.x, AndroidUtilities.displaySize.y));

        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersNeedReload);
        NotificationCenter.getGlobalInstance().addObserver(this, NotificationCenter.wallpapersDidLoad);
        TAG = DownloadController.getInstance(currentAccount).generateObserverTag();

        if (patterns == null) {
            patterns = new ArrayList<>();
            MessagesStorage.getInstance(currentAccount).getWallpapers();
        }
    } else {
        isMotion = Theme.isWallpaperMotion();
    }

    return super.onFragmentCreate();
}