├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── icon.png │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── icon.png │ │ │ │ ├── logo.png │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── icon.png │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── button_passdelete.png │ │ │ ├── drawable-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── drawable-v21 │ │ │ │ └── bg_btn_number.xml │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ └── colors.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── drawable │ │ │ │ └── bg_btn_number.xml │ │ │ └── layout │ │ │ │ ├── activity_sample3.xml │ │ │ │ ├── activity_sample4.xml │ │ │ │ ├── activity_sample1.xml │ │ │ │ ├── activity_sample2.xml │ │ │ │ ├── activity_main.xml │ │ │ │ ├── activity_input_pass_code.xml │ │ │ │ └── activity_confirm_pass_code.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── example │ │ │ │ └── u_nation │ │ │ │ └── passcodelocksample │ │ │ │ ├── util │ │ │ │ ├── ShowToast.java │ │ │ │ └── PrefUtil.java │ │ │ │ ├── Constants.java │ │ │ │ ├── sample_activities │ │ │ │ ├── Sample4Activity.java │ │ │ │ ├── Sample2Activity.java │ │ │ │ ├── Sample3Activity.java │ │ │ │ ├── Sample1Activity.java │ │ │ │ └── MainActivity.java │ │ │ │ ├── MyApplication.java │ │ │ │ ├── PassCodeConfirmationActivity.java │ │ │ │ └── PassCodeSetActivity.java │ │ └── AndroidManifest.xml │ └── androidTest │ │ └── java │ │ └── com │ │ └── example │ │ └── u_nation │ │ └── passcodelocksample │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── art └── passcodelock.gif ├── gradle └── wrapper │ └── gradle-wrapper.properties ├── .gitignore ├── LICENSE ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /art/passcodelock.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/art/passcodelock.gif -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xhdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xxhdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xxhdpi/logo.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xxxhdpi/icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/button_passdelete.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/u-nation/PassCodeLockSample/HEAD/app/src/main/res/drawable-hdpi/button_passdelete.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/bg_btn_number.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Dec 02 21:16:36 JST 2017 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/u_nation/passcodelocksample/util/ShowToast.java: -------------------------------------------------------------------------------- 1 | package com.example.u_nation.passcodelocksample.util; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | public class ShowToast { 7 | public static void show(String text, Context context) { 8 | Toast.makeText(context, text, Toast.LENGTH_SHORT).show(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/example/u_nation/passcodelocksample/Constants.java: -------------------------------------------------------------------------------- 1 | package com.example.u_nation.passcodelocksample; 2 | 3 | public class Constants { 4 | // プリファレンス用のキー 5 | public static final String PREF_KEY_PASSWORD = "password"; 6 | public static final String PREF_KEY_IS_LOCKED = "isLocked"; 7 | public static final String PREF_KEY_APPLICATION_BACKGROUND = "background"; 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/example/u_nation/passcodelocksample/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.example.u_nation.passcodelocksample; 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 /Users/endo-ex/Android/android-sdk-macosx/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/res/drawable/bg_btn_number.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 16dp 5 | 16dp 6 | 7 | 45dip 8 | 37dip 9 | 50dip 10 | 5dip 11 | 12sp 12 | 14sp 13 | 16sp 14 | 18sp 15 | 22sp 16 | 26sp 17 | 36sp 18 | 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # built application files 2 | *.apk 3 | *.ap_ 4 | 5 | # files for the dex VM 6 | *.dex 7 | 8 | # Java class files 9 | *.class 10 | 11 | # generated files 12 | bin/ 13 | gen/ 14 | 15 | # Local configuration file (sdk path, etc) 16 | local.properties 17 | 18 | # Eclipse project files 19 | .classpath 20 | .project 21 | 22 | # Proguard folder generated by Eclipse 23 | proguard/ 24 | 25 | # Intellij project files 26 | *.iml 27 | *.ipr 28 | *.iws 29 | .idea 30 | 31 | project.properties 32 | .DS_Store 33 | tests/.settings/org.eclipse.jdt.core.prefs 34 | org.eclipse.jdt.core.prefs 35 | /.apt_generated/ 36 | 37 | .settings/ 38 | release/ 39 | build/ 40 | 41 | .gradle/ 42 | gradle.properties 43 | 44 | local.properties 45 | 46 | .mtj.tmp/ 47 | 48 | # Package Files # 49 | *.jar 50 | *.war 51 | *.ear 52 | 53 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 54 | hs_err_pid* 55 | 56 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 26 5 | buildToolsVersion '26.0.2' 6 | 7 | defaultConfig { 8 | applicationId "com.example.u_nation.passcodelocksample" 9 | minSdkVersion 15 10 | targetSdkVersion 26 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | ext { 23 | supportLibraryVersion = '26.0.1' 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | compile "com.android.support:design:$supportLibraryVersion" 29 | compile "com.android.support:support-v4:$supportLibraryVersion" 30 | compile "com.android.support:appcompat-v7:$supportLibraryVersion" 31 | compile 'com.jakewharton.timber:timber:4.5.1' 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_sample3.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 16 | 17 |