timepicker

Android: TimePicker setIs24HourView not working

做~自己de王妃 提交于 2019-12-05 07:53:20
I am trying to use the TimePicker in the 24 hour format and I am using setIs24HourView= true, but I am still not getting 24 hour format on the TimePicker. Here is my code in the onCreate of the Activity. timePicker = (TimePicker) findViewById(R.id.timePicker1); timePicker.setIs24HourView(true); I even tried timePicker.setCurrentHour(cal.HOUR_OF_DAY) after setIs24HourView, but I am not able to see the 24 hour format on the TimePicker. <TimePicker android:id="@+id/timePicker1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="110dp" /> Am I

Android - How do I change the textColor in a TimePicker?

六月ゝ 毕业季﹏ 提交于 2019-12-05 05:20:17
I'm using a TimePicker into a LinearLayout with backgroundColor = black, however, I can't see the numbers in the TimePicker, and I need the background color set to black in the layout, how can I change the textColor in the TimePicker? I already tried this with no luck: <style name="MyTimePicker" parent="@android:style/Widget.TimePicker"> <item name="android:textColor">#000000</item> </style> <style name="MyHoloTimePicker" parent="@android:style/Widget.Holo.TimePicker"> <item name="android:textColor">#000000</item> </style> I tried to assign them as styles in the TimePicker, but the Widget

Changing the title on a TimePicker?

这一生的挚爱 提交于 2019-12-05 03:51:06
I'm trying to look for a solution to change the title on a TimePicker dialog. Right now it says whatever the system time is (ex. "12:23 AM") but I want to change this to something a little more descriptive. Does anyone have any suggestions? By request. :) By TimePicker dialog do you mean the actual TimePickerDialog? Because that has a setTitle(CharSequence text) method. The TimePickerDialog is what is used in the official tutorial. http://developer.android.com/reference/android/app/AlertDialog.html#setTitle(java.lang.CharSequence) p9teufel This question is rather old, but it shows up on Google

angularjs timepicker ng-change

筅森魡賤 提交于 2019-12-05 01:47:08
问题 I am using AngularJS TimePicker (ui.bootstrap.timepicker). I would like to fire an event when the timepicker is changed. I looked for an ng-change attribute, but did not find one. My purpose is that I would like to save the changes that are made to the model when the time is changed. Right now I've used ng-model to set the model, but I cannot figure out how to notify the controller so it can perform the save (the model is serialized to localstorage). I would like to avoid the use of a "Save"

customize the style of rc-time-picker

ε祈祈猫儿з 提交于 2019-12-04 20:01:55
I am using rc-time-picker package for my project, but I have problem with customizing the style of pop-up of my time picker component. Here is the screenshot of my component: Firstly, I need to change the background-color of time item in the time li from light grey (in the screenshot) to #edeffe when time is hovered and selected . The following is my code: import React from "react"; import TimePicker from "rc-time-picker"; import "rc-time-picker/assets/index.css"; import styled from 'styled-components'; const StyledTimePicker = styled(TimePicker)` &.rc-time-picker-panel-select-option-selected{

How can i change the textcolor of my timepicker and datepicker?

北城以北 提交于 2019-12-04 19:54:25
Currently I am working on one of my first applications. In this application I have a TimePicker and a DatePicker . My current Activity has a dark background. Now I want a white textcolor in my TimePicker / DatePicker . In my layout I have defined my pickers: <DatePicker android:id="@+id/dpDateOfValue" android:calendarViewShown="false" /> <TimePicker android:id="@+id/tpTimeOfValue" /> The solution should work on 2.3 - 4.1 Use: <style name="MyHolo" parent="android:Theme.Holo.NoActionBar"> ... <item name="android:editTextColor">#000000</item> </style> to set TimePicker text color for API >= 11

Rotating Android device while viewing dialog preference with TimePicker or NumberPicker causes app crash

不羁岁月 提交于 2019-12-04 17:00:33
I've made a custom DialogPreference which uses two NumberPicker widgets on it to allow a user to select an hour of the day as well as another custom DialogPreference which allows a user to select a time of day using a TimePicker widget. As long as the dialog is not open and I rotate the screen, everything works as desired. However, if the dialog is open and the screen is rotated then the entire app crashes. I've placed break points in the onSaveInstanceState and onRestoreInstanceState methods and have verified that everything that is needed to restore the DialogPreference is in order, the

How can I capture when time changes in a TimePicker if the keyboard is being used?

眉间皱痕 提交于 2019-12-04 16:44:53
I have a widget which is a TimePicker that retrieves the time saved in a field in a database. Thing is that when the user changes the time value in the widget, this is not being saved in the database. So I came across the setOnTimeChangedListener method that works like a charm, if you are only using the plus and minus signs in the widget. It does not capture the change if you are using the keyword. Here is my code: pickedTime.setOnTimeChangedListener(new TimePicker.OnTimeChangedListener() { public void onTimeChanged(TimePicker arg0, int arg1, int arg2) { System.out.println("What time is it? "

How to restrict the bootstrap timepicker min-time and max-time?

若如初见. 提交于 2019-12-04 10:02:58
I am using bootstrap time picker by using bootstrap-timepicker.js and i want to restrict the min-time and max-time of that timepicker .Can anyone please tell me how can i achieve it. I have used following methods but nothing gonna help me out: $('input[data-role="time"]').timepicker({ showMeridian: true, minTime: { hour: 10, minute: 15 }, minuteStep: 1, showInputs: true, defaultTime: defaulttime }) And $('input[data-role="time"]').timepicker({ showMeridian: true, minTime: '10:15', minuteStep: 1, showInputs: true, defaultTime: defaulttime }) use event changeTime , check the current time, if

Android TimePicker AM/PM button not invoking onTimeChanged

扶醉桌前 提交于 2019-12-04 09:13:24
问题 I'm having some issues implementing a TimePicker in my application that allows the user to change the time of a database record prior to inserting it. The problem is that when the AM/PM button is pressed, the onTimeChanged(View, int, int) method isn't invoked. Whenever I change either the hour or minute value of the TimePicker, onTimeChanged() is called, however. Scenarios: User just clicks the AM/PM button: AM/PM is NOT updated User clicks the Hours/Minutes: Time is updated User clicks the