Skip to content

Commit

Permalink
try fix Ramotion#86
Browse files Browse the repository at this point in the history
  • Loading branch information
wwwdotfa committed Feb 22, 2020
1 parent 33607aa commit f895ca0
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public void unfold(boolean skipAnimation) {
} else {
ViewCompat.setHasTransientState(this, true);
// create layout container for animation elements
final LinearLayout foldingLayout = createAndPrepareFoldingContainer();
final LinearLayout foldingLayout = createAndPrepareFoldingContainer(titleView.getHeight());
this.addView(foldingLayout);
// calculate heights of animation parts
ArrayList<Integer> heights = calculateHeightsForAnimationParts(titleView.getHeight(), contentView.getHeight(), mAdditionalFlipsCount);
Expand Down Expand Up @@ -197,7 +197,7 @@ public void fold(boolean skipAnimation) {
} else {
ViewCompat.setHasTransientState(this, true);
// create empty layout for folding animation
final LinearLayout foldingLayout = createAndPrepareFoldingContainer();
final LinearLayout foldingLayout = createAndPrepareFoldingContainer(contentView.getHeight());
// add that layout to structure
this.addView(foldingLayout);

Expand Down Expand Up @@ -366,12 +366,12 @@ protected Bitmap measureViewAndGetBitmap(View view, int parentWidth) {
*
* @return Configured container for animation elements (LinearLayout)
*/
protected LinearLayout createAndPrepareFoldingContainer() {
protected LinearLayout createAndPrepareFoldingContainer(int initHeight) {
LinearLayout foldingContainer = new LinearLayout(getContext());
foldingContainer.setClipToPadding(false);
foldingContainer.setClipChildren(false);
foldingContainer.setOrientation(LinearLayout.VERTICAL);
foldingContainer.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.WRAP_CONTENT));
foldingContainer.setLayoutParams(new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, initHeight));
return foldingContainer;
}

Expand Down

0 comments on commit f895ca0

Please sign in to comment.