示例#1
0
        public void RecyclerViewItemStyleConstructor()
        {
            tlog.Debug(tag, $"RecyclerViewItemStyleConstructor START");

            var style = new RecyclerViewItemStyle()
            {
                BackgroundColor = Color.Cyan,
            };

            var testingTarget = new RecyclerViewItemStyle(style);

            Assert.IsNotNull(testingTarget, "null handle");
            Assert.IsInstanceOf <RecyclerViewItemStyle>(testingTarget, "Should return RecyclerViewItemStyle instance.");

            testingTarget.IsEnabled = true;
            tlog.Debug(tag, "IsEnabled : " + testingTarget.IsEnabled);

            testingTarget.IsSelectable = true;
            tlog.Debug(tag, "IsSelectable : " + testingTarget.IsSelectable);

            testingTarget.IsSelected = false;
            tlog.Debug(tag, "IsSelected : " + testingTarget.IsSelected);

            testingTarget.IsSelected = true;
            tlog.Debug(tag, "IsSelected : " + testingTarget.IsSelected);

            tlog.Debug(tag, $"RecyclerViewItemStyleConstructor END (OK)");
        }
示例#2
0
        public void RecyclerViewItemConstructorWithItemStyle()
        {
            tlog.Debug(tag, $"RecyclerViewItem START");

            var style = new RecyclerViewItemStyle()
            {
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = new Color(1, 1, 1, 1),
                    Pressed  = new Color(0.85f, 0.85f, 0.85f, 1),
                    Disabled = new Color(0.70f, 0.70f, 0.70f, 1),
                    Selected = new Color(0.701f, 0.898f, 0.937f, 1),
                },
            };
            var testingTarget = new RecyclerViewItem(style);

            Assert.IsNotNull(testingTarget, "should be not null");
            Assert.IsInstanceOf <RecyclerViewItem>(testingTarget, "should be an instance of testing target class!");

            testingTarget.Dispose();
            tlog.Debug(tag, $"RecyclerViewItem END (OK)");
        }
示例#3
0
        public CollectionViewTest8Page()
        {
            InitializeComponent();
            BindingContext = new TestSourceModel(40);

            var customStyle = new RecyclerViewItemStyle()
            {
                BackgroundColor = new Selector <Color>()
                {
                    Normal   = Color.White,
                    Pressed  = Color.Red,
                    Selected = Color.Blue,
                    Disabled = Color.Grey,
                },
            };

            ColView.ItemTemplate = new DataTemplate(() =>
            {
                var item = new RecyclerViewItem(customStyle)
                {
                    WidthSpecification  = 100,
                    HeightSpecification = LayoutParamPolicies.MatchParent,
                };
                var label = new TextLabel()
                {
                    ParentOrigin           = Tizen.NUI.ParentOrigin.Center,
                    PivotPoint             = Tizen.NUI.PivotPoint.Center,
                    PositionUsesPivotPoint = true,
                };
                label.PixelSize = 30;
                label.SetBinding(TextLabel.TextProperty, "Index");
                item.Add(label);

                return(item);
            });
        }