Ejemplo n.º 1
0
        private void CreateGerneListView()
        {
            Tizen.Log.Fatal("NUI.ChannelList", "CreateGerneListView...");
            //Create genre list.
            genreListView = new List();
            genreListView.BackgroundColor      = new Vector4(8.0f / 255.0f, 12.0f / 255.0f, 15.0f / 255.0f, 0.95f);
            genreListView.Name                 = "Genre";
            genreListView.SizeWidth            = windowSize.Width * 0.344270f;
            genreListView.SizeHeight           = windowSize.Height * 0.887962f;
            genreListView.PreloadFrontItemSize = 1;
            genreListView.PreloadBackItemSize  = 1;

            //Initial genre list data set.
            List <object> dataList = new List <object>();
            int           num      = (new GenreListData(0)).Num;

            for (int i = 0; i < num; i++)
            {
                GenreListData data = new GenreListData(i);
                dataList.Add(data);
            }

            //Create genre list adapter.
            GenreListAdapter mAdapter = new GenreListAdapter(dataList);

            genreListView.SetAdapter(mAdapter);
            genreListView.Focusable = true;
            genreListView.KeyEvent += OnKeyPressed; // Add key event handler
            selectContentLayout.AddChild(genreListView, new TableView.CellPosition(1, 0));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Get a View that displays the data at the specified index in the genre list.
        /// </summary>
        /// <param name="index">The index of the genre list.</param>
        /// <returns>A View corresponding to the genre list at the specified index.</returns>
        public override View GetItemView(int index)
        {
            Tizen.Log.Fatal("NUI.ChannelList", "GetItemView ... " + index);
            object        data     = GetData(index);
            GenreListData itemData = data as GenreListData;

            GenreListItem itemView = new GenreListItem();

            itemView.Text = itemData.Name;

            return(itemView);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Update View that displays the data at the specified index in the genre list when data change.
        /// </summary>
        /// <param name="index">The index of the genre list.</param>
        /// <param name="view">A View that displays the data at the specified index in the genre list.</param>
        public override void UpdateItem(int index, View view)
        {
            Tizen.Log.Fatal("NUI.ChannelList", "UpdateItem...index: " + index);
            object        data     = GetData(index);
            GenreListData itemData = data as GenreListData;

            GenreListItem itemView = view as GenreListItem;

            if (itemView != null)
            {
                itemView.Text = itemData.Name;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Update View that displays the data at the specified index in the genre list when focus change.
        /// </summary>
        /// <param name="index">The index of the genre list.</param>
        /// <param name="view">A View that displays the data at the specified index in the genre list.</param>
        /// <param name="flagFocused">True means the item state change to focus, false means the item state change to unfocus.</param>
        public override void FocusChange(int index, View view, bool flagFocused)
        {
            Tizen.Log.Fatal("NUI.ChannelList", "FocusChange... index:" + index + ", flagFocused: " + flagFocused);

            object        data     = GetData(index);
            GenreListData itemData = data as GenreListData;

            GenreListItem itemView = view as GenreListItem;

            if (itemView != null)
            {
                itemView.Focus(flagFocused);
            }
        }