All Projects → gantonious → MaterialDayPicker

gantonious / MaterialDayPicker

Licence: MIT License
An elegant day of the week picker inspired by Google's clock app

Programming Languages

kotlin
9241 projects
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to MaterialDayPicker

ColorPick.js
A simple and minimal jQuery color picker plugin for the modern web.
Stars: ✭ 48 (-18.64%)
Mutual labels:  picker, ui-components
Colorpicker
jQuery UI widget for color picking (similar to the one in Microsoft Office 2010).
Stars: ✭ 271 (+359.32%)
Mutual labels:  picker, ui-components
Swifthuecolorpicker
iOS HUE color picker
Stars: ✭ 44 (-25.42%)
Mutual labels:  picker, ui-components
android-pickpic
Ready to use library that allows people to select pictures from their device and Facebook account.
Stars: ✭ 12 (-79.66%)
Mutual labels:  picker
pearl-ui
Pearl UI is a powerful UI toolkit that helps you build beautiful production-ready mobile apps right out of the box ⚡️
Stars: ✭ 19 (-67.8%)
Mutual labels:  ui-components
react-native-value-picker
Cross-Platform iOS(ish) style picker for react native.
Stars: ✭ 18 (-69.49%)
Mutual labels:  picker
taiga-ui
Angular UI Kit and components library for awesome people
Stars: ✭ 2,251 (+3715.25%)
Mutual labels:  ui-components
vue-timeselector
🕒 Simply customizable powerful time picker for Vue.js
Stars: ✭ 41 (-30.51%)
Mutual labels:  picker
HiGoogleFonts
HiGoogleFonts allows you to add a Google font picker to easily display a list of Google fonts. The picker shows an instant preview of the font style without loading the font css.
Stars: ✭ 44 (-25.42%)
Mutual labels:  picker
flant
vant风格的flutter组件库
Stars: ✭ 27 (-54.24%)
Mutual labels:  ui-components
react-native-card-media
Card Media component for React Native
Stars: ✭ 68 (+15.25%)
Mutual labels:  ui-components
SettingsAppInSwiftUI
I have recreated a Settings App in iPhoneXR using SwiftUI concepts such as Form,Section,Toggle,Picker,Stack..etc
Stars: ✭ 37 (-37.29%)
Mutual labels:  picker
vanilla-place-picker
Simple(vanilla) yet 'Do it all' place picker for your place picking needs in Android
Stars: ✭ 113 (+91.53%)
Mutual labels:  picker
dotnet-upforgrabs
.NET Core Global Tool to help you get started with contributing to Open Source projects.
Stars: ✭ 50 (-15.25%)
Mutual labels:  contributions-welcome
light-ui
A lightly React UI library
Stars: ✭ 38 (-35.59%)
Mutual labels:  ui-components
RepostCheckerBot
Bot for checking reposts on reddit
Stars: ✭ 36 (-38.98%)
Mutual labels:  contributions-welcome
qi-design-vue
This is a design standard with an implement for web UI components library based on Vue.
Stars: ✭ 26 (-55.93%)
Mutual labels:  ui-components
svelte-flat-ui
Flat UI Independent JS Components + English Docs =
Stars: ✭ 45 (-23.73%)
Mutual labels:  ui-components
PuiSegmentedControl
PuiSegmentedControl is a customizable for segmented control.
Stars: ✭ 19 (-67.8%)
Mutual labels:  ui-components
react-daterange-picker
A react date range picker to using @material-ui. Live Demo: https://flippingbitss.github.io/react-daterange-picker/
Stars: ✭ 85 (+44.07%)
Mutual labels:  picker

MaterialDayPicker

CircleCI Download

Inspired by the day picker in the builtin Android clock app.

Note: I'm not actively working on new features for this library. I'm only addressing critical bugs. With that being said contributions for new features are more than welcome and I am available to review pull requests. See contributing.md if you're interested in contributing.

Normal Usage Localized Usage Dark Mode Usage
Default Usage Localized Usage Dark Mode Usage

Features

  • 🎨 Customizable theming
  • Easy to use API/hooks
  • 🌎 Fully localized
  • 👻 Supports dark mode

What's New: Version 0.7.4 - Better Configuration + Bug fixes

  • You can now manually override the first day of the week shown in the picker by using the newly added firstDayOfWeek property

Changes from 0.7.3

  • Upgraded MaterialDayPicker to target API 30 and upgraded its AndroidX dependencies

Changes from 0.7.2

Bug fixes

  • Fixes a bug when using android gradle plugin 3.6.1 that would cause building to fail due to not being able to find the selectionMode attribute.

Changes from 0.7.1

Bug fixes

  • Fixes an issue where calling setSelectedDays would cause selected days to flash off and on.

Changes from 0.7.0

Configuration Improvements

  • You can now enable/disable days from being selected using enableDay/disableDay methods. See more below.
  • You can now set the selection mode via xml by using the app:selectionMode attribute.

Download the latest version by adding the following to your project's build.gradle file:

dependencies {
    implementation 'ca.antonious:materialdaypicker:0.7.4'
}

Using MaterialDayPicker in your App

You can just drop the view into your existing xml:

<ca.antonious.materialdaypicker.MaterialDayPicker
    android:id="@+id/day_picker"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"/>

You can get the currently selected days by using:

val selectedDays = materialDayPicker.selectedDays
// returns [MaterialDayPicker.Weekday.TUESDAY, MaterialDayPicker.Weekday.FRIDAY]

You can set the selected days by doing:

val daysToSelect = listOf(MaterialDayPicker.Weekday.TUESDAY, MaterialDayPicker.Weekday.FRIDAY)
materialDayPicker.setSelectedDays(daysToSelect)

If you want to only allow one day to be selected at a time you can do:

materialDayPicker.selectionMode = SingleSelectionMode.create()

This can also be set via xml using the selectionMode attribute:

<ca.antonious.materialdaypicker.MaterialDayPicker
    ...
    app:selectionMode="ca.antonious.materialdaypicker.SingleSelectionMode"/>

You can enable/disable days using the following methods. Note if you disable a day when it's selected it cannot be deselected:

materialDayPicker.enableDay(MaterialDayPicker.Weekday.Monday)
materialDayPicker.disableDay(MaterialDayPicker.Weekday.Monday)
materialDayPicker.setDayEnable(MaterialDayPicker.Weekday.Monday, isEnabled = false)

If you want to listen to whenever the day selection is changed you can use:

materialDayPicker.setDaySelectionChangedListener { selectedDays ->
    // handle selection change
}

If you need to know when a specific day is selected/deselected you can use:

materialDayPicker.setDayPressedListener { weekday, isSelected ->
    // handle weekday selection
}

Customizing MaterialDayPicker for your App

You can override these colors to change how MaterialDayPicker looks. You can also update these values in your night color resources directory to update how MaterialDayPicker looks in dark mode:

<color name="dayPressed">@color/colorPrimaryDark</color>
<color name="daySelected">@color/colorPrimary</color>
<color name="daySelectedTextColor">@android:color/white</color>
<color name="dayDeselected">#FAFAFA</color>
<color name="dayDeselectedTextColor">@android:color/black</color>

<!-- Customizing colors for disabled days-->
<color name="daySelectedAndDisabled">#43444F</color>
<color name="daySelectedAndDisabledTextColor">@color/daySelectedTextColor</color>
<color name="dayDeselectedAndDisabled">@color/dayDeselected</color>
<color name="dayDeselectedAndDisabledTextColor">@android:color/darker_gray</color>

If you don't want to use the device's current locale you can override it by doing:

materialDayPicker.locale = Locale.ENGLISH // or any other locale

If you want to specify the first day of the week explicitly:

materialDayPicker.firstDayOfWeek = MaterialDayPicker.Weekday.MONDAY // or any other day

License

MIT License

Copyright (c) 2017 George Antonious

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].