[NUI] Update recyclerView items and styles.
authorEverLEEst(SangHyeon Jade Lee) <dltkdgus1764@gmail.com>
Mon, 29 Mar 2021 11:22:06 +0000 (20:22 +0900)
committerdongsug-song <35130733+dongsug-song@users.noreply.github.com>
Thu, 1 Apr 2021 01:07:37 +0000 (10:07 +0900)
test/Tizen.NUI.Samples/Tizen.NUI.Samples/Samples/CollectionViewDemo/CollectionViewLinearSample.cs

index 693cf1e..e252842 100755 (executable)
@@ -32,32 +32,36 @@ namespace Tizen.NUI.Samples
                 ItemTemplate = new DataTemplate(() =>
                 {
                     var rand = new Random();
-                    RecyclerViewItem item = new RecyclerViewItem();
-                    item.WidthSpecification = LayoutParamPolicies.MatchParent;
-                    item.HeightSpecification = 100;
-                    item.BackgroundColor = new Color((float)rand.NextDouble(), (float)rand.NextDouble(), (float)rand.NextDouble(), 1);
-                    /*
                     DefaultLinearItem item = new DefaultLinearItem();
                     //Set Width Specification as MatchParent to fit the Item width with parent View.
                     item.WidthSpecification = LayoutParamPolicies.MatchParent;
+
                     //Decorate Label
                     item.Label.SetBinding(TextLabel.TextProperty, "ViewLabel");
                     item.Label.HorizontalAlignment = HorizontalAlignment.Begin;
+
+                    //Decorate SubLabel
+                    if ((rand.Next() % 2) == 0)
+                    {
+                        item.SubLabel.SetBinding(TextLabel.TextProperty, "Name");
+                        item.SubLabel.HorizontalAlignment = HorizontalAlignment.Begin;
+                    }
+
                     //Decorate Icon
                     item.Icon.SetBinding(ImageView.ResourceUrlProperty, "ImageUrl");
-                    item.Icon.WidthSpecification = 80;
-                    item.Icon.HeightSpecification = 80;
+                    item.Icon.WidthSpecification = 48;
+                    item.Icon.HeightSpecification = 48;
+
                     //Decorate Extra RadioButton.
                     //[NOTE] This is sample of RadioButton usage in CollectionView.
                     // RadioButton change their selection by IsSelectedProperty bindings with
                     // SelectionChanged event with SingleSelection ItemSelectionMode of CollectionView.
-                    // be aware of there are no RadioButtonGroup. 
+                    // be aware of there are no RadioButtonGroup.
                     item.Extra = new RadioButton();
                     //FIXME : SetBinding in RadioButton crashed as Sensitive Property is disposed.
                     //item.Extra.SetBinding(RadioButton.IsSelectedProperty, "Selected");
-                    item.Extra.WidthSpecification = 80;
-                    item.Extra.HeightSpecification = 80;
-                    */
+                    item.Extra.WidthSpecification = 48;
+                    item.Extra.HeightSpecification = 48;
 
                     return item;
                 }),