FuseNativeControls

Hey guys, I’m trying to use nekronos’ FuseNativeControls (https://github.com/nekronos/FuseNativeControls).

The problem is that if the date is set like var date = { year: 2017, month: 1, day: 6 }; it shows me this

which is correct.

But if the date is var date = { year: 2017, month: 1, day: 2}; it appears like this:

file

and var date = { year: 2017, month: 1, day: 9 }; :

and var date = { year: 2016, month: 2, day: 8 }; :

So, I guess the problem here is when the day is a Monday. Have any of you bumped into this? I’m using the original code of nekronos.

As of now, I’m testing this on Android 7.0. At this moment, I don’t have access to an iOS device, so I don’t know if the behavior is the same.
Fuse version 0.32.0 (build 9613)
macOS Sierra Version 10.12.2

Thank you.

Hi!

I just tested this and can see the same behavior myself. After debugging I could not see anything going wrong in the Uno and JS code. This looks like a bug in the Native UI.

Also, this is the datepicker from Holo theme. I tested the Material theme datepicker and that worked as expected

Thank you for the answer.

So noob question, can you please tell me how I can test this with the Material Theme?

That is kinda hard to change now and we need a way for it to be configured from the *.unoproj for example.

But you can change it by replacing Holo with Material in YourProject\build\Android\Debug\YourProject\app\src\main\res\values\styles.xml

And the change will disappear between recompiles :frowning:

I’m sad to hear about it. I really needed this. :frowning:

Isn’t there any way to change the theme with uno and native code? (I’m starting at this, I don’t know yet how powerful uno with native code is and what is possible to do).

Is there any prediction when you guys will look at this? I know is may not be a priority, I just need to plan what I’m doing.

Thank you so much for your answers.

Hello again!

I remembered that I had already used this date/time picker in another app just to show how the components looked like and I didn’t test the functionality at the time. So now I did and it seems to be working fine:

Video

I have no clue why it does work here and not with the standalone app or my new app.

Do you guys have any idea how this is possible?

  • I have the same projects imported.
  • I have some extra packages on the first app, but tried to add them on the new app with no success.
  • And tried to use the files in the project of the first app on the new app and also had no success.

Thank you.

That is really strange! When implementing FuseNativeControls I cannot remember seeing anything like this. And when I tested it even happens if there is no data passed between the UI and Uno/JS. So I dont have any ideas why this bug occurs :frowning:

We have a fix for the issue with theming though. In a future release (I hope the next one) Material theme will be the default on android and other themes can be set by specifying it in the .unoproj.

Hi once again,

I have a problem with this module. I’m using an Android device with version 4.4.2. The datepicker works fine, it shows the Holo Calendar. But the timepicker gets an error while building

W/System.err(23284): java.lang.NoSuchMethodError: android.widget.TimePicker.getHour
W/System.err(23284): 	at com.foreign.Native.Android.TimePickerView.GetTime386(TimePickerView.java:35)
W/System.err(23284): 	at com.Bindings.ExternedBlockHost.GetTime386(ExternedBlockHost.java:1810)
W/System.err(23284): 	at com.fuse.ActivityNativeEntryPoints.cppOnCreate(Native Method)
W/System.err(23284): 	at com.fuse.App.onCreate(App.java:90)
W/System.err(23284): 	at com.timewax.fusetimphoneemployee.fusetimphoneemployee.onCreate(fusetimphoneemployee.java:55)
W/System.err(23284): 	at android.app.Activity.performCreate(Activity.java:5264)
W/System.err(23284): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
W/System.err(23284): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2304)
W/System.err(23284): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2392)
W/System.err(23284): 	at android.app.ActivityThread.access$800(ActivityThread.java:153)
W/System.err(23284): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1323)
W/System.err(23284): 	at android.os.Handler.dispatchMessage(Handler.java:110)
W/System.err(23284): 	at android.os.Looper.loop(Looper.java:193)
W/System.err(23284): 	at android.app.ActivityThread.main(ActivityThread.java:5305)
W/System.err(23284): 	at java.lang.reflect.Method.invokeNative(Native Method)
W/System.err(23284): 	at java.lang.reflect.Method.invoke(Method.java:515)
W/System.err(23284): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:829)
W/System.err(23284): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:645)
W/System.err(23284): 	at dalvik.system.NativeStart.main(Native Method)

I checked the Timepicker documentation, the getCurrentHour(), getCurrentMinute(),setCurrentHour(Integer currentHour) and setCurrentMinute(Integer currentMinute) methods are deprecated and where replaced by getHour(), getMinute(), setHour(int) and setMinute(int) methods, which are used in this module.

I guess this is the problem.

I’ve tried to check which Android version is being used and if it’s lower than Lollipop it would call the deprecated methods, but I had no luck, it crashes the app.

Is there any solution for this or any idea how I can solve this?