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