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;
20 namespace Tizen.NUI.Components
23 /// [Draft] Defalt adapter for RecyclerView.
24 /// Managing RecycleItem and Data for RecyclerView.
26 /// <since_tizen> 8 </since_tizen>
27 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
28 [EditorBrowsable(EditorBrowsableState.Never)]
29 public class RecycleAdapter
31 private List<object> mData = new List<object>();
34 /// Create recycle item for RecyclerView.
35 /// RecyclerView will make its children using this api.
37 /// <returns>Item for RecyclerView</returns>
38 /// <since_tizen> 8 </since_tizen>
39 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
40 [EditorBrowsable(EditorBrowsableState.Never)]
41 public virtual RecycleItem CreateRecycleItem()
43 return new RecycleItem();
47 /// Bind data with recycler item.
48 /// This function is called when RecyclerItem is used again with new data.
49 /// Can update content of recycle item with new data at DataIndex of item.
51 /// <param name="item">Reused RecycleItem which needs data binding.</param>
52 /// <since_tizen> 8 </since_tizen>
53 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public virtual void BindData(RecycleItem item)
61 /// Notify when data of adapter is changed.
63 /// <since_tizen> 8 </since_tizen>
64 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
65 [EditorBrowsable(EditorBrowsableState.Never)]
68 OnDataChanged?.Invoke(this, new EventArgs());
72 /// Triggered when user called Notify().
74 /// <since_tizen> 8 </since_tizen>
75 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
76 [EditorBrowsable(EditorBrowsableState.Never)]
77 public event EventHandler<EventArgs> OnDataChanged;
80 /// Triggered when user called Notify().
82 /// <since_tizen> 8 </since_tizen>
83 /// This may be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API
84 [EditorBrowsable(EditorBrowsableState.Never)]
85 public List<object> Data