Skip to content
This repository has been archived by the owner on Feb 22, 2021. It is now read-only.

Custom OnSurfaceCount issue #3

Closed
tree1891 opened this issue Feb 20, 2018 · 15 comments
Closed

Custom OnSurfaceCount issue #3

tree1891 opened this issue Feb 20, 2018 · 15 comments
Assignees
Labels

Comments

@tree1891
Copy link

Navigating away from the screen with ViewPager and dots and then navigating back, custom OnSurfaceCount not restored and layout broken.
ex: setOnSurfaceCount(1);

@tree1891 tree1891 changed the title custom OnSurfaceCount issue Custom OnSurfaceCount issue Feb 20, 2018
@shuhart shuhart self-assigned this Mar 1, 2018
@shuhart
Copy link
Owner

shuhart commented Mar 1, 2018

I try to reproduce and no luck. Could you please post a code to reproduce?

@shuhart
Copy link
Owner

shuhart commented Mar 1, 2018

A bug related with broken state after updating onSurfaceCount is fixed. Not sure whether it's related to your issue but try version 1.0.7.

@tree1891
Copy link
Author

tree1891 commented Mar 1, 2018

It is not fixed and grow worse.
it is not center aligned and moving while swiping on default OnSurfaceCount.

BubblePageIndicator pageIndicator = view.findViewById(R.id.page_indicator);
pageIndicator.setViewPager(viewPager);
//pageIndicator.setOnSurfaceCount(3);
pageIndicator.setEnabled(false);

at the beginning
image

after swiping left and right repeatedly
image

@shuhart
Copy link
Owner

shuhart commented Mar 1, 2018 via email

@tree1891
Copy link
Author

tree1891 commented Mar 1, 2018

sorry, it is not possible.

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018 via email

@tree1891
Copy link
Author

tree1891 commented Mar 2, 2018

<LinearLayout
	android:layout_width="match_parent"
	android:layout_height="wrap_content"
	android:layout_alignBottom="@+id/viewpager"
	android:layout_centerHorizontal="true"
	android:orientation="vertical"
	android:paddingBottom="20dp">

	<com.shuhart.bubblepagerindicator.BubblePageIndicator
		android:id="@+id/page_indicator"
		android:layout_width="wrap_content"
		android:layout_height="wrap_content"
		android:layout_alignParentBottom="true"
		android:layout_centerInParent="true"
		android:layout_gravity="center_horizontal"
		app:fillColor="@color/azure"
		app:pageColor="#d8d8d8"
		app:radius="4dp" />

</LinearLayout>
BubblePageIndicator pageIndicator = view.findViewById(R.id.page_indicator);
pageIndicator.setViewPager(viewPager);
//pageIndicator.setOnSurfaceCount(3);
pageIndicator.setEnabled(false);

After init, there is no any update for pageIndicator, but not for viewpager's adapter.

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018 via email

@tree1891
Copy link
Author

tree1891 commented Mar 2, 2018

Yes, right, it will be updated every on resume or by other action

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018 via email

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018

Some related to this bugs were fixed in 1.0.8. Try it out and let me know if everything is OK.

@shuhart shuhart added the bug label Mar 2, 2018
@tree1891
Copy link
Author

tree1891 commented Mar 2, 2018

With custom OnSurfaceCount(ex: 3), it does not work at the beginning(viewpager is not empty).
Sliding in viewpager does not change indicator.
Navigating away and then navigating back, it does work.

It is also not center aligned.
image

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018

Fixed in 1.0.10

@tree1891
Copy link
Author

tree1891 commented Mar 2, 2018

It does work!
Thank you very much!

@shuhart
Copy link
Owner

shuhart commented Mar 2, 2018 via email

@shuhart shuhart closed this as completed Mar 2, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants