Android IOC Annotation Library EasyUI

Introduction to EasyUI

1. Implement butterknife-like IOC frameworks using reflection mechanisms and annotations
2. Fast findViewById and OnClick
3. Extended click without network monitoring
4. Extended Quick Click Monitoring

Usage method

1. Reference

compile ''

2. Initialization (optional)

This step mainly configures the text content of the Toast prompt when there is no network and determines the time interval between quick-read clicks
Toast default: no network, please check the network settings, quickly click on the default 1000ms

public class MyApplication extends Application {

    public void onCreate() {
        EasyUI.init(500, "Honey, your network isn't working so hard!");

3. Use (activity fragment s custom view)

  • Activity Usage
public class MainActivity extends AppCompatActivity {
    private TextView mTvTest;
    private Button mBtnTest;
    private ImageView mImgTest;

    protected void onCreate(Bundle savedInstanceState) {

    @CheckNet //Do not perform onclick without network
    @QuickClick //Click no onclick in 1 second
    public void onclick(View view) {
  • fragment use
public class BlankFragment extends Fragment {
    View view;
    private TextView mTv;
    private Button mBtn;

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.fragment_blank, container, false);
        EasyUI.bind(view, this);
        return view;

    public void onClick(View view) {
  1. As for the quick code generation of plug-ins, I will not develop android plug-ins. The cost of learning is a bit high. I do not need to develop plug-ins by myself. I am lazy. Interested buddies can play with dei.

  2. There is no need to tangle with reflective performance issues, and the performance consumed by handler and picture loading is largely negligible relative to threads.

Tags: Android network Fragment ButterKnife

Posted on Mon, 20 Jan 2020 11:23:32 -0500 by svan_rv