1 /* Copyright (c) 2020 Samsung Electronics Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
17 using System.Collections.Generic;
18 using System.ComponentModel;
19 using Tizen.NUI.Components;
21 namespace Tizen.NUI.Wearable
24 /// [Draft] Defalt adapter for RecyclerView.
25 /// Managing RecycleItem and Data for RecyclerView.
27 /// <since_tizen> 8 </since_tizen>
28 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
29 [EditorBrowsable(EditorBrowsableState.Never)]
30 public class RecycleAdapter
32 private List<object> mData = new List<object>();
35 /// Create recycle item for RecyclerView.
36 /// RecyclerView will make its children using this api.
38 /// <returns>Item for RecyclerView</returns>
39 /// <since_tizen> 8 </since_tizen>
40 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
41 [EditorBrowsable(EditorBrowsableState.Never)]
42 public virtual RecycleItem CreateRecycleItem()
44 return new RecycleItem();
48 /// Bind data with recycler item.
49 /// This function is called when RecyclerItem is used again with new data.
50 /// Can update content of recycle item with new data at DataIndex of item.
52 /// <param name="item">Reused RecycleItem which needs data binding.</param>
53 /// <since_tizen> 8 </since_tizen>
54 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
55 [EditorBrowsable(EditorBrowsableState.Never)]
56 public virtual void BindData(RecycleItem item)
62 /// Notify when data of adapter is changed.
64 /// <since_tizen> 8 </since_tizen>
65 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
66 [EditorBrowsable(EditorBrowsableState.Never)]
69 OnDataChanged?.Invoke(this, new EventArgs());
73 /// Triggered when user called Notify().
75 /// <since_tizen> 8 </since_tizen>
76 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
77 [EditorBrowsable(EditorBrowsableState.Never)]
78 public event EventHandler<EventArgs> OnDataChanged;
81 /// Triggered when user called Notify().
83 /// <since_tizen> 8 </since_tizen>
84 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
85 [EditorBrowsable(EditorBrowsableState.Never)]
86 public List<object> Data