Esempio n. 1
0
        public void Activate()
        {
            Window.Instance.BackgroundColor = Color.White;
            root            = new SampleLayout(false);
            root.HeaderText = "FlexibleView";

            flexibleView1                 = new Tizen.NUI.CommonUI.FlexibleView();
            flexibleView1.Name            = "FlexibleView1";
            flexibleView1.Position2D      = new Position2D(300, 20);
            flexibleView1.Size2D          = new Size2D(400, 450);
            flexibleView1.Padding         = new Extents(10, 10, 10, 10);
            flexibleView1.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            List <ListItemData> dataList = new List <ListItemData>();

            for (int i = 0; i < 131; ++i)
            {
                dataList.Add(new ListItemData(i));
            }
            adapter = new ListBridge(dataList);
            flexibleView1.SetAdapter(adapter);

            LinearLayoutManager layoutManager1 = new LinearLayoutManager(LinearLayoutManager.VERTICAL);

            //GridLayoutManager layoutManager1 = new GridLayoutManager(3, LinearLayoutManager.VERTICAL);
            flexibleView1.SetLayoutManager(layoutManager1);

            root.Add(flexibleView1);

            scrollBar1            = new ScrollBar("DAScrollbar");
            scrollBar1.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar1.Position2D = new Position2D(394, 2);
            scrollBar1.Size2D     = new Size2D(4, 446);
            scrollBar1.ThumbSize  = new Size2D(4, 30);
            flexibleView1.AttachScrollBar(scrollBar1);


            flexibleView2                 = new Tizen.NUI.CommonUI.FlexibleView();
            flexibleView2.Name            = "FlexibleView2";
            flexibleView2.Position2D      = new Position2D(150, 520);
            flexibleView2.Size2D          = new Size2D(700, 200);
            flexibleView2.Padding         = new Extents(10, 10, 10, 10);
            flexibleView2.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.4f);

            flexibleView2.SetAdapter(adapter);

            GridLayoutManager layoutManager2 = new GridLayoutManager(3, LinearLayoutManager.HORIZONTAL);

            flexibleView2.SetLayoutManager(layoutManager2);

            root.Add(flexibleView2);

            scrollBar2            = new ScrollBar("DAScrollbar");
            scrollBar2.Position2D = new Position2D(2, 194);
            scrollBar2.Size2D     = new Size2D(696, 4);
            scrollBar2.ThumbSize  = new Size2D(30, 4);
            flexibleView2.AttachScrollBar(scrollBar2);
        }
Esempio n. 2
0
        protected override void OnCreate()
        {
            base.OnCreate();

            var examples = from type in Assembly.GetEntryAssembly().GetTypes()
                           where typeof(IExample).GetTypeInfo().IsAssignableFrom(type) && type.Namespace == this.GetType().Namespace &&
                           type != this.GetType() && type.GetTypeInfo().IsClass
                           orderby type.Name ascending
                           select type.Name;

            //RunSample("NuiCommonUiSamples", "ContactCardsSample");

            naviFrame = new Tizen.FH.NUI.Controls.NaviFrame("DefaultNaviFrame");
            Tizen.FH.NUI.Controls.Header head = new Tizen.FH.NUI.Controls.Header("DefaultHeader");
            head.BackgroundColor = Color.Yellow;
            head.HeaderText      = "CommonUI Samples";

            contentList            = new Tizen.NUI.CommonUI.FlexibleView();
            contentList.Name       = "Sample List";
            contentList.Position2D = new Position2D(0, 1);
            contentList.Size2D     = new Size2D(1080, 1790);
            //contentList.Size2D = new Size2D(1080, 896);
            contentList.Padding         = new Extents(0, 8, 0, 0);
            contentList.BackgroundColor = new Color(0, 0, 0, 0.2f);
            contentList.ItemClickEvent += OnListItemClickEvent;

            List <NaviListItemData2> dataList = new List <NaviListItemData2>();

            for (int i = 0; i < examples.Count(); ++i)
            {
                dataList.Add(new NaviListItemData2(examples.ElementAt(i)));
            }
            adapter = new NaviListBridge2(dataList);
            contentList.SetAdapter(adapter);

            LinearLayoutManager layoutManager = new LinearLayoutManager(LinearLayoutManager.VERTICAL);

            contentList.SetLayoutManager(layoutManager);

            scrollBar            = new ScrollBar("DAScrollbar");
            scrollBar.Direction  = ScrollBar.DirectionType.Vertical;
            scrollBar.Position2D = new Position2D(1074, 2);
            scrollBar.Size2D     = new Size2D(4, 1786);
            //scrollBar.Size2D = new Size2D(4, 894);
            scrollBar.ThumbSize = new Size2D(4, 30);
            contentList.AttachScrollBar(scrollBar);

            naviFrame.NaviFrameItemPush(head, contentList);

            backNavigation                 = new Tizen.FH.NUI.Controls.Navigation("Back");
            backNavigation.Position2D      = new Position2D(0, 950);
            backNavigation.ItemTouchEvent += OnBackNaviTouchEvent;

            Tizen.FH.NUI.Controls.Navigation.NavigationItemData backItem = new Tizen.FH.NUI.Controls.Navigation.NavigationItemData("WhiteBackItem");
            backNavigation.AddItem(backItem);

            Window.Instance.KeyEvent += Instance_Key;

            Activate();
            sampleStack.Push(this);
        }