android.os.Parcelable

Here are the examples of the java api android.os.Parcelable taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1318 Examples 7

19 Source : PluginSettingsListFragment.java
with GNU General Public License v2.0
from ZorinOS

public clreplaced PluginSettingsListFragment extends PreferenceFragmentCompat {

    private static final String ARG_DEVICE_ID = "deviceId";

    private static final String KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE = "RecyclerViewLayoutmanagerState";

    private PluginPreference.PluginPreferenceCallback callback;

    private Parcelable recyclerViewLayoutManagerState;

    /*
        https://bricolsoftconsulting.com/state-preservation-in-backstack-fragments/
        When adding a fragment to the backstack the fragments onDestroyView is called (which releases
        the RecyclerView) but the fragments onSaveInstanceState is not called. When the fragment is destroyed later
        on, its onSaveInstanceState() is called but I don't have access to the RecyclerView or it's LayoutManager any more
     */
    private boolean stateSaved;

    public static PluginSettingsListFragment newInstance(@NonNull String deviceId) {
        PluginSettingsListFragment fragment = new PluginSettingsListFragment();
        Bundle args = new Bundle();
        args.putString(ARG_DEVICE_ID, deviceId);
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        if (requireActivity() instanceof PluginPreference.PluginPreferenceCallback) {
            callback = (PluginPreference.PluginPreferenceCallback) getActivity();
        } else {
            throw new RuntimeException(requireActivity().getClreplaced().getSimpleName() + " must implement PluginPreference.PluginPreferenceCallback");
        }
        super.onCreate(savedInstanceState);
        if (savedInstanceState != null && savedInstanceState.containsKey(KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE)) {
            recyclerViewLayoutManagerState = savedInstanceState.getParcelable(KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE);
        }
    }

    @Override
    public void onDestroy() {
        super.onDestroy();
        callback = null;
    }

    @Override
    public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
        PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(requireContext());
        setPreferenceScreen(preferenceScreen);
        final String deviceId = getArguments().getString(ARG_DEVICE_ID);
        BackgroundService.RunCommand(requireContext(), service -> {
            final Device device = service.getDevice(deviceId);
            if (device == null) {
                final FragmentActivity activity = requireActivity();
                activity.runOnUiThread(activity::finish);
                return;
            }
            List<String> plugins = device.getSupportedPlugins();
            for (final String pluginKey : plugins) {
                // TODO: Use PreferenceManagers context
                PluginPreference pref = new PluginPreference(requireContext(), pluginKey, device, callback);
                preferenceScreen.addPreference(pref);
            }
        });
    }

    @Override
    protected RecyclerView.Adapter onCreateAdapter(PreferenceScreen preferenceScreen) {
        RecyclerView.Adapter adapter = super.onCreateAdapter(preferenceScreen);
        /*
            The layoutmanager's state (e.g. scroll position) can only be restored when the recyclerView's
            adapter has been re-populated with data.
         */
        if (recyclerViewLayoutManagerState != null) {
            adapter.registerAdapterDataObserver(new RecyclerView.AdapterDataObserver() {

                @Override
                public void onChanged() {
                    RecyclerView.LayoutManager layoutManager = getListView().getLayoutManager();
                    if (layoutManager != null) {
                        layoutManager.onRestoreInstanceState(recyclerViewLayoutManagerState);
                    }
                    recyclerViewLayoutManagerState = null;
                    adapter.unregisterAdapterDataObserver(this);
                }
            });
        }
        return adapter;
    }

    @Override
    public void onPause() {
        super.onPause();
        stateSaved = false;
    }

    @Override
    public void onResume() {
        super.onResume();
        requireActivity().setreplacedle(getString(R.string.device_menu_plugins));
    }

    @Override
    public void onDestroyView() {
        if (!stateSaved && getListView() != null && getListView().getLayoutManager() != null) {
            recyclerViewLayoutManagerState = getListView().getLayoutManager().onSaveInstanceState();
        }
        super.onDestroyView();
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        Parcelable layoutManagerState = recyclerViewLayoutManagerState;
        if (getListView() != null && getListView().getLayoutManager() != null) {
            layoutManagerState = getListView().getLayoutManager().onSaveInstanceState();
        }
        if (layoutManagerState != null) {
            outState.putParcelable(KEY_RECYCLERVIEW_LAYOUTMANAGER_STATE, layoutManagerState);
        }
        stateSaved = true;
    }
}

