Skip to content

Commit db848ba

Browse files
authored
Update README.md
1 parent 9cc3068 commit db848ba

1 file changed

Lines changed: 92 additions & 22 deletions

File tree

README.md

Lines changed: 92 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -113,102 +113,172 @@ class MainActivity : AppCompatActivity() {
113113

114114
You can customize the appearance and behavior of the `CustomizableDatePicker` using the `CustomCalendarResources` singleton. Below are the available customization options:
115115

116-
#### Calendar and Date Appearance
116+
### Calendar and Date Appearance
117117

118-
- **Highlight Date Background**:
118+
- **Highlight Date Background**
119+
Set the drawable for highlighting selected dates.
119120
```kotlin
120121
CustomCalendarResources.setCalendarDayHighlightBackground(R.drawable.highlight_background)
121122
```
122123

123-
- **Default Date Background**:
124+
- **Default Date Background**
125+
Define the default background for calendar dates.
124126
```kotlin
125127
CustomCalendarResources.setCalendarDayBackgroundDefault(R.drawable.default_background)
126128
```
127129

128-
- **Text Color for Calendar Days**:
130+
- **Text Color for Calendar Days**
131+
Set the text color for all calendar dates.
129132
```kotlin
130133
CustomCalendarResources.setCalendarDaysTextColor(Color.BLACK)
131134
```
132135

133-
- **Text Color for Disabled Days**:
136+
- **Text Color for Disabled Days**
137+
Define the text color for disabled dates.
134138
```kotlin
135139
CustomCalendarResources.setCalendarDaysDisabledTextColor(Color.GRAY)
136140
```
137141

138-
- **Text Color for Highlighted Days**:
142+
- **Text Color for Highlighted Days**
143+
Specify the text color for highlighted calendar dates.
139144
```kotlin
140145
CustomCalendarResources.setCalendarDaysHighlightTextColor(Color.RED)
141146
```
142147

143-
- **Font**:
148+
- **Font**
149+
Change the font used for all calendar text.
144150
```kotlin
145151
CustomCalendarResources.setFont(R.font.dm_sans_medium)
146152
```
147153

148-
#### Top Bar Customization
154+
---
149155

150-
- **Top Bar Background Color**:
156+
### Top Bar Customization
157+
158+
- **Top Bar Background Color**
159+
Customize the background color of the top bar.
151160
```kotlin
152161
CustomCalendarResources.setTopBarBackgroundColor(Color.WHITE)
153162
```
154163

155-
- **Sunday Day Color in Top Bar**:
164+
- **Sunday Day Color in Top Bar**
165+
Define the color for Sundays in the top bar.
156166
```kotlin
157167
CustomCalendarResources.setTopBarSundayColor(Color.RED)
158168
```
159169

160-
- **Default Day Color in Top Bar**:
170+
- **Default Day Color in Top Bar**
171+
Specify the default color for other weekdays in the top bar.
161172
```kotlin
162173
CustomCalendarResources.setTopBarDefaultDayColor(Color.parseColor("#848487"))
163174
```
164175

165-
#### Button Customization
176+
---
177+
178+
### Button Customization
166179

167-
- **Button Background**:
180+
- **Button Background**
181+
Set the background drawable for buttons.
168182
```kotlin
169183
CustomCalendarResources.setButtonDrawable(R.drawable.button_background)
170184
```
171185

172-
- **Button Text Color**:
186+
- **Button Text Color**
187+
Define the text color for buttons.
173188
```kotlin
174189
CustomCalendarResources.setButtonTextColor(Color.WHITE)
175190
```
176191

177-
#### Month & Year Navigation
192+
---
178193

179-
- **Year Dropdown Background**:
194+
### Month & Year Navigation
195+
196+
- **Year Dropdown Background**
197+
Customize the background of the year dropdown menu.
180198
```kotlin
181199
CustomCalendarResources.setYearDropDownBackground(R.drawable.year_dropdown_background)
182200
```
183201

184-
- **Year Dropdown Text Color**:
202+
- **Year Dropdown Text Color**
203+
Specify the text color for the year dropdown menu.
185204
```kotlin
186205
CustomCalendarResources.setYearDropdownTextColor(Color.parseColor("#474747"))
187206
```
188207

189-
- **Month Switch Icons (Left and Right)**:
208+
- **Month Switch Icons (Left and Right)**
209+
Change the icons for navigating months.
190210
```kotlin
191211
CustomCalendarResources.setMonthSwitchIconLeft(R.drawable.ic_arrow_left)
192212
CustomCalendarResources.setMonthSwitchIconRight(R.drawable.ic_arrow_right)
193213
```
194214

195-
- **Year Switch Icon**:
215+
- **Year Switch Icon**
216+
Set the icon for switching years.
196217
```kotlin
197218
CustomCalendarResources.setYearSwitchIcon(R.drawable.ic_arrow_down)
198219
```
199220

200-
#### Popup and Gesture Support
221+
---
222+
223+
### Popup and Gesture Support
201224

202-
- **Popup Background**:
225+
- **Popup Background**
226+
Customize the background of popups.
203227
```kotlin
204228
CustomCalendarResources.setPopupBackground(R.drawable.popup_background)
205229
```
206230

207-
- **Enable Gesture-based Month Switching**:
231+
- **Enable Gesture-based Month Switching**
232+
Enable or disable gestures for switching months.
208233
```kotlin
209234
CustomCalendarResources.useGestureForSwitchingMonths(true)
210235
```
211236

237+
---
238+
239+
### Font and Size Adjustments
240+
241+
- **Calendar Font Size**
242+
Adjust the font size for calendar text.
243+
```kotlin
244+
CustomCalendarResources.setCalendarFontSize(14f)
245+
```
246+
247+
- **Year Dropdown Font Size**
248+
Customize the font size for the year dropdown menu.
249+
```kotlin
250+
CustomCalendarResources.setYearDropdownFontSize(12f)
251+
```
252+
253+
- **Selector Font Size**
254+
Define the font size for month/year selector.
255+
```kotlin
256+
CustomCalendarResources.setSelectorFontSize(16f)
257+
```
258+
259+
- **Button Font Size**
260+
Adjust the font size for button text.
261+
```kotlin
262+
CustomCalendarResources.setButtonFontSize(14f)
263+
```
264+
265+
---
266+
267+
## Additional Customization
268+
269+
- **Days Bar Visibility**
270+
Show or hide the days bar at the top of the calendar.
271+
```kotlin
272+
CustomCalendarResources.setDaysBarVisibility(View.VISIBLE)
273+
```
274+
275+
- **Top Bar Days Background**
276+
Set a background drawable for the top bar days.
277+
```kotlin
278+
CustomCalendarResources.setTopBarDaysBackground(R.drawable.days_background)
279+
```
280+
281+
212282
### 3. The `show()` Method
213283

214284
The `show()` method is used to display the date picker with full flexibility. Here's a detailed breakdown of the parameters:

0 commit comments

Comments
 (0)