예제 #1
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   ButterKnife.inject(this, getWindow().getDecorView());
   search.setOnClickListener(
       v -> {
         JUtils.closeInputMethod(this);
         recycler.showProgress();
         getPresenter().search(word.getText().toString());
       });
 }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    ButterKnife.inject(this, getWindow().getDecorView());
    word.addTextChangedListener(
        new TextWatcher() {
          @Override
          public void beforeTextChanged(CharSequence s, int start, int count, int after) {}

          @Override
          public void onTextChanged(CharSequence s, int start, int before, int count) {}

          @Override
          public void afterTextChanged(Editable s) {
            getPresenter().search(word.getText().toString());
          }
        });
    search.setOnClickListener(
        v -> {
          JUtils.closeInputMethod(this);
        });
  }