Coder Social home page Coder Social logo

ashiqursuperfly / android-material-ranged-time-picker-dialog Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 2.92 MB

An android library to create ranged time picker dialog using material design components.

License: MIT License

Kotlin 100.00%
material-design android android-library timepickerdialog

android-material-ranged-time-picker-dialog's Introduction

material-ranged-time-picker-dialog

License: MIT

Setup

  • Make sure you are using material components in your default AppTheme i.e your AppTheme inherits from a material theme
  • In project-level build.gradle:
  allprojects {
  	repositories {
          // ...
          maven { url 'https://jitpack.io' }
      }
  }
  • In your app-level build.gradle file:
implementation 'com.github.ashiqursuperfly:Android-Material-Ranged-Time-Picker-Dialog:x.x.x'

Make sure you use the latest release version, this project adheres to Semantic Versioning.

Usage

val dialog = TimeRangePickerDialog(
    startLabel = "START",
    endLabel = "END",
    is24HourView = false,
    onPickedTimeTime = object : TimeRangePickerDialog.OnPickedTimeRange {
        override fun onPickedTime(
            startHour: Int,
            startMinute: Int,
            endHour: Int,
            endMinute: Int
        ) {
            val str = "${startHour}:${startMinute} ${endHour}:${endMinute}"
            text_view.text = str
        }

    }
)
// now you can apply slight modifications to the dialog like you can do for any dialog e.g:
d.isCancelable = false
// finally just show the dialog when you want with
d.show(supportFragmentManager, "my-dialog-tag-string")

Contributing

  • Create an issue with appropriate description (explain which behaviour you want to change)
  • Add either one of the following labels: bug, enhancement, documentation, question
  • Prefix the branch name with the issue label and issue number like so: label/number-branchName e.g: bug/3-Hour24ViewNotVisible
  • send a PR

android-material-ranged-time-picker-dialog's People

Contributors

ashiqursuperfly avatar

Stargazers

 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.