Samsung / Tizen.CircularUI

Tizen Wearable CircularUI project is to develop an open source software motivate software developer to creating Tizen Wearable Xamarin Forms app more easily and efficiently.
Other
80 stars 32 forks source link

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

Closed abussl closed 4 years ago

abussl commented 4 years ago

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):

myroot commented 4 years ago

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

myroot commented 4 years ago

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

myroot commented 4 years ago

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;
                            })
                        }
                    }
                }
            };
        }
    }
}
abussl commented 4 years ago

Sorry (My first issue report...).

CircularUI 1.5.1 Xamarin.Forms 4.8.1269

So, i can reproduce it with these steps:

        public TextWatchApplication()
        {
            InitializeComponent();

            MainPage = new NavigationPage(new ButtonPage());
        }
<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>
myroot commented 4 years ago

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

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

myroot commented 4 years ago

It can reproduce with WatchFace app type

abussl commented 4 years ago

TizenWatchfaceListViewTest.zip

abussl commented 4 years ago

grafik

myroot commented 4 years ago

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

abussl commented 4 years ago

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

rookiejava commented 4 years ago

@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. 🙏

rookiejava commented 4 years ago

I've updated the documentation. (#349)