Skip to content

Commit

Permalink
bug: view disappear after orientation change.
Browse files Browse the repository at this point in the history
fix: saving the drawable visibility onSaveInstanceState
  • Loading branch information
shay-rom committed May 22, 2015
1 parent 8524a63 commit 7c50c92
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 7c50c92

Please sign in to comment.