반응형

build.gradle

// slide animation
    implementation 'com.ncorti:slidetoact:0.3.0'

xml

<com.ncorti.slidetoact.SlideToActView
                    android:id="@+id/slide"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    app:outer_color="#3F51B5"
                    android:elevation="10dp"
                    app:text="슬라이드 버튼" />

Activity

 SlideToActView slide;
 
 ...

slide = findViewById(R.id.slide);

slide.setOnSlideCompleteListener(new SlideToActView.OnSlideCompleteListener() {
            @Override
            public void onSlideComplete(@NonNull SlideToActView slideToActView) {
                
                // 이벤트 발생 시키는 부분

                slide_driver.resetSlider();
            }
        });

결과

slidetoact 결과

반응형

+ Recent posts