You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 26, 2024. It is now read-only.
Hi I am using your library and it works very well until I try to update one of the carousel items programmatically.
I do the following when I create my Activity:
listVideoLeft = (Carousel) findViewById(R.id.carousel1);
photos = getPhotos(); //get all available photos
updateList(index); // display only first 5 photos in the carousel (which are added to a tempPhotos list
adapter = new MyAdapter(this, tempPhotos);
listVideoLeft.setAdapter(adapter);
adapter.notifyDataSetChanged();
On click volume button down, I want to remove the first photo in tempPhotos and add a new one
@Override
public boolean dispatchKeyEvent(KeyEvent event) {
int action = event.getAction();
int keyCode = event.getKeyCode();
if (keyCode == KeyEvent.KEYCODE_VOLUME_DOWN)
if (action == KeyEvent.ACTION_DOWN) {
if (photos.size() > 0) {
tempPhotos.remove(0);
tempPhotos.add(photos.get(newIndex));
adapter.notifyDataSetChanged();
listVideoLeft.invalidate();
}
}
}
However, nothing changes in my carousel. Any ideas on the reason why it doesn't work in this case? as far as I know, in Adapter the notifyDataSetChanged in all you need to let the adapter know it's data has changed and it should update
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi I am using your library and it works very well until I try to update one of the carousel items programmatically.
I do the following when I create my Activity:
On click volume button down, I want to remove the first photo in tempPhotos and add a new one
However, nothing changes in my carousel. Any ideas on the reason why it doesn't work in this case? as far as I know, in Adapter the notifyDataSetChanged in all you need to let the adapter know it's data has changed and it should update
The text was updated successfully, but these errors were encountered: