Samsung/Tizen.CircularUI

Navigation to a Page containing CircleListView throws exception if CircleSurfaceEffectBehavior is not added

abussl opened this issue · 12 comments

Describe the bug
Navigation to a Page containing CircleListView throws exception if CircleSurfaceEffectBehavior is not added

To Reproduce
Steps to reproduce the behavior:

  1. Create ContentPage
  2. Add CircleListView-Element
  3. Compile and start
  4. See error

System.NullReferenceException: Object reference not set to an instance of an object.
at ElmSharp.Wearable.CircleGenList.CreateHandle(EvasObject parent)
at ElmSharp.EvasObject.Realize(EvasObject parent)
at Xamarin.Forms.Platform.Tizen.Native.Watch.WatchListView.CreateHandle(EvasObject parent)
at ElmSharp.EvasObject.Realize(EvasObject parent)

The same with added CircleSurfaceEffectBehavior dont throw exception

Expected behavior
No exception. Show an empty list/page

Environment (please complete the following information):

  • Emulator & Device
  • Tizen [4.0.0, 5.5]
  • Tizen.CircularUI Version [1.5.1]

Normal behavior,
To use CircleListView, you must use CirclePage or BezelInteractionPage or CircleSurfaceEffectBehavior.

Did you really use CircularUI 1.5.1 version?
after 1.5.1, CircleListView can use normal Page

This code is working well with CircularUI 1.5.1

using System.Collections.Generic;

using Xamarin.Forms;
using Tizen.Wearable.CircularUI.Forms;

namespace ListViewTest
{
    public class App : Application
    {
        public App()
        {
            List<string> items = new List<string>();
            items.Add("1");
            items.Add("2");
            items.Add("3");
            items.Add("4");
            // The root page of your application
            MainPage = new ContentPage
            {
                Content = new StackLayout
                {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new CircleListView
                        {
                            ItemsSource = items,
                            ItemTemplate = new DataTemplate(() =>
                            {
                                var textCell = new TextCell();
                                textCell.SetBinding(TextCell.TextProperty, new Binding("."));
                                return textCell;
                            })
                        }
                    }
                }
            };
        }
    }
}

Sorry (My first issue report...).

CircularUI 1.5.1
Xamarin.Forms 4.8.1269

So, i can reproduce it with these steps:

  • New Watchface Project

  • Update to UI 1.5.1 & XF 4.8.1269

  • Add a Xaml ListViewPage (code below)

  • Add a Xaml ButtonPage and add a button with code behind:
    private void Button_Clicked(object sender, EventArgs e) { Navigation.PushAsync(new ListViewPage()); }

  • alter the main content in app to

        public TextWatchApplication()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new ButtonPage());
        }
  • Compile & Start
  • Press button ( Navigate to ListViewPage())
    -> Crash!
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             xmlns:c="clr-namespace:Tizen.Wearable.CircularUI.Forms;assembly=Tizen.Wearable.CircularUI.Forms"
             x:Class="TizenWatchfaceListViewTest.ListViewPage">
    <ContentPage.Behaviors>
        <c:CircleSurfaceEffectBehavior/>    <-- Crashes,  if not added
    </ContentPage.Behaviors>
    <ContentPage.Content>
        <c:CircleListView>

        </c:CircleListView>
    </ContentPage.Content>
</ContentPage>

Can't reproduce error,
Could you share your project file?

Attached files is test app it is working well
ListViewTest.zip

It can reproduce with WatchFace app type

On WatchFace type App, Default CircleSurface is not supporting
So, you need to create CircleSurface, it internally created with CirclePage, BezelInteractionPage or CircleSurfaceEffectBehavior.

Ok, but is a little bit confusing. Maybe update the docs? I read them 100 times....

@abussl Sorry for the confusion. As @myroot mentioned, it is not currently supported by the WatchFaceApp, but we will consider it to be supported. We will notify you as soon as it is updated. In addition, we will update the documentation as well. Again, I apologize for the inconvenience and thank you for your interest. 🙏

I've updated the documentation. (#349)