JakeWharton / butterknife

Bind Android views and callbacks to fields and methods.
http://jakewharton.github.io/butterknife/
Apache License 2.0
25.55k stars 4.6k forks source link

Can you add throttleFirst to the Click event? #1517

Closed Zvirtuey closed 5 years ago

Zvirtuey commented 5 years ago

Can you add throttleFirst to the Click event? Like in your RxBinding "throttleFirst(500, TimeUnit.MILLISECONDS);" We can set the same properties or set properties separately, like features is very good.

@OnClick({R.id.bt_login,R.id.bt_set,R.id.bt_registered})
public void onViewClicked(View view) {
    //throttleFirst(500, TimeUnit.MILLISECONDS); ???Unified Settings
    switch (view.getId()) {
        case R.id.bt_login:
            //throttleFirst(500, TimeUnit.MILLISECONDS);???Set up separately
            jumpToActivity(HomeActivity.class);

            break;
       case R.id.bt_set:
           //throttleFirst(600, TimeUnit.MILLISECONDS);???Set up separately
            jumpToActivity(SetActivity.class);

            break;
    }
}
JakeWharton commented 5 years ago

Not as part of Butter Knife, no. The scope of the library is only to bind callbacks to methods. How you react to those events remains up to you the same as it would if you used the listener directly. You can post to a Handler with delay to emulate such behavior, though.