コード例 #1
0
        private void CreatelistView()
        {
            Tizen.Log.Fatal("NUI.ChannelList", "CreatelistView...");
            // Create main list.
            listView = new List();
            listView.BackgroundColor      = new Vector4(0, 8.0f / 255.0f, 12.0f / 255.0f, 0.95f);
            listView.Name                 = "All_Channel";
            listView.SizeWidth            = windowSize.Width * 0.323437f;
            listView.SizeHeight           = windowSize.Height * 0.887962f;
            listView.PreloadFrontItemSize = 1;
            listView.PreloadBackItemSize  = 1;

            // Initial main list data set.
            List <object> dataList = new List <object>();
            int           num      = (new ListItemData(listView.Name, 0)).Num;

            for (int i = 0; i < num; i++)
            {
                ListItemData data = new ListItemData(listView.Name, i);
                dataList.Add(data);
            }

            // Create main list adapter.
            SampleListAdapter mAdapter = new SampleListAdapter(dataList);

            listView.SetAdapter(mAdapter);
            listView.Focusable = true;
            listView.KeyEvent += OnKeyPressed; // Add key event handler.
            listContentLayout.AddChild(listView, new TableView.CellPosition(0, 0));
        }
コード例 #2
0
        private void GenreSelect()
        {
            Tizen.Log.Fatal("NUI.ChannelList", "GenreSelect...");
            string    selectGenre = (genreListView.GetLoadedItemView(genreListView.FocusItemIndex) as GenreListItem).Text;
            Animation animation   = new Animation();

            animation.AnimateTo(contentLayout, "colorAlpha", 1.0f, 0, 334);
            animation.AnimateTo(selectContentLayout, "PositionX", windowSize.Width * 0.344270f, 0, 500);

            animation.Finished += (obj, ee) =>
            {
                FocusManager.Instance.SetCurrentFocusView(listView);
            };

            if (titleText.Text == selectGenre)
            {
                animation.Play();
                return;
            }

            if (genreListView.GetLoadedItemView(genreSelectIndex) != null)
            {
                (genreListView.GetLoadedItemView(genreSelectIndex) as GenreListItem).Select(false);
            }

            if (genreListView.GetLoadedItemView(genreListView.FocusItemIndex) != null)
            {
                (genreListView.GetLoadedItemView(genreListView.FocusItemIndex) as GenreListItem).Select(true);
            }

            if (selectListView.GetLoadedItemView(selectViewIndex) != null)
            {
                (selectListView.GetLoadedItemView(selectViewIndex) as SelectListItem).Select(false);
            }

            selectViewIndex  = -1;
            genreSelectIndex = genreListView.FocusItemIndex;

            preSubSelectIndex = subSelectedIndex;
            playIndex         = -1;
            listView.Name     = selectGenre;
            List <object> dataList = new List <object>();
            int           num      = (new ListItemData(listView.Name, 0)).Num;

            for (int i = 0; i < num; i++)
            {
                ListItemData data = new ListItemData(listView.Name, i);
                dataList.Add(data);
                if (data.ProgramIndex == playProgramIndex)
                {
                    playIndex = i;
                }
            }

            SampleListAdapter mAdapter = new SampleListAdapter(dataList);

            mAdapter.PlayProgramIndex = playProgramIndex;
            listView.SetAdapter(mAdapter);

            titleIcon.ResourceUrl = titleIconGenre;
            titleText.Text        = selectGenre;
            animation.Play();
        }