Hi all,
I have a label with corner radius set to 20, then i want to change the color with SetColorAnimated method, the color was change but the corner radius is missing.
If i define Col1 and Col2 as ColorDrawable, it raise error
thank you
I have a label with corner radius set to 20, then i want to change the color with SetColorAnimated method, the color was change but the corner radius is missing.
B4X:
Sub Label1_Click
Dim Col1, Col2 As Int
Col1 = Colors.Red
Col2 = Colors.Green
Label1.SetColorAnimated(500, Col1, Col2)
End Sub
If i define Col1 and Col2 as ColorDrawable, it raise error
B4X:
Sub Label1_Click
Dim col1, col2 As ColorDrawable
col1.Initialize(Colors.ARGB(175,255,0,0),20dip)
col2.Initialize(Colors.ARGB(175,0,255,0),20dip)
Label1.SetColorAnimated(500, Col1, Col2)
End Sub
*** Service (starter) Create ***
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
main_label1_click (java line: 385)
java.lang.NumberFormatException: Invalid double: "(GradientDrawableWithCorners) anywheresoftware.b4a.objects.drawable.ColorDrawable$GradientDrawableWithCorners@5356ef18"
at java.lang.StringToReal.invalidReal(StringToReal.java:63)
at java.lang.StringToReal.initialParse(StringToReal.java:114)
at java.lang.StringToReal.parseDouble(StringToReal.java:263)
at java.lang.Double.parseDouble(Double.java:295)
at anywheresoftware.b4a.BA.ObjectToNumber(BA.java:662)
at b4a.example.main._label1_click(main.java:385)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:191)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:175)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:171)
at anywheresoftware.b4a.objects.ViewWrapper$1.onClick(ViewWrapper.java:80)
at android.view.View.performClick(View.java:4084)
at android.view.View$PerformClick.run(View.java:16966)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4745)
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:786)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
at dalvik.system.NativeStart.main(Native Method)
thank you