nileshigreen / android-dateslider

Automatically exported from code.google.com/p/android-dateslider
0 stars 0 forks source link

Center hour if 0 is centered in minute slider #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, the hour slider is centered if the minute slider has 30 as its 
center. I find this behavior confusing - is it possible to optionally configure 
the sliders such that the hour is centered when the minute slider has a 0 as 
its center?

One use case is that I want to use the DateSlider to let the user choose a 
duration. For this, I initially set 0:00 as the SliderContainer's time. It's 
very confusing to the user now that the 0 is not centered in the hour slider.

Original issue reported on code.google.com by christia...@gmail.com on 6 Nov 2011 at 1:35

GoogleCodeExporter commented 9 years ago
should be an easy fix. I guess all that's necessary is to set up the hour label 
to be left-aligned. I'll get back to you after I have checked whether/how easy 
it is to do that

Original comment by daniel.b...@gmail.com on 7 Nov 2011 at 9:55

GoogleCodeExporter commented 9 years ago
you now can provide a gravity for the scroll elements as demonstrated in the 
customslider's year scroller:

<com.googlecode.android.widgets.DateSlider.ScrollLayout
        style="@style/Scroller"
        app:labelerClass="com.googlecode.android.widgets.DateSlider.labeler.YearLabeler"
        app:labelerFormat="%tY"
        app:childWidth="200dp"
        android:gravity="left|bottom"/>

the gravity defaults to "center"

to achieve what you are attempting you need to define "left|center_vertical" 
for both, hour and minute slider

Original comment by daniel.b...@gmail.com on 7 Nov 2011 at 11:32