SlideView一个滑动效果库

先上效果图:

SlideView一个滑动效果库_第1张图片

1.建立Gradle

allprojects {
    repositories {
        jcenter()
        maven { url "https://jitpack.io" }
    }
}

dependencies {

    compile 'com.github.MAXDeliveryNG:slideview:1.0.0'

}

2.xml:




    

    

    

    

    

    




3.使用,MainActivity:

public class MainActivity extends AppCompatActivity {

    private SlideView slideView1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        slideView1 = (SlideView) findViewById(R.id.slider1);

        slideView1.setOnSlideCompleteListener(new SlideView.OnSlideCompleteListener() {
            @Override
            public void onSlideComplete(SlideView slideView) {

                // 震动100毫秒,需要添加权限  Vibrator
                Vibrator vibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
                vibrator.vibrate(100);
                // 跳转下一个Activity
                startActivity(new Intent(MainActivity.this, SecondActivity.class));
            }
        });
    }
}

4.属性信息:

SlideView一个滑动效果库_第2张图片

5.GitHub地址:

https://github.com/MAXDeliveryNG/slideview


Demo下载

你可能感兴趣的:(GitHub发现)