Skip to content
This repository has been archived by the owner on Dec 28, 2023. It is now read-only.

CircleListView within CarouselView crashes when the ListView has been swiped away before the animation ends #364

Closed
KieronQuinn opened this issue May 8, 2021 · 12 comments · Fixed by #369
Labels
bug Something isn't working

Comments

@KieronQuinn
Copy link

Describe the bug
When using one (or more) CircleListView within a CarouselView, if the user swipes away from the focused CircleListview while the animation is still running (ie. they scroll by swipe or rotary action then swipe away), the app will hard crash with a NullReferenceException.

To Reproduce
Steps to reproduce the behavior:

  1. Create a CarouselView containing two 'pages', containing one or more CircleListView (my setup has the second page with a CircleListView, the first page is dynamic between a CircleScrollView and a CircleListVIew)
  2. Open the app and swipe to the second page
  3. Scroll up and down a few times, then swipe off the page back to the first.
  4. The app will crash with the following exception:
System.NullReferenceException: Object reference not set to an instance of an object.
   at Tizen.Wearable.CircularUI.Forms.Renderer.CircleListViewRenderer.OnScrollAnimationStopped(Object sender, EventArgs args)

Expected behavior
The page should be swiped away without issue

Screenshots
First page (scrollview)
Second page (circlelistview)

Environment (please complete the following information):

  • Target Product: Galaxy Watch Active 2
  • Tizen Platform Version: 5.5.0.2
  • Tizen.CircularUI Version: 1.5.3
@KieronQuinn KieronQuinn added the bug Something isn't working label May 8, 2021
@EmilAlipiev
Copy link
Contributor

Exactly my problem. Looks like no fix yet for it. Did you find a workaround for this? maybe Some thread.sleep or?

@EmilAlipiev
Copy link
Contributor

@rookiejava you know if we can find a solution for this? :) just tagging in case if you have missed it thanks

@KieronQuinn
Copy link
Author

Exactly my problem. Looks like no fix yet for it. Did you find a workaround for this? maybe Some thread.sleep or?

Nope. I actually abandoned my whole Tizen project entirely and intend to switch to the new WearOS powered watch in the next couple of weeks. Tizen turned out to just be too buggy and annoying to develop on.

@EmilAlipiev
Copy link
Contributor

EmilAlipiev commented Aug 26, 2021

Too bad Tizen has such potential i am doing WearOS also and i find I can complete a task with Tizen even faster as it supports XF but it has too less support unfortunately. One thing also good existing TIzen apps are working on Samsung Watch 4 now.

@EmilAlipiev
Copy link
Contributor

Regarding the error, I tried to override OnScrollAnimationStopped with some null controls but somehow it doesnt help and below exception is still fired. I am guessing that it occurs within the Core or somewhere else.


  public class MyCustomListViewRenderer : CircleListViewRenderer
    {
        new MyCustomListView Element => base.Element as MyCustomListView;

        protected override void OnElementReady()
        {
            base.OnElementReady();
            Control.ScrollAnimationStopped += OnScrollAnimationStopped;
        }

        private void OnScrollAnimationStopped(object sender, EventArgs arrgs)
        {
            if (Control == null || Element == null)
                return;

            GenListItem item = Control.GetItemByPosition(180, 180, out int pos);
            if (item == null)
                return;

            if (item.Data is NListView.ItemContext itemContext && itemContext != null && pos == 0)
            {
                var obj = itemContext.Cell?.BindingContext;
                if (obj != null)
                {
                    var index = Element.TemplatedItems.GetGlobalIndexOfItem(obj);
                    Log.Debug("TEST", $"Item index: {index}");
                    Element.NotifyHighlightedItem(obj, index);
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && Control != null)
            {
                Control.ScrollAnimationStopped -= OnScrollAnimationStopped;
            }
            base.Dispose(disposing);
        }
    }
System.NullReferenceException: Object reference not set to an instance of an object.   
 at Tizen.Wearable.CircularUI.Forms.Renderer.CircleListViewRenderer.OnScrollAnimationStopped(Object sender, EventArgs args)   
 at ElmSharp.SmartEvent.SendEvent(Object sender, EventArgs e)  
 at ElmSharp.SmartEvent`1.<>c__DisplayClass12_0.<add_On>b__0(IntPtr d, IntPtr o, IntPtr e) 
 at Tizen.Applications.CoreBackend.UICoreBackend.Run(String[] args)    at Tizen.Applications.CoreApplication.Run(String[] args)  
 at Tizen.Applications.CoreUIApplication.Run(String[] args)   
 at myWorkoutAccessoryC.Program.Main(String[] args) Fatal error. 

@KieronQuinn
Copy link
Author

One thing also good existing TIzen apps are working on Samsung Watch 4 now.

I don't think this is the case, WearOS doesn't run Tizen apps. We're actually seeing companies port the apps, they're not using the same code.

@EmilAlipiev
Copy link
Contributor

I am not sure in general wearos but when you create a new tizen app and want to publish via Samsung developer Portal, there is option to publish for watch 4 and active 4 as well. So I mean samsung watch 4 with wearos is able to run tizen apps.

@rookiejava
Copy link
Contributor

Nope. I actually abandoned my whole Tizen project entirely and intend to switch to the new WearOS powered watch in the next couple of weeks. Tizen turned out to just be too buggy and annoying to develop on.

My Bad. I'm sorry to check this issue too late. We will check and get back as soon as possible.
(/cc @shyunMin @sung-su @JoonghyunCho )

you know if we can find a solution for this? :) just tagging in case if you have missed it thanks

Thank you for reminding me. :-)

@shyunMin
Copy link
Collaborator

shyunMin commented Sep 8, 2021

Hello @KieronQuinn, sorry again for the late answer.
We tested a scenario like you said with CarouselView, ScrollView and CircleListView, and the issue is not reproduced on an emulator, unfortunately. We will test it on the target product as soon as we get to find one.

@KieronQuinn
Copy link
Author

I vaguely recall that it might have worked in the emulator but not on device, but I was unable to get an internet connection to work on the emulator so it was hard to test.

@shyunMin
Copy link
Collaborator

Hello @KieronQuinn,
I've checked the issue and pushed the patch to fix it. I'll let you know as soon as a new package applied the change is published.
Thanks for reporting the issue.

@shyunMin
Copy link
Collaborator

Just in case you missed. Fixed package has been released! Thanks.
https://github.com/Samsung/Tizen.CircularUI/releases/tag/release-1.5.4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants