diff --git a/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java b/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java index 939aebb..b5445ec 100644 --- a/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java +++ b/app/src/main/java/org/ntlab/developrx/JavaMainActivity.java @@ -2,6 +2,9 @@ import android.os.Bundle; import android.support.v7.app.AppCompatActivity; +import android.widget.SeekBar; + +import java.util.concurrent.TimeUnit; /** * Created by matsumoto_k on 2017/11/11. @@ -27,5 +30,27 @@ findViewById(R.id.flatmap_1_btn).setOnClickListener(view -> rxProcess.flatmap1()); findViewById(R.id.flatmap_2_btn).setOnClickListener(view -> rxProcess.flatmap2()); findViewById(R.id.meeting_btn).setOnClickListener(view -> rxProcess.meetingTest()); + SeekBar seekBar = findViewById(R.id.seek_bar); + seekBar.setMax(1000); + seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { + @Override + public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { + rxProcess.getPublishSubject().onNext(progress); + } + + @Override + public void onStartTrackingTouch(SeekBar seekBar) { + + } + + @Override + public void onStopTrackingTouch(SeekBar seekBar) { + + } + }); + + rxProcess.getPublishSubject() + .throttleLast(500, TimeUnit.MILLISECONDS) + .subscribe(progress -> System.out.println(progress)); } }