Skip to content

Commit

Permalink
Change sample usages of BottomSheetDatePickerDialog to DatePickerDialog.
Browse files Browse the repository at this point in the history
  • Loading branch information
philliphsu committed Feb 24, 2017
1 parent 6a43ee9 commit 2b5e0e0
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import android.widget.TextView;

import com.philliphsu.bottomsheetpickers.BottomSheetPickerDialog;
import com.philliphsu.bottomsheetpickers.date.BottomSheetDatePickerDialog;
import com.philliphsu.bottomsheetpickers.date.DatePickerDialog;
import com.philliphsu.bottomsheetpickers.time.BottomSheetTimePickerDialog;
import com.philliphsu.bottomsheetpickers.time.grid.GridTimePickerDialog;
Expand Down Expand Up @@ -136,13 +135,12 @@ private DialogFragment createDialogWithBuilders(int checkedId) {
Calendar now = Calendar.getInstance();
Calendar max = Calendar.getInstance();
max.add(Calendar.YEAR, 10);
builder = new BottomSheetDatePickerDialog.Builder(
builder = new DatePickerDialog.Builder(
MainActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH));
BottomSheetDatePickerDialog.Builder dateDialogBuilder =
(BottomSheetDatePickerDialog.Builder) builder;
DatePickerDialog.Builder dateDialogBuilder = (DatePickerDialog.Builder) builder;
dateDialogBuilder.setMaxDate(max)
.setMinDate(now)
.setYearRange(1970, 2032);
Expand Down Expand Up @@ -214,15 +212,15 @@ private DialogFragment createDialogWithSetters(int checkedId) {
case R.id.choice_date_picker_custom:
case R.id.choice_date_picker_custom_dark: {
Calendar now = Calendar.getInstance();
dialog = BottomSheetDatePickerDialog.newInstance(
dialog = DatePickerDialog.newInstance(
MainActivity.this,
now.get(Calendar.YEAR),
now.get(Calendar.MONTH),
now.get(Calendar.DAY_OF_MONTH));
custom = checkedId == R.id.choice_date_picker_custom;
customDark = checkedId == R.id.choice_date_picker_custom_dark;
themeDark = checkedId == R.id.choice_date_picker_dark || customDark;
BottomSheetDatePickerDialog dateDialog = (BottomSheetDatePickerDialog) dialog;
DatePickerDialog dateDialog = (DatePickerDialog) dialog;
dateDialog.setMinDate(now);
Calendar max = Calendar.getInstance();
max.add(Calendar.YEAR, 10);
Expand Down

0 comments on commit 2b5e0e0

Please sign in to comment.