当前位置: 首页>>代码示例>>Java>>正文


Java TextViewTextChangeEvent类代码示例

本文整理汇总了Java中com.jakewharton.rxbinding.widget.TextViewTextChangeEvent的典型用法代码示例。如果您正苦于以下问题:Java TextViewTextChangeEvent类的具体用法?Java TextViewTextChangeEvent怎么用?Java TextViewTextChangeEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


TextViewTextChangeEvent类属于com.jakewharton.rxbinding.widget包,在下文中一共展示了TextViewTextChangeEvent类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getFilterObserver

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
/**
 * Get the observer to use to handle filter text changes.
 * @return Filter text change observer
 */
private Observer<TextViewTextChangeEvent> getFilterObserver() {
    return new Observer<TextViewTextChangeEvent>() {
        @Override
        public void onCompleted() {
            // Nothing.
        }

        @Override
        public void onError(Throwable e) {
            // Shouldn't happen, but we'll log it if it does.
            Timber.e("Some error occurred due to the filter observer!");
            e.printStackTrace();
        }

        @Override
        public void onNext(TextViewTextChangeEvent textViewTextChangeEvent) {
            // Apply filter to items and then update adapter's copy of items.
            applyFilter(textViewTextChangeEvent.text().toString());
            adapter.updateRealmResults(items);
        }
    };
}
 
开发者ID:bkromhout,项目名称:Minerva,代码行数:27,代码来源:TaggingActivity.java

示例2: onCreate

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);

    ButterKnife.bind(this);

    presenter = new SplashActivityPresenter(this,new Validator());

    textChangeSubscription = RxTextView.textChangeEvents(etUsername).subscribe(new Action1<TextViewTextChangeEvent>() {
        @Override
        public void call(TextViewTextChangeEvent textViewTextChangeEvent) {
            presenter.username = textViewTextChangeEvent.text().toString();
            etUsername.setError(null);
        }
    });
}
 
开发者ID:xsingHu,项目名称:xs-android-architecture,代码行数:18,代码来源:SplashActivity.java

示例3: getSearchObserver

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
private Observer<TextViewTextChangeEvent> getSearchObserver() {
    return new Observer<TextViewTextChangeEvent>() {
        @Override
        public void onCompleted() {
            Timber.d(" onComplete");
        }

        @Override
        public void onError(Throwable e) {
            Timber.e(e, " on error!");
            log("Dang error. check your logs");
        }

        @Override
        public void onNext(TextViewTextChangeEvent onTextChangeEvent) {
            log(format("Searching for %s", onTextChangeEvent.text().toString()));
        }
    };
}
 
开发者ID:gdg-novi-sad,项目名称:oct-04-16-rxjava,代码行数:20,代码来源:DebounceSearchEmitterFragment.java

示例4: method18

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
/**
 * EditText,每隔500ms,去响应变化
 */
private void method18() {
    mSearchEditText.setVisibility(View.VISIBLE);
    RxTextView.textChangeEvents(mSearchEditText)
            .debounce(500, TimeUnit.MILLISECONDS)
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Subscriber<TextViewTextChangeEvent>() {
                @Override
                public void onCompleted() {
                }

                @Override
                public void onError(Throwable e) {
                }

                @Override
                public void onNext(TextViewTextChangeEvent textViewTextChangeEvent) {
                    String changedMessage = textViewTextChangeEvent.text().toString();
                    Logger.d(TAG, changedMessage);
                    if (!TextUtils.isEmpty(changedMessage)) {
                        ToastUtil.getInstance().showToast(MainActivity.this, changedMessage);
                    }
                }
            });
}
 
开发者ID:androidmalin,项目名称:RengwuxianRxjava,代码行数:28,代码来源:MainActivity.java

示例5: getSearchObserver

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
private Observer<TextViewTextChangeEvent> getSearchObserver(){
 return new Observer<TextViewTextChangeEvent>() {
     @Override
     public void onCompleted() {
         Timber.d("--------- onComplete");
     }

     @Override
     public void onError(Throwable e) {
         Timber.e(e, "--------- Woops on error!");
         log("Dang error. check your logs");
     }

     @Override
     public void onNext(TextViewTextChangeEvent textViewTextChangeEvent) {
         log(format("Searching for %s", textViewTextChangeEvent.text().toString()));
     }
 };
}
 
开发者ID:yeungeek,项目名称:Android-Gradle-Samples,代码行数:20,代码来源:DebounceSearchEmitterFragment.java

示例6: searchKeyWordDemo

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
/**
 * 搜索关键字提醒Demo
 */
private void searchKeyWordDemo() {
    RxTextView.textChangeEvents(et_search)
            .debounce(300, TimeUnit.MILLISECONDS)  //debounce:每次文本更改后有300毫秒的缓冲时间,默认在computation调度器
            .observeOn(AndroidSchedulers.mainThread())  //触发后回到Android主线程调度器
            .subscribe(new Action1<TextViewTextChangeEvent>() {
                @Override
                public void call(TextViewTextChangeEvent textViewTextChangeEvent) {
                    String key = textViewTextChangeEvent.text().toString().trim();
                    if (TextUtils.isEmpty(key)) {
                        iv_x.setVisibility(View.GONE);
                        if (mAdapter != null) {
                            mAdapter.clear();
                            mAdapter.notifyDataSetChanged();
                        }
                    } else {
                        iv_x.setVisibility(View.VISIBLE);
                        getKeyWordFormNet(key)
                                .subscribeOn(Schedulers.io())
                                .observeOn(AndroidSchedulers.mainThread())
                                .subscribe(new Action1<List<String>>() {
                                    @Override
                                    public void call(List<String> strings) {
                                        initPage(strings);
                                    }
                                });
                    }
                }
            });

}
 
开发者ID:cowthan,项目名称:AyoSunny,代码行数:34,代码来源:DebounceFragment.java

示例7: onActivityCreated

import com.jakewharton.rxbinding.widget.TextViewTextChangeEvent; //导入依赖的package包/类
@Override
    public void onActivityCreated(Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        setupLogger();

        Observable<TextViewTextChangeEvent> textChangeEventObservable = RxTextView.textChangeEvents(inputSearchText);

//        subscription = textChangeEventObservable.compose(bindToLifecycle())
//                .debounce(400, TimeUnit.MILLISECONDS)
//                .observeOn(AndroidSchedulers.mainThread())
//                .subscribe(getSearchObserver());
    }
 
开发者ID:yeungeek,项目名称:Android-Gradle-Samples,代码行数:13,代码来源:DebounceSearchEmitterFragment.java


注:本文中的com.jakewharton.rxbinding.widget.TextViewTextChangeEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。