From 0b27cb170bae8106c8154ff7d45ffc92f8ec6343 Mon Sep 17 00:00:00 2001 From: Akash Date: Mon, 15 Feb 2021 18:11:36 +0530 Subject: [PATCH 1/2] #311 issue resolved,Added background shape custmisation, OK button text can be change now, ok button text color, Added small icon container to show next button icon configurable --- app/build.gradle | 6 +- ...atePickerMainActivityWithDoublePicker.java | 12 +- app/src/main/res/drawable/curve_shape.xml | 16 +++ .../drawable/ic_right_arrow_light_blue.xml | 9 ++ ...ate_picker_activity_main_double_picker.xml | 3 + build.gradle | 4 +- singledateandtimepicker/build.gradle | 2 +- .../SingleDateAndTimePicker.java | 7 ++ .../dialog/BaseDialog.java | 8 ++ .../dialog/SingleDateAndTimePickerDialog.java | 105 +++++++++++++++++- .../bottom_sheet_picker_bottom_sheet.xml | 13 ++- .../bottom_sheet_picker_bottom_sheet.xml | 15 ++- 12 files changed, 189 insertions(+), 11 deletions(-) create mode 100644 app/src/main/res/drawable/curve_shape.xml create mode 100644 app/src/main/res/drawable/ic_right_arrow_light_blue.xml diff --git a/app/build.gradle b/app/build.gradle index afec38dd..e17406ad 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -28,9 +28,9 @@ android { dependencies { implementation fileTree(include: ['*.jar'], dir: 'libs') - implementation "androidx.appcompat:appcompat:1.1.0" - implementation 'com.google.android.material:material:1.1.0' - implementation 'com.jakewharton:butterknife:10.2.1' + implementation "androidx.appcompat:appcompat:1.2.0" + implementation 'com.google.android.material:material:1.3.0' + implementation 'com.jakewharton:butterknife:10.2.3' annotationProcessor 'com.jakewharton:butterknife-compiler:10.2.1' implementation project(':singledateandtimepicker') } \ No newline at end of file diff --git a/app/src/main/java/com/github/florent37/sample/singledateandtimepicker/SingleDatePickerMainActivityWithDoublePicker.java b/app/src/main/java/com/github/florent37/sample/singledateandtimepicker/SingleDatePickerMainActivityWithDoublePicker.java index c6846449..1c7a738d 100644 --- a/app/src/main/java/com/github/florent37/sample/singledateandtimepicker/SingleDatePickerMainActivityWithDoublePicker.java +++ b/app/src/main/java/com/github/florent37/sample/singledateandtimepicker/SingleDatePickerMainActivityWithDoublePicker.java @@ -1,5 +1,6 @@ package com.github.florent37.sample.singledateandtimepicker; +import android.graphics.Color; import android.os.Bundle; import android.util.Log; import android.widget.TextView; @@ -99,6 +100,8 @@ public void simpleTimeClicked() { .displayMinutes(true) .displayHours(true) .displayDays(false) + .minutesStep(15) + .setBackgroundShape(R.drawable.curve_shape) //.displayMonth(true) //.displayYears(true) @@ -113,8 +116,13 @@ public void onClosed(SingleDateAndTimePicker picker) { Log.d(TAG, "Dialog closed"); } }) - - .title("Simple Time") + .titleTextColor(Color.parseColor("#E8EAEE")) + .mainColor(Color.parseColor("#FAFAFA")) + .backgroundColor(Color.parseColor("#1D2D51")) + .title("Pickup Time") + .setButtonName("NEXT") + .setButtonIconRight(R.drawable.ic_right_arrow_light_blue) + .setButtonTextColor(Color.parseColor("#FD9731")) .listener(new SingleDateAndTimePickerDialog.Listener() { @Override public void onDateSelected(Date date) { diff --git a/app/src/main/res/drawable/curve_shape.xml b/app/src/main/res/drawable/curve_shape.xml new file mode 100644 index 00000000..a1b9f429 --- /dev/null +++ b/app/src/main/res/drawable/curve_shape.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_right_arrow_light_blue.xml b/app/src/main/res/drawable/ic_right_arrow_light_blue.xml new file mode 100644 index 00000000..5a0f2292 --- /dev/null +++ b/app/src/main/res/drawable/ic_right_arrow_light_blue.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml b/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml index 17cb48cd..ae69635d 100644 --- a/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml +++ b/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml @@ -54,6 +54,7 @@ + diff --git a/singledateandtimepicker/src/main/res/layout/bottom_sheet_picker_bottom_sheet.xml b/singledateandtimepicker/src/main/res/layout/bottom_sheet_picker_bottom_sheet.xml index 44b7ae1e..4cd80e48 100644 --- a/singledateandtimepicker/src/main/res/layout/bottom_sheet_picker_bottom_sheet.xml +++ b/singledateandtimepicker/src/main/res/layout/bottom_sheet_picker_bottom_sheet.xml @@ -19,6 +19,7 @@ @@ -47,8 +48,20 @@ android:textAllCaps="true" android:textColor="@color/picker_button_background_selected" android:textStyle="bold" + android:layout_marginRight="10dp" /> + + Date: Wed, 17 Feb 2021 12:05:27 +0530 Subject: [PATCH 2/2] enable sample app clicks layout --- .../single_date_picker_activity_main_double_picker.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml b/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml index ae69635d..2de13933 100644 --- a/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml +++ b/app/src/main/res/layout/single_date_picker_activity_main_double_picker.xml @@ -54,7 +54,7 @@