Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
EastWood Yang committed Jul 21, 2018
0 parents commit fced05c
Show file tree
Hide file tree
Showing 81 changed files with 3,163 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .gitignore
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
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# AnnoRouter
Use interfaces and annotations to define route jump info.
25 changes: 25 additions & 0 deletions app/build.gradle
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'
}
25 changes: 25 additions & 0 deletions app/proguard-rules.pro
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
26 changes: 26 additions & 0 deletions app/src/main/AndroidManifest.xml
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>
56 changes: 56 additions & 0 deletions app/src/main/java/com/eastwood/demo/router/App.java
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();
}
}
Loading

0 comments on commit fced05c

Please sign in to comment.