Giter Site home page Giter Site logo

multipickers's Introduction


The Multipicker library features a collection of easily implementable composable pickers.

Current pickers:

  • TextPicker
  • NumberPicker
  • TimePicker

Setup 🔧

Gradle KTS

  • Add it in root build.gradle
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven {url = uri("https://jitpack.io")}
    }
}
  • Add the dependency
  implementation ("com.github.returdev:multipickers:$version")

Examples 👀

Short Picker

Long Picker

Time Picker

Picker with colorful selection


Implementation ✏️

  • TextPicker

@Composable
fun TextPicker() {
    val textList = listOf("One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine", "Ten")

    val pickerState = rememberSaveablePickerState(
        itemsCount = textList.size
    )

    TextPicker(items = textList, pickerState = pickerState)

}
  • NumberPicker

@Composable
fun NumberPicker() {
    val numberList = (0..100).toList()
    val pickerState = rememberSaveablePickerState(
        itemsCount = numberList.size,
        pickerLength = PickerLength.Long
    )

   TimePicker(pickerState = pickerState)

}
  • TimePicker

@Composable
fun TimePickerPreview() {

    val pickerState = rememberTimePickerState(
        initialHour = 12,
        initialMinute = 30,
        initialSecond = 0,
        pickerLength = PickerLength.LONG
    )
   NumberPicker(items = numberList, pickerState = pickerState)

}

License 📄

Copyright 2024 ReturDev

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

multipickers's People

Contributors

returdev avatar

Stargazers

Savvas Dalkitsis avatar Ronaldo Avalos avatar Manuel Jesús avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.