| | 1 | | using System; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.Builder |
| | 5 | | { |
| | 6 | | internal abstract class SectionBase : IDisposable |
| | 7 | | { |
| | 8 | | public Action OnEmptyContent; |
| | 9 | | public Action OnNotEmptyContent; |
| | 10 | |
|
| 0 | 11 | | public bool isVisible { get; private set; } = false; |
| 0 | 12 | | public virtual ISectionSearchHandler searchHandler { get; protected set; } = null; |
| 27 | 13 | | public virtual SearchBarConfig searchBarConfig { get; protected set; } = new SearchBarConfig() |
| | 14 | | { |
| | 15 | | showFilterContributor = false, |
| | 16 | | showFilterOperator = true, |
| | 17 | | showFilterOwner = true, |
| | 18 | | showResultLabel = true |
| | 19 | | }; |
| 0 | 20 | | public bool isLoading { get; private set; } = false; |
| | 21 | |
|
| | 22 | | public abstract void SetViewContainer(Transform viewContainer); |
| | 23 | | public abstract void Dispose(); |
| | 24 | | protected abstract void OnShow(); |
| | 25 | | protected abstract void OnHide(); |
| 5 | 26 | | protected virtual void OnFetchingStateChange(bool isLoading) { } |
| | 27 | |
|
| | 28 | | public void SetVisible(bool visible) |
| | 29 | | { |
| 7 | 30 | | if (isVisible == visible) |
| 0 | 31 | | return; |
| | 32 | |
|
| 7 | 33 | | isVisible = visible; |
| 7 | 34 | | if (visible) |
| 5 | 35 | | OnShow(); |
| | 36 | | else |
| 2 | 37 | | OnHide(); |
| 2 | 38 | | } |
| | 39 | |
|
| | 40 | | public void SetFetchingDataState(bool isLoading) |
| | 41 | | { |
| 5 | 42 | | this.isLoading = isLoading; |
| 5 | 43 | | OnFetchingStateChange(isLoading); |
| 5 | 44 | | } |
| | 45 | | } |
| | 46 | | } |