// Path: src/main/java/com/googlecode/android/widgets/DateSlider/TimeObject.java
// public class TimeObject {
//     public final CharSequence text;
//     public final long startTime, endTime;
//     public TimeObject(final CharSequence text, final long startTime, final long endTime) {
//         this.text = text;
//         this.startTime = startTime;
//         this.endTime = endTime;
//     }
// }
// 
// Path: src/main/java/com/googlecode/android/widgets/DateSlider/timeview/TimeTextView.java
// public class TimeTextView extends TextView implements TimeView {
//     protected long endTime, startTime;
//     protected boolean isOutOfBounds = false;
// 
//     /**
//      * constructor
//      * @param context
//      * @param isCenterView true if the element is the centered view in the ScrollLayout
//      * @param textSize text size in dps
//      */
//     public TimeTextView(Context context, boolean isCenterView, int textSize) {
//         super(context);
//         setupView(isCenterView, textSize);
//     }
// 
//     /**
//      * this method should be overwritten by inheriting classes to define its own look and feel
//      * @param isCenterView true if the element is in the center of the scrollLayout
//      * @param textSize textSize in dps
//      */
//     protected void setupView(boolean isCenterView, int textSize) {
//         setGravity(Gravity.CENTER);
//         setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize);
//         if (isCenterView) {
//             setTypeface(Typeface.DEFAULT_BOLD);
//             setTextColor(0xFF333333);
//         } else {
//             setTextColor(0xFF666666);
//         }
//     }
// 
//     
//     public void setVals(TimeObject to) {
//         setText(to.text);
//         this.startTime = to.startTime;
//         this.endTime = to.endTime;
//     }
// 
//     
//     public void setVals(TimeView other) {
//         setText(other.getTimeText());
//         startTime = other.getStartTime();
//         endTime = other.getEndTime();
//     }
//     
//     public long getStartTime() {
//         return this.startTime;
//     }
// 
//     
//     public long getEndTime() {
//         return this.endTime;
//     }
// 
//     
//     public String getTimeText() {
//         return getText().toString();
//     }
// 
// 	public boolean isOutOfBounds() {
// 		return isOutOfBounds;
// 	}
// 
// 	public void setOutOfBounds(boolean outOfBounds) {
// 		if (outOfBounds && !isOutOfBounds) {
// 			setTextColor(0x44666666);
// 		}
// 		else if (!outOfBounds && isOutOfBounds) {
//             setTextColor(0xFF666666);
// 		}
// 		isOutOfBounds = outOfBounds;
// 	}
// 
// }
// 
// Path: src/main/java/com/googlecode/android/widgets/DateSlider/timeview/TimeView.java
// public interface TimeView {
//     /**
//      * Sets this TimeView to display the contents of the specified TimeObject.
//      *
//      * @param to The TimeObject to use to populate this TimeView
//      */
//     public void setVals(TimeObject to);
//     /**
//      * Instructs this TimeView to copy its values from the specified TimeView, so
//      * it will assume the state of the other TimeView.
//      *
//      * @param other The TimeView to copy values from
//      */
//     public void setVals(TimeView other);
//     
//     /**
//      * Get a string containing the textual representation of this TimeView's time
//      * @return
//      */
//     public String getTimeText();
//     /**
//      * Get the start time of this TimeView
//      * @return
//      */
//     public long getStartTime();
//     /**
//      * Get the end time of this TimeView
//      * @return
//      */
//     public long getEndTime();
//     
//     public boolean isOutOfBounds();
//     public void setOutOfBounds(boolean outOfBounds);
// }


import java.util.Calendar;
import android.content.Context;
import com.googlecode.android.widgets.DateSlider.TimeObject;
import com.googlecode.android.widgets.DateSlider.timeview.TimeTextView;
import com.googlecode.android.widgets.DateSlider.timeview.TimeView;
package com.googlecode.android.widgets.DateSlider.labeler;




/**
 * This is an abstract class whose job is create TimeViews that can be used
 * to populate a ScrollLayout, and to generate TimeObjects from times that
 * can be used to populate the TimeViews.
 */
public abstract class Labeler {
    /**
     * The default width of views that this labeler generates, in dp
     */
    private final int viewWidthDP;
    /**
     * The default height of views that this labeler generates, in dp
     */
    private final int viewHeightDP;
    
    protected int minuteInterval=1;

    /**
     * @param viewWidthDB The default width of views labeled by this labeler in dp
     * @param viewHeightDB The default height of views labeled by this labeler in dp
     */
    public Labeler(int viewWidthDP, int viewHeightDP) {
        this.viewWidthDP = viewWidthDP;
        this.viewHeightDP = viewHeightDP;
    }

