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