Android Arsenal

DWRulerView

Youtube

Demo

  • Ruler Number Picker & Ruler Seekbar

Image


Usage

  • Ruler Number Picker
ScrollingValuePicker myScrollingValuePicker;
myScrollingValuePicker = (ScrollingValuePicker) findViewById(R.id.myScrollingValuePicker);
myScrollingValuePicker.setViewMultipleSize(LINE_RULER_MULTIPLE_SIZE);
myScrollingValuePicker.setMaxValue(MIN_VALUE, MAX_VALUE);
myScrollingValuePicker.setValueTypeMultiple(5);
myScrollingValuePicker.getScrollView().setOnTouchListener(new View.OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_UP) {
            myScrollingValuePicker.getScrollView().startScrollerTask();
        }
        return false;
    }
});
  • Ruler Seekbar
DWRulerSeekbar dwRulerSeekbar;
dwRulerSeekbar = (DWRulerSeekbar) findViewById(R.id.dwRulerSeekbar);
dwRulerSeekbar
        .setMinMaxValue((int) MIN_VALUE, (int) MAX_VALUE)
        //Get the value with the OnDWSeekbarListener
        .setDWRulerSeekbarListener(new DWRulerSeekbar.OnDWSeekBarListener() {
            @Override
            public void onStopSeekbarValue(int value) {
                seekbarText.setText("DWSeekBar Value : " + value);
            }
        });

Get Value

  • Ruler Number Picker
myScrollingValuePicker.setOnScrollChangedListener(new ObservableHorizontalScrollView.OnScrollChangedListener() {

        @Override
        public void onScrollChanged(ObservableHorizontalScrollView view, int l, int t) {}

        @Override
        public void onScrollStopped(int l, int t) {
            text.setText("Value STOP : " + DWUtils.getValueAndScrollItemToCenter(myScrollingValuePicker.getScrollView() // set TextView
                            , l
                            , t
                            , MAX_VALUE
                            , MIN_VALUE
                            , myScrollingValuePicker.getViewMultipleSize()));
        }
    });

Gradle

allprojects {
		repositories {
			...
			maven { url "https://jitpack.io" }
		}
}
dependencies {
	  compile 'com.github.dwfox:DWRulerView:1.1.0'
}

More Usage

More Usage Here [link]

Become a better Android Developer
Millions of developers are learning at MindOrks

Online Training Program

Featured Blogs

Our Team

MindOrks is Certainly one of the best online blog to stay on top of all the Android development news, coding and design patterns. Finally a blog I can count on to keep myself updated with latest and greatest things happening in Android world.

Vipul Shah
Android Developer
Microsoft

Become Pro in Android by watching videos

OUR LEARNERS WORK AT