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]

Join India's largest learning revolution
Free Video Tutorials
Learn Programming
Learning is a journey, let's learn together

MindOrks Newsletter
100,000+ Subscribers
A free weekly newsletter that comes with the latest Android articles, open source projects, events and hot discussions.

Subscribe Now

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

OUR LEARNERS WORK AT