@@ -0,0 +1,2771 @@
+package com.laxture.skeleton.view;%0A%0Aimport android.content.Context;%0Aimport android.os.Parcel;%0Aimport android.os.Parcelable;%0Aimport android.support.annotation.Nullable;%0Aimport android.util.AttributeSet;%0Aimport android.util.SparseArray;%0Aimport android.widget.FrameLayout;%0A%0Apublic class SaveStateLayout extends FrameLayout %7B%0A%0A    public SaveStateLayout(Context context) %7B%0A        super(context);%0A    %7D%0A%0A    public SaveStateLayout(Context context, AttributeSet attrs) %7B%0A        super(context, attrs);%0A    %7D%0A%0A    public SaveStateLayout(Context context, @Nullable AttributeSet attrs, int defStyleAttr) %7B%0A        super(context, attrs, defStyleAttr);%0A    %7D%0A%0A    @Override%0A    public Parcelable onSaveInstanceState() %7B%0A        Parcelable superState = super.onSaveInstanceState();%0A        SavedState state = new SavedState(superState);%0A        state.childrenStates = new SparseArray();%0A        for (int i = 0; i %3C getChildCount(); i++) %7B%0A            getChildAt(i).saveHierarchyState(state.childrenStates);%0A        %7D%0A        return state;%0A    %7D%0A%0A    @Override%0A    public void onRestoreInstanceState(Parcelable state) %7B%0A        SavedState savedState = (SavedState) state;%0A        super.onRestoreInstanceState(savedState.getSuperState());%0A        for (int i = 0; i %3C getChildCount(); i++) %7B%0A            getChildAt(i).restoreHierarchyState(savedState.childrenStates);%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void dispatchSaveInstanceState(SparseArray%3CParcelable%3E container) %7B%0A        dispatchFreezeSelfOnly(container);%0A    %7D%0A%0A    @Override%0A    protected void dispatchRestoreInstanceState(SparseArray%3CParcelable%3E container) %7B%0A        dispatchThawSelfOnly(container);%0A    %7D%0A%0A    static class SavedState extends BaseSavedState %7B%0A        SparseArray childrenStates;%0A%0A        SavedState(Parcelable superState) %7B%0A            super(superState);%0A        %7D%0A%0A        private SavedState(Parcel in, ClassLoader classLoader) %7B%0A            super(in);%0A            childrenStates = in.readSparseArray(classLoader);%0A        %7D%0A%0A        @Override%0A        public void writeToParcel(Parcel out, int flags) %7B%0A            super.writeToParcel(out, flags);%0A            out.writeSparseArray(childrenStates);%0A        %7D%0A%0A        public static final ClassLoaderCreator%3CSavedState%3E CREATOR%0A                = new ClassLoaderCreator%3CSavedState%3E() %7B%0A            @Override%0A            public SavedState createFromParcel(Parcel source, ClassLoader loader) %7B%0A                return new SavedState(source, loader);%0A            %7D%0A%0A            @Override%0A            public SavedState createFromParcel(Parcel source) %7B%0A                return createFromParcel(source, null);%0A            %7D%0A%0A            public SavedState%5B%5D newArray(int size) %7B%0A                return new SavedState%5Bsize%5D;%0A            %7D%0A        %7D;%0A    %7D%0A%7D%0A

Add SaveStateLayout to save ViewState for custom view