private void applyBackgroundChanges() { if (!mAttached || mLayerWrapper == null) { return; } if (DEBUG) Log.v(TAG, "applyBackgroundChanges drawable " + mBackgroundDrawable); int dimAlpha = 0; if (mImageOutWrapper != null && mImageOutWrapper.isAnimationPending()) { if (DEBUG) Log.v(TAG, "mImageOutWrapper animation starting"); mImageOutWrapper.startAnimation(); mImageOutWrapper = null; dimAlpha = DIM_ALPHA_ON_SOLID; } if (mImageInWrapper == null && mBackgroundDrawable != null) { if (DEBUG) Log.v(TAG, "creating new imagein drawable"); mImageInWrapper = new DrawableWrapper(mBackgroundDrawable); mLayerDrawable.setDrawableByLayerId(R.id.background_imagein, mBackgroundDrawable); if (DEBUG) Log.v(TAG, "mImageInWrapper animation starting"); mImageInWrapper.setAlpha(0); mImageInWrapper.fadeIn(FADE_DURATION_SLOW, 0); mImageInWrapper.startAnimation(); dimAlpha = FULL_ALPHA; } if (mDimWrapper != null && dimAlpha != 0) { if (DEBUG) Log.v(TAG, "dimwrapper animation starting to " + dimAlpha); mDimWrapper.fade(FADE_DURATION_SLOW, 0, dimAlpha); mDimWrapper.startAnimation(); } }
private void updateImmediate() { lazyInit(); mColorWrapper.setColor(mBackgroundColor); if (mDimWrapper != null) { mDimWrapper.setAlpha(mBackgroundColor == Color.TRANSPARENT ? 0 : DIM_ALPHA_ON_SOLID); } showWallpaper(mBackgroundColor == Color.TRANSPARENT); mThemeDrawable = getThemeDrawable(); mLayerDrawable.setDrawableByLayerId(R.id.background_theme, mThemeDrawable); if (mBackgroundDrawable == null) { mLayerDrawable.setDrawableByLayerId(R.id.background_imagein, createEmptyDrawable()); } else { if (DEBUG) Log.v(TAG, "Background drawable is available"); mImageInWrapper = new DrawableWrapper(mBackgroundDrawable); mLayerDrawable.setDrawableByLayerId(R.id.background_imagein, mBackgroundDrawable); if (mDimWrapper != null) { mDimWrapper.setAlpha(FULL_ALPHA); } } }