    /**
     * Converts from a time to a TimeObject according to the rules of this labeler.
     *
     * @param time The time to display
     * @return the TimeObject representing "time" suitable for populating TimeViews
     * returned from {@link #createView(Context, boolean)}
     */
    public TimeObject getElem(long time) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(time);
// Path: src/main/java/com/googlecode/android/widgets/DateSlider/TimeObject.java
// public class TimeObject {
//     public final CharSequence text;
//     public final long startTime, endTime;
//     public TimeObject(final CharSequence text, final long startTime, final long endTime) {
//         this.text = text;
//         this.startTime = startTime;
//         this.endTime = endTime;
//     }
// }
// 
// Path: src/main/java/com/googlecode/android/widgets/DateSlider/timeview/TimeTextView.java
// public class TimeTextView extends TextView implements TimeView {
//     protected long endTime, startTime;
//     protected boolean isOutOfBounds = false;
// 
//     /**
//      * constructor
//      * @param context
//      * @param isCenterView true if the element is the centered view in the ScrollLayout
//      * @param textSize text size in dps
//      */
//     public TimeTextView(Context context, boolean isCenterView, int textSize) {
//         super(context);
//         setupView(isCenterView, textSize);
//     }
// 
//     /**
//      * this method should be overwritten by inheriting classes to define its own look and feel
//      * @param isCenterView true if the element is in the center of the scrollLayout
//      * @param textSize textSize in dps
//      */
//     protected void setupView(boolean isCenterView, int textSize) {
//         setGravity(Gravity.CENTER);
//         setTextSize(TypedValue.COMPLEX_UNIT_DIP, textSize);
//         if (isCenterView) {
//             setTypeface(Typeface.DEFAULT_BOLD);
//             setTextColor(0xFF333333);
//         } else {
//             setTextColor(0xFF666666);
//         }
//     }
// 
//     
//     public void setVals(TimeObject to) {
//         setText(to.text);
//         this.startTime = to.startTime;
//         this.endTime = to.endTime;
//     }
// 
//     
//     public void setVals(TimeView other) {
//         setText(other.getTimeText());
//         startTime = other.getStartTime();
//         endTime = other.getEndTime();
//     }
//     
//     public long getStartTime() {
//         return this.startTime;
//     }
// 
//     
//     public long getEndTime() {
//         return this.endTime;
//     }
// 
//     
//     public String getTimeText() {
//         return getText().toString();
//     }
// 
// 	public boolean isOutOfBounds() {
// 		return isOutOfBounds;
// 	}
// 
// 	public void setOutOfBounds(boolean outOfBounds) {
// 		if (outOfBounds && !isOutOfBounds) {
// 			setTextColor(0x44666666);
// 		}
// 		else if (!outOfBounds && isOutOfBounds) {
//             setTextColor(0xFF666666);
// 		}
// 		isOutOfBounds = outOfBounds;
// 	}
// 
// }
// 
// Path: src/main/java/com/googlecode/android/widgets/DateSlider/timeview/TimeView.java
// public interface TimeView {
//     /**
//      * Sets this TimeView to display the contents of the specified TimeObject.
//      *
//      * @param to The TimeObject to use to populate this TimeView
//      */
//     public void setVals(TimeObject to);
//     /**
//      * Instructs this TimeView to copy its values from the specified TimeView, so
//      * it will assume the state of the other TimeView.
//      *
//      * @param other The TimeView to copy values from
//      */
//     public void setVals(TimeView other);
//     
//     /**
//      * Get a string containing the textual representation of this TimeView's time
//      * @return
//      */
//     public String getTimeText();
//     /**
//      * Get the start time of this TimeView
//      * @return
//      */
//     public long getStartTime();
//     /**
//      * Get the end time of this TimeView
//      * @return
//      */
//     public long getEndTime();
//     
//     public boolean isOutOfBounds();
//     public void setOutOfBounds(boolean outOfBounds);
// }


// Path: src/main/java/com/googlecode/android/widgets/DateSlider/labeler/Labeler.java
import java.util.Calendar;
import android.content.Context;
import com.googlecode.android.widgets.DateSlider.TimeObject;
import com.googlecode.android.widgets.DateSlider.timeview.TimeTextView;
import com.googlecode.android.widgets.DateSlider.timeview.TimeView;

package com.googlecode.android.widgets.DateSlider.labeler;




/**
 * This is an abstract class whose job is create TimeViews that can be used
 * to populate a ScrollLayout, and to generate TimeObjects from times that
 * can be used to populate the TimeViews.
 */
public abstract class Labeler {
    /**
     * The default width of views that this labeler generates, in dp
     */
    private final int viewWidthDP;
    /**
     * The default height of views that this labeler generates, in dp
     */
    private final int viewHeightDP;
    
    protected int minuteInterval=1;

    /**
     * @param viewWidthDB The default width of views labeled by this labeler in dp
     * @param viewHeightDB The default height of views labeled by this labeler in dp
     */
    public Labeler(int viewWidthDP, int viewHeightDP) {
        this.viewWidthDP = viewWidthDP;
        this.viewHeightDP = viewHeightDP;
    }

    /**
     * Converts from a time to a TimeObject according to the rules of this labeler.
     *
     * @param time The time to display
     * @return the TimeObject representing "time" suitable for populating TimeViews
     * returned from {@link #createView(Context, boolean)}
     */
    public TimeObject getElem(long time) {
        Calendar c = Calendar.getInstance();
        c.setTimeInMillis(time);
        return timeObjectfromCalendar(c);