-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Disable slide (not autocycle) when theres only one image? #82
Comments
I also think that this is a must have feature. Keep up the great work! |
I overlap an ImageView with the first image over the Slider and change visibility when I receive the rest of the images, but it's only a patch. |
This, and the fact that simply removing and adding slides dynamically makes it freak out and slide around a bunch on initializing is why I must ditch the use of this plugin. Great otherwise, look forward to this request being fulfilled. |
1. When removing slider, there will be a white blank area 2. When there is only one image, it will still able to scroll.
I'm waiting for this feature too. I created a ghost view in my layout <FrameLayout
android:id="@+id/container_layout"
android:background="@color/gray_hard_text"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/my_tickets_header"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/gray_hint">
<com.daimajia.slider.library.SliderLayout
android:id="@+id/adp_my_tickets_banner_slider"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</LinearLayout>
<FrameLayout
android:id="@+id/ghost_view_workaround"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="gone">
</FrameLayout>
</FrameLayout>
In code, I check if my list has one element, if yes, I set the visibility to VISIBLE and set a listener to onclick if (purchase.getOrder().getTickets().size() < 2) {
viewHolder.findViewById(R.id.ghost_view_workaround).setVisibility(View.VISIBLE);
viewHolder.findViewById(R.id.ghost_view_workaround).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
}
});
} |
@daimajia It would be great if you could implement this feature. Thanks! Great work. |
+1 please provide this feature! |
Why this is not yet supported? That's a pity.. |
Is there any workaround for that? |
I've found a workaround I guess, this makes it unable to swipe but not sure if it will be stable :) if (imageCount < 2) {
sliderShow.stopAutoCycle();
sliderShow.setPagerTransformer(false, new BaseTransformer() {
@Override
protected void onTransform(View view, float v) {
}
});
//TODO: disable indicator
} |
I donnot want it cycle,just one-way |
@dgngulcan Thanks! Its works! |
+1 definitely a must have feature! |
how to make it one way slider, it will stuck on last item and not cycling to the first item. thank you |
@dgngulcan Thanks a lot for this. |
Thanks @dgngulcan |
@dgngulcan But it's affecting the other images when we using it with recycler views that is because the recycler view inflating the views in which the transformation has been done. |
@dgngulcan Can you have any solution for that using in recycler view??? |
How can I stop (and restart) the swipe gestures of a SliderLayout? I've got dinamic scenarios where I use a SliderLayout with only one image and sometimes with multiple images, or multiple images could be added dinamically.
When theres only one image I put the visibility of the indicators to View.GONE but I can still swipping the image. Is there a way to stop the swipe?
Thanks a lot for this amazing library and your work.
The text was updated successfully, but these errors were encountered: