├── .gitignore ├── arouter-annotations ├── build.gradle └── src │ └── main │ └── java │ └── com │ └── dylanc │ └── arouter │ └── annotations │ ├── LoginActivityPath.kt │ ├── RequireLoginPath.kt │ ├── RequireSignIn.kt │ └── SignInActivity.kt ├── arouter-compiler ├── build.gradle └── src │ └── main │ ├── java │ └── com │ │ └── dylanc │ │ └── arouter │ │ └── compiler │ │ ├── Constants.kt │ │ ├── LoginInfoProcessor.kt │ │ └── PathsProcessor.kt │ └── resources │ └── META-INF │ └── services │ └── javax.annotation.processing.Processor ├── arouter-ktx ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── dylanc │ └── arouter │ ├── ARouter.kt │ ├── ARouterInitializer.kt │ ├── IRoutePaths.kt │ ├── PathsInitializer.kt │ ├── Postcard.kt │ ├── RequireSignInContract.kt │ └── SignInInterceptor.kt ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── module-base ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── dylanc │ └── arouter │ └── sample │ └── base │ ├── bean │ └── ApiResponse.kt │ └── constants │ └── Constants.kt ├── module-payment-api ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── dylanc │ │ └── arouter │ │ └── sample │ │ └── payment │ │ └── service │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ └── java │ │ └── com │ │ └── dylanc │ │ └── arouter │ │ └── sample │ │ └── payment │ │ └── service │ │ ├── Paths.kt │ │ └── PaymentService.kt │ └── test │ └── java │ └── com │ └── dylanc │ └── arouter │ └── sample │ └── payment │ └── service │ └── ExampleUnitTest.kt ├── module-payment-impl ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── dylanc │ │ └── arouter │ │ └── sample │ │ └── payment │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── dylanc │ │ │ └── arouter │ │ │ └── sample │ │ │ └── payment │ │ │ ├── provider │ │ │ └── PaymentServiceProvider.kt │ │ │ └── ui │ │ │ └── PayActivity.kt │ ├── manifest │ │ └── AndroidManifest.xml │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ └── activity_pay.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-night │ │ └── themes.xml │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── themes.xml │ └── test │ └── java │ └── com │ └── dylanc │ └── arouter │ └── sample │ └── payment │ └── ExampleUnitTest.kt ├── module-user-api ├── .gitignore ├── build.gradle ├── consumer-rules.pro ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ └── java │ └── com │ └── dylanc │ └── arouter │ └── sample │ └── user │ └── service │ ├── Paths.kt │ ├── UserService.kt │ └── bean │ └── User.kt ├── module-user-impl ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── dylanc │ │ │ └── arouter │ │ │ └── sample │ │ │ └── user │ │ │ ├── App.kt │ │ │ ├── api │ │ │ └── UserApi.kt │ │ │ ├── provider │ │ │ └── UserServiceProvider.kt │ │ │ ├── repository │ │ │ └── UserRepository.kt │ │ │ └── ui │ │ │ ├── TestActivity.kt │ │ │ ├── login │ │ │ ├── LoginActivity.kt │ │ │ └── LoginViewModel.kt │ │ │ └── userinfo │ │ │ └── UserInfoActivity.kt │ ├── manifest │ │ └── AndroidManifest.xml │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_login.xml │ │ ├── activity_main.xml │ │ └── activity_user_info.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── userUI2 │ └── res │ └── layout │ └── activity_login.xml ├── sample-app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ ├── androidTest │ └── java │ │ └── com │ │ └── dylanc │ │ └── arouter │ │ └── sample │ │ └── ExampleInstrumentedTest.kt │ ├── main │ ├── AndroidManifest.xml │ ├── java │ │ └── com │ │ │ └── dylanc │ │ │ └── arouter │ │ │ └── sample │ │ │ ├── App.kt │ │ │ ├── constant │ │ │ └── Constants.kt │ │ │ └── ui │ │ │ ├── MainActivity.kt │ │ │ └── SplashActivity.kt │ └── res │ │ ├── drawable-v24 │ │ └── ic_launcher_foreground.xml │ │ ├── drawable │ │ ├── ic_baseline_account_circle_24.xml │ │ └── ic_launcher_background.xml │ │ ├── layout │ │ ├── activity_main.xml │ │ └── activity_splash.xml │ │ ├── mipmap-anydpi-v26 │ │ ├── ic_launcher.xml │ │ └── ic_launcher_round.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── colors.xml │ │ ├── strings.xml │ │ └── styles.xml │ └── test │ └── java │ └── com │ └── dylanc │ └── arouter │ └── sample │ └── ExampleUnitTest.kt └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/caches 5 | /.idea/libraries 6 | /.idea/modules.xml 7 | /.idea/workspace.xml 8 | /.idea/navEditor.xml 9 | /.idea/assetWizardSettings.xml 10 | .DS_Store 11 | /build 12 | /captures 13 | .externalNativeBuild 14 | .cxx 15 | -------------------------------------------------------------------------------- /arouter-annotations/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | id 'kotlin' 4 | } 5 | 6 | java { 7 | sourceCompatibility = JavaVersion.VERSION_1_7 8 | targetCompatibility = JavaVersion.VERSION_1_7 9 | } -------------------------------------------------------------------------------- /arouter-annotations/src/main/java/com/dylanc/arouter/annotations/LoginActivityPath.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.annotations 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | @Retention(AnnotationRetention.SOURCE) 7 | @Target(AnnotationTarget.FIELD) 8 | annotation class LoginActivityPath 9 | -------------------------------------------------------------------------------- /arouter-annotations/src/main/java/com/dylanc/arouter/annotations/RequireLoginPath.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.annotations 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | @Retention(AnnotationRetention.SOURCE) 7 | @Target(AnnotationTarget.FIELD) 8 | annotation class RequireLoginPath 9 | -------------------------------------------------------------------------------- /arouter-annotations/src/main/java/com/dylanc/arouter/annotations/RequireSignIn.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.annotations 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | @Retention(AnnotationRetention.SOURCE) 7 | @Target(AnnotationTarget.CLASS) 8 | annotation class RequireSignIn 9 | -------------------------------------------------------------------------------- /arouter-annotations/src/main/java/com/dylanc/arouter/annotations/SignInActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.annotations 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | @Retention(AnnotationRetention.SOURCE) 7 | @Target(AnnotationTarget.CLASS) 8 | annotation class SignInActivity 9 | -------------------------------------------------------------------------------- /arouter-compiler/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java-library' 3 | id 'kotlin' 4 | } 5 | 6 | dependencies { 7 | implementation "com.squareup:javapoet:1.13.0" 8 | implementation 'com.alibaba:arouter-compiler:1.5.2' 9 | api 'com.alibaba:arouter-annotation:1.0.6' 10 | api project(path: ':arouter-annotations') 11 | } 12 | 13 | java { 14 | sourceCompatibility = JavaVersion.VERSION_1_7 15 | targetCompatibility = JavaVersion.VERSION_1_7 16 | } 17 | -------------------------------------------------------------------------------- /arouter-compiler/src/main/java/com/dylanc/arouter/compiler/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.compiler 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | const val PACKAGE_NAME = "com.alibaba.android.arouter.routes" 7 | 8 | const val PROJECT = "ARouter" 9 | 10 | const val SEPARATOR = "$$" 11 | 12 | const val KEY_MODULE_NAME = "AROUTER_MODULE_NAME" 13 | 14 | const val IROUTE_PATHS = "com.dylanc.arouter.IRoutePaths" -------------------------------------------------------------------------------- /arouter-compiler/src/main/java/com/dylanc/arouter/compiler/LoginInfoProcessor.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.compiler 2 | 3 | import com.dylanc.arouter.annotations.LoginActivityPath 4 | import com.squareup.javapoet.* 5 | import java.io.IOException 6 | import javax.annotation.processing.AbstractProcessor 7 | import javax.annotation.processing.Filer 8 | import javax.annotation.processing.ProcessingEnvironment 9 | import javax.annotation.processing.RoundEnvironment 10 | import javax.lang.model.SourceVersion 11 | import javax.lang.model.element.Modifier 12 | import javax.lang.model.element.TypeElement 13 | import javax.lang.model.element.VariableElement 14 | 15 | /** 16 | * @author Dylan Cai 17 | */ 18 | class LoginInfoProcessor : AbstractProcessor() { 19 | private lateinit var filer: Filer 20 | 21 | override fun init(processingEnv: ProcessingEnvironment) { 22 | super.init(processingEnv) 23 | filer = processingEnv.filer 24 | } 25 | 26 | override fun process(annotations: MutableSet, roundEnv: RoundEnvironment): Boolean { 27 | val loginActivityPathElements = roundEnv.getElementsAnnotatedWith(LoginActivityPath::class.java).map { it as VariableElement } 28 | val typeSpec = TypeSpec.classBuilder(ClassName.get(PACKAGE_NAME, "$PROJECT${SEPARATOR}LoginInfo")) 29 | .addModifiers(Modifier.PUBLIC) 30 | .addField(FieldSpec.builder(String::class.java, "activityPath", Modifier.PUBLIC).build()) 31 | .addMethod(MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC) 32 | .apply { 33 | if (loginActivityPathElements.isNotEmpty()) { 34 | if (loginActivityPathElements.size > 1) { 35 | throw IllegalStateException("There must be only one annotation of @LoginActivityPath.") 36 | } 37 | val element = loginActivityPathElements.first() 38 | addStatement("activityPath = ${element.fullClassName}.${element.simpleName}") 39 | } 40 | } 41 | .build()) 42 | .build() 43 | 44 | try { 45 | JavaFile.builder(PACKAGE_NAME, typeSpec).build().writeTo(filer) 46 | } catch (e: IOException) { 47 | e.printStackTrace() 48 | } 49 | return false 50 | } 51 | 52 | override fun getSupportedAnnotationTypes() = setOf(LoginActivityPath::class.java.canonicalName) 53 | 54 | override fun getSupportedSourceVersion() = SourceVersion.RELEASE_8 55 | 56 | private val VariableElement.fullClassName: String 57 | get() = ClassName.get(enclosingElement.asType()).toString() 58 | } -------------------------------------------------------------------------------- /arouter-compiler/src/main/java/com/dylanc/arouter/compiler/PathsProcessor.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.compiler 2 | 3 | import com.dylanc.arouter.annotations.RequireLoginPath 4 | import com.squareup.javapoet.* 5 | import java.io.IOException 6 | import java.lang.RuntimeException 7 | import javax.annotation.processing.AbstractProcessor 8 | import javax.annotation.processing.Filer 9 | import javax.annotation.processing.ProcessingEnvironment 10 | import javax.annotation.processing.RoundEnvironment 11 | import javax.lang.model.SourceVersion 12 | import javax.lang.model.element.Modifier 13 | import javax.lang.model.element.TypeElement 14 | import javax.lang.model.element.VariableElement 15 | import javax.lang.model.util.Elements 16 | 17 | /** 18 | * @author Dylan Cai 19 | */ 20 | class PathsProcessor : AbstractProcessor() { 21 | private lateinit var filer: Filer 22 | private lateinit var elementUtils: Elements 23 | private var moduleName: String? = null 24 | 25 | override fun init(processingEnv: ProcessingEnvironment) { 26 | super.init(processingEnv) 27 | filer = processingEnv.filer 28 | elementUtils = processingEnv.elementUtils 29 | 30 | val options = processingEnv.options 31 | if (options.isNotEmpty()) { 32 | moduleName = options[KEY_MODULE_NAME] 33 | } 34 | if (!moduleName.isNullOrEmpty()) { 35 | moduleName = moduleName!!.replace("[^0-9a-zA-Z_]+".toRegex(), "") 36 | print("The user has configuration the module name, it was [$moduleName]") 37 | } else { 38 | throw RuntimeException("ARouter::Compiler >>> No module name, for more information, look at gradle log.") 39 | } 40 | } 41 | 42 | override fun process(annotations: MutableSet, roundEnv: RoundEnvironment): Boolean { 43 | val checkLoginPathElements = roundEnv.getElementsAnnotatedWith(RequireLoginPath::class.java).map { it as VariableElement } 44 | val arrayListType = ParameterizedTypeName.get(ClassName.get(ArrayList::class.java), ClassName.get(String::class.java)) 45 | val paramSpec = ParameterSpec.builder(arrayListType, "paths").build() 46 | val typeIRoutePaths = elementUtils.getTypeElement(IROUTE_PATHS) 47 | 48 | val loadIntoMethodBuilder = MethodSpec.methodBuilder("loadInto") 49 | .addAnnotation(Override::class.java) 50 | .addModifiers(Modifier.PUBLIC) 51 | .addParameter(paramSpec) 52 | 53 | checkLoginPathElements.forEach { element -> 54 | loadIntoMethodBuilder.addStatement("paths.add(${element.fullClassName}.${element.simpleName})") 55 | } 56 | 57 | val typeSpec = TypeSpec.classBuilder(ClassName.get(PACKAGE_NAME, "$PROJECT${SEPARATOR}Paths$SEPARATOR$moduleName")) 58 | .addSuperinterface(ClassName.get(typeIRoutePaths)) 59 | .addModifiers(Modifier.PUBLIC) 60 | .addMethod(loadIntoMethodBuilder.build()) 61 | .build() 62 | 63 | try { 64 | JavaFile.builder(PACKAGE_NAME, typeSpec).build().writeTo(filer) 65 | } catch (e: IOException) { 66 | e.printStackTrace() 67 | } 68 | return false 69 | } 70 | 71 | override fun getSupportedAnnotationTypes() = setOf(RequireLoginPath::class.java.canonicalName) 72 | 73 | override fun getSupportedOptions() = setOf(KEY_MODULE_NAME) 74 | 75 | override fun getSupportedSourceVersion() = SourceVersion.RELEASE_8 76 | 77 | private val VariableElement.fullClassName: String 78 | get() = ClassName.get(enclosingElement.asType()).toString() 79 | } -------------------------------------------------------------------------------- /arouter-compiler/src/main/resources/META-INF/services/javax.annotation.processing.Processor: -------------------------------------------------------------------------------- 1 | com.dylanc.arouter.compiler.PathsProcessor 2 | com.dylanc.arouter.compiler.LoginInfoProcessor 3 | com.alibaba.android.arouter.compiler.processor.RouteProcessor,aggregating 4 | com.alibaba.android.arouter.compiler.processor.AutowiredProcessor,aggregating 5 | com.alibaba.android.arouter.compiler.processor.InterceptorProcessor,aggregating 6 | -------------------------------------------------------------------------------- /arouter-ktx/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /arouter-ktx/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-parcelize' 4 | apply plugin: 'kotlin-kapt' 5 | apply plugin: 'com.github.dcendents.android-maven' 6 | 7 | group = 'com.github.DylanCaiCoding' 8 | 9 | android { 10 | compileSdkVersion rootProject.compile_sdk_version 11 | 12 | defaultConfig { 13 | minSdkVersion 16 14 | targetSdkVersion rootProject.target_sdk_version 15 | versionCode 1 16 | versionName "1.0" 17 | 18 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 19 | consumerProguardFiles 'consumer-rules.pro' 20 | } 21 | 22 | buildTypes { 23 | release { 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 26 | } 27 | } 28 | 29 | compileOptions { 30 | kotlinOptions.freeCompilerArgs += ['-module-name', "arouter-ktx"] 31 | } 32 | } 33 | 34 | kapt { 35 | arguments { 36 | arg("AROUTER_MODULE_NAME", project.getName()) 37 | } 38 | } 39 | 40 | dependencies { 41 | implementation fileTree(dir: 'libs', include: ['*.jar']) 42 | implementation 'androidx.fragment:fragment-ktx:1.3.6' 43 | implementation "androidx.startup:startup-runtime:1.1.0" 44 | api "com.alibaba:arouter-api:$arouter_api_version" 45 | api project(path: ':arouter-annotations') 46 | } -------------------------------------------------------------------------------- /arouter-ktx/consumer-rules.pro: -------------------------------------------------------------------------------- 1 | -keep class com.dylanc.arouter.*{*;} 2 | 3 | -keep public class com.alibaba.android.arouter.routes.**{*;} 4 | -keep public class com.alibaba.android.arouter.facade.**{*;} 5 | -keep class * implements com.alibaba.android.arouter.facade.template.ISyringe{*;} 6 | # 如果使用了 byType 的方式获取 Service,需添加下面规则,保护接口 7 | -keep interface * implements com.alibaba.android.arouter.facade.template.IProvider -------------------------------------------------------------------------------- /arouter-ktx/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /arouter-ktx/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 12 | 15 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/ARouter.kt: -------------------------------------------------------------------------------- 1 | @file:JvmName("ARouterUtils") 2 | @file:Suppress("unused") 3 | 4 | package com.dylanc.arouter 5 | 6 | import android.app.Activity 7 | import android.content.Context 8 | import android.content.Intent 9 | import androidx.activity.result.ActivityResultLauncher 10 | import androidx.core.os.bundleOf 11 | import androidx.fragment.app.Fragment 12 | import com.alibaba.android.arouter.facade.Postcard 13 | import com.alibaba.android.arouter.facade.template.IProvider 14 | import com.alibaba.android.arouter.launcher.ARouter 15 | 16 | internal const val KEY_ROUTER_PATH = "router_path" 17 | 18 | @JvmName("startActivity") 19 | fun startActivityByRouter(path: String, vararg pairs: Pair, block: (PostcardBuilder.() -> Unit)? = null) = 20 | application.startActivityByRouter(path, *pairs, block = block) 21 | 22 | @JvmName("startActivity") 23 | fun Fragment.startActivityByRouter(path: String, vararg pairs: Pair, block: (PostcardBuilder.() -> Unit)? = null) = 24 | requireActivity().startActivityByRouter(path, *pairs, block = block) 25 | 26 | @JvmName("startActivity") 27 | fun Context.startActivityByRouter(path: String, vararg pairs: Pair, block: (PostcardBuilder.() -> Unit)? = null) { 28 | ARouter.getInstance().build(path).with(bundleOf(*pairs)).navigation(this, block) 29 | } 30 | 31 | inline fun routerServices() = 32 | lazy { ARouter.getInstance().navigation(T::class.java) } 33 | 34 | inline fun routerServices(path: String) = 35 | lazy { ARouter.getInstance().build(path).navigation() as? T } 36 | 37 | fun createFragmentByRouter(path: String, block: Postcard.() -> Unit = {}) = 38 | ARouter.getInstance().build(path).apply(block).navigation() as? Fragment 39 | 40 | fun ActivityResultLauncher.launchByRouter(path: String, vararg pairs: Pair, block: (PostcardBuilder.() -> Unit)? = null) { 41 | ARouter.getInstance().build(path).with(bundleOf(*pairs)).navigation(this, block = block) 42 | } 43 | 44 | fun Activity.loginSuccess() { 45 | val path = intent.getStringExtra(KEY_ROUTER_PATH) 46 | if (path != null) { 47 | startActivityByRouter(path) { 48 | onArrival { finish() } 49 | } 50 | } else { 51 | setResult(Activity.RESULT_OK) 52 | finish() 53 | } 54 | } -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/ARouterInitializer.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.dylanc.arouter 4 | 5 | import android.app.Application 6 | import android.content.Context 7 | import android.content.pm.ApplicationInfo 8 | import androidx.startup.Initializer 9 | import com.alibaba.android.arouter.launcher.ARouter 10 | 11 | /** 12 | * @author Dylan Cai 13 | */ 14 | internal lateinit var application: Application 15 | 16 | internal class ARouterInitializer : Initializer { 17 | 18 | override fun create(context: Context) { 19 | application = context as Application 20 | val applicationInfo = context.packageManager.getApplicationInfo(context.packageName, 0) 21 | val isDebug = applicationInfo.flags and ApplicationInfo.FLAG_DEBUGGABLE != 0 22 | if (isDebug) { 23 | ARouter.openLog() 24 | ARouter.openDebug() 25 | } 26 | ARouter.init(context) 27 | } 28 | 29 | override fun dependencies() = emptyList>>() 30 | } -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/IRoutePaths.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | interface IRoutePaths { 7 | 8 | fun loadInto(list: ArrayList) 9 | } -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/PathsInitializer.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.dylanc.arouter 4 | 5 | import android.content.Context 6 | import android.util.Log 7 | import androidx.startup.Initializer 8 | import com.alibaba.android.arouter.launcher.ARouter 9 | import com.alibaba.android.arouter.utils.Consts 10 | import com.dylanc.arouter.SignInInterceptor.Companion.SignInActivityPath 11 | import com.dylanc.arouter.SignInInterceptor.Companion.requireSignInPaths 12 | 13 | /** 14 | * @author Dylan Cai 15 | */ 16 | internal class PathsInitializer : Initializer { 17 | 18 | @Suppress("NULLABILITY_MISMATCH_BASED_ON_JAVA_ANNOTATIONS") 19 | override fun create(context: Context) { 20 | try { 21 | val clazz = Class.forName("${Consts.ROUTE_ROOT_PAKCAGE}.ARouter$\$LoginInfo") 22 | SignInActivityPath = clazz.getField("activityPath")[clazz.newInstance()] as? String 23 | 24 | val sharedPreferences = context.getSharedPreferences(Consts.AROUTER_SP_CACHE_KEY, Context.MODE_PRIVATE) 25 | val routerMap = HashSet(sharedPreferences.getStringSet(Consts.AROUTER_SP_KEY_MAP, HashSet())) 26 | for (className in routerMap) { 27 | if(className.startsWith("${Consts.ROUTE_ROOT_PAKCAGE}.ARouter$\$Paths$\$")){ 28 | (Class.forName(className).newInstance() as? IRoutePaths)?.loadInto(requireSignInPaths) 29 | } 30 | } 31 | 32 | ARouter.logger.debug("Paths", requireSignInPaths.toString()) 33 | } catch (e: NoSuchFieldException) { 34 | } catch (e: Exception) { 35 | e.printStackTrace() 36 | } 37 | } 38 | 39 | override fun dependencies() = listOf(ARouterInitializer::class.java) 40 | } 41 | -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/Postcard.kt: -------------------------------------------------------------------------------- 1 | @file:Suppress("unused") 2 | 3 | package com.dylanc.arouter 4 | 5 | import android.app.Activity 6 | import android.content.Context 7 | import android.content.Intent 8 | import android.os.Bundle 9 | import android.os.Handler 10 | import android.os.Looper 11 | import android.widget.Toast 12 | import androidx.activity.result.ActivityResultLauncher 13 | import androidx.fragment.app.Fragment 14 | import com.alibaba.android.arouter.core.LogisticsCenter 15 | import com.alibaba.android.arouter.exception.NoRouteFoundException 16 | import com.alibaba.android.arouter.facade.Postcard 17 | import com.alibaba.android.arouter.facade.callback.InterceptorCallback 18 | import com.alibaba.android.arouter.facade.callback.NavCallback 19 | import com.alibaba.android.arouter.facade.callback.NavigationCallback 20 | import com.alibaba.android.arouter.facade.enums.RouteType 21 | import com.alibaba.android.arouter.facade.service.DegradeService 22 | import com.alibaba.android.arouter.facade.service.InterceptorService 23 | import com.alibaba.android.arouter.facade.service.PretreatmentService 24 | import com.alibaba.android.arouter.launcher.ARouter 25 | import com.alibaba.android.arouter.utils.Consts 26 | import com.alibaba.android.arouter.utils.TextUtils 27 | 28 | fun Postcard.navigation(context: Context, block: (PostcardBuilder.() -> Unit)? = null): Any? = 29 | navigation(context, PostcardBuilder(this).apply { block?.invoke(this) }.callback) 30 | 31 | fun Postcard.navigation(launcher: ActivityResultLauncher, context: Context = application, block: (PostcardBuilder.() -> Unit)? = null): Any? = 32 | navigation(launcher, context, PostcardBuilder(this).apply { block?.invoke(this) }.callback) 33 | 34 | fun Postcard.navigation(launcher: ActivityResultLauncher, context: Context = application, callback: NavigationCallback? = null): Any? { 35 | val pretreatmentService = ARouter.getInstance().navigation(PretreatmentService::class.java) 36 | if (null != pretreatmentService && !pretreatmentService.onPretreatment(context, this)) { 37 | return null 38 | } 39 | 40 | this.context = context 41 | 42 | try { 43 | LogisticsCenter.completion(this) 44 | } catch (ex: NoRouteFoundException) { 45 | ARouter.logger.warning(Consts.TAG, ex.message) 46 | 47 | if (ARouter.debuggable()) { 48 | runInMainThread { 49 | val text = "There's no route matched!\nPath = [$path]\nGroup = [$group]" 50 | Toast.makeText(application, text, Toast.LENGTH_LONG).show() 51 | } 52 | } 53 | 54 | if (null != callback) { 55 | callback.onLost(this) 56 | } else { 57 | ARouter.getInstance().navigation(DegradeService::class.java)?.onLost(context, this) 58 | } 59 | return null 60 | } 61 | 62 | callback?.onFound(this) 63 | 64 | val interceptorService = ARouter.getInstance().build("/arouter/service/interceptor").navigation() as InterceptorService 65 | if (!isGreenChannel) { 66 | interceptorService.doInterceptions(this, object : InterceptorCallback { 67 | 68 | override fun onContinue(postcard: Postcard) { 69 | postcard._navigation(launcher, callback) 70 | } 71 | 72 | override fun onInterrupt(exception: Throwable) { 73 | callback?.onInterrupt(this@navigation) 74 | ARouter.logger.info(Consts.TAG, "Navigation failed, termination by interceptor : " + exception.message) 75 | } 76 | }) 77 | } else { 78 | return _navigation(launcher, callback) 79 | } 80 | return null 81 | } 82 | 83 | @Suppress("FunctionName", "DEPRECATION") 84 | private fun Postcard._navigation(launcher: ActivityResultLauncher, callback: NavigationCallback?): Any? { 85 | val currentContext = context 86 | 87 | when (type) { 88 | RouteType.ACTIVITY -> { 89 | val intent = Intent(currentContext, destination).putExtras(extras) 90 | 91 | val flags = flags 92 | if (0 != flags) { 93 | intent.flags = flags 94 | } 95 | 96 | val action = action 97 | if (!TextUtils.isEmpty(action)) { 98 | intent.action = action 99 | } 100 | 101 | runInMainThread { 102 | launcher.launch(intent) 103 | 104 | if (-1 != enterAnim && -1 != exitAnim && currentContext is Activity) { // Old version. 105 | currentContext.overridePendingTransition(enterAnim, exitAnim) 106 | } 107 | 108 | callback?.onArrival(this) 109 | } 110 | } 111 | RouteType.PROVIDER -> return provider 112 | RouteType.BOARDCAST, RouteType.CONTENT_PROVIDER, RouteType.FRAGMENT -> { 113 | val fragmentMeta = destination 114 | try { 115 | val instance = fragmentMeta.getConstructor().newInstance() 116 | if (instance is android.app.Fragment) { 117 | instance.arguments = extras 118 | } else if (instance is Fragment) { 119 | instance.arguments = extras 120 | } 121 | return instance 122 | } catch (ex: java.lang.Exception) { 123 | ARouter.logger.error(Consts.TAG, "Fetch fragment instance error, " + TextUtils.formatStackTrace(ex.stackTrace)) 124 | } 125 | return null 126 | } 127 | RouteType.METHOD, RouteType.SERVICE -> return null 128 | else -> return null 129 | } 130 | return null 131 | } 132 | 133 | private val handler by lazy { Handler(Looper.getMainLooper()) } 134 | 135 | private fun runInMainThread(runnable: Runnable) { 136 | if (Looper.getMainLooper().thread !== Thread.currentThread()) { 137 | handler.post(runnable) 138 | } else { 139 | runnable.run() 140 | } 141 | } 142 | 143 | class PostcardBuilder(private val postcard: Postcard) { 144 | private var onArrival: ((Postcard) -> Unit)? = null 145 | private var onInterrupt: ((Postcard) -> Unit)? = null 146 | private var onFound: ((Postcard) -> Unit)? = null 147 | private var onLost: ((Postcard) -> Unit)? = null 148 | 149 | fun bundle(bundle: Bundle) { 150 | postcard.with(bundle) 151 | } 152 | 153 | fun flags(flag: Int) { 154 | postcard.withFlags(flag) 155 | } 156 | 157 | fun transition(enterAnim: Int, exitAnim: Int) { 158 | postcard.withTransition(enterAnim, exitAnim) 159 | } 160 | 161 | fun onArrival(block: (Postcard) -> Unit) { 162 | onArrival = block 163 | } 164 | 165 | fun onInterrupt(block: (Postcard) -> Unit) { 166 | onInterrupt = block 167 | } 168 | 169 | fun onFound(block: (Postcard) -> Unit) { 170 | onFound = block 171 | } 172 | 173 | fun onLost(block: (Postcard) -> Unit) { 174 | onLost = block 175 | } 176 | 177 | internal val callback: NavigationCallback? 178 | get() = if (onArrival != null || onInterrupt != null || onFound != null || onLost != null) { 179 | object : NavCallback() { 180 | override fun onArrival(postcard: Postcard) { 181 | onArrival?.invoke(postcard) 182 | } 183 | 184 | override fun onFound(postcard: Postcard) { 185 | onFound?.invoke(postcard) 186 | } 187 | 188 | override fun onLost(postcard: Postcard) { 189 | onLost?.invoke(postcard) 190 | } 191 | 192 | override fun onInterrupt(postcard: Postcard) { 193 | if (SignInInterceptor.isInterceptPath(postcard.path)) { 194 | onArrival?.invoke(postcard) 195 | } else { 196 | onInterrupt?.invoke(postcard) 197 | } 198 | } 199 | } 200 | } else { 201 | null 202 | } 203 | 204 | companion object { 205 | internal fun Postcard.builder() = PostcardBuilder(this) 206 | } 207 | } 208 | -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/RequireSignInContract.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import android.content.Intent 6 | import androidx.activity.result.ActivityResultCaller 7 | import androidx.activity.result.contract.ActivityResultContract 8 | import com.alibaba.android.arouter.core.LogisticsCenter 9 | import com.alibaba.android.arouter.facade.enums.RouteType 10 | import com.alibaba.android.arouter.launcher.ARouter 11 | import com.dylanc.arouter.SignInInterceptor.Companion.SignInActivityPath 12 | 13 | fun ActivityResultCaller.requireLoginLauncher(onLoginFailure: (() -> Unit)? = null, onLoginSuccess: () -> Unit) = 14 | registerForActivityResult(RequireSignInContract()) { 15 | if (it) onLoginSuccess() else onLoginFailure?.invoke() 16 | } 17 | 18 | class RequireSignInContract : ActivityResultContract() { 19 | 20 | override fun createIntent(context: Context, input: Unit?): Intent { 21 | val postcard = ARouter.getInstance().build(SignInActivityPath!!) 22 | LogisticsCenter.completion(postcard) 23 | if (postcard.type != RouteType.ACTIVITY) { 24 | throw IllegalArgumentException("The routing class for the path of $SignInActivityPath is not an activity type.") 25 | } 26 | return Intent(context, postcard.destination) 27 | } 28 | 29 | override fun parseResult(resultCode: Int, intent: Intent?) = resultCode == Activity.RESULT_OK 30 | 31 | override fun getSynchronousResult(context: Context, input: Unit?): SynchronousResult? = 32 | when { 33 | SignInActivityPath == null -> SynchronousResult(true) 34 | SignInInterceptor.checkSignIn?.invoke() == true -> SynchronousResult(true) 35 | else -> null 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /arouter-ktx/src/main/java/com/dylanc/arouter/SignInInterceptor.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter 2 | 3 | import android.content.Context 4 | import com.alibaba.android.arouter.facade.Postcard 5 | import com.alibaba.android.arouter.facade.annotation.Interceptor 6 | import com.alibaba.android.arouter.facade.callback.InterceptorCallback 7 | import com.alibaba.android.arouter.facade.template.IInterceptor 8 | 9 | /** 10 | * @author Dylan Cai 11 | */ 12 | @Interceptor(priority = Int.MAX_VALUE) 13 | class SignInInterceptor : IInterceptor { 14 | 15 | override fun process(postcard: Postcard, callback: InterceptorCallback) { 16 | if (isInterceptPath(postcard.path)) { 17 | startActivityByRouter(SignInActivityPath!!, KEY_ROUTER_PATH to postcard.path) { 18 | onArrival { callback.onInterrupt(null) } 19 | } 20 | } else { 21 | callback.onContinue(postcard) 22 | } 23 | } 24 | 25 | override fun init(context: Context) = Unit 26 | 27 | companion object { 28 | internal var checkSignIn: (() -> Boolean)? = null 29 | internal var SignInActivityPath: String? = null 30 | internal val requireSignInPaths = arrayListOf() 31 | 32 | fun enable(onCheckSignIn: () -> Boolean) { 33 | checkSignIn = onCheckSignIn 34 | } 35 | 36 | internal fun isInterceptPath(path: String) = 37 | SignInActivityPath != null && path != SignInActivityPath && 38 | requireSignInPaths.contains(path) && checkSignIn?.invoke() == false 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | 2 | buildscript { 3 | ext{ 4 | debugUserComponent = false 5 | debugPayComponent = false 6 | 7 | // Sdk and tools 8 | compile_sdk_version = 30 9 | min_sdk_version = 21 10 | target_sdk_version = 30 11 | build_tools_version = "29.0.3" 12 | 13 | // App dependencies 14 | app_compat_version = '1.3.1' 15 | arouter_api_version = '1.5.2' 16 | arouter_compiler_version = '1.5.2' 17 | constraintlayout_version = '2.1.1' 18 | core_ktx_version = '1.7.0-alpha01' 19 | espresso_version = '3.4.0' 20 | gradle_version = '4.2.2' 21 | junit_version = '4.13.2' 22 | kotlin_version = '1.6.10' 23 | leak_canary_version = '2.7' 24 | lifecycle_version = '2.2.0' 25 | retrofit_ktx_version = '1.0.0-alpha4' 26 | runner_version = '1.4.0' 27 | } 28 | 29 | repositories { 30 | google() 31 | jcenter() 32 | } 33 | 34 | dependencies { 35 | classpath "com.android.tools.build:gradle:$gradle_version" 36 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 37 | classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version" 38 | classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' 39 | } 40 | } 41 | 42 | allprojects { 43 | repositories { 44 | google() 45 | jcenter() 46 | maven { url 'https://jitpack.io' } 47 | } 48 | } 49 | 50 | task clean(type: Delete) { 51 | delete rootProject.buildDir 52 | } 53 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx1536m 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app's APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | # Automatically convert third-party libraries to use AndroidX 19 | android.enableJetifier=true 20 | # Kotlin code style for this project: "official" or "obsolete": 21 | kotlin.code.style=official 22 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DylanCaiCoding/ARouterKTX/b47f98fb67c1fbf56e95ff9db507acd5b11ecda0/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat May 23 00:05:36 CST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /module-base/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /module-base/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-kapt' 4 | 5 | android { 6 | compileSdkVersion rootProject.compile_sdk_version 7 | 8 | defaultConfig { 9 | minSdkVersion rootProject.min_sdk_version 10 | targetSdkVersion rootProject.target_sdk_version 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | consumerProguardFiles 'consumer-rules.pro' 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | 30 | kotlinOptions { 31 | jvmTarget = '1.8' 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation fileTree(dir: 'libs', include: ['*.jar']) 37 | api "androidx.core:core-ktx:$core_ktx_version" 38 | api "androidx.appcompat:appcompat:$app_compat_version" 39 | api "androidx.constraintlayout:constraintlayout:$constraintlayout_version" 40 | api "androidx.lifecycle:lifecycle-extensions:$lifecycle_version" 41 | 42 | api 'com.github.DylanCaiCoding.ViewBindingKTX:viewbinding-ktx:1.2.4' 43 | api "com.github.DylanCaiCoding.RetrofitKTX:retrofit-ktx:$retrofit_ktx_version" 44 | kapt "com.github.DylanCaiCoding.RetrofitKTX:retrofit-compiler:$retrofit_ktx_version" 45 | api "com.github.DylanCaiCoding.RetrofitKTX:retrofit-coroutines:$retrofit_ktx_version" 46 | api 'com.github.DylanCaiCoding:Longan:1.0.0' 47 | api 'com.github.DylanCaiCoding:MMKV-KTX:1.0.0' 48 | } -------------------------------------------------------------------------------- /module-base/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DylanCaiCoding/ARouterKTX/b47f98fb67c1fbf56e95ff9db507acd5b11ecda0/module-base/consumer-rules.pro -------------------------------------------------------------------------------- /module-base/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /module-base/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /module-base/src/main/java/com/dylanc/arouter/sample/base/bean/ApiResponse.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.base.bean 2 | 3 | /** 4 | * @author Dylan Cai 5 | * @since 2020/5/24 6 | */ 7 | data class ApiResponse( 8 | val code: Int, 9 | val msg: String, 10 | val data: T 11 | ) -------------------------------------------------------------------------------- /module-base/src/main/java/com/dylanc/arouter/sample/base/constants/Constants.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.base.constants 2 | 3 | 4 | /** 5 | * @author Dylan Cai 6 | */ 7 | 8 | //const val GROUP_APP = "/app" 9 | // 10 | //@RequireLoginPath 11 | //const val PATH_MAIN = "$GROUP_APP/main" -------------------------------------------------------------------------------- /module-payment-api/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /module-payment-api/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | apply plugin: 'kotlin-android' 3 | apply plugin: 'kotlin-parcelize' 4 | 5 | android { 6 | compileSdkVersion rootProject.compile_sdk_version 7 | 8 | defaultConfig { 9 | minSdkVersion rootProject.min_sdk_version 10 | targetSdkVersion rootProject.target_sdk_version 11 | versionCode 1 12 | versionName "1.0" 13 | 14 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 15 | consumerProguardFiles 'consumer-rules.pro' 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 22 | } 23 | } 24 | 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_1_8 27 | targetCompatibility JavaVersion.VERSION_1_8 28 | } 29 | 30 | kotlinOptions { 31 | jvmTarget = '1.8' 32 | } 33 | } 34 | 35 | dependencies { 36 | implementation fileTree(dir: 'libs', include: ['*.jar']) 37 | api project(path: ':module-base') 38 | api project(path: ':arouter-ktx') 39 | } 40 | -------------------------------------------------------------------------------- /module-payment-api/consumer-rules.pro: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DylanCaiCoding/ARouterKTX/b47f98fb67c1fbf56e95ff9db507acd5b11ecda0/module-payment-api/consumer-rules.pro -------------------------------------------------------------------------------- /module-payment-api/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /module-payment-api/src/androidTest/java/com/dylanc/arouter/sample/payment/service/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.service 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.dylanc.arouter.sample.payment.service.test", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /module-payment-api/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | -------------------------------------------------------------------------------- /module-payment-api/src/main/java/com/dylanc/arouter/sample/payment/service/Paths.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.service 2 | 3 | /** 4 | * @author Dylan Cai 5 | */ 6 | 7 | const val GROUP_PAYMENT = "/payment" 8 | const val PATH_PAYMENT = "$GROUP_PAYMENT/payment" -------------------------------------------------------------------------------- /module-payment-api/src/main/java/com/dylanc/arouter/sample/payment/service/PaymentService.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.service 2 | 3 | import com.alibaba.android.arouter.facade.template.IProvider 4 | 5 | /** 6 | * @author Dylan Cai 7 | */ 8 | interface PaymentService : IProvider { 9 | fun aliPay(money: Float) 10 | 11 | fun wechatPay(money: Float) 12 | } -------------------------------------------------------------------------------- /module-payment-api/src/test/java/com/dylanc/arouter/sample/payment/service/ExampleUnitTest.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.service 2 | 3 | import org.junit.Test 4 | 5 | import org.junit.Assert.* 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * See [testing documentation](http://d.android.com/tools/testing). 11 | */ 12 | class ExampleUnitTest { 13 | @Test 14 | fun addition_isCorrect() { 15 | assertEquals(4, 2 + 2) 16 | } 17 | } -------------------------------------------------------------------------------- /module-payment-impl/.gitignore: -------------------------------------------------------------------------------- 1 | /build -------------------------------------------------------------------------------- /module-payment-impl/build.gradle: -------------------------------------------------------------------------------- 1 | if (debugPayComponent) { 2 | apply plugin: 'com.android.application' 3 | } else { 4 | apply plugin: 'com.android.library' 5 | } 6 | apply plugin: 'kotlin-android' 7 | apply plugin: 'kotlin-kapt' 8 | 9 | android { 10 | compileSdkVersion rootProject.compile_sdk_version 11 | resourcePrefix "payment_" 12 | 13 | defaultConfig { 14 | if (debugPayComponent) { 15 | applicationId "com.dylanc.arouter.sample.payment" 16 | } 17 | minSdkVersion rootProject.min_sdk_version 18 | targetSdkVersion rootProject.target_sdk_version 19 | versionCode 1 20 | versionName "1.0" 21 | 22 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 23 | } 24 | 25 | sourceSets { 26 | main { 27 | if (debugPayComponent) { 28 | manifest.srcFile 'src/main/AndroidManifest.xml' 29 | } else { 30 | manifest.srcFile 'src/main/manifest/AndroidManifest.xml' 31 | } 32 | } 33 | } 34 | 35 | buildTypes { 36 | release { 37 | minifyEnabled false 38 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 39 | } 40 | } 41 | 42 | compileOptions { 43 | sourceCompatibility JavaVersion.VERSION_1_8 44 | targetCompatibility JavaVersion.VERSION_1_8 45 | } 46 | 47 | kotlinOptions { 48 | jvmTarget = '1.8' 49 | } 50 | 51 | buildFeatures { 52 | viewBinding true 53 | } 54 | 55 | flavorDimensions "paymentUI" 56 | productFlavors { 57 | paymentUI { 58 | dimension "paymentUI" 59 | } 60 | paymentUI2 { 61 | dimension "paymentUI" 62 | } 63 | } 64 | } 65 | 66 | kapt { 67 | arguments { 68 | arg("AROUTER_MODULE_NAME", project.getName()) 69 | } 70 | } 71 | 72 | dependencies { 73 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 74 | kapt project(path: ':arouter-compiler') 75 | implementation project(path: ':module-payment-api') 76 | 77 | testImplementation "junit:junit:$junit_version" 78 | androidTestImplementation "androidx.test:runner:$runner_version" 79 | androidTestImplementation "androidx.test.espresso:espresso-core:$espresso_version" 80 | } -------------------------------------------------------------------------------- /module-payment-impl/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile -------------------------------------------------------------------------------- /module-payment-impl/src/androidTest/java/com/dylanc/arouter/sample/payment/ExampleInstrumentedTest.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment 2 | 3 | import androidx.test.platform.app.InstrumentationRegistry 4 | import androidx.test.ext.junit.runners.AndroidJUnit4 5 | 6 | import org.junit.Test 7 | import org.junit.runner.RunWith 8 | 9 | import org.junit.Assert.* 10 | 11 | /** 12 | * Instrumented test, which will execute on an Android device. 13 | * 14 | * See [testing documentation](http://d.android.com/tools/testing). 15 | */ 16 | @RunWith(AndroidJUnit4::class) 17 | class ExampleInstrumentedTest { 18 | @Test 19 | fun useAppContext() { 20 | // Context of the app under test. 21 | val appContext = InstrumentationRegistry.getInstrumentation().targetContext 22 | assertEquals("com.dylanc.arouter.sample.payment", appContext.packageName) 23 | } 24 | } -------------------------------------------------------------------------------- /module-payment-impl/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 12 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /module-payment-impl/src/main/java/com/dylanc/arouter/sample/payment/provider/PaymentServiceProvider.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.provider 2 | 3 | import android.content.Context 4 | import com.alibaba.android.arouter.facade.annotation.Route 5 | import com.dylanc.arouter.sample.payment.service.PaymentService 6 | import com.dylanc.longan.toast 7 | import com.dylanc.longan.topActivity 8 | 9 | /** 10 | * @author Dylan Cai 11 | */ 12 | @Route(path = "/payment/service") 13 | class PaymentServiceProvider : PaymentService { 14 | 15 | override fun aliPay(money: Float) { 16 | topActivity.toast("Ali Pay ¥$money") 17 | } 18 | 19 | override fun wechatPay(money: Float) { 20 | topActivity.toast("Wechat Pay ¥$money") 21 | } 22 | 23 | override fun init(context: Context) { 24 | 25 | } 26 | } -------------------------------------------------------------------------------- /module-payment-impl/src/main/java/com/dylanc/arouter/sample/payment/ui/PayActivity.kt: -------------------------------------------------------------------------------- 1 | package com.dylanc.arouter.sample.payment.ui 2 | 3 | import android.os.Bundle 4 | import androidx.appcompat.app.AppCompatActivity 5 | import com.alibaba.android.arouter.facade.annotation.Route 6 | import com.dylanc.arouter.routerServices 7 | import com.dylanc.arouter.sample.payment.databinding.ActivityPayBinding 8 | import com.dylanc.arouter.sample.payment.service.PATH_PAYMENT 9 | import com.dylanc.arouter.sample.payment.service.PaymentService 10 | import com.dylanc.viewbinding.binding 11 | 12 | @Route(path = PATH_PAYMENT) 13 | class PayActivity : AppCompatActivity() { 14 | 15 | private val binding: ActivityPayBinding by binding() 16 | private val paymentService: PaymentService? by routerServices() 17 | 18 | override fun onCreate(savedInstanceState: Bundle?) { 19 | super.onCreate(savedInstanceState) 20 | with(binding) { 21 | btnAliPay.setOnClickListener { 22 | paymentService?.aliPay(100f) 23 | } 24 | btnWechatPay.setOnClickListener { 25 | paymentService?.wechatPay(200f) 26 | } 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /module-payment-impl/src/main/manifest/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /module-payment-impl/src/main/res/drawable-v24/ic_launcher_foreground.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 15 | 18 | 21 | 22 | 23 | 24 | 30 | -------------------------------------------------------------------------------- /module-payment-impl/src/main/res/drawable/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 15 | 20 | 25 | 30 | 35 | 40 | 45 | 50 | 55 | 60 | 65 | 70 | 75 | 80 | 85 | 90 | 95 | 100 | 105 | 110 | 115 | 120 | 125 | 130 | 135 | 140 | 145 | 150 | 155 | 160 | 165 | 170 | 171 | -------------------------------------------------------------------------------- /module-payment-impl/src/main/res/layout/activity_pay.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 |