本文整理匯總了Java中com.jakewharton.rxbinding.widget.RxTextView.textChanges方法的典型用法代碼示例。如果您正苦於以下問題:Java RxTextView.textChanges方法的具體用法?Java RxTextView.textChanges怎麽用?Java RxTextView.textChanges使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.jakewharton.rxbinding.widget.RxTextView
的用法示例。
在下文中一共展示了RxTextView.textChanges方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onCreate
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
Observable<CharSequence> loginObservable = RxTextView.textChanges(mLogin);
loginObservable
.map(this::isValidLogin)
.subscribe(isValid -> mLogin.setCompoundDrawablesRelativeWithIntrinsicBounds(null,null, (isValid ? mValidField : mInvalidField), null));
Observable<CharSequence> passwordObservable = RxTextView.textChanges(mPassword);
passwordObservable
.map(this::isValidPassword)
.subscribe(isValid -> mPassword.setCompoundDrawablesRelativeWithIntrinsicBounds(null,null, (isValid ? mValidField : mInvalidField), null));
Observable<Boolean> combinedObservables = Observable.combineLatest(loginObservable, passwordObservable, (o1, o2) -> isValidLogin(o1) && isValidPassword(o2));
combinedObservables.subscribe(isVisible -> mLoginButton.setVisibility(isVisible ? View.VISIBLE : View.GONE));
}
示例2: RxTextInputLayout
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
/**
* @author Soussi
*
* @param appCompatEditText
* @param textInputLayout
*/
public RxTextInputLayout(final AppCompatEditText appCompatEditText, final TextInputLayout textInputLayout)
{
this.appCompatEditText=appCompatEditText;
this.textInputLayout=textInputLayout;
customChangeObservable = RxTextView.textChanges(appCompatEditText);
}
示例3: onAttachedToWindow
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
protected void onAttachedToWindow() {
super.onAttachedToWindow();
final Observable<CharSequence> text = RxTextView.textChanges(this.searchEditText);
final Observable<Boolean> clearable = text.map(t -> t.length() > 0);
addSubscription(clearable
.observeOn(AndroidSchedulers.mainThread())
.subscribe(c -> this.clearButton.setVisibility(c ? View.VISIBLE : View.INVISIBLE)));
addSubscription(text
.observeOn(AndroidSchedulers.mainThread())
.subscribe(t -> ((SearchActivity) getContext()).viewModel().inputs.search(t.toString())));
}
示例4: getNameObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@NonNull
@Override
public Observable<CharSequence> getNameObservable() {
return RxTextView.textChanges(name);
}
示例5: getAmountObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@NonNull
@Override
public Observable<CharSequence> getAmountObservable() {
return RxTextView.textChanges(editAmount);
}
示例6: onTotalCostChanged
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@NonNull @Override public Observable<CharSequence> onTotalCostChanged() {
return RxTextView.textChanges(editText);
}
示例7: passwordChange
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> passwordChange() {
return RxTextView.textChanges(password);
}
示例8: registerBirthDateObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerBirthDateObservable() {
return RxTextView.textChanges(birthDateEditText);
}
示例9: registerEmailObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerEmailObservable() {
return RxTextView.textChanges(emailEditText);
}
示例10: registerCepObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerCepObservable() {
return RxTextView.textChanges(cepEditText);
}
示例11: registerPasswordObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerPasswordObservable() {
return RxTextView.textChanges(passwordEditText);
}
示例12: registerRePasswordObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerRePasswordObservable() {
return RxTextView.textChanges(confirmPasswordEditText);
}
示例13: registerSearchEditTextObserver
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerSearchEditTextObserver() {
return RxTextView.textChanges(searchRemedyEditText);
}
示例14: registerSearchObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerSearchObservable() {
return RxTextView.textChanges(searchRemedyEditText);
}
示例15: registerNameObservable
import com.jakewharton.rxbinding.widget.RxTextView; //導入方法依賴的package包/類
@Override
public Observable<CharSequence> registerNameObservable() {
return RxTextView.textChanges(nameEditText);
}