code-troopers / android-betterpickers Goto Github PK
View Code? Open in Web Editor NEW[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
[NO LONGER MAINTAINED] Android library for better Picker DialogFragments
Hi Derek,
I am planning on using your number picker, but I would like to present it with a title and possibly an icon (a bit like AlertDialog).
I am happy to implement it myself and share the code, but I would appreciate if you had any pointers on the best option to implement this.
First thing that came to my mind would be to modify the number_picker_dialog layout, and add some "customisation" methods in the NumberPickerDialogFragment and NumberPickerBuilder classes.
How does it sound ?
Many thanks for your advice.
JM
Would it be possible to add an option where the ViewPagerIndicator shows a title or label for the current tab. For someone who has played with the pickers it might be obvious, but to a new user accustomed to the stock Android Date/Time pickers the swiping functionality (i.e. to switch from day, month, year, etc) won't be as discoverable. By indicating the title (at least for the current tab) it will be more obvious to the user that they can swipe to switch between day/month/year (DatePicker) or hour/minutes (TimePicker).
There appears to be no mention of the required SDK level in order for this project to work. When first importing, as I've got the 2.2 SDK downloaded for testing, I assume the project defaulted to that as the SDK, however I needed to change it to a higher SDK level in order to compile.
Perhaps an entry stating the minimum required SDK level would be useful on the main page of this git?
Cheers for the lovely library, very snazzy :)
Could you add a v13 version similar to the support library that uses native fragments?
Hi here is one serious issue in your app.
It is easily reproducible from ur sample app.
1.Click the set button. The date picker dialog appears.
2. Change the orientation.
3.Tap any date and "done".
When all the above three steps over, you cannot see the date as be set.
please guide me to handle this issue soon..
Hi,
It seems that Calendar picker dialog does not fit on small screen sizes (320x240) and you can't tap on Done because of this (it's not visible). It affects portrait and landscape orientation as well.
Zs
I get the following stacktrace when trying to custom style my dialog:
java.lang.NullPointerException
at android.widget.TextView.setTextColor(TextView.java:2641)
at com.doomonafireball.betterpickers.datepicker.DateView.restyleViews(DateView.java:74)
at com.doomonafireball.betterpickers.datepicker.DateView.setTheme(DateView.java:69)
at com.doomonafireball.betterpickers.datepicker.DatePicker.restyleViews(DatePicker.java:189)
at com.doomonafireball.betterpickers.datepicker.DatePicker.setTheme(DatePicker.java:140)
at com.doomonafireball.betterpickers.datepicker.DatePickerDialogFragment.onCreateView(DatePickerDialogFragment.java:170)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)
at android.app.ActivityThread.main(ActivityThread.java:5017)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
at dalvik.system.NativeStart.main(Native Method)
I have the following code snippet creating a DatePicker
DatePickerBuilder dpb = new DatePickerBuilder()
.setFragmentManager(getSupportFragmentManager())
.addDatePickerDialogHandler(new DatePickerDialogFragment.DatePickerDialogHandler() {
@Override
public void onDialogDateSet(int reference, int year, int monthOfYear, int dayOfMonth) {
// Do stuff
}
})
.setStyleResId(R.style.CustomBetterPickerTheme);
dpb.show();
The following is the style:
<style name="CustomBetterPickerTheme">
<item name="bpTextColor">@color/my_orange</item>
</style>
So, as the title, I want to know if it's possible to set max date for calendar date picker.
If it's not, then how to make it possible?
For me it would make sense to have the ability to set a daterange in the datepicker. So you don't have to open two distinct dialogs and reduce user interaction.
It is impossible to select FEB 29.
I can't reproduce the bug.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.xxxx/com.xxxx.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2100)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.NullPointerException
at android.os.Parcel.readIntArray(Parcel.java:784)
at com.doomonafireball.betterpickers.numberpicker.NumberPicker$SavedState.(NumberPicker.java:564)
at com.doomonafireball.betterpickers.numberpicker.NumberPicker$SavedState.(NumberPicker.java:561)
at com.doomonafireball.betterpickers.numberpicker.a.a(NumberPicker.java:579)
at com.doomonafireball.betterpickers.numberpicker.a.createFromParcel(NumberPicker.java:1)
at android.os.Parcel.readParcelable(Parcel.java:2103)
at android.os.Parcel.readValue(Parcel.java:1965)
at android.os.Parcel.readSparseArrayInternal(Parcel.java:2255)
at android.os.Parcel.readSparseArray(Parcel.java:1687)
at android.os.Parcel.readValue(Parcel.java:2022)
at android.os.Parcel.readMapInternal(Parcel.java:2226)
at android.os.Bundle.unparcel(Bundle.java:223)
at android.os.Bundle.getSparseParcelableArray(Bundle.java:1232)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:861)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
at android.support.v4.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:1879)
at android.support.v4.app.Fragment.performCreate(Fragment.java:1490)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:893)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1086)
at android.support.v4.app.FragmentManagerImpl.dispatchCreate(FragmentManager.java:1879)
at android.support.v4.app.FragmentActivity.onCreate(FragmentActivity.java:215)
at com.yyyyy.MainActivity.onCreate(MainActivity.java:79)
at android.app.Activity.performCreate(Activity.java:5206)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1083)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2064)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2125)
at android.app.ActivityThread.access$600(ActivityThread.java:140)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1227)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
at java.lang.reflect.Method.invokeNative(Method.java)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1006)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:773)
at dalvik.system.NativeStart.main(NativeStart.java)
I don't know what the hack is going on but it's not possible to import your projects (sample + lib) into Eclipse. I mean - it's possible to import them, but they have tons of wrong dependencies.
Am I doing something wrong?
Importing the project as usual and adding it as a lib to another project.. I'd love to use your lib - it looks fabulous - but it really sucks that it can't be included as a normal lib.
Could you add an option to simply supply a context and use the context's theme to style the picker (so basically what normal dialogs do)? I have a light and a dark theme in my app and currently have to use reflection to set either the one or the other.
How could this be used as a click event from a view in every item? I want to use in place of edittext widget but can't figure it how it should be done. Any idea's?
Hi there!
I've been having trouble using BetterPickers with HoloEveryWhere. It might just be an issue from my side with setting up both BetterPickers and HoloEveryWhere libraries (I'm new to all this). I'll drop the code I have and the issue I'm getting. Any help would be greatly appreciated! So here's the code:
package com.example.myfirstapp;
import org.holoeverywhere.widget.Button;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import com.actionbarsherlock.view.Menu;
import com.actionbarsherlock.view.MenuItem;
import com.doomonafireball.betterpickers.timepicker.TimePickerBuilder;
import com.doomonafireball.betterpickers.timepicker.TimePickerDialogFragment;
public class MainActivity extends org.holoeverywhere.app.Activity implements TimePickerDialogFragment.TimePickerDialogHandler{
private Button theTime;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
theTime = (Button) findViewById(R.id.the_button);
theTime.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TimePickerBuilder tpb = new TimePickerBuilder()
.setFragmentManager(getSupportFragmentManager())
.setStyleResId(R.style.BetterPickersDialogFragment);
tpb.show();
}
});
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getSupportMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
Intent showSettings = new Intent(this, SettingsActivity.class);
startActivity(showSettings);
return true;
}
@Override
public void onDialogTimeSet(int reference, int hourOfDay, int minute) {
theTime.setText("" + hourOfDay + ":" + minute);
}
}
And here's the errors I'm getting:
06-16 15:24:24.048: E/AndroidRuntime(25989): FATAL EXCEPTION: main
06-16 15:24:24.048: E/AndroidRuntime(25989): android.view.InflateException: Binary XML file line #7: Error inflating class com.doomonafireball.betterpickers.timepicker.TimePicker
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:376)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:584)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:438)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:725)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:532)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:482)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:477)
06-16 15:24:24.048: E/AndroidRuntime(25989): at com.doomonafireball.betterpickers.timepicker.TimePickerDialogFragment.onCreateView(TimePickerDialogFragment.java:87)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1460)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:911)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1088)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1444)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:429)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.os.Handler.handleCallback(Handler.java:725)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.os.Handler.dispatchMessage(Handler.java:92)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.os.Looper.loop(Looper.java:137)
06-16 15:24:24.048: E/AndroidRuntime(25989): at android.app.ActivityThread.main(ActivityThread.java:5193)
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Method.invokeNative(Native Method)
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Method.invoke(Method.java:511)
06-16 15:24:24.048: E/AndroidRuntime(25989): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
06-16 15:24:24.048: E/AndroidRuntime(25989): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
06-16 15:24:24.048: E/AndroidRuntime(25989): at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:101)
06-16 15:24:24.048: E/AndroidRuntime(25989): at dalvik.system.NativeStart.main(Native Method)
06-16 15:24:24.048: E/AndroidRuntime(25989): Caused by: java.lang.reflect.InvocationTargetException
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Constructor.constructNative(Native Method)
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:352)
06-16 15:24:24.048: E/AndroidRuntime(25989): ... 23 more
06-16 15:24:24.048: E/AndroidRuntime(25989): Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:376)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.onCreateView(LayoutInflater.java:588)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.createViewFromTag(LayoutInflater.java:438)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:725)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.parseInclude(LayoutInflater.java:641)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.rInflate(LayoutInflater.java:715)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:532)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:482)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater.inflate(LayoutInflater.java:477)
06-16 15:24:24.048: E/AndroidRuntime(25989): at com.doomonafireball.betterpickers.timepicker.TimePicker.(TimePicker.java:70)
06-16 15:24:24.048: E/AndroidRuntime(25989): ... 26 more
06-16 15:24:24.048: E/AndroidRuntime(25989): Caused by: java.lang.reflect.InvocationTargetException
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Constructor.constructNative(Native Method)
06-16 15:24:24.048: E/AndroidRuntime(25989): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.LayoutInflater._createView(LayoutInflater.java:352)
06-16 15:24:24.048: E/AndroidRuntime(25989): ... 35 more
06-16 15:24:24.048: E/AndroidRuntime(25989): Caused by: java.lang.IllegalStateException: Could not find font in raw resources: roboto_light
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader$RawLazyFont.loadTypeface(FontLoader.java:187)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader$Font.getTypeface(FontLoader.java:52)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader$FontCollector.getTypeface(FontLoader.java:81)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader.applyInternal(FontLoader.java:296)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader.apply(FontLoader.java:273)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.FontLoader.applyDefaultFont(FontLoader.java:278)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.widget.TextView.setFontStyle(TextView.java:109)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.widget.Button.setFontStyle(Button.java:38)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.widget.TextView.setTextAppearance(TextView.java:151)
06-16 15:24:24.048: E/AndroidRuntime(25989): at org.holoeverywhere.
06-16 15:24:26.056: I/Process(25989): Sending signal. PID: 25989 SIG: 9
For example, .setPlusMinusVisibility or .setDecimalVisibilty.
Just change it to .setPlusMinusVisible(boolean isVisible) or .setDecimalVisible(boolean isVisible).
Error occurred in method:
com.doomonafireball.betterpickers.calendardatepicker.CalendarDatePickerDialog.updateDisplay(boolean)
Please fix it.
Great LIB!
Regards
I tried following the directions, which congrats, are simple enough, but for some reason this doesn't import right. I added it to my workspace in Eclipse by doing the usual (File->Import->Existing Code...) just like I did for actionbarsherlock. It showed 1059 errors. I tried changing the target API to 4.0. as instructions said, this dropped it down to 1015 errors, but still doesn't work. I lastly tried adding actionbarsherlock library to this as a library, and that dropped it down to 644 errors but still can't get it to work. FWIW, I'm using Kepler and not android studio. I've imported projects before so not sure why this isn't working. :(
Do I need to also get NineOldAndroids?
Help?
Edit: It seems like I fixed it...required to add external Jar nineoldandroids, an adding actionbarsherlock as a required library to this library
It would be great if this project had a gradle build and published .aar packages, since that is where Android develoment is headed now. I believe this issue depends on JakeWharton/ViewPagerIndicator#229 (or the duplicate issue 241) being merged, since you depend on that library.
Should add a bold 0 in the ones place.
As in the title - while using NumberPickerDialogFragment i get NPE. I debuged it and it seems that after inflating view (in onCreateView method) mSet and mCancel fields (R.id.set_button nad R.id.cancel_button) are null. Quite strange...
I get NPE when invoking mCancel.setOnClickListener.
Please see below stacktrace:
java.lang.NullPointerException
at com.doomonafireball.betterpickers.numberpicker.NumberPickerDialogFragment.onCreateView(NumberPickerDialogFragment.java:146)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1500)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:927)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:682)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1467)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:440)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method)
The Fragment crashes when embedded in a frame instead of being used as Dialog (not, Android specs allows this usage).
Instanciating...
DialogFragment newFragment = RadialTimePickerDialog.newInstance(new OnTimeSetListener() {...}
...and then launching it (first branch in case of landscape orientation):
if (hasDialogFrame) {
FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
ft.add(R.id.main_dialogs, fragment, fragment.getTag())
.setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
.commit();
} else {
...
}
Return an NPE in RadialTimePickerDialog.java
:
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
getDialog().getWindow().requestFeature(Window.FEATURE_NO_TITLE);
Because the Dialog is never created (DialogFragment.java
):
@Override
public LayoutInflater getLayoutInflater(Bundle savedInstanceState) {
if (!mShowsDialog) {
return super.getLayoutInflater(savedInstanceState);
}
Can you confirm the issue? A solution would be to remove the request in the onCreateView (that is the only method gets called in this case by the Android framework...
Thanks!
The library project is missing the asset folder. They are in the sample project instead.
Gives rise to nice errors like this :)
E/AndroidRuntime(25996): Caused by: android.view.InflateException: Binary XML file line #11: Error inflating class com.doomonafireball.betterpickers.timepicker.TimerView
E/AndroidRuntime(25996): at android.view.LayoutInflater.createView(LayoutInflater.java:613)
E/AndroidRuntime(25996): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:687)
E/AndroidRuntime(25996): at android.view.LayoutInflater.rInflate(LayoutInflater.java:746)
E/AndroidRuntime(25996): at android.view.LayoutInflater.rInflate(LayoutInflater.java:749)
E/AndroidRuntime(25996): at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
E/AndroidRuntime(25996): at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
E/AndroidRuntime(25996): at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
E/AndroidRuntime(25996): at com.doomonafireball.betterpickers.timepicker.TimePicker.(TimePicker.java:70)
E/AndroidRuntime(25996): ... 24 more
E/AndroidRuntime(25996): Caused by: java.lang.reflect.InvocationTargetException
E/AndroidRuntime(25996): at java.lang.reflect.Constructor.constructNative(Native Method)
E/AndroidRuntime(25996): at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
E/AndroidRuntime(25996): at android.view.LayoutInflater.createView(LayoutInflater.java:587)
E/AndroidRuntime(25996): ... 31 more
E/AndroidRuntime(25996): Caused by: java.lang.RuntimeException: native typeface cannot be made
E/AndroidRuntime(25996): at android.graphics.Typeface.(Typeface.java:175)
E/AndroidRuntime(25996): at android.graphics.Typeface.createFromAsset(Typeface.java:149)
E/AndroidRuntime(25996): at com.doomonafireball.betterpickers.timepicker.TimerView.(TimerView.java:31)
E/AndroidRuntime(25996): ... 34 more
Hi Derek,
you have a lovely libray, I'm trying it now to use it in my next application but I just have a small question !!!
when I have more then one button in my xml layout,in fact I need to put 2 buttons (2 Time pickers for picking departure and arrival times ).
it's working with one button but not with two or more !!!!
this is my code and I hope that you helps me please
@OverRide
public void onDialogTimeSet(int reference, int hourOfDay, int minute) {
// TODO Auto-generated method stub
Toast.makeText(getSherlockActivity(), ""+reference, Toast.LENGTH_SHORT).show();
ti_depart.setText("" + hourOfDay + ":" + minute);
//ti_arrive.setText("" + hourOfDay + ":" + minute);
}
How can specify the time for every button ????
Thanks a lot and keep up the great work!!
Javadoc is missing for every public method, this is really bad.
Hello,
I've tried to use hmsPicker in a android.support.v4.app.FragmentActivity and I used the same code as in your sample app.
btnDuration.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
HmsPickerBuilder hpb = new HmsPickerBuilder()
.setFragmentManager(getSupportFragmentManager())
.setStyleResId(R.style.BetterPickersDialogFragment_Light);
hpb.show();
}
});
However, it produce an error as below when clicked, is this normal? I've tested against 4.3 and 4.4. Could you please take a look at it? Thanks!
02-03 00:32:52.934: E/AndroidRuntime(4690): android.view.InflateException: Binary XML file line #7: Error inflating class com.doomonafireball.betterpickers.hmspicker.HmsPicker
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.createView(LayoutInflater.java:620)
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:696)
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.rInflate(LayoutInflater.java:755)
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.inflate(LayoutInflater.java:397)
02-03 00:32:52.934: E/AndroidRuntime(4690): at android.view.LayoutInflater.inflate(LayoutInflater.java:353)
02-03 00:32:52.934: E/AndroidRuntime(4690): at com.doomonafireball.betterpickers.hmspicker.HmsPickerDialogFragment.onCreateView(HmsPickerDialogFragment.java:96)
The HMS Picker allows the user to enter stuff like 99m99s, even though the "maximum" minutes and seconds is 60.
I just started using the number picker for a couple of optional fields.
If the fields are pre-populated with data, there is currently no way of allowing the user to clear the data in the field through the number picker.
Currently, the HMS picker does not allow for more than 9 hours to be entered. It'd be nice if it did. Perhaps it could just be in a HorizontalScrollView for when the digits overflow?
How could this be used as a click event from a view in every item? I want to use in place of edittext widget but can't figure it how it should be done. Any idea's?
When compiling from master:
Could not resolve dependencies for project com.doomonafireball.betterpickers:library:apklib:1.4.3-SNAPSHOT: Failure to find com.google.android:support-v4:jar:18
The last version of support-v4 on Maven Central is "r7". It would be nice if betterpickers would depend only on artifacts that can be resolved via Maven Central. (This is also a requirement for uploading it to Maven Central afaik.)
Hi there!
Is it possible to have a Better Picker in the main layout of an activity (such as with the 4.0+ time picker seen here: https://lh3.ggpht.com/LXeEbyIqY2D1f4WD9XAv8JgI_mb6hNWJ3XOjsrpZZIhEzPX2xz7ek9GBCVXWwGC2FaM)?
Thanks,
JN
Such as 1:90.
Hello,
i just found this library and it looks cool.
but i can't find a reason why it would need this in the library pom.xml
<dependency>
<groupId>com.viewpagerindicator</groupId>
<artifactId>library</artifactId>
<version>2.4.1</version>
<type>apklib</type>
</dependency>
in its pom. it does not seem to use any of the features of the viewpagerindicator library.
could you push an update that does not require this extra library?
Thanks in advance! :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.