/// <summary> /// Update View that displays the data at the specified index in the sub list when data change. /// </summary> /// <param name="index">The index of the sub list.</param> /// <param name="view">A View that displays the data at the specified index in the sub list.</param> public override void UpdateItem(int index, View view) { Tizen.Log.Fatal("NUI.ChannelList", "UpdateItem..., index: " + index); object data = GetData(index); SubListData itemData = data as SubListData; SubListItem itemView = view as SubListItem; if (itemView != null) { itemView.Text = itemData.Text; if (index == selectedIndex) { itemView.IconUrl = itemData.IconS; itemView.SelectedText(true); itemView.IconOpacity(true); } else { itemView.IconUrl = itemData.IconN; itemView.SelectedText(false); if (Open == false) { itemView.IconOpacity(false); } } } }
/// <summary> /// Get a View that displays the data at the specified index in the sub list. /// </summary> /// <param name="index">The index of the sub list.</param> /// <returns>A View corresponding to the sub list at the specified index.</returns> public override View GetItemView(int index) { Tizen.Log.Fatal("NUI.ChannelList", "GetItemView ... " + index); object data = GetData(index); SubListData itemData = data as SubListData; SubListItem itemView = new SubListItem(); itemView.Text = itemData.Text; if (index == selectedIndex) { itemView.IconUrl = itemData.IconS; itemView.SelectedText(true); itemView.IconOpacity(true); } else { itemView.IconUrl = itemData.IconN; itemView.SelectedText(false); if (Open == false) { itemView.IconOpacity(false); } } return(itemView); }
/// <summary> /// Update View that displays the data at the specified index in the sub list when focus change. /// </summary> /// <param name="index">The index of the sub list.</param> /// <param name="view">A View that displays the data at the specified index in the sub 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); object data = GetData(index); SubListItem itemData = data as SubListItem; SubListItem itemView = view as SubListItem; if (itemView != null) { itemView.Focus(flagFocused); } }
/// <summary> /// Unload view at the specified index when item scroll out or deleted. /// </summary> /// <param name="index">The index of the sub list.</param> /// <param name="view">A View that displays the data at the specified index in the sub list.</param> public override void UnloadItem(int index, View view) { Tizen.Log.Fatal("NUI.ChannelList", "UnloadItem... "); object data = GetData(index); SubListData itemData = data as SubListData; SubListItem itemView = view as SubListItem; if (itemView != null) { itemView.Text = itemData.Text; itemView.IconUrl = itemData.IconN; } view?.Dispose(); }