Skip to content

Commit da4997f

Browse files
committed
Readme modification
1 parent aa74a2d commit da4997f

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

ReadMe.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,25 @@ SwitchDateTime use *AppTheme*, for use another theme add in *Android.manifest*:
88
`tools:replace="android:theme"`
99

1010
## Use
11+
You can see
12+
https://github.com/J-Jamet/Android-SwitchDateTimePicker/blob/master/sample/src/main/java/com/kunzisoft/switchdatetimesample/Sample.java
13+
for complete sample.
14+
1115

1216
```
17+
// Initialize
1318
SwitchDateTimeDialogFragment dateTimeDialogFragment = SwitchDateTimeDialogFragment.newInstance(
1419
getString(R.string.label_datetime_dialog),
1520
getString(R.string.positive_button_datetime_picker),
1621
getString(R.string.negative_button_datetime_picker)
1722
);
23+
// Assign values
24+
dateTimeDialogFragment.setYear(2016);
25+
dateTimeDialogFragment.setMonth(12);
26+
dateTimeDialogFragment.setMonth(10);
27+
dateTimeDialogFragment.setHour(1);
28+
dateTimeDialogFragment.setMinute(20);
29+
// Set listener
1830
dateTimeDialogFragment.setOnButtonClickListener(new SwitchDateTimeDialogFragment.OnButtonClickListener() {
1931
@Override
2032
public void onPositiveButtonClick(Date date) {
@@ -27,6 +39,7 @@ dateTimeDialogFragment.setOnButtonClickListener(new SwitchDateTimeDialogFragment
2739
// Date is get on negative button click
2840
}
2941
});
42+
// Show
3043
dateTimeDialogFragment.show(getSupportFragmentManager(), "dialog_time");
3144
```
3245

switchdatetime/src/main/java/com/kunzisoft/switchdatetime/SwitchDateTimeDialogFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public void onClick(DialogInterface dialog, int which) {
139139
});
140140

141141
// Show datetime from locale format
142+
//TODO DateFormat
142143
dateText.setText(DateFormat.getDateTimeInstance().format(dateTime.getTime()));
143144
AlertDialog dialog = db.show();
144145

0 commit comments

Comments
 (0)