├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── icon_slide.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable │ │ │ │ └── shape_round_normal_green.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ └── activity_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── qdong │ │ │ └── slidetounlockdemo │ │ │ └── MainActivity.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── qdong │ │ │ └── slidetounlockdemo │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── qdong │ │ └── slidetounlockdemo │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── app.iml ├── SlideToUnlockView ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ └── attrs.xml │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── icon_slide.png │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable │ │ │ │ └── shape_round_normal_green.xml │ │ │ └── layout │ │ │ │ └── layout_view_slide_to_unlock.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── qdong │ │ │ └── slide_to_unlock_view │ │ │ ├── DensityUtil.java │ │ │ └── CustomSlideToUnlockView.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── qdong │ │ │ └── slide_to_unlock_view │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── qdong │ │ └── slide_to_unlock_view │ │ └── ApplicationTest.java ├── proguard-rules.pro ├── build.gradle └── slidetounlockview.iml ├── demo.gif ├── app-debug.apk ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /SlideToUnlockView/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/demo.gif -------------------------------------------------------------------------------- /app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app-debug.apk -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/icon_slide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-xhdpi/icon_slide.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SlideToUnlock 3 | 滑动解锁 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SlideToUnlockView 3 | 滑动解锁 4 | 5 | 6 | -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/mipmap-xhdpi/icon_slide.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/SlideToUnlockView/src/main/res/mipmap-xhdpi/icon_slide.png -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/506954774/AndroidCustomSlideToUnlockView/HEAD/SlideToUnlockView/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | #FFFFFF 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 50dp 6 | 18sp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_round_normal_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/drawable/shape_round_normal_green.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/test/java/com/qdong/slidetounlockdemo/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.qdong.slidetounlockdemo; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /SlideToUnlockView/src/test/java/com/qdong/slide_to_unlock_view/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.qdong.slide_to_unlock_view; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * To work on unit tests, switch the Test Artifact in the Build Variants view. 9 | */ 10 | public class ExampleUnitTest { 11 | @Test 12 | public void addition_isCorrect() throws Exception { 13 | assertEquals(4, 2 + 2); 14 | } 15 | } -------------------------------------------------------------------------------- /app/src/androidTest/java/com/qdong/slidetounlockdemo/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.qdong.slidetounlockdemo; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /SlideToUnlockView/src/androidTest/java/com/qdong/slide_to_unlock_view/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.qdong.slide_to_unlock_view; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest() { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\IDE\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /SlideToUnlockView/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\IDE\sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | repositories { 4 | flatDir { 5 | dir 'libs' 6 | } 7 | maven { url "https://jitpack.io" } 8 | } 9 | 10 | android { 11 | compileSdkVersion 25 12 | buildToolsVersion "25.0.1" 13 | 14 | defaultConfig { 15 | applicationId "com.qdong.slidetounlockdemo" 16 | minSdkVersion 19 17 | targetSdkVersion 25 18 | versionCode 1 19 | versionName "1.0" 20 | } 21 | buildTypes { 22 | release { 23 | minifyEnabled false 24 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 25 | } 26 | } 27 | } 28 | 29 | dependencies { 30 | compile fileTree(include: ['*.jar'], dir: 'libs') 31 | testCompile 'junit:junit:4.12' 32 | compile 'com.android.support:appcompat-v7:25.1.0' 33 | compile 'com.nineoldandroids:library:2.4.0' 34 | compile 'com.github.florent37:viewanimator:1.0.0@aar' 35 | //compile project(':slidetounlockview') 36 | compile 'com.linklink.views:slide_to_unlock_view:1.0.0' 37 | } 38 | -------------------------------------------------------------------------------- /SlideToUnlockView/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | apply plugin: 'maven' 4 | apply plugin: 'com.novoda.bintray-release' 5 | 6 | android { 7 | compileSdkVersion 25 8 | buildToolsVersion "25.0.1" 9 | 10 | defaultConfig { 11 | minSdkVersion 19 12 | targetSdkVersion 25 13 | versionCode 1 14 | versionName "1.0" 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile fileTree(dir: 'libs', include: ['*.jar']) 26 | testCompile 'junit:junit:4.12' 27 | compile 'com.android.support:appcompat-v7:25.1.0' 28 | compile 'com.nineoldandroids:library:2.4.0' 29 | compile 'com.github.florent37:viewanimator:1.0.0@aar' 30 | } 31 | 32 | 33 | 34 | publish { 35 | userOrg = 'linklink' 36 | groupId = 'com.linklink.views' 37 | artifactId = 'slide_to_unlock_view' 38 | version = '1.0.0' 39 | description = 'Slide To Unlock View' 40 | website = 'https://github.com/506954774/AndroidCustomSlideToUnlockView' 41 | } 42 | 43 | 44 | 45 | tasks.withType(JavaCompile) { 46 | options.encoding = "UTF-8" 47 | } 48 | 49 | tasks.withType(Javadoc) { 50 | options.addStringOption('Xdoclint:none', '-quiet') 51 | options.addStringOption('encoding', 'UTF-8') 52 | } -------------------------------------------------------------------------------- /SlideToUnlockView/src/main/res/layout/layout_view_slide_to_unlock.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 15 | 16 | 20 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/qdong/slidetounlockdemo/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.qdong.slidetounlockdemo; 2 | import android.os.Bundle; 3 | import android.support.v7.app.AppCompatActivity; 4 | import android.view.View; 5 | import android.widget.TextView; 6 | import com.qdong.slide_to_unlock_view.CustomSlideToUnlockView; 7 | 8 | 9 | public class MainActivity extends AppCompatActivity { 10 | 11 | private CustomSlideToUnlockView mCustomSlideToUnlockView; 12 | private TextView tv_text; 13 | 14 | @Override 15 | protected void onCreate(Bundle savedInstanceState) { 16 | super.onCreate(savedInstanceState); 17 | setContentView(R.layout.activity_main); 18 | mCustomSlideToUnlockView= (com.qdong.slide_to_unlock_view.CustomSlideToUnlockView) findViewById(R.id.slide_to_unlock); 19 | tv_text= (TextView) findViewById(R.id.tv_text); 20 | 21 | CustomSlideToUnlockView.CallBack callBack=new CustomSlideToUnlockView.CallBack() { 22 | @Override 23 | public void onSlide(int distance) { 24 | tv_text.setText("slide distance:"+distance); 25 | } 26 | 27 | @Override 28 | public void onUnlocked() { 29 | tv_text.setText("onUnlocked"); 30 | } 31 | }; 32 | mCustomSlideToUnlockView.setmCallBack(callBack); 33 | findViewById(R.id.button).setOnClickListener(new View.OnClickListener() { 34 | @Override 35 | public void onClick(View view) { 36 | mCustomSlideToUnlockView.resetView(); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | 21 | 22 | 24 | 37 | 38 | 39 | 40 | 41 |