Skip to content

Commit 1d738be

Browse files
committed
Convert code to Kotlin
1 parent 6792a69 commit 1d738be

File tree

218 files changed

+6875
-7560
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

218 files changed

+6875
-7560
lines changed

android_project_common.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ ext {
3535
'compileSdk' : 28,
3636

3737
// Android official support
38-
'kotlin' : "1.3.30",
38+
'kotlin' : "1.3.31",
3939
'supportLib' : "28.0.0",
4040
'multidexLib' : "2.0.1",
4141
'constraintLayout' : "1.1.3",
4242
'lintLib' : "26.4.0",
43-
'archCore' : "2.0.0-rc01",
44-
'lifecycle' : "2.0.0-rc01",
45-
'room' : "2.0.0-rc01",
43+
'archCore' : "2.0.0",
44+
'lifecycle' : "2.0.0",
45+
'room' : "2.0.0",
4646

4747
// test
4848
'runner' : "1.1.0",
@@ -60,7 +60,7 @@ ext {
6060
'wearableSupport' : "2.3.0",
6161

6262
// infrastructure
63-
'butterknife' : "10.0.0",
63+
'butterknife' : "10.1.0",
6464
'timber' : "4.7.1",
6565
'guava' : "23.5-android",
6666

archLib/src/main/java/me/ycdev/android/arch/ArchConstants.java

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package me.ycdev.android.arch
2+
3+
import android.widget.Toast
4+
import androidx.annotation.IntDef
5+
6+
object ArchConstants {
7+
const val INTENT_TYPE_ACTIVITY = 1
8+
const val INTENT_TYPE_BROADCAST = 2
9+
const val INTENT_TYPE_SERVICE = 3
10+
11+
@IntDef(INTENT_TYPE_ACTIVITY, INTENT_TYPE_BROADCAST, INTENT_TYPE_SERVICE)
12+
@Retention(AnnotationRetention.SOURCE)
13+
annotation class IntentType
14+
15+
/*
16+
* Durations for toast
17+
*/
18+
@IntDef(Toast.LENGTH_SHORT, Toast.LENGTH_LONG)
19+
@Retention(AnnotationRetention.SOURCE)
20+
annotation class ToastDuration
21+
}

archLib/src/main/java/me/ycdev/android/arch/activity/AppCompatBaseActivity.java

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package me.ycdev.android.arch.activity
2+
3+
import android.os.Bundle
4+
import androidx.appcompat.app.AppCompatActivity
5+
6+
/**
7+
* Base class for Activity which wants to inherit
8+
* [androidx.appcompat.app.AppCompatActivity].
9+
*/
10+
abstract class AppCompatBaseActivity : AppCompatActivity() {
11+
override fun onCreate(savedInstanceState: Bundle?) {
12+
super.onCreate(savedInstanceState)
13+
if (shouldSetDisplayHomeAsUpEnabled()) {
14+
val actionBar = supportActionBar
15+
actionBar?.setDisplayHomeAsUpEnabled(true)
16+
}
17+
}
18+
19+
protected open fun shouldSetDisplayHomeAsUpEnabled(): Boolean {
20+
return true
21+
}
22+
}

archLib/src/main/java/me/ycdev/android/arch/activity/BaseActivity.java

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package me.ycdev.android.arch.activity
2+
3+
import android.app.Activity
4+
5+
/**
6+
* Base class for Activity which wants to inherit [android.app.Activity].
7+
*/
8+
abstract class BaseActivity : Activity() // nothing to do right now

archLib/src/main/java/me/ycdev/android/arch/activity/PreferenceBaseActivity.java

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
package me.ycdev.android.arch.activity
2+
3+
import android.preference.PreferenceActivity
4+
5+
/**
6+
* Base class for Activity which wants to inherit
7+
* [android.preference.PreferenceActivity].
8+
*/
9+
abstract class PreferenceBaseActivity : PreferenceActivity() // nothing to do right now

archLib/src/main/java/me/ycdev/android/arch/utils/AppLogger.java

Lines changed: 0 additions & 77 deletions
This file was deleted.

0 commit comments

Comments
 (0)