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
91 changed files
with
5,213 additions
and
27 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
/*/build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Proguard folder generated by Eclipse | ||
proguard/ | ||
|
||
# Log Files | ||
*.log | ||
|
||
# IDEA Files | ||
.idea | ||
*.iml | ||
/*.ipr | ||
/*.iws | ||
|
||
# Eclipse Files | ||
/target | ||
*.classpath | ||
*.project | ||
*.settings | ||
|
||
app/src/main/res/values/config.xml | ||
app/src/main/res/drawable/yw_1222.jpg | ||
|
||
# OS X Files | ||
.DS_Store | ||
|
||
map.txt |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
apply plugin: 'com.android.application' | ||
apply plugin: 'com.neenbedankt.android-apt' | ||
|
||
android { | ||
compileSdkVersion Integer.parseInt(COMPILE_SDK_VERSION) | ||
buildToolsVersion BUILDTOOLS_VERSION | ||
|
||
defaultConfig { | ||
minSdkVersion Integer.parseInt(MIN_SDK_VERSION) | ||
targetSdkVersion Integer.parseInt(TARGET_SDK_VERSION) | ||
versionName "0.0.1" | ||
} | ||
|
||
compileOptions { | ||
sourceCompatibility JavaVersion.VERSION_1_7 | ||
targetCompatibility JavaVersion.VERSION_1_7 | ||
} | ||
|
||
signingConfigs { | ||
debug { | ||
storeFile file("./doc/debug/debug.keystore") | ||
storePassword "android" | ||
keyAlias "androiddebugkey" | ||
keyPassword "android" | ||
} | ||
} | ||
|
||
buildTypes { | ||
debug { | ||
minifyEnabled false | ||
signingConfig signingConfigs.debug | ||
} | ||
|
||
release { | ||
minifyEnabled false | ||
signingConfig null | ||
} | ||
} | ||
|
||
lintOptions { | ||
abortOnError false | ||
} | ||
} | ||
|
||
dependencies { | ||
compile fileTree(dir: 'libs', include: ['*.jar']) | ||
|
||
apt 'com.alibaba:arouter-compiler:1.0.1' | ||
compile 'com.alibaba:arouter-api:1.0.1' | ||
|
||
compile project(':test-module-1') | ||
compile project(':test-module-2') | ||
|
||
compile 'com.android.support:appcompat-v7:22.2.0' | ||
} | ||
|
||
apt { | ||
arguments { | ||
moduleName project.getName(); | ||
} | ||
} |
Binary file not shown.
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,63 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.alibaba.android.arouter.demo"> | ||
|
||
<!-- To auto-complete the email text field in the login form with the user's emails --> | ||
<uses-permission android:name="android.permission.GET_ACCOUNTS"/> | ||
<uses-permission android:name="android.permission.READ_PROFILE"/> | ||
<uses-permission android:name="android.permission.READ_CONTACTS"/> | ||
|
||
<application | ||
android:name=".AppContext" | ||
android:allowBackup="false" | ||
android:label="ARouter demo" | ||
android:theme="@style/Base.Theme.AppCompat"> | ||
<activity android:name=".SchameFilterActivity"> | ||
|
||
<!-- Schame --> | ||
<intent-filter> | ||
<data | ||
android:host="m.aliyun.com" | ||
android:scheme="arouter"/> | ||
|
||
<action android:name="android.intent.action.VIEW"/> | ||
|
||
<category android:name="android.intent.category.DEFAULT"/> | ||
<category android:name="android.intent.category.BROWSABLE"/> | ||
</intent-filter> | ||
|
||
<!-- App Links --> | ||
<intent-filter android:autoVerify="true"> | ||
<action android:name="android.intent.action.VIEW"/> | ||
|
||
<category android:name="android.intent.category.DEFAULT"/> | ||
<category android:name="android.intent.category.BROWSABLE"/> | ||
|
||
<data | ||
android:host="m.aliyun.com" | ||
android:scheme="http"/> | ||
<data | ||
android:host="m.aliyun.com" | ||
android:scheme="https"/> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".MainActivity"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN"/> | ||
|
||
<category android:name="android.intent.category.LAUNCHER"/> | ||
</intent-filter> | ||
</activity> | ||
<activity android:name=".TestWebview"> | ||
</activity> | ||
<activity android:name=".testactivity.Test1Activity"> | ||
</activity> | ||
<activity android:name=".testactivity.Test2Activity"> | ||
</activity> | ||
<activity android:name=".testactivity.Test3Activity"> | ||
</activity> | ||
<activity android:name=".testactivity.Test4Activity"> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
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,25 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | ||
<title></title> | ||
</head> | ||
|
||
<body> | ||
|
||
<h2>跳转测试</h2> | ||
|
||
<h2>自定义Schame[通常来说都是这样的]</h2> | ||
<p><a href="arouter://m.aliyun.com/test/activity1">arouter://m.aliyun.com/test/activity1</a></p> | ||
<p><a href="arouter://m.aliyun.com/test/activity1?url=https%3a%2f%2fm.abc.com%3fa%3db%26c%3dd">测试URL Encode情况</a></p> | ||
<p><a href="arouter://m.aliyun.com/test/activity1?name=alex&age=18&boy=true&high=180">arouter://m.aliyun.com/test/activity1?name=alex&age=18&boy=true&high=180</a></p> | ||
<p><a href="arouter://m.aliyun.com/test/activity2">arouter://m.aliyun.com/test/activity2</a></p> | ||
<p><a href="arouter://m.aliyun.com/test/activity2?key1=value1">arouter://m.aliyun.com/test/activity2?key1=value1</a></p> | ||
<p><a href="arouter://m.aliyun.com/test/activity3?name=alex&age=18&boy=true&high=180">(需要开启自动注入)arouter://m.aliyun.com/test/activity3?name=alex&age=18&boy=true&high=180</a></p> | ||
|
||
<h2>App Links[防止被App屏蔽]</h2> | ||
<p><a href="http://m.aliyun.com/test/activity1">http://m.aliyun.com/test/activity1</a></p> | ||
<p><a href="http://m.aliyun.com/test/activity2">http://m.aliyun.com/test/activity2</a></p> | ||
|
||
</body> | ||
</html> |
44 changes: 44 additions & 0 deletions
44
app/src/main/java/com/alibaba/android/arouter/demo/AppContext.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,44 @@ | ||
package com.alibaba.android.arouter.demo; | ||
|
||
import android.app.Application; | ||
import android.content.Context; | ||
|
||
import com.alibaba.android.arouter.launcher.ARouter; | ||
|
||
/** | ||
* TODO feature | ||
* | ||
* @author Alex <a href="mailto:[email protected]">Contact me.</a> | ||
* @version 1.0 | ||
* @since 16/8/23 11:54 | ||
*/ | ||
public class AppContext extends Application { | ||
|
||
private static Application mInstance; | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
|
||
mInstance = this; | ||
} | ||
|
||
public static Application getInstance() { | ||
return mInstance; | ||
} | ||
|
||
/** | ||
* Set the base context for this ContextWrapper. All calls will then be | ||
* delegated to the base context. Throws | ||
* IllegalStateException if a base context has already been set. | ||
* | ||
* @param base The new base context for this wrapper. | ||
*/ | ||
@Override | ||
protected void attachBaseContext(Context base) { | ||
super.attachBaseContext(base); | ||
|
||
// 实验性功能,不推荐使用 | ||
ARouter.attachBaseContext(); | ||
} | ||
} |
Oops, something went wrong.