pakerfeldt/android-viewflow — Issue #56: TitleFlowIndicator crashes when title is too long
Author: sebastiancity
Created: 2012-01-09 09:02:00+00:00
State: open

Hi,

I am creating my calendar's weekly view based on the viewflow-example, AsyncDataFlowExample. I'm setting the title to something else and longer, specifically "Monday, January 09 2012 to Sunday, January 15 2012"

However the app crashes and I believe it's because the title is too long. How do I increase the size of the titleFlowIndicator? Is it something I have to edit inside this XML?

Or is it something I edit inside the viewflow library?

Will appreciate any advice, thank you!

Debug code:
01-09 08:40:56.535: D/AndroidRuntime(1291): Shutting down VM
01-09 08:40:56.535: W/dalvikvm(1291): threadid=1: thread exiting with uncaught exception (group=0x4001d800)
01-09 08:40:56.565: E/AndroidRuntime(1291): FATAL EXCEPTION: main
01-09 08:40:56.565: E/AndroidRuntime(1291): java.lang.NullPointerException
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.graphics.Paint.native_measureText(Native Method)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.graphics.Paint.measureText(Paint.java:1037)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at org.taptwo.android.widget.TitleFlowIndicator.calcBounds(TitleFlowIndicator.java:308)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at org.taptwo.android.widget.TitleFlowIndicator.calculateAllBounds(TitleFlowIndicator.java:283)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at org.taptwo.android.widget.TitleFlowIndicator.onDraw(TitleFlowIndicator.java:151)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.View.draw(View.java:6740)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.drawChild(ViewGroup.java:1638)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.View.draw(View.java:6743)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.widget.FrameLayout.draw(FrameLayout.java:352)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.drawChild(ViewGroup.java:1640)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewGroup.dispatchDraw(ViewGroup.java:1367)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.View.draw(View.java:6743)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.widget.FrameLayout.draw(FrameLayout.java:352)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at com.android.internal.policy.impl.PhoneWindow$DecorView.draw(PhoneWindow.java:1842)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewRoot.draw(ViewRoot.java:1407)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewRoot.performTraversals(ViewRoot.java:1163)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.view.ViewRoot.handleMessage(ViewRoot.java:1727)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.os.Looper.loop(Looper.java:123)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at android.app.ActivityThread.main(ActivityThread.java:4627)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at java.lang.reflect.Method.invokeNative(Native Method)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at java.lang.reflect.Method.invoke(Method.java:521)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
01-09 08:40:56.565: E/AndroidRuntime(1291):	at dalvik.system.NativeStart.main(Native Method)