com.google.android.apps.muzei.event.WallpaperActiveStateChangedEvent

Here are the examples of the java api class com.google.android.apps.muzei.event.WallpaperActiveStateChangedEvent taken from open source projects.

1. MuzeiActivity#onPostResume()

Project: muzei
Source File: MuzeiActivity.java
View license
@Override
protected void onPostResume() {
    super.onPostResume();
    mPaused = false;
    mConsecutiveLoadErrorCount = 0;
    // update intro mode UI to latest wallpaper active state
    WallpaperActiveStateChangedEvent e = EventBus.getDefault().getStickyEvent(WallpaperActiveStateChangedEvent.class);
    if (e != null) {
        onEventMainThread(e);
    } else {
        onEventMainThread(new WallpaperActiveStateChangedEvent(false));
    }
    updateUiMode();
    mChromeContainerView.setVisibility((mUiMode == UI_MODE_ART_DETAIL) ? View.VISIBLE : View.GONE);
    if (mStatusBarScrimView != null) {
        mStatusBarScrimView.setVisibility((mUiMode == UI_MODE_ART_DETAIL) ? View.VISIBLE : View.GONE);
    }
    // Note: normally should use window animations for this, but there's a bug
    // on Samsung devices where the wallpaper is animated along with the window for
    // windows showing the wallpaper (the wallpaper _should_ be static, not part of
    // the animation).
    View decorView = getWindow().getDecorView();
    decorView.setAlpha(0f);
    decorView.animate().cancel();
    decorView.animate().setStartDelay(500).alpha(1f).setDuration(300);
    maybeUpdateArtDetailOpenedClosed();
    NewWallpaperNotificationReceiver.markNotificationRead(this);
}

2. SettingsActivity#updateRenderLocallyToLatestActiveState()

Project: muzei
Source File: SettingsActivity.java
View license
private void updateRenderLocallyToLatestActiveState() {
    WallpaperActiveStateChangedEvent e = EventBus.getDefault().getStickyEvent(WallpaperActiveStateChangedEvent.class);
    if (e != null) {
        onEventMainThread(e);
    } else {
        onEventMainThread(new WallpaperActiveStateChangedEvent(false));
    }
}