Skip to content

Commit

Permalink
improved javadoc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jjobes committed Feb 3, 2015
1 parent 386b9ca commit 48772f9
Show file tree
Hide file tree
Showing 8 changed files with 150 additions and 59 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
import android.content.Context;
import android.util.AttributeSet;
import android.util.Log;
import android.widget.DatePicker;
import android.widget.NumberPicker;

/**
* A subclass of DatePicker that uses reflection to allow
* for customization of the default blue dividers.
* A subclass of {@link android.widget.DatePicker} that uses
* reflection to allow for customization of the default blue
* dividers.
*
* @author jjobes
*
*/
public class CustomDatePicker extends android.widget.DatePicker
public class CustomDatePicker extends DatePicker
{
private static final String TAG = "CustomDatePicker";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,17 @@
import android.util.AttributeSet;
import android.util.Log;
import android.widget.NumberPicker;
import android.widget.TimePicker;

/**
* This is a subclass of TimePicker that uses reflection to allow
* for customization of the default blue dividers.
* A subclass of {@link android.widget.TimePicker} that uses
* reflection to allow for customization of the default blue
* dividers.
*
* @author jjobes
*
*/
public class CustomTimePicker extends android.widget.TimePicker
public class CustomTimePicker extends TimePicker
{
private static final String TAG = "CustomTimePicker";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import android.widget.TimePicker;

/**
* A custom ViewPager implementation that corrects the height of the ViewPager
* and also dispatches touch events to either the ViewPager or the date or time
* picker depending on the direction of the swipe.
* A custom {@link android.support.v4.view.ViewPager} implementation that corrects
* the height of the ViewPager and also dispatches touch events to either the ViewPager
* or the date or time picker depending on the direction of the swipe.
*
* @author jjobes
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

/**
* The fragment for the first page in the ViewPager that holds
* the DatePicker.
* the {@link CustomDatePicker}.
*
* @author jjobes
*
Expand All @@ -32,15 +32,16 @@ public interface DateChangedListener
}

private DateChangedListener mCallback;
private DatePicker mDatePicker;
private CustomDatePicker mDatePicker;

public DateFragment()
{
// Required empty public constructor for fragment.
}

/**
* Cast the reference to SlideDateTimeDialogFragment to a DateChangedListener.
* Cast the reference to {@link SlideDateTimeDialogFragment}
* to a {@link DateChangedListener}.
*/
@Override
public void onCreate(Bundle savedInstanceState)
Expand All @@ -61,7 +62,7 @@ public void onCreate(Bundle savedInstanceState)
/**
* Return an instance of DateFragment with its bundle filled with the
* constructor arguments. The values in the bundle are retrieved in
* onCreateView() below to properly initialize the DatePicker.
* {@link #onCreateView()} below to properly initialize the DatePicker.
*
* @param theme
* @param year
Expand Down Expand Up @@ -118,7 +119,7 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container,

View v = localInflater.inflate(R.layout.fragment_date, container, false);

mDatePicker = (DatePicker) v.findViewById(R.id.datePicker);
mDatePicker = (CustomDatePicker) v.findViewById(R.id.datePicker);
// block keyboard popping up on touch
mDatePicker.setDescendantFocusability(DatePicker.FOCUS_BLOCK_DESCENDANTS);
mDatePicker.init(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@
import android.widget.Button;

/**
* The DialogFragment that contains the SlidingTabLayout and CustomViewPager.
* The CustomViewPager contains the DateFragment and TimeFragment.
* This DialogFragment is managed by SlideDateTimePicker.
* <p>The {@code DialogFragment} that contains the {@link SlidingTabLayout}
* and {@link CustomViewPager}.</p>
*
* <p>The {@code CustomViewPager} contains the {@link DateFragment} and {@link TimeFragment}.</p>
*
* <p>This {@code DialogFragment} is managed by {@link SlideDateTimePicker}.</p>
*
* @author jjobes
*
Expand Down Expand Up @@ -63,8 +66,10 @@ public SlideDateTimeDialogFragment()
}

/**
* Return a new instance of SlideDateTimeDialogFragment with its bundle
* filled with the initial date/time.
* <p>Return a new instance of {@code SlideDateTimeDialogFragment} with its bundle
* filled with the incoming arguments.</p>
*
* <p>Called by {@link SlideDateTimePicker#show()}.</p>
*
* @param listener
* @param initialDate
Expand Down Expand Up @@ -268,10 +273,13 @@ public void onClick(View v)
}

/**
* The callback used by the DatePicker to update mCalendar as the user
* changes the date. Each time this is called, we also update the text
* on the date tab to reflect the date the user has currenly selected.
* Implements the DateFragment.DateChangedListener interface.
* <p>The callback used by the DatePicker to update {@code mCalendar} as
* the user changes the date. Each time this is called, we also update
* the text on the date tab to reflect the date the user has currenly
* selected.</p>
*
* <p>Implements the {@link DateFragment.DateChangedListener}
* interface.</p>
*/
@Override
public void onDateChanged(int year, int month, int day)
Expand All @@ -282,10 +290,13 @@ public void onDateChanged(int year, int month, int day)
}

/**
* The callback used by the TimePicker to update mCalendar as the user
* changes the time. Each time this is called, we also update the text
* on the time tab to reflect the time the user has currenly selected.
* Implements the TimeFragment.TimeChangedListener interface.
* <p>The callback used by the TimePicker to update {@code mCalendar} as
* the user changes the time. Each time this is called, we also update
* the text on the time tab to reflect the time the user has currenly
* selected.</p>
*
* <p>Implements the {@link TimeFragment.TimeChangedListener}
* interface.</p>
*/
@Override
public void onTimeChanged(int hour, int minute)
Expand Down Expand Up @@ -328,9 +339,11 @@ private void updateTimeTab()
}

/**
* Called when the user clicks outside the dialog or presses the Back
* button. Actual Cancel button clicks are handled by mCancelButton's
* event handler.
* <p>Called when the user clicks outside the dialog or presses the <b>Back</b>
* button.</p>
*
* <p><b>Note:</b> Actual <b>Cancel</b> button clicks are handled by {@code mCancelButton}'s
* event handler.</p>
*/
@Override
public void onCancel(DialogInterface dialog)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import java.util.Date;

/**
* This listener class informs the client when the user sets
* a date and time by pressing "OK" or cancels the dialog.
* <p>This listener class informs the client when the user sets
* a date and time by pressing "OK", or cancels the dialog.</p>
*
* Overriding onDateTimeCancel() is optional. The client can
* always override this to listen for when the user cancels
* the dialog. This is called when the user presses the Cancel
* button, touches outside the dialog or presses the Back button.
* <p>Overriding {@code onDateTimeCancel()} is optional. The client
* can override this to listen for when the user cancels the dialog.
* This is called when the user presses the dialog's Cancel button,
* touches outside the dialog or presses the device's Back button.</p>
*
* @author jjobes
*
Expand All @@ -20,7 +20,7 @@ public abstract class SlideDateTimeListener
* Informs the client when the user presses "OK"
* and selects a date and time.
*
* @param date The Date object that contains the date
* @param date The {@code Date} object that contains the date
* and time that the user has selected.
*/
public abstract void onDateTimeSet(Date date);
Expand Down
Loading

0 comments on commit 48772f9

Please sign in to comment.