• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java TextViewTextChangeEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CellDataFeatures类代码示例发布时间:2022-05-22
下一篇:
Java DuplicateMessageException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap