Skip to content
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

SlideToActView.OnSlideCompleteListener -> onSlideComplete is not getting called when slides is Locked #161

Open
sarathsvs opened this issue Jul 11, 2021 · 3 comments

Comments

@sarathsvs
Copy link

slideissue

my xml

        <com.ncorti.slidetoact.SlideToActView
            android:layout_alignParentBottom="true"
            android:layout_marginBottom="100dp"
            android:layout_marginStart="20dp"
            android:layout_marginEnd="20dp"
            android:id="@+id/slideToActView"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:elevation="6dp"
            app:area_margin="4dp"
            app:animation_duration="250"
            app:outer_color="@color/colorAccent"
            app:inner_color="@color/white"
            app:border_radius="50dp"
            app:text="Swipe to Unlock"
            app:text_size="16sp"
            app:slider_height="80dp"
            app:bump_vibration="50"
            />

my callback method

fun setUpSlideCallBacks(){
        val slideToActView :SlideToActView = findViewById<SlideToActView>(R.id.slideToActView)
        slideToActView.onSlideCompleteListener = object : SlideToActView.OnSlideCompleteListener{
            override fun onSlideComplete(view: SlideToActView) {
                //its not getting called
            }
        }
    }
@cortinico
Copy link
Owner

I can't find anything wrong with your code.
There is a sample in the repository that is really similar:

slide.setOnSlideCompleteListener(new SlideToActView.OnSlideCompleteListener() {
@Override
public void onSlideComplete(@NonNull SlideToActView view) {
log.append("\n" + getTime() + " onSlideComplete");
}
});

And it works fine so far.

Have you locked the slider by any chance?
From the screenshot the behavior looks really similar to https://github.com/cortinico/slidetoact#slider_locked.

@Sanjay026
Copy link

Sanjay026 commented Jan 9, 2022

Hello,

 slide.setOnSlideCompleteListener(new SlideToActView.OnSlideCompleteListener() { 
     @Override 
     public void onSlideComplete(@NonNull SlideToActView view) { 
         log.append("\n" + getTime() + " onSlideComplete"); 
     } 
 }); 

this method wont call when the slider is locked.
Please let me know to achieve call this method when slider is locked

@cortinico cortinico changed the title SlideToActView.OnSlideCompleteListener -> onSlideComplete is not getting called SlideToActView.OnSlideCompleteListener -> onSlideComplete is not getting called when slides is Locker Jan 10, 2022
@cortinico cortinico changed the title SlideToActView.OnSlideCompleteListener -> onSlideComplete is not getting called when slides is Locker SlideToActView.OnSlideCompleteListener -> onSlideComplete is not getting called when slides is Locked Jan 10, 2022
@cortinico
Copy link
Owner

Please let me know to achieve call this method when slider is locked

That's currently not possible. The current behavior is to don't fire an event if the slider is locked. Can you explain why you would need such event, maybe with some examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants