infinitered / bluepotion

Like RedPotion, but for Android
MIT License
74 stars 18 forks source link

PotionDateTimePicker #111

Closed bmichotte closed 8 years ago

bmichotte commented 8 years ago

This PR adds DatePicker and TimePicker

# show datepicker
PotionDateTimePicker.new do |time|
  mp time.to_s
end
# show timepicker
PotionDateTimePicker.new(type: :time) do |hour, minute|
  mp "#{hour}:#{minute}"
end

There are few options like :time, :hour, ...

jamonholmgren commented 8 years ago

I'd recommend using a class method show (instead of new instantiator) to make it obvious that you're showing the picker.

# show datepicker
PotionDateTimePicker.show do |time|
  mp time.to_s
end
bmichotte commented 8 years ago

I added this method