GithubHelp home page GithubHelp logo

ytpeng105 / yrouter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from ysbing/yrouter

0.0 0.0 0.0 135.58 MB

一款性能0损耗的Android模块路由

Java 18.41% Kotlin 81.51% Shell 0.04% Batchfile 0.04%

yrouter's Introduction

右键动图新标签页打开效果更佳

一、简介

YRouter是一款性能0损耗的Android模块路由。

二、框架特性

  • 性能0损耗
  • 数据模拟,支持模块化开发后的数据模拟
  • 反射优化,非常简单使用系统类

三、安装

根目录的build.gradle:

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.ysbing.yrouter:YRouter-gradle-plugin:1.2.3'
    }
}

在需要使用的模块应用插件

apply plugin: 'YRouter'

plugins {
    id 'YRouter'
}

四、生成索引jar

在需要开放的类、方法、变量的前面加入注解 @YRouterApi

public class JavaTest {
    @YRouterApi
    public String a = "JavaTest";

    public static class InnerClass1 extends JavaTest {
        @YRouterApi
        public InnerClass1(String a) {
        }

        @YRouterApi
        public static void f111(Context context) {
            Toast.makeText(context, "这里是JavaTest的第一个内部类", Toast.LENGTH_SHORT).show();
        }
    }
}

执行app的任务yrouter,如下图:

执行完毕在app工程的build目录下有一个yrouter文件夹,把yrouter文件夹里的.jar文件拿出来

这个jar文件就是我们的api了,拿着这个jar文件随意调用即可,我们尝试把它放到library1工程

在library1工程里,就可以随意整个app工程开放的方法或变量了

五、进阶

进阶的内容较为复杂,仅仅简单使用的话上面足够了

yrouter's People

Contributors

ysbing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.