Skip to content

Commit

Permalink
Updated CarouselView class
Browse files Browse the repository at this point in the history
Updated CarouselView class
  • Loading branch information
sung2063 committed Jul 3, 2020
1 parent 2d4c2ed commit 4276af4
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ protected void init() {
// Setup Layout
setupLayoutDirection(carouselHandler.getScrollDirection());
setupSlideNumber(carouselHandler.isShowingSlideNumber());
addView(rootLayout); // Add layout to the root layout

}

Expand Down Expand Up @@ -119,6 +118,9 @@ private void repositioningVerticalTab() {
*/
private void setupLayoutDirection(int layoutDirection) {

if (rootLayout != null)
removeView(rootLayout); // Remove layout first

LayoutInflater inflater = LayoutInflater.from(context);
if (layoutDirection == CarouselHandler.CAROUSEL_HORIZONTAL_DIRECTION) {
// Scroll horizontally
Expand All @@ -135,6 +137,7 @@ private void setupLayoutDirection(int layoutDirection) {
tvPageNum = (TextView) rootLayout.findViewById(R.id.tv_slide_num);
pbLayoutLoader = (ProgressBar) rootLayout.findViewById(R.id.pb_layout_loader);
}
addView(rootLayout); // Add layout to the root layout

}

Expand Down

0 comments on commit 4276af4

Please sign in to comment.