-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Only limited scroll items. The viewpager is not taking more than 3 banners out of 7. #10
Comments
I haven't limit the scroll items, you should implement viewpager adapter like this. public class MyAdapter extends InfinitePagerAdapter {
private List<String> data;
public MyAdapter(List<String> data) {
this.data = data;
}
@Override
public int getItemCount() {
return data == null ? 0 : data.size();
}
@Override
public View getItemView(int position, View convertView, ViewGroup container) {
return your view;
}
} |
This is my adapter,
This is my Main Activity
Output: |
The viewpager is infinite, but it is able to show only 3 positions of the list. 0, 1 and the last position. Is there anything at any point that I need to modify to get all my banners into this viewpager. |
if (convertView == null) {
//We must create a View:
convertView = layoutInflater.inflate(R.layout.item_view, container, false);
}
final TextView tv = convertView.findViewById(R.id.textView);
tv.setText(data.get(position).trim()); |
This is working. Appreciate for that. Is onPageClickListener is implemented in this library?? I am asking because I didn't find any methods saying so inside AutoScrollViewPager.java. Can we implement it by making a custom ViewPager using this library. Suggestions will be helpful. |
if (convertView == null) {
//We must create a View:
convertView = layoutInflater.inflate(R.layout.item_view, container, false);
}
convertView.setOnClickListener(...); |
Ok, thank you so much. |
I have cloned the repository into my IDE, used it as per the instructions in my custom project. The pager is working as expected but, it is taking only 3 pages by default. I have 7 pages out of which first two will scroll one by one and then the pager directly jumps to the last page.
I had tried to make it a custom implementation but was unable to find the exact line where this is going on. Let me know if there is any scope of implementation of this kind.
The text was updated successfully, but these errors were encountered: