forked from alibaba/ARouter
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
153 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
apply plugin: 'com.android.library' | ||
apply plugin: 'kotlin-android' | ||
apply plugin: 'kotlin-kapt' | ||
apply plugin: 'kotlin-android-extensions' | ||
|
||
kapt { | ||
arguments { | ||
arg("moduleName", project.getName()) | ||
} | ||
} | ||
|
||
dependencies { | ||
compile project(':arouter-api') | ||
compile "com.android.support:appcompat-v7:${SUPPORT_LIB_VERSION}" | ||
compile "org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlin_version" | ||
compile 'com.android.support.constraint:constraint-layout:1.0.2' | ||
kapt 'com.alibaba:arouter-compiler:1.0.3' | ||
} | ||
android { | ||
compileSdkVersion Integer.parseInt(COMPILE_SDK_VERSION) | ||
buildToolsVersion BUILDTOOLS_VERSION | ||
|
||
defaultConfig { | ||
minSdkVersion Integer.parseInt(MIN_SDK_VERSION) | ||
targetSdkVersion Integer.parseInt(TARGET_SDK_VERSION) | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
buildTypes { | ||
release { | ||
debuggable false | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
|
||
lintOptions { abortOnError false } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.alibaba.android.arouter.demo.kotlin"> | ||
|
||
<!-- 读写存储的权限 --> | ||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | ||
|
||
<application> | ||
<activity android:name=".KotlinTestActivity"/> | ||
<activity android:name=".TestNormalActivity"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
26 changes: 26 additions & 0 deletions
26
module-kotlin/src/main/java/com/alibaba/android/arouter/demo/kotlin/KotlinTestActivity.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.alibaba.android.arouter.demo.kotlin | ||
|
||
import android.app.Activity | ||
import android.os.Bundle | ||
import com.alibaba.android.arouter.facade.annotation.Autowired | ||
import com.alibaba.android.arouter.facade.annotation.Route | ||
import com.alibaba.android.arouter.launcher.ARouter | ||
import kotlinx.android.synthetic.main.activity_kotlin_test.* | ||
|
||
@Route(path = "/test/kotlin") | ||
class KotlinTestActivity : Activity() { | ||
|
||
@Autowired | ||
@JvmField var name: String? = null | ||
@Autowired | ||
@JvmField var age: Int? = 0 | ||
|
||
override fun onCreate(savedInstanceState: Bundle?) { | ||
ARouter.getInstance().inject(this) // Start auto inject. | ||
|
||
super.onCreate(savedInstanceState) | ||
setContentView(R.layout.activity_kotlin_test) | ||
|
||
content.text = "name = $name, age = $age" | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
module-kotlin/src/main/java/com/alibaba/android/arouter/demo/kotlin/TestNormalActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.alibaba.android.arouter.demo.kotlin; | ||
|
||
import android.support.v7.app.AppCompatActivity; | ||
import android.os.Bundle; | ||
|
||
import com.alibaba.android.arouter.facade.annotation.Route; | ||
|
||
@Route(path = "/test/normal/activity") | ||
public class TestNormalActivity extends AppCompatActivity { | ||
|
||
@Override | ||
protected void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.activity_test_normal); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
module-kotlin/src/main/res/layout/activity_kotlin_test.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context=".KotlinTestActivity"> | ||
|
||
<TextView | ||
android:id="@+id/content" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:text="Im kotlin activity."/> | ||
</LinearLayout> |
10 changes: 10 additions & 0 deletions
10
module-kotlin/src/main/res/layout/activity_test_normal.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<android.support.constraint.ConstraintLayout | ||
xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
tools:context="com.alibaba.android.arouter.demo.kotlin.TestNormalActivity"> | ||
|
||
</android.support.constraint.ConstraintLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<resources> | ||
<!-- Default screen margins, per the Android Design guidelines. --> | ||
<dimen name="activity_horizontal_margin">16dp</dimen> | ||
<dimen name="activity_vertical_margin">16dp</dimen> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<resources></resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.