• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java RxSeekBar类的典型用法和代码示例

java 2次浏览

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

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

示例1: setupVolume

点赞 3

import com.jakewharton.rxbinding.widget.RxSeekBar; //导入依赖的package包/类
private void setupVolume(SeekBar bar, ImageView mute, ImageView unmute, int stream) {
    int max = audioManager.getStreamMaxVolume(stream);

    bar.setMax(max);

    uiState.onNext(new State(stream, audioManager.getStreamVolume(stream), audioManager.isStreamMute(stream)));

    // Skip the initial value to avoid setting the focused stream
    RxSeekBar.userChanges(bar).skip(1).subscribe(v -> {
        focusedStream = stream;
        uiState.onNext(new State(stream, v, false));
        volumeState.onNext(new State(stream, v, false));
    });

    RxView.clicks(mute).subscribe(v -> {
        focusedStream = stream;
        uiState.onNext(new State(stream, -1, true));
        volumeState.onNext(new State(stream, -1, true));
    });

    RxView.clicks(unmute).subscribe(v -> {
        focusedStream = stream;
        uiState.onNext(new State(stream, -1, false));
        volumeState.onNext(new State(stream, -1, false));
    });
}
 

开发者ID:urandom,
项目名称:VolumeTile,
代码行数:27,
代码来源:Service.java

示例2: onResume

点赞 2

import com.jakewharton.rxbinding.widget.RxSeekBar; //导入依赖的package包/类
@Override
protected void onResume() {
    super.onResume();
    mSubscription = RxSeekBar.userChanges(mSeekBar)
            .map(Long::valueOf)
            .doOnNext(aLong -> mTarget.setText(String.valueOf(aLong)))
            .subscribe(mCounter.targetAction());
}
 

开发者ID:ursimon,
项目名称:CounterTextView,
代码行数:9,
代码来源:MainActivity.java

示例3: initViews

点赞 2

import com.jakewharton.rxbinding.widget.RxSeekBar; //导入依赖的package包/类
@Override
public void initViews() {
    inflater.inflate(R.layout.widget_metric_slider, this);
    seekBar = (AppCompatSeekBar) findViewById(R.id.sliderVal);
    valueText = (TextView) findViewById(R.id.value);
    nameText = ((TextView) findViewById(R.id.name));
    minText = ((TextView) findViewById(R.id.min));
    maxText = ((TextView) findViewById(R.id.max));

    RxSeekBar.userChanges(seekBar).subscribeOn(AndroidSchedulers.mainThread()).subscribe(seekValue -> {
        value = seekValue + min;
        valueText.setText(Integer.toString(value));
    });
}
 

开发者ID:frc2052,
项目名称:FRC-Krawler,
代码行数:15,
代码来源:SliderMetricWidget.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)