19 Source : DefaultKeyParceler.java
with Apache License 2.0
from Zhuinden

@Override
public Object fromParcelable(Parcelable parcelable) {
    return parcelable;
}

19 Source : IPCMethod.java
with Apache License 2.0
from zhangke3016

private Object readValue(Parcel replay) {
    Object result = replay.readValue(getClreplaced().getClreplacedLoader());
    if (result instanceof Parcelable[]) {
        Parcelable[] parcelables = (Parcelable[]) result;
        Object[] results = (Object[]) Array.newInstance(method.getReturnType().getComponentType(), parcelables.length);
        System.arraycopy(parcelables, 0, results, 0, results.length);
        return results;
    }
    return result;
}

19 Source : EasyPagerAdapter.java
with Apache License 2.0
from Yuphee

/**
 * Restore any instance state replacedociated with this adapter and its pages
 * that was previously saved by {@link #saveState()}.
 *
 * @param state  State previously saved by a call to {@link #saveState()}
 * @param loader A ClreplacedLoader that should be used to instantiate any restored objects
 */
public void restoreState(Parcelable state, ClreplacedLoader loader) {
}

19 Source : ProgressWheel.java
with Apache License 2.0
from Yuanhongliang

// Great way to save a view's state http://stackoverflow.com/a/7089687/1991053
@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    WheelSavedState ss = new WheelSavedState(superState);
    // We save everything that can be changed at runtime
    ss.mProgress = this.mProgress;
    ss.mTargetProgress = this.mTargetProgress;
    ss.isSpinning = this.isSpinning;
    ss.spinSpeed = this.spinSpeed;
    ss.barWidth = this.barWidth;
    ss.barColor = this.barColor;
    ss.rimWidth = this.rimWidth;
    ss.rimColor = this.rimColor;
    ss.circleRadius = this.circleRadius;
    ss.linearProgress = this.linearProgress;
    ss.fillRadius = this.fillRadius;
    return ss;
}

19 Source : ProgressWheel.java
with Apache License 2.0
from Yuanhongliang

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof WheelSavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    WheelSavedState ss = (WheelSavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());
    this.mProgress = ss.mProgress;
    this.mTargetProgress = ss.mTargetProgress;
    this.isSpinning = ss.isSpinning;
    this.spinSpeed = ss.spinSpeed;
    this.barWidth = ss.barWidth;
    this.barColor = ss.barColor;
    this.rimWidth = ss.rimWidth;
    this.rimColor = ss.rimColor;
    this.circleRadius = ss.circleRadius;
    this.linearProgress = ss.linearProgress;
    this.fillRadius = ss.fillRadius;
    this.lastTimeAnimated = SystemClock.uptimeMillis();
}

19 Source : ProgressView.java
with Apache License 2.0
from youkai-app

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState savedState = new SavedState(superState);
    savedState.progress = progress;
    if (max != null)
        savedState.max = max;
    return savedState;
}

19 Source : ProgressView.java
with Apache License 2.0
from youkai-app

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    SavedState savedState = (SavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    if (max != null)
        setMax(max);
    setProgress(savedState.progress);
}

19 Source : ParcelableHelper.java
with Apache License 2.0
from YoshiOne

/**
 * Same as {@link #immediateDeepCopy(android.os.Parcelable)}, but for when you need a little
 * more control over which ClreplacedLoader will be used.
 */
public static Parcelable immediateDeepCopy(Parcelable input, ClreplacedLoader clreplacedLoader) {
    Parcel parcel = null;
    try {
        parcel = Parcel.obtain();
        parcel.writeParcelable(input, 0);
        parcel.setDataPosition(0);
        return parcel.readParcelable(clreplacedLoader);
    } finally {
        if (parcel != null) {
            parcel.recycle();
        }
    }
}

19 Source : ParcelableHelper.java
with Apache License 2.0
from YoshiOne

/**
 * There is not always a guarantee that Parcelable values will be immediately written out and
 * read back in.  For data data that mutable (its own issue), this can be a problem.  This is
 * for the times when it would be great to have confidence that you will be working with a copy
 * of that data.
 */
public static Parcelable immediateDeepCopy(Parcelable input) {
    return immediateDeepCopy(input, input.getClreplaced().getClreplacedLoader());
}

19 Source : FlipLayoutManager.java
with Apache License 2.0
from yiyuanliu

@Override
public void onRestoreInstanceState(Parcelable state) {
    SavedState savedState = (SavedState) state;
    mPosition = savedState.position;
    mPositionOffset = savedState.positionOffset;
    mPendingPosition = savedState.pendingPosition;
}

19 Source : HTextView.java
with Apache License 2.0
from yikwing

@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState state = new SavedState(superState);
    state.animateType = animateType;
    return state;
}

19 Source : HTextView.java
with Apache License 2.0
from yikwing

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(state);
    animateType = ss.animateType;
}

19 Source : MultiSelectListPreference.java
with GNU General Public License v2.0
from yeriomin

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (state instanceof SavedState) {
        final SavedState myState = (SavedState) state;
        if (myState.values != null) {
            mValues = myState.values;
        }
        if (myState.newValues != null) {
            mNewValues = myState.newValues;
        }
        mPreferenceChanged = myState.preferenceChanged;
        super.onRestoreInstanceState(myState.getSuperState());
    } else {
        super.onRestoreInstanceState(state);
    }
}

19 Source : MultiSelectListPreference.java
with GNU General Public License v2.0
from yeriomin

@Override
protected Parcelable onSaveInstanceState() {
    final Parcelable superState = super.onSaveInstanceState();
    final SavedState myState = new SavedState(superState);
    myState.values = mValues;
    myState.newValues = mNewValues;
    myState.preferenceChanged = mPreferenceChanged;
    return myState;
}

19 Source : ShareElementInfo.java
with Apache License 2.0
from yellowcath

/**
 * Created by huangwei on 2018/9/22.
 */
public clreplaced ShareElementInfo<T extends Parcelable> implements Parcelable {

    protected transient View mView;

    /**
     * 用于存放{@link android.app.SharedElementCallback#onCreateSnapshotView}里的snapshot
     */
    protected Parcelable mSnapshot;

    /**
     * 存放View相关的数据。用于定位切换页面后新的ShareElement
     */
    protected T mData;

    /**
     * 用于Transition判断当前是进入还是退出
     */
    protected boolean mIsEnter;

    protected Bundle mFromViewBundle = new Bundle();

    protected Bundle mToViewBundle = new Bundle();

    protected ViewStateSaver mViewStateSaver;

    public ShareElementInfo(@NonNull View view) {
        this(view, null, null);
    }

    public ShareElementInfo(@NonNull View view, @Nullable T data) {
        this(view, data, null);
    }

    public ShareElementInfo(@NonNull View view, ViewStateSaver viewStateSaver) {
        this(view, null, viewStateSaver);
    }

    public ShareElementInfo(@NonNull View view, @Nullable T data, ViewStateSaver viewStateSaver) {
        this.mView = view;
        this.mData = data;
        view.setTag(R.id.share_element_info, this);
        mViewStateSaver = viewStateSaver;
    }

    public Bundle getFromViewBundle() {
        return mFromViewBundle;
    }

    public void setFromViewBundle(Bundle fromViewBundle) {
        mFromViewBundle = fromViewBundle;
    }

    public Bundle getToViewBundle() {
        return mToViewBundle;
    }

    public void setToViewBundle(Bundle toViewBundle) {
        mToViewBundle = toViewBundle;
    }

    public View getView() {
        return mView;
    }

    public Parcelable getSnapshot() {
        return mSnapshot;
    }

    public void setSnapshot(Parcelable snapshot) {
        mSnapshot = snapshot;
    }

    public T getData() {
        return mData;
    }

    public boolean isEnter() {
        return mIsEnter;
    }

    public void setEnter(boolean enter) {
        mIsEnter = enter;
    }

    public ViewStateSaver getViewStateSaver() {
        return mViewStateSaver;
    }

    public static ShareElementInfo getFromView(View view) {
        if (view == null) {
            return null;
        }
        Object tag = view.getTag(R.id.share_element_info);
        return tag instanceof ShareElementInfo ? (ShareElementInfo) tag : null;
    }

    public static void saveToView(View view, ShareElementInfo info) {
        if (view == null) {
            return;
        }
        view.setTag(R.id.share_element_info, info);
    }

    public void captureFromViewInfo(View view) {
        if (mViewStateSaver != null) {
            mViewStateSaver.captureViewInfo(view, mFromViewBundle);
        }
    }

    public void captureToViewInfo(View view) {
        if (mViewStateSaver != null) {
            mViewStateSaver.captureViewInfo(view, mToViewBundle);
        }
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeParcelable(this.mSnapshot, flags);
        dest.writeParcelable(this.mData, flags);
        dest.writeByte(this.mIsEnter ? (byte) 1 : (byte) 0);
        dest.writeBundle(this.mFromViewBundle);
        dest.writeBundle(this.mToViewBundle);
        dest.writeParcelable(this.mViewStateSaver, flags);
    }

    protected ShareElementInfo(Parcel in) {
        this.mSnapshot = in.readParcelable(Parcelable.clreplaced.getClreplacedLoader());
        this.mData = in.readParcelable(getClreplaced().getClreplacedLoader());
        this.mIsEnter = in.readByte() != 0;
        this.mFromViewBundle = in.readBundle();
        this.mToViewBundle = in.readBundle();
        this.mViewStateSaver = in.readParcelable(ViewStateSaver.clreplaced.getClreplacedLoader());
    }

    public static final Creator<ShareElementInfo> CREATOR = new Creator<ShareElementInfo>() {

        @Override
        public ShareElementInfo createFromParcel(Parcel source) {
            return new ShareElementInfo(source);
        }

        @Override
        public ShareElementInfo[] newArray(int size) {
            return new ShareElementInfo[size];
        }
    };
}

19 Source : ShareElementInfo.java
with Apache License 2.0
from yellowcath

public void setSnapshot(Parcelable snapshot) {
    mSnapshot = snapshot;
}

19 Source : BundleHelper.java
with MIT License
from yangjiantao

public BundleHelper putParcelable(String key, Parcelable data) {
    mBundle.putParcelable(key, data);
    return this;
}

19 Source : BundleHelper.java
with Apache License 2.0
from yangjiantao

public BundleHelper putParcelable(String key, Parcelable data) {
    b.putParcelable(key, data);
    return this;
}

19 Source : BundleHelper.java
with Apache License 2.0
from yangjiantao

public BundleHelper putParcelableArray(String key, Parcelable[] array) {
    b.putParcelableArray(key, array);
    return this;
}

19 Source : TabPagerAdapter.java
with Apache License 2.0
from yangjiantao

@Override
public void restoreState(Parcelable state, ClreplacedLoader loader) {
}

19 Source : SlideLayout.java
with Apache License 2.0
from yangchong211

@Override
protected void onRestoreInstanceState(Parcelable state) {
    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());
    mSlideOffset = ss.offset;
    mStatus = Status.valueOf(ss.status);
    if (mStatus == Status.OPEN) {
        mBehindView.setVisibility(VISIBLE);
    }
    requestLayout();
}

19 Source : ColorPickerView.java
with Apache License 2.0
from yangchong211

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable parcelable = super.onSaveInstanceState();
    SavedState ss = new SavedState(parcelable);
    ss.selX = curX;
    ss.selY = curY;
    ss.color = bitmapForColor;
    if (mIndicatorEnable) {
        ss.indicator = bitmapForIndicator;
    }
    return ss;
}

19 Source : ColorPickerView.java
with Apache License 2.0
from yangchong211

@Override
protected void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());
    curX = ss.selX;
    curY = ss.selY;
    colors = ss.colors;
    bitmapForColor = ss.color;
    if (mIndicatorEnable) {
        bitmapForIndicator = ss.indicator;
        needReDrawIndicator = true;
    }
    needReDrawColorTable = true;
}

19 Source : GalleryRecyclerView.java
with Apache License 2.0
from yangchong211

@Override
protected void onRestoreInstanceState(Parcelable state) {
    super.onRestoreInstanceState(state);
    // 轮播图用在fragment中,如果是横竖屏切换(Fragment销毁),不应该走smoothScrollToPosition(0)
    // 因为这个方法会导致ScrollManager的onHorizontalScroll不断执行,而ScrollManager.mConsumeX已经重置,会导致这个值紊乱
    // 而如果走scrollToPosition(0)方法,则不会导致ScrollManager的onHorizontalScroll执行,
    // 所以ScrollManager.mConsumeX这个值不会错误
    // 从索引0处开始轮播
    smoothScrollToPosition(0);
    // 但是因为不走ScrollManager的onHorizontalScroll,所以不会执行切换动画,
    // 所以就调用smoothScrollBy(int dx, int dy),让item轻微滑动,触发动画
    smoothScrollBy(10, 0);
    smoothScrollBy(0, 0);
    startPlay();
}

19 Source : FlowlayoutTags.java
with Apache License 2.0
from y1xian

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());
    setTags(ss.tags);
    TagView checkedTagView = getTagAt(ss.checkedPosition);
    if (checkedTagView != null) {
        checkedTagView.setCheckedWithoutAnimal(true);
    }
}

19 Source : FlowlayoutTags.java
with Apache License 2.0
from y1xian

@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState ss = new SavedState(superState);
    ss.tags = getTags();
    ss.checkedPosition = getCheckedTagIndex();
    return ss;
}

19 Source : MMKVCache.java
with Apache License 2.0
from y1xian

@Override
public void save(String key, Parcelable value) {
    MMKV.defaultMMKV().encode(key, value);
}

19 Source : KvUtils.java
with Apache License 2.0
from y1xian

public static void save(String key, Parcelable value) {
    cache.save(key, value);
}

19 Source : ProgressView.java
with Apache License 2.0
from y1xian

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof WheelSavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    WheelSavedState savedState = (WheelSavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    this.mProgress = savedState.mProgress;
    this.mTargetProgress = savedState.mTargetProgress;
    this.isSpinning = savedState.isSpinning;
    this.mSpinSpeed = savedState.spinSpeed;
    this.mBarWidth = savedState.barWidth;
    this.mBarColor = savedState.barColor;
    this.mRimWidth = savedState.rimWidth;
    this.mRimColor = savedState.rimColor;
    this.mCircleRadius = savedState.circleRadius;
    this.mLinearProgress = savedState.linearProgress;
    this.mFillRadius = savedState.fillRadius;
    this.mLastTimeAnimated = SystemClock.uptimeMillis();
}

19 Source : RatingBar.java
with Apache License 2.0
from xuexiangjys

@Override
protected void onRestoreInstanceState(Parcelable state) {
    SavedState ss = (SavedState) state;
    super.onRestoreInstanceState(ss.getSuperState());
    setRating(ss.getRating());
}

19 Source : RatingBar.java
with Apache License 2.0
from xuexiangjys

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState ss = new SavedState(superState);
    ss.setRating(mRating);
    return ss;
}

19 Source : ExpandableLayout.java
with Apache License 2.0
from xuexiangjys

@Override
protected Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    Bundle bundle = new Bundle();
    mExpansion = isExpanded() ? 1 : 0;
    bundle.putFloat(KEY_EXPANSION, mExpansion);
    bundle.putParcelable(KEY_SUPER_STATE, superState);
    return bundle;
}

19 Source : ExpandableLayout.java
with Apache License 2.0
from xuexiangjys

@Override
protected void onRestoreInstanceState(Parcelable parcelable) {
    Bundle bundle = (Bundle) parcelable;
    mExpansion = bundle.getFloat(KEY_EXPANSION);
    mState = mExpansion == 1 ? EXPANDED : COLLAPSED;
    Parcelable superState = bundle.getParcelable(KEY_SUPER_STATE);
    super.onRestoreInstanceState(superState);
}

19 Source : PasswordEditText.java
with Apache License 2.0
from xuexiangjys

@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    return new SavedState(superState, mShowingIcon, mPreplacedwordVisible);
}

19 Source : PasswordEditText.java
with Apache License 2.0
from xuexiangjys

@Override
public void onRestoreInstanceState(Parcelable state) {
    SavedState savedState = (SavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    mShowingIcon = savedState.isShowingIcon();
    mPreplacedwordVisible = savedState.isPreplacedwordVisible();
    handlePreplacedwordInputVisibility();
    showPreplacedwordVisibilityIndicator(mShowingIcon);
}

19 Source : SwitchIconView.java
with Apache License 2.0
from xuexiangjys

@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SwitchIconSavedState savedState = new SwitchIconSavedState(superState);
    savedState.iconEnabled = mEnabled;
    return savedState;
}

19 Source : SwitchIconView.java
with Apache License 2.0
from xuexiangjys

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (!(state instanceof SwitchIconSavedState)) {
        super.onRestoreInstanceState(state);
        return;
    }
    SwitchIconSavedState savedState = (SwitchIconSavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    mEnabled = savedState.iconEnabled;
    setFraction(mEnabled ? 0F : 1F);
}

19 Source : LoopPagerAdapterWrapper.java
with Apache License 2.0
from xuexiangjys

@Override
public void restoreState(Parcelable bundle, ClreplacedLoader clreplacedLoader) {
    mAdapter.restoreState(bundle, clreplacedLoader);
}

19 Source : OverFlyingLayoutManager.java
with Apache License 2.0
from xuexiangjys

@Override
public void onRestoreInstanceState(Parcelable state) {
    if (state instanceof SavedState) {
        mPendingSavedState = new SavedState((SavedState) state);
        requestLayout();
    }
}

19 Source : UnderlinePageIndicator.java
with Apache License 2.0
from xinpengfei520

@Override
public void onRestoreInstanceState(Parcelable state) {
    SavedState savedState = (SavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    mCurrentPage = savedState.currentPage;
    requestLayout();
}

19 Source : UnderlinePageIndicator.java
with Apache License 2.0
from xinpengfei520

@Override
public Parcelable onSaveInstanceState() {
    Parcelable superState = super.onSaveInstanceState();
    SavedState savedState = new SavedState(superState);
    savedState.currentPage = mCurrentPage;
    return savedState;
}

19 Source : CirclePageIndicator.java
with Apache License 2.0
from xinpengfei520

@Override
public void onRestoreInstanceState(Parcelable state) {
    SavedState savedState = (SavedState) state;
    super.onRestoreInstanceState(savedState.getSuperState());
    mCurrentPage = savedState.currentPage;
    mSnapPage = savedState.currentPage;
    requestLayout();
}

19 Source : RxFragmentNavigator.java
with Apache License 2.0
from xiaojinzi123

public RxFragmentNavigator putParcelable(@NonNull String key, @Nullable Parcelable value) {
    super.putParcelable(key, value);
    return this;
}

19 Source : RxFragmentNavigator.java
with Apache License 2.0
from xiaojinzi123

public RxFragmentNavigator putParcelableArray(@NonNull String key, @Nullable Parcelable[] value) {
    super.putParcelableArray(key, value);
    return this;
}

19 Source : ProxyIntentBuilder.java
with Apache License 2.0
from xiaojinzi123

public ProxyIntentBuilder putParcelable(@NonNull String key, @Nullable Parcelable value) {
    this.bundle.putParcelable(key, value);
    return this;
}

19 Source : ProxyIntentBuilder.java
with Apache License 2.0
from xiaojinzi123

public ProxyIntentBuilder putParcelableArray(@NonNull String key, @Nullable Parcelable[] value) {
    this.bundle.putParcelableArray(key, value);
    return this;
}

19 Source : FragmentNavigator.java
with Apache License 2.0
from xiaojinzi123

public FragmentNavigator putParcelable(@NonNull String key, @Nullable Parcelable value) {
    this.bundle.putParcelable(key, value);
    return this;
}

19 Source : FragmentNavigator.java
with Apache License 2.0
from xiaojinzi123

public FragmentNavigator putParcelableArray(@NonNull String key, @Nullable Parcelable[] value) {
    this.bundle.putParcelableArray(key, value);
    return this;
}

19 Source : ContentLayout.java
with Apache License 2.0
from xiaojieonly

@Override
protected void onRestoreInstanceState(Parcelable state) {
    super.onRestoreInstanceState(mContentHelper.restoreInstanceState(state));
}

See More Examples