-
Notifications
You must be signed in to change notification settings - Fork 4
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
EastWood Yang
committed
Jul 21, 2018
0 parents
commit fced05c
Showing
81 changed files
with
3,163 additions
and
0 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,35 @@ | ||
# Built application files | ||
*.apk | ||
*.ap_ | ||
|
||
# Files for the ART/Dalvik VM | ||
*.dex | ||
|
||
# Java class files | ||
*.class | ||
|
||
# Generated files | ||
bin/ | ||
gen/ | ||
out/ | ||
|
||
# Gradle files | ||
.gradle/ | ||
build/ | ||
|
||
# Local configuration file (sdk path, etc) | ||
local.properties | ||
|
||
# Android Studio Navigation editor temp files | ||
.navigation/ | ||
.externalNativeBuild | ||
|
||
# Android Studio captures folder | ||
captures/ | ||
|
||
# Intellij | ||
*.iml | ||
.idea | ||
|
||
# Keystore files | ||
*.jks |
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,2 @@ | ||
# AnnoRouter | ||
Use interfaces and annotations to define route jump info. |
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 @@ | ||
apply plugin: 'com.android.application' | ||
|
||
android { | ||
compileSdkVersion 27 | ||
|
||
defaultConfig { | ||
minSdkVersion 14 | ||
applicationId "com.eastwood.demo.router" | ||
versionCode 1 | ||
versionName "1.0" | ||
} | ||
|
||
buildTypes { | ||
release { | ||
minifyEnabled false | ||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | ||
} | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation "com.android.support:appcompat-v7:27.1.1" | ||
implementation project(':router') | ||
// implementation 'com.winwin.common:Router:1.4.4-SNAPSHOT' | ||
} |
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 @@ | ||
# Add project specific ProGuard rules here. | ||
# By default, the flagParamValue in this file are appended to flagParamValue specified | ||
# in F:\Android\sdk/tools/proguard/proguard-android.txt | ||
# You can edit the include path and order by changing the proguardFiles | ||
# directive in build.gradle. | ||
# | ||
# For more details, see | ||
# http://developer.android.com/guide/developing/tools/proguard.html | ||
|
||
# Add any project specific keep options here: | ||
|
||
# If your project uses WebView with JS, uncomment the following | ||
# and specify the fully qualified class name to the JavaScript interface | ||
# class: | ||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { | ||
# public *; | ||
#} | ||
|
||
# Uncomment this to preserve the line number information for | ||
# debugging stack traces. | ||
#-keepattributes SourceFile,LineNumberTable | ||
|
||
# If you keep the line number information, uncomment this to | ||
# hide the original source file name. | ||
#-renamesourcefileattribute SourceFile |
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 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.eastwood.demo.router" > | ||
|
||
<application | ||
android:name=".App" | ||
android:allowBackup="true" | ||
android:icon="@mipmap/ic_launcher" | ||
android:label="@string/app_name" | ||
android:roundIcon="@mipmap/ic_launcher_round" | ||
android:supportsRtl="true" | ||
android:theme="@style/AppTheme" > | ||
<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=".RouterAActivity" /> | ||
<activity android:name=".TempActivity" /> | ||
|
||
</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,56 @@ | ||
package com.eastwood.demo.router; | ||
|
||
import android.app.Application; | ||
|
||
import com.eastwood.common.router.IExceptionHandler; | ||
import com.eastwood.common.router.Router; | ||
import com.eastwood.common.router.IRouterUrlFilter; | ||
import com.eastwood.demo.router.api.IRouterAApi; | ||
import com.eastwood.demo.router.api.InnerRouterApi; | ||
import com.eastwood.demo.router.api.PassObjectRouterApi; | ||
import com.eastwood.demo.router.api.TestRouterApi; | ||
import com.eastwood.demo.router.handler.HttpRouterHandler; | ||
|
||
public class App extends Application { | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
|
||
HttpRouterHandler httpRouterHandler = new HttpRouterHandler(); | ||
Router.Builder builder = new Router.Builder() | ||
.application(this) | ||
// 添加各模块生成的RouterIndex | ||
// 自定义处理Scheme | ||
.routerUrlFilter(new IRouterUrlFilter() { | ||
@Override | ||
public String filter(String url) { | ||
// 过滤URL | ||
return url; | ||
} | ||
}) | ||
.exceptionHandler(new IExceptionHandler() { | ||
@Override | ||
public void handler(String s, Exception e) { | ||
// 自定义处理异常 | ||
} | ||
}); | ||
Router.init(builder); | ||
|
||
Router.addRouterIndex(TestRouterApi.class); | ||
|
||
Router.addRouterIndex(IRouterAApi.class); | ||
Router.addRouterIndex(InnerRouterApi.class); | ||
Router.addRouterIndex(PassObjectRouterApi.class); | ||
|
||
Router.addSchemeHandler("https", httpRouterHandler); | ||
Router.addSchemeHandler("http", httpRouterHandler); | ||
} | ||
|
||
@Override | ||
public void onTerminate() { | ||
super.onTerminate(); | ||
|
||
Router.destroy(); | ||
} | ||
} |
Oops, something went wrong.