@Override public void onRestoreInstanceState(Parcelable state) { if (state instanceof Bundle) { Bundle bundle = (Bundle) state; normalizedScale = bundle.getFloat("saveScale"); m = bundle.getFloatArray("matrix"); prevMatrix.setValues(m); prevMatchViewHeight = bundle.getFloat("matchViewHeight"); prevMatchViewWidth = bundle.getFloat("matchViewWidth"); prevViewHeight = bundle.getInt("viewHeight"); prevViewWidth = bundle.getInt("viewWidth"); imageRenderedAtLeastOnce = bundle.getBoolean("imageRendered"); viewSizeChangeFixedPixel = (FixedPixel) bundle.getSerializable("viewSizeChangeFixedPixel"); orientationChangeFixedPixel = (FixedPixel) bundle.getSerializable("orientationChangeFixedPixel"); int oldOrientation = bundle.getInt("orientation"); if (orientation != oldOrientation) { orientationJustChanged = true; } super.onRestoreInstanceState(bundle.getParcelable("instanceState")); return; } super.onRestoreInstanceState(state); }
@Override protected void onRestoreInstanceState(Parcelable state) { if (!(state instanceof SavedState)) { super.onRestoreInstanceState(state); return; } SavedState ss = (SavedState) state; super.onRestoreInstanceState(ss.getSuperState()); animationName = ss.animationName; if (!TextUtils.isEmpty(animationName)) { setAnimation(animationName); } animationResId = ss.animationResId; if (animationResId != 0) { setAnimation(animationResId); } setProgress(ss.progress); if (ss.isAnimating) { playAnimation(); } lottieDrawable.setImagesAssetsFolder(ss.imageAssetsFolder); setRepeatMode(ss.repeatMode); setRepeatCount(ss.repeatCount); }
@Override protected void onRestoreInstanceState(Parcelable state) { PaperSavedState savedState = (PaperSavedState) state; super.onRestoreInstanceState(savedState.getSuperState()); pathEvents = savedState.pathEvents; applyEvents(); invalidate(); }