From 62c2ee64a21425a90cc11d27c682fcd6b34a4855 Mon Sep 17 00:00:00 2001 From: Hyemin Kim <1117hyemin@gmail.com> Date: Sat, 22 Jul 2017 10:26:19 +0900 Subject: [PATCH 01/56] Add component to .gitignore file --- .gitignore | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.gitignore b/.gitignore index e77debe72..ab375b2ab 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,10 @@ /build /gradle /captures +.idea +build/ +.DS_Store +*.iml +*.apk +*.aar +*.zip From 8d1c82b308a5b184be3734955e13264b933e6ff5 Mon Sep 17 00:00:00 2001 From: Hyemin Kim <1117hyemin@gmail.com> Date: Sat, 22 Jul 2017 10:38:28 +0900 Subject: [PATCH 02/56] Convert Animation1 Java file into Kotiln file --- build.gradle | 4 ++- mobile/build.gradle | 5 +++ .../view/{Animation1.java => Animation1.kt} | 33 +++++++++---------- 3 files changed, 24 insertions(+), 18 deletions(-) rename mobile/src/main/java/com/example/android/apis/view/{Animation1.java => Animation1.kt} (50%) diff --git a/build.gradle b/build.gradle index e4873fbe3..af7038d92 100644 --- a/build.gradle +++ b/build.gradle @@ -2,11 +2,13 @@ // vim: ts=4 sts=4 sw=4 expandtab buildscript { + ext.kotlin_version = '1.1.3-2' repositories { jcenter() } dependencies { - classpath 'com.android.tools.build:gradle:2.3.3' + classpath 'com.android.tools.build:gradle:3.0.0-alpha7' + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/mobile/build.gradle b/mobile/build.gradle index 413448435..0f3641797 100644 --- a/mobile/build.gradle +++ b/mobile/build.gradle @@ -1,4 +1,5 @@ apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' android { compileSdkVersion 26 @@ -27,4 +28,8 @@ dependencies { compile fileTree(include: ['*.jar'], dir: 'libs') compile 'com.android.support:support-v4:26.0.0-beta2' compile 'com.android.support:appcompat-v7:26.0.0-beta2' + compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" +} +repositories { + mavenCentral() } diff --git a/mobile/src/main/java/com/example/android/apis/view/Animation1.java b/mobile/src/main/java/com/example/android/apis/view/Animation1.kt similarity index 50% rename from mobile/src/main/java/com/example/android/apis/view/Animation1.java rename to mobile/src/main/java/com/example/android/apis/view/Animation1.kt index 73563f310..c6841c954 100644 --- a/mobile/src/main/java/com/example/android/apis/view/Animation1.java +++ b/mobile/src/main/java/com/example/android/apis/view/Animation1.kt @@ -14,32 +14,31 @@ * limitations under the License. */ -package com.example.android.apis.view; +package com.example.android.apis.view // Need the following import to get access to the app resources, since this // class is in a sub-package. -import com.example.android.apis.R; +import com.example.android.apis.R -import android.app.Activity; -import android.os.Bundle; -import android.view.View; -import android.view.animation.Animation; -import android.view.animation.AnimationUtils; +import android.app.Activity +import android.os.Bundle +import android.view.View +import android.view.animation.Animation +import android.view.animation.AnimationUtils -public class Animation1 extends Activity implements View.OnClickListener { +class Animation1 : Activity(), View.OnClickListener { - @Override - public void onCreate(Bundle savedInstanceState) { - super.onCreate(savedInstanceState); - setContentView(R.layout.animation_1); + public override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.animation_1) - View loginButton = findViewById(R.id.login); - loginButton.setOnClickListener(this); + val loginButton = findViewById(R.id.login) + loginButton.setOnClickListener(this) } - public void onClick(View v) { - Animation shake = AnimationUtils.loadAnimation(this, R.anim.shake); - findViewById(R.id.pw).startAnimation(shake); + override fun onClick(v: View) { + val shake = AnimationUtils.loadAnimation(this, R.anim.shake) + findViewById(R.id.pw).startAnimation(shake) } } From 42805f0edd2809dca4cf7cc3bbb4b84c80d62f7a Mon Sep 17 00:00:00 2001 From: Hyemin Kim <1117hyemin@gmail.com> Date: Sat, 22 Jul 2017 10:43:42 +0900 Subject: [PATCH 03/56] Use android:inputType instead of android:password Because android:password in EditText is Deprecated. --- mobile/src/main/res/layout/animation_1.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile/src/main/res/layout/animation_1.xml b/mobile/src/main/res/layout/animation_1.xml index 8380fc485..791665111 100644 --- a/mobile/src/main/res/layout/animation_1.xml +++ b/mobile/src/main/res/layout/animation_1.xml @@ -32,7 +32,7 @@ android:layout_height="wrap_content" android:clickable="true" android:singleLine="true" - android:password="true" + android:inputType="numberPassword" />