Ramotion / paper-onboarding-android

:octocat: PaperOnboarding is a material design slider made by @Ramotion
https://www.ramotion.com/paper-onboarding-android/
MIT License
2.56k stars 421 forks source link

When i keep MPAndroid PieChart in FrameLayout after swipe half chart going out of screen #39

Closed eswaraaa closed 5 years ago

eswaraaa commented 5 years ago

In PaperOnboardingEngine.java implemented PieChart to show in each screen swipe. Once i press right swipe PieChart going bottom of screen and only half chart is showing. Please help to fix this issue.

protected ViewGroup createContentTextView(PaperOnboardingPage PaperOnboardingPage) { LayoutInflater vi = LayoutInflater.from(mAppContext); ViewGroup contentTextView = (ViewGroup) vi.inflate(R.layout.onboarding_text_content_layout, mContentTextContainer, false); ... pieChart = (PieChart) contentTextView.getChildAt(1); pieChart.setRotationEnabled(false); pieChart.setUsePercentValues(true); .. .. }

golovin47 commented 5 years ago

Hello, @eswaraaa. To resolve this issue you may download the examples from this repository and put your PieChart there. The reason of this issue is probably in your implementation.

eswaraaa commented 5 years ago

Hello, @eswaraaa. To resolve this issue you may download the examples from this repository and put your PieChart there. The reason of this issue is probably in your implementation.

Hi golovin47, Thanks for your quick response. I already integrated your code to my project. Issue is occurring only when i keep PieChart in screen. I implemented piechart in this xml layout layout.onboarding_text_content_layout

and referring it here: PaperOnboardingEngine.java protected ViewGroup createContentTextView(PaperOnboardingPage PaperOnboardingPage) { LayoutInflater vi = LayoutInflater.from(mAppContext); ViewGroup contentTextView = (ViewGroup) vi.inflate(R.layout.onboarding_text_content_layout, mContentTextContainer, false); ... pieChart = (PieChart) contentTextView.getChildAt(1); pieChart.setRotationEnabled(false); pieChart.setUsePercentValues(true); .. .. }

should i need to include any extra code in any place or in ViewGroup 4 animate content text createContentCenteringVerticalAnimation method // 4 animate content text ViewGroup newContentText = createContentTextView(newElement); mContentTextContainer.addView(newContentText); AnimatorSet contentTextShowAnimation = createContentTextShowAnimation( mContentTextContainer.getChildAt(mContentTextContainer.getChildCount() - 2), newContentText);

golovin47 commented 5 years ago

Try to play around with CONTENT_TEXT_POS_DELTA_Y_DP in this line in createContentCenteringVerticalAnimation method: int positionDeltaPx = dpToPixels(CONTENT_TEXT_POS_DELTA_Y_DP)