Coder Social home page Coder Social logo

targetclick's Introduction

TargetClick

思路总结:

​ 点击事件经常会面临增量业务的冲击,下级事件也经常会和上级做交互,导致流程不清晰管理混乱。

​ TargetClick使用APT和Kotlinpoet在编译期为每个主体生成一个TargetClickImpl作为点击事件总线管理,通过开放的局域和全域的生成模板,保持应对几乎任何增量业务的能力。

*全域已生成快速点击的逻辑判断

切面生成思路:

target_processor

流程思路:

target_view

模板类:

target_class

使用:

WARING:build on Android studio 4.0.1

implementation 'com.github.softwarekk:targetclick:1.0.3.5'
kapt 'com.github.softwarekk:targetclick:1.0.3.6'

@TargetClick
class MainActivity : AppCompatActivity(),TargetClickImplCallback {
    private val bindingClickImpl=MainActivityTargetClickImpl(this)
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
    }
	
    override fun viewOnclick(view: Any, index: Int?, data: Any?) {

    }
}
示例代码:https://github.com/softwarekk/TargetClickDemo

targetclick's People

Contributors

softwarekk avatar

Stargazers

Tracy avatar  avatar

Watchers

James Cloos avatar  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.