diff --git a/library/src/main/java/com/balysv/materialmenu/MaterialMenuDrawable.java b/library/src/main/java/com/balysv/materialmenu/MaterialMenuDrawable.java index d83b81a..1c33e17 100644 --- a/library/src/main/java/com/balysv/materialmenu/MaterialMenuDrawable.java +++ b/library/src/main/java/com/balysv/materialmenu/MaterialMenuDrawable.java @@ -857,4 +857,8 @@ public int getChangingConfigurations() { static float dpToPx(Resources resources, float dp) { return TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dp, resources.getDisplayMetrics()); } + + boolean isDrawableVisible(){ + return visible; + } } diff --git a/library/src/main/java/com/balysv/materialmenu/MaterialMenuView.java b/library/src/main/java/com/balysv/materialmenu/MaterialMenuView.java index d767133..8fce991 100644 --- a/library/src/main/java/com/balysv/materialmenu/MaterialMenuView.java +++ b/library/src/main/java/com/balysv/materialmenu/MaterialMenuView.java @@ -193,6 +193,7 @@ public Parcelable onSaveInstanceState() { Parcelable superState = super.onSaveInstanceState(); SavedState savedState = new SavedState(superState); savedState.state = currentState; + savedState.visible = ((drawable != null) ? drawable.isDrawableVisible() : false); return savedState; }