android-timepicker

Appcompatactivity with custom native (not compatibility) dialogpreference containing a TimePicker

断了今生、忘了曾经 提交于 2019-12-24 10:36:41
问题 I am building a preferences / settings screen inside an Android AppCompatActivity . One requirement is a custom [DialogPreference][1] with a TimePicker . The DialogPreference must be 'native', meaning not the compatibility version like described here and here. The code for the AppCompatActivity: ... public class SettingsActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity

Creating TimePickerDialog with custom style in Android

萝らか妹 提交于 2019-12-23 12:53:24
问题 I'd like to create a DialogFragment or a Dialog with a TimePicker inside, just like in the following image. The problem is that my application is using the Holo.Light theme and then from there, I'm customizing it, but I can't find anything related to TimePicker . Is it possible to assign a custom style to a TimePicker ? I haven't found anything in the official Android documentation. The following image is what I got so far, but still the TimePicker isn't in the color I want (it's the same

Android - How to programmatically change timepicker mode?

亡梦爱人 提交于 2019-12-23 07:38:07
问题 I had a look at this answer but using the APIs timepickerdialog (code below) I would like to set timePickerMode property in my class .java is it possible? public static class TimePickerFragment extends DialogFragment implements TimePickerDialog.OnTimeSetListener { @Override public Dialog onCreateDialog(Bundle savedInstanceState) { // Use the current time as the default values for the picker final Calendar c = Calendar.getInstance(); int hour = c.get(Calendar.HOUR_OF_DAY); int minute = c.get

How to set range of Time Picker Dialog in android in kotlin?

给你一囗甜甜゛ 提交于 2019-12-23 05:40:17
问题 I have a function for time picker dialog as follows: private fun showStartingTimeDialog() { val hr = 9 val mn = 0 val startingTimeListener = TimePickerDialog.OnTimeSetListener { _, _, _ -> /* no time setting */ } TimePickerDialog(this, startingTimeListener, hr, mn, false).show() } I want to restrict the selection between 8am and 10am, meaning that the user can only slide the hand of clock between this range, how to do that? 来源: https://stackoverflow.com/questions/56526133/how-to-set-range-of

Changing TimePickerDialog Styles

大憨熊 提交于 2019-12-23 02:52:15
问题 I want to change the style of my TimePicker but I can't get to change the color of the clock face and the header background. Here's my XML style code - <style name="DateTimeDialog" parent="Theme.AppCompat.Dialog"> <item name="android:colorBackground">@color/colorWhite</item> <item name="android:textColorPrimary">#000000</item> <item name="android:headerBackground">#000000</item> <item name="android:textColorSecondary">#000000</item> <item name="android:button">@color/colorWhite</item> <item

How to set Maxmum and minimum time in Time picker?

半腔热情 提交于 2019-12-22 08:34:44
问题 i have time interval 12:00 PM to 12:00 AM.I want set this time interval in time picker dialog.Disable the time before 12:00 PM and after 12:00 AM in time picker.I don't know how to set time in time picker dialog.Can any one know help me to solve this issue. Time Picker private void showTimePicker(){ Time_picker time = new Time_picker(); Bundle args = new Bundle(); args.putInt("hours", c.get(Calendar.HOUR_OF_DAY)+2); args.putInt("minute", c.get(Calendar.MINUTE)+30); time.setArguments(args);

Date and time picker in one view

半世苍凉 提交于 2019-12-22 08:24:00
问题 I wanted to know whether we can implement both date and time picker in one view... In our iPhone app you can pick both date and time through one view. But in Android we have date picker and time picker used separately. Is there any method by which I can get values of both date and time from one view? 回答1: There is no built in widget that implements both a date and time picker. However, you can create your own custom view for that, perhaps combining the existing DatePicker and TimePicker . 来源:

android how to get an date picker & time picker throgh image button click

一曲冷凌霜 提交于 2019-12-20 07:31:48
问题 Main thing is to set listadapter for ListActivity I used differnent adapter class(TaskAdapter.java) where I override the getview() and in there i write the code foe checkbox, textview & imageview. TextView & checkbox click events & checkedchange working & ImageViews click event also working. But problm is that i am trying to open DatePicker on click of ImageView but it shows an error below in snapshot. my code is here,, HomeActivity package com.v3.todo; import java.util.ArrayList; import java

How to turn off keyboard icon at TimePicker?

寵の児 提交于 2019-12-19 04:16:08
问题 I have a timepicker, everything works well but the problem is that I can't make it look like designer wants. For now it looks like this: I need to hide this keyboard icon under the buttons. How can I do it? It's just a prototype, so here's only its xml: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" android:tag="ww"> <TextView

ScrollView fighting with scroll of TimePicker, Timepicker not scrolling as a result

你。 提交于 2019-12-18 15:53:37
问题 Hopefully there is a solution here, I have a XML TimePicker and ScrollView in my main.xml and with the set up the TimePicker does not scroll. If I remove the ScrollView the Timepicker will scroll just fine but obviously I need both. It seems like they are both fighting to get the touch events but it's causing problems. Here is my code: <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent"