numberpicker

Android numberpicker theme (plus minus buttons)

谁都会走 提交于 2019-12-07 10:23:22
问题 I would like to change the NumberPicker theme, instead of the three value theme (eg: value 10): 9 10 11 I would like to have the plus and the minus button and the numer 10 in the middle. I read this: http://developer.android.com/reference/android/widget/NumberPicker.html I should change only the theme, to obtain what I wish. But how? I can't set the theme in my fragment: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android

Texts in NumberPicker are cut off

假如想象 提交于 2019-12-07 08:57:07
问题 I have dialog with NumberPicker security questions. The long texts are cut off. How to solve this issue? This is layout's content for dialog <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dp"> <NumberPicker android:id="@+id/numberPicker" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center

Change android numberpicker divider color

旧巷老猫 提交于 2019-12-06 11:37:00
I want to change the divider color(blue) of numberpicker shown above to transparent. I tried a lot of things like number_picker.setDividerDrawable(getResources().getDrawable(R.color.transparent)); number_picker.setShowDividers(NumberPicker.SHOW_DIVIDER_NONE); I also tried settings android:divider in xml But none of them worked Then I tried setting it using styles, but when I put the following entry in my styles, it says minimum version required is 14 and my app has minimum version 11 <style name="AppTheme" parent="@android:style/Widget.DeviceDefault.DatePicker"> <!-- All customizations that

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

前提是你 提交于 2019-12-06 09:09:29
问题 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

Catch keyboard 'Done' for NumberPicker

回眸只為那壹抹淺笑 提交于 2019-12-05 22:05:25
问题 I have an AlertDialog with just some text, a NumberPicker , an OK, and a Cancel. package org.dyndns.schep.example; import android.os.Bundler; import android.view.View; import android.widget.NumberPicker; import android.app.Activity; import android.app.AlertDialog; import android.app.Dialog; import android.app.DialogFragment; import android.content.DialogInterface; public class FooFragment extends DialogFragment { @Override public void onAttach(Activity activity) { super.onAttach(activity);

Texts in NumberPicker are cut off

寵の児 提交于 2019-12-05 17:29:29
I have dialog with NumberPicker security questions. The long texts are cut off. How to solve this issue? This is layout's content for dialog <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:padding="10dp"> <NumberPicker android:id="@+id/numberPicker" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_gravity="center_horizontal" android:layout_marginBottom="10dp" /> <com.aperto.ext.edekaapp.ui.CustomFontButton android:id="@

Android numberpicker theme (plus minus buttons)

荒凉一梦 提交于 2019-12-05 12:00:58
I would like to change the NumberPicker theme, instead of the three value theme (eg: value 10): 9 10 11 I would like to have the plus and the minus button and the numer 10 in the middle. I read this: http://developer.android.com/reference/android/widget/NumberPicker.html I should change only the theme, to obtain what I wish. But how? I can't set the theme in my fragment: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/gradient

How to change Number Picker center text color in Android

巧了我就是萌 提交于 2019-12-05 05:47:06
I have implemented a custom Date Picker wherein I need to have custom colors for the number picker (Date picker uses Number picker inside) inside it as follows: With the help of this answer I could make it look like this: But as you see the actual date is getting shown in the yellow color instead of white. Moreover, I tried doing it at run time like this: npMonth.setOnValueChangedListener(new OnValueChangeListener() { @Override public void onValueChange(NumberPicker picker, int oldVal, int newVal) { EditText et = ((EditText) npMonth.getChildAt(0)); et.setTextColor(getResources().getColor(R

Custom Date Time picker using NumberPicker and FragmentDialog in android

喜欢而已 提交于 2019-12-04 21:26:56
I want to a custom Date Time Picker Dialog exactly as shown in the image. In my project this is dialog is shown when clicked on a TextView which is in a Fragment . I know that I need to use NumberPickers which populates the dates From Current date till all the dates next week. The default android date and time pickers doesnt fit my required so I need to create my own custom `DateTimePicker fragmentDialog'. My required DateTimePicker <LinearLayout android:background="@color/background_default_white" style="@style/LinearPageLayout" xmlns:android="http://schemas.android.com/apk/res/android">

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