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.
16 using Tizen.NUI.BaseComponents;
17 using Tizen.NUI.Components;
18 using System.Collections.Generic;
19 using System.ComponentModel;
22 namespace Tizen.NUI.Wearable
25 /// [Draft] Defalt layout manager for RecyclerView.
26 /// Lay out RecycleItem and recycle RecycleItem.
28 /// <since_tizen> 8 </since_tizen>
29 [Obsolete("This has been deprecated in API12")]
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public class RecycleLayoutManager
34 /// Enumeration for the direction in which the content is laid out
36 /// <since_tizen> 8 </since_tizen>
37 [Obsolete("This has been deprecated in API12")]
38 [EditorBrowsable(EditorBrowsableState.Never)]
39 public enum Orientation
44 /// <since_tizen> 8 </since_tizen>
45 [Obsolete("This has been deprecated in API12")]
46 [EditorBrowsable(EditorBrowsableState.Never)]
51 /// <since_tizen> 8 </since_tizen>
52 [Obsolete("This has been deprecated in API12")]
53 [EditorBrowsable(EditorBrowsableState.Never)]
58 /// Container which contains RecycleItems.
60 /// <since_tizen> 8 </since_tizen>
61 [Obsolete("This has been deprecated in API12")]
62 [EditorBrowsable(EditorBrowsableState.Never)]
63 public View Container { get; set; }
66 /// Size of RecycleItem.
68 /// <since_tizen> 8 </since_tizen>
69 [Obsolete("This has been deprecated in API12")]
70 [EditorBrowsable(EditorBrowsableState.Never)]
71 public Size ItemSize { get; set; } = new Size();
74 /// Get/Set the orientation in the layout.
76 /// <since_tizen> 8 </since_tizen>
77 [Obsolete("This has been deprecated in API12")]
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public Orientation LayoutOrientation { get; set; } = Orientation.Vertical;
82 /// How far can you reach the next item.
84 /// <since_tizen> 8 </since_tizen>
85 [Obsolete("This has been deprecated in API12")]
86 [EditorBrowsable(EditorBrowsableState.Never)]
87 public float StepSize { get; protected set; }
90 /// How far can you reach the next item.
92 /// <since_tizen> 8 </since_tizen>
93 [Obsolete("This has been deprecated in API12")]
94 [EditorBrowsable(EditorBrowsableState.Never)]
95 public int DataCount { get; set; }
98 /// The last scrolled position which is calculated by ScrollableBase. The value should be updated in the Recycle() method.
100 [Obsolete("This has been deprecated in API12")]
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 protected float PrevScrollPosition { get; set; }
105 /// This is called to find out where items are lain out according to current scroll position.
107 /// <param name="scrollPosition">Scroll position which is calculated by ScrollableBase</param>
108 /// <since_tizen> 8 </since_tizen>
109 [Obsolete("This has been deprecated in API12")]
110 [EditorBrowsable(EditorBrowsableState.Never)]
111 public virtual void Layout(float scrollPosition)
117 /// This is called to find out how much container size can be.
119 /// <since_tizen> 8 </since_tizen>
120 [Obsolete("This has been deprecated in API12")]
121 [EditorBrowsable(EditorBrowsableState.Never)]
122 public virtual float CalculateLayoutOrientationSize()
128 /// This is called to find out which items should be recycled according to current scroll position.
130 /// <param name="scrollPosition">Scroll position which is calculated by ScrollableBase</param>
131 /// <returns>List of RecycleItems which should be recycled.</returns>
132 /// <since_tizen> 8 </since_tizen>
133 [Obsolete("This has been deprecated in API12")]
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 public virtual List<RecycleItem> Recycle(float scrollPosition)
137 return new List<RecycleItem>();
141 /// Adjust scrolling position by own scrolling rules.
143 /// <param name="scrollPosition">Scroll position which is calculated by ScrollableBase</param>
144 /// <since_tizen> 8 </since_tizen>
145 [Obsolete("This has been deprecated in API12")]
146 [EditorBrowsable(EditorBrowsableState.Never)]
147 public virtual float CalculateCandidateScrollPosition(float scrollPosition)
149 return scrollPosition;
153 /// Gets the next keyboard focusable view in this control towards the given direction.<br />
154 /// A control needs to override this function in order to support two dimensional keyboard navigation.<br />
156 /// <param name="currentFocusedView">The current focused view.</param>
157 /// <param name="direction">The direction to move the focus towards.</param>
158 /// <param name="loopEnabled">Whether the focus movement should be looped within the control.</param>
159 /// <returns>The next keyboard focusable view in this control or an empty handle if no view can be focused.</returns>
160 [Obsolete("This has been deprecated in API12")]
161 [EditorBrowsable(EditorBrowsableState.Never)]
162 public virtual View RequestNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled)