Esempio n. 1
0
        /// <summary>
        /// Override to create the required scene
        /// </summary>
        protected override void OnCreate()
        {
            base.OnCreate();

            // Get the window instance and change background color
            Window window = Window.Instance;

            window.BackgroundColor = Color.White;

            SampleAdapter sampleAdapter = new SampleAdapter();

            sampleAdapter.Data = DummyData.CreateDummyData(50);

            recyclerView = new Tizen.NUI.Wearable.RecyclerView(sampleAdapter, new RecycleLayoutManager())
            {
                // Size = new Size(480, 800),
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.MatchParent,
            };

            window.Add(recyclerView);

            window.KeyEvent += OnKeyEvent;
        }
Esempio n. 2
0
        /// <summary>
        /// Override to create the required scene
        /// </summary>
        protected override void OnCreate()
        {
            base.OnCreate();

            // Get the window instance and change background color
            Window window = Window.Instance;

            window.BackgroundColor = new Color("#141414");

            View root = new View()
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = LayoutParamPolicies.MatchParent,
                Layout = new LinearLayout()
                {
                    LinearOrientation = LinearLayout.Orientation.Vertical,
                },
            };

            window.Add(root);

            TextLabel horizontalLabel = new TextLabel("Horizontal Grid")
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = 60,
                VerticalAlignment   = VerticalAlignment.Center,
                TextColor           = Color.White,
                Margin    = new Extents(20, 0, 10, 0),
                PointSize = 18,
            };

            root.Add(horizontalLabel);

            RecyclerView horizontalGrid = new RecyclerView()
            {
                Adapter = new SampleAdapter()
                {
                    Data = DummyData.CreateDummyPictureData(73)
                },
                LayoutManager = new GridRecycleLayoutManager()
                {
                    LayoutOrientation = RecycleLayoutManager.Orientation.Vertical,
                    Rows = 2,
                },
                ScrollingDirection  = ScrollableBase.Direction.Horizontal,
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = 240,
                TotalItemCount      = 20,
            };

            root.Add(horizontalGrid);

            TextLabel verticalLabel = new TextLabel("Vertical Grid")
            {
                WidthSpecification  = LayoutParamPolicies.MatchParent,
                HeightSpecification = 60,
                VerticalAlignment   = VerticalAlignment.Center,
                TextColor           = Color.White,
                Margin    = new Extents(20, 0, 10, 0),
                PointSize = 18,
            };

            root.Add(verticalLabel);

            RecyclerView verticalGrid = new RecyclerView()
            {
                Adapter = new SampleAdapter()
                {
                    Data = DummyData.CreateDummyPictureData(132)
                },
                LayoutManager = new GridRecycleLayoutManager()
                {
                    LayoutOrientation = RecycleLayoutManager.Orientation.Horizontal,
                    Columns           = 4,
                },
                ScrollingDirection = ScrollableBase.Direction.Vertical,
                WidthSpecification = LayoutParamPolicies.MatchParent,
                Weight             = 1,
                TotalItemCount     = 40,
            };

            root.Add(verticalGrid);

            window.KeyEvent += OnKeyEvent;
        }