< Summary

Class:SearchSubSectionComponentView
Assembly:ExploreV2
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Sections/PlacesAndEventsSection/SubSections/SearchSubSection/SearchSubSectionComponentView.cs
Covered lines:213
Uncovered lines:77
Coverable lines:290
Total lines:546
Line coverage:73.4% (213 of 290)
Covered branches:0
Total branches:0
Covered methods:24
Total methods:41
Method coverage:58.5% (24 of 41)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
SearchSubSectionComponentView()0%110100%
Awake()0%110100%
InitialiseButtonEvents()0%660100%
RequestAdditionalPage()0%56700%
OnBackButtonPressed()0%20400%
RequestAllEvents()0%6200%
RequestAllPlaces()0%6200%
RequestAllWorlds()0%6200%
ShowEvents(...)0%330100%
ShowPlaces(...)0%330100%
ShowWorlds(...)0%330100%
CheckAndSetNoResults(...)0%5.035088.89%
ConfigureEventCardActions(...)0%33092.31%
ConfigurePlaceCardActions(...)0%110100%
ConfigureWorldCardActions(...)0%110100%
HideWorldModal()0%6200%
ViewOnVoteChanged(...)0%6200%
ViewOnOnFavoriteChanged(...)0%6200%
ShowEventModal(...)0%2100%
ShowPlaceModal(...)0%2100%
ShowWorldModal(...)0%2100%
ShowAllEvents(...)0%220100%
ShowAllPlaces(...)0%220100%
ShowAllWorlds(...)0%220100%
InitializePools()0%110100%
RestartScrollViewPosition()0%2100%
CloseFullList()0%2100%
SetAllAsLoading()0%2100%
SetHeaderEnabled(...)0%110100%
SetActive(...)0%3.033085.71%
OnEnable()0%110100%
RefreshControl()0%2100%
Dispose()0%110100%
ClearEventsPool()0%220100%
ClearFullEventsPool()0%220100%
ClearPlacesPool()0%220100%
ClearFullPlacesPool()0%220100%
ClearWorldsPool()0%220100%
ClearFullWorldsPool()0%220100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/Scripts/MainScripts/DCL/Controllers/ExploreV2/Scripts/Sections/PlacesAndEventsSection/SubSections/SearchSubSection/SearchSubSectionComponentView.cs

#LineLine coverage
 1using DCL;
 2using MainScripts.DCL.Controllers.HotScenes;
 3using MainScripts.DCL.Helpers.Utils;
 4using System;
 5using System.Collections.Generic;
 6using TMPro;
 7using UnityEngine;
 8using UnityEngine.UI;
 9using Utils = DCL.Helpers.Utils;
 10
 11public class SearchSubSectionComponentView : BaseComponentView, ISearchSubSectionComponentView
 12{
 13    private const int MAX_POOL_COUNT = 6;
 14    internal const string WORLDS_SUBSECTION_FF = "worlds_subsection";
 15
 016    public int CurrentTilesPerRow { get; }
 017    public int CurrentGoingTilesPerRow { get; }
 18
 19    [SerializeField] private GameObject minimalSearchSection;
 20    [SerializeField] private GameObject fullSearchSection;
 21    [SerializeField] private GameObject normalHeader;
 22    [SerializeField] private GameObject searchHeader;
 23    [SerializeField] private GameObject favoritesHeader;
 24    [SerializeField] private Button backButton;
 25    [SerializeField] private TMP_Text searchTerm;
 26
 27    [SerializeField] private Canvas canvas;
 28    [SerializeField] private GameObject worldsSection;
 29    [SerializeField] private Transform eventsParent;
 30    [SerializeField] private Transform placesParent;
 31    [SerializeField] private Transform worldsParent;
 32    [SerializeField] private RectTransform fullEventsParent;
 33    [SerializeField] private RectTransform fullPlacesParent;
 34    [SerializeField] private RectTransform fullWorldsParent;
 35    [SerializeField] private RectTransform gridContainer;
 36    [SerializeField] private EventCardComponentView eventPrefab;
 37    [SerializeField] private PlaceCardComponentView placePrefab;
 38    [SerializeField] private GameObject loadingEvents;
 39    [SerializeField] private GameObject loadingPlaces;
 40    [SerializeField] private GameObject loadingWorlds;
 41    [SerializeField] private GameObject loadingAll;
 42    [SerializeField] private Button showAllPlaces;
 43    [SerializeField] private Button showAllWorlds;
 44    [SerializeField] private Button showAllEvents;
 45    [SerializeField] private Button showMore;
 46
 47    [SerializeField] internal GameObject noEvents;
 48    [SerializeField] internal GameObject noPlaces;
 49    [SerializeField] internal GameObject noWorlds;
 50    [SerializeField] internal GameObject noResults;
 51    [SerializeField] private TMP_Text noEventsText;
 52    [SerializeField] private TMP_Text noPlacesText;
 53    [SerializeField] private TMP_Text noWorldsText;
 54    [SerializeField] private TMP_Text noResultsText;
 55    [SerializeField] internal EventCardComponentView eventCardModalPrefab;
 56    [SerializeField] internal PlaceCardComponentView placeCardModalPrefab;
 57    [SerializeField] internal PlaceCardComponentView worldCardModalPrefab;
 58
 59    internal EventCardComponentView eventModal;
 60    internal PlaceCardComponentView placeModal;
 61    internal PlaceCardComponentView worldModal;
 62    public event Action<int> OnRequestAllEvents;
 63    public event Action<int> OnRequestAllPlaces;
 64    public event Action<int> OnRequestAllWorlds;
 65    public event Action OnBackFromSearch;
 66    public event Action<EventCardComponentModel, int> OnEventInfoClicked;
 67    public event Action<PlaceCardComponentModel, int> OnPlaceInfoClicked;
 68    public event Action<PlaceCardComponentModel, int> OnWorldInfoClicked;
 69    public event Action<EventFromAPIModel> OnEventJumpInClicked;
 70    public event Action<IHotScenesController.PlaceInfo> OnPlaceJumpInClicked;
 71    public event Action<IHotScenesController.PlaceInfo> OnWorldJumpInClicked;
 72    public event Action<string, bool?> OnVoteChanged;
 73    public event Action<string, bool> OnPlaceFavoriteChanged;
 74    public event Action<string, bool> OnSubscribeEventClicked;
 75    public event Action<string, bool> OnUnsubscribeEventClicked;
 76
 77    private UnityObjectPool<EventCardComponentView> eventsPool;
 5078    internal List<EventCardComponentView> pooledEvents = new List<EventCardComponentView>();
 79    private UnityObjectPool<EventCardComponentView> fullEventsPool;
 5080    internal List<EventCardComponentView> pooledFullEvents = new List<EventCardComponentView>();
 81    private UnityObjectPool<PlaceCardComponentView> placesPool;
 5082    internal List<PlaceCardComponentView> pooledPlaces = new List<PlaceCardComponentView>();
 83    private UnityObjectPool<PlaceCardComponentView> fullPlacesPool;
 5084    internal List<PlaceCardComponentView> pooledFullPlaces = new List<PlaceCardComponentView>();
 85    private UnityObjectPool<PlaceCardComponentView> worldsPool;
 5086    internal List<PlaceCardComponentView> pooledWorlds = new List<PlaceCardComponentView>();
 87    private UnityObjectPool<PlaceCardComponentView> fullWorldsPool;
 5088    internal List<PlaceCardComponentView> pooledFullWorlds = new List<PlaceCardComponentView>();
 89    private int currentPage = 0;
 90
 91    public override void Awake()
 92    {
 4793        InitializePools();
 4794        InitialiseButtonEvents();
 95
 4796        noEvents.SetActive(false);
 4797        noPlaces.SetActive(false);
 4798        eventModal = PlacesAndEventsCardsFactory.GetEventCardTemplateHiddenLazy(eventCardModalPrefab);
 4799        placeModal = PlacesAndEventsCardsFactory.GetPlaceCardTemplateHiddenLazy(placeCardModalPrefab);
 47100        worldModal = PlacesAndEventsCardsFactory.GetWorldCardTemplateHiddenLazy(worldCardModalPrefab);
 47101    }
 102
 103    private void InitialiseButtonEvents()
 104    {
 47105        if (showAllEvents != null)
 106        {
 47107            showAllEvents.onClick.RemoveAllListeners();
 47108            showAllEvents.onClick.AddListener(RequestAllEvents);
 109        }
 110
 47111        if (showAllPlaces != null)
 112        {
 47113            showAllPlaces.onClick.RemoveAllListeners();
 47114            showAllPlaces.onClick.AddListener(RequestAllPlaces);
 115        }
 116
 47117        if (showAllWorlds != null)
 118        {
 47119            showAllWorlds.onClick.RemoveAllListeners();
 47120            showAllWorlds.onClick.AddListener(RequestAllWorlds);
 121        }
 122
 47123        if (showMore != null)
 124        {
 47125            showMore.onClick.RemoveAllListeners();
 47126            showMore.onClick.AddListener(RequestAdditionalPage);
 127        }
 128
 47129        if (backButton != null)
 130        {
 37131            backButton.onClick.RemoveAllListeners();
 37132            backButton.onClick.AddListener(OnBackButtonPressed);
 133        }
 47134    }
 135
 136    private void RequestAdditionalPage()
 137    {
 0138        currentPage++;
 139
 0140        if(fullEventsParent.gameObject.activeSelf)
 0141            OnRequestAllEvents?.Invoke(currentPage);
 0142        else if(fullPlacesParent.gameObject.activeSelf)
 0143            OnRequestAllPlaces?.Invoke(currentPage);
 0144        else if(fullWorldsParent.gameObject.activeSelf)
 0145            OnRequestAllWorlds?.Invoke(currentPage);
 0146    }
 147
 148    private void OnBackButtonPressed()
 149    {
 0150        if (minimalSearchSection.activeSelf || noResults.activeSelf)
 151        {
 0152            OnBackFromSearch?.Invoke();
 153        }
 154        else
 155        {
 0156            minimalSearchSection.SetActive(true);
 0157            fullSearchSection.SetActive(false);
 158        }
 0159    }
 160
 161    private void RequestAllEvents()
 162    {
 0163        currentPage = 0;
 0164        minimalSearchSection.SetActive(false);
 0165        fullSearchSection.SetActive(true);
 0166        fullEventsParent.gameObject.SetActive(true);
 0167        fullPlacesParent.gameObject.SetActive(false);
 0168        fullWorldsParent.gameObject.SetActive(false);
 0169        loadingAll.SetActive(true);
 0170        ClearFullEventsPool();
 0171        OnRequestAllEvents?.Invoke(currentPage);
 0172    }
 173
 174    private void RequestAllPlaces()
 175    {
 0176        currentPage = 0;
 0177        minimalSearchSection.SetActive(false);
 0178        fullSearchSection.SetActive(true);
 0179        fullEventsParent.gameObject.SetActive(false);
 0180        fullPlacesParent.gameObject.SetActive(true);
 0181        fullWorldsParent.gameObject.SetActive(false);
 0182        loadingAll.SetActive(true);
 0183        ClearFullPlacesPool();
 0184        OnRequestAllPlaces?.Invoke(currentPage);
 0185    }
 186
 187    private void RequestAllWorlds()
 188    {
 0189        currentPage = 0;
 0190        minimalSearchSection.SetActive(false);
 0191        fullSearchSection.SetActive(true);
 0192        fullEventsParent.gameObject.SetActive(false);
 0193        fullPlacesParent.gameObject.SetActive(false);
 0194        fullWorldsParent.gameObject.SetActive(true);
 0195        loadingAll.SetActive(true);
 0196        ClearFullWorldsPool();
 0197        OnRequestAllWorlds?.Invoke(currentPage);
 0198    }
 199
 200    public void ShowEvents(List<EventCardComponentModel> events, string searchText)
 201    {
 3202        ClearEventsPool();
 10203        foreach (EventCardComponentModel eventCardComponentModel in events)
 204        {
 2205            EventCardComponentView eventCardComponentView = eventsPool.Get();
 2206            eventCardComponentView.model = eventCardComponentModel;
 2207            eventCardComponentView.RefreshControl();
 2208            pooledEvents.Add(eventCardComponentView);
 2209            ConfigureEventCardActions(eventCardComponentView, eventCardComponentModel);
 210        }
 3211        eventsParent.gameObject.SetActive(true);
 3212        loadingEvents.gameObject.SetActive(false);
 213
 3214        showAllEvents.gameObject.SetActive(events.Count == 6);
 3215        if (events.Count == 0)
 216        {
 2217            noEvents.SetActive(true);
 2218            noEventsText.text = $"No events found for '{searchText}'";
 219        }
 220        else
 221        {
 1222            noEvents.SetActive(false);
 223        }
 3224        CheckAndSetNoResults(searchText);
 3225    }
 226
 227    public void ShowPlaces(List<PlaceCardComponentModel> places, string searchText)
 228    {
 3229        ClearPlacesPool();
 10230        foreach (PlaceCardComponentModel placeCardComponentModel in places)
 231        {
 2232            PlaceCardComponentView placeCardComponentView = placesPool.Get();
 2233            placeCardComponentView.model = placeCardComponentModel;
 2234            placeCardComponentView.RefreshControl();
 2235            pooledPlaces.Add(placeCardComponentView);
 2236            ConfigurePlaceCardActions(placeCardComponentView, placeCardComponentModel);
 237        }
 3238        placesParent.gameObject.SetActive(true);
 3239        loadingPlaces.gameObject.SetActive(false);
 240
 3241        showAllPlaces.gameObject.SetActive(places.Count == 6);
 3242        if (places.Count == 0)
 243        {
 2244            noPlaces.SetActive(true);
 2245            noPlacesText.text = $"No places found for '{searchText}'";
 246        }
 247        else
 248        {
 1249            noPlaces.SetActive(false);
 250        }
 3251        CheckAndSetNoResults(searchText);
 3252    }
 253
 254    public void ShowWorlds(List<PlaceCardComponentModel> worlds, string searchText)
 255    {
 3256        ClearWorldsPool();
 10257        foreach (PlaceCardComponentModel placeCardComponentModel in worlds)
 258        {
 2259            PlaceCardComponentView placeCardComponentView = worldsPool.Get();
 2260            placeCardComponentView.model = placeCardComponentModel;
 2261            placeCardComponentView.RefreshControl();
 2262            pooledWorlds.Add(placeCardComponentView);
 2263            ConfigureWorldCardActions(placeCardComponentView, placeCardComponentModel);
 264        }
 3265        worldsParent.gameObject.SetActive(true);
 3266        loadingWorlds.gameObject.SetActive(false);
 267
 3268        showAllWorlds.gameObject.SetActive(worlds.Count == 6);
 3269        if (worlds.Count == 0)
 270        {
 2271            noWorlds.SetActive(true);
 2272            noWorldsText.text = $"No wordls found for '{searchText}'";
 273        }
 274        else
 275        {
 1276            noWorlds.SetActive(false);
 277        }
 3278        CheckAndSetNoResults(searchText);
 3279    }
 280
 281    private void CheckAndSetNoResults(string searchText)
 282    {
 9283        if (noPlaces.activeSelf && noEvents.activeSelf && noWorlds.activeSelf)
 284        {
 1285            noResults.SetActive(true);
 1286            minimalSearchSection.SetActive(false);
 1287            noResultsText.text = $"No results found for '{searchText}'";
 288        }
 289        else
 290        {
 8291            noResults.SetActive(false);
 8292            if(minimalSearchSection.activeSelf == false)
 0293                minimalSearchSection.SetActive(true);
 294        }
 9295        Utils.ForceRebuildLayoutImmediate(gridContainer);
 9296    }
 297
 298    private void ConfigureEventCardActions(EventCardComponentView view, EventCardComponentModel model)
 299    {
 4300        view.onInfoClick.RemoveAllListeners();
 4301        view.onBackgroundClick.RemoveAllListeners();
 4302        view.onSubscribeClick.RemoveAllListeners();
 4303        view.onUnsubscribeClick.RemoveAllListeners();
 4304        view.onJumpInClick.RemoveAllListeners();
 4305        view.onSecondaryJumpInClick?.RemoveAllListeners();
 4306        view.onInfoClick.AddListener(() => OnEventInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4307        view.onBackgroundClick.AddListener(() => OnEventInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4308        view.onSubscribeClick.AddListener(() => OnSubscribeEventClicked?.Invoke(model.eventId, !string.IsNullOrEmpty(mod
 4309        view.onUnsubscribeClick.AddListener(() => OnUnsubscribeEventClicked?.Invoke(model.eventId, !string.IsNullOrEmpty
 4310        view.onJumpInClick.AddListener(() => OnEventJumpInClicked?.Invoke(model.eventFromAPIInfo));
 4311        view.onSecondaryJumpInClick?.AddListener(() => OnEventJumpInClicked?.Invoke(model.eventFromAPIInfo));
 0312    }
 313
 314    private void ConfigurePlaceCardActions(PlaceCardComponentView view, PlaceCardComponentModel model)
 315    {
 4316        view.onInfoClick.RemoveAllListeners();
 4317        view.onBackgroundClick.RemoveAllListeners();
 4318        view.onJumpInClick.RemoveAllListeners();
 4319        view.OnFavoriteChanged -= ViewOnOnFavoriteChanged;
 4320        view.OnVoteChanged -= ViewOnVoteChanged;
 4321        view.onInfoClick.AddListener(()=>OnPlaceInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4322        view.onBackgroundClick.AddListener(()=>OnPlaceInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4323        view.onJumpInClick.AddListener(()=>OnPlaceJumpInClicked?.Invoke(model.placeInfo));
 4324        view.OnFavoriteChanged += ViewOnOnFavoriteChanged;
 4325        view.OnVoteChanged += ViewOnVoteChanged;
 4326    }
 327
 328    private void ConfigureWorldCardActions(PlaceCardComponentView view, PlaceCardComponentModel model)
 329    {
 4330        view.onInfoClick.RemoveAllListeners();
 4331        view.onBackgroundClick.RemoveAllListeners();
 4332        view.onJumpInClick.RemoveAllListeners();
 4333        view.OnFavoriteChanged -= ViewOnOnFavoriteChanged;
 4334        view.OnVoteChanged -= ViewOnVoteChanged;
 4335        view.onInfoClick.AddListener(()=>OnWorldInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4336        view.onBackgroundClick.AddListener(()=>OnWorldInfoClicked?.Invoke(model, view.transform.GetSiblingIndex()));
 4337        view.onJumpInClick.AddListener(()=>OnWorldJumpInClicked?.Invoke(model.placeInfo));
 4338        view.OnFavoriteChanged += ViewOnOnFavoriteChanged;
 4339        view.OnVoteChanged += ViewOnVoteChanged;
 4340    }
 341
 342    public void HideWorldModal()
 343    {
 0344        if (worldModal != null)
 0345            worldModal.Hide();
 0346    }
 347
 348    private void ViewOnVoteChanged(string arg1, bool? arg2)
 349    {
 0350        OnVoteChanged?.Invoke(arg1, arg2);
 0351    }
 352
 353    private void ViewOnOnFavoriteChanged(string placeId, bool isFavorite)
 354    {
 0355        OnPlaceFavoriteChanged?.Invoke(placeId, isFavorite);
 0356    }
 357
 358    public void ShowEventModal(EventCardComponentModel eventInfo)
 359    {
 0360        eventModal.Show();
 0361        EventsCardsConfigurator.Configure(eventModal, eventInfo, null, OnEventJumpInClicked, OnSubscribeEventClicked, On
 0362    }
 363
 364    public void ShowPlaceModal(PlaceCardComponentModel placeModel)
 365    {
 0366        placeModal.Show();
 0367        PlacesCardsConfigurator.Configure(placeModal, placeModel, null, OnPlaceJumpInClicked, OnVoteChanged, OnPlaceFavo
 0368    }
 369
 370    public void ShowWorldModal(PlaceCardComponentModel placeModel)
 371    {
 0372        worldModal.Show();
 0373        PlacesCardsConfigurator.Configure(worldModal, placeModel, null, OnWorldJumpInClicked, OnVoteChanged, OnPlaceFavo
 0374    }
 375
 376    public void ShowAllEvents(List<EventCardComponentModel> events, bool showMoreButton)
 377    {
 1378        showMore.gameObject.SetActive(showMoreButton);
 6379        foreach (EventCardComponentModel eventCardComponentModel in events)
 380        {
 2381            EventCardComponentView eventCardComponentView = fullEventsPool.Get();
 2382            eventCardComponentView.model = eventCardComponentModel;
 2383            eventCardComponentView.RefreshControl();
 2384            eventCardComponentView.transform.SetAsLastSibling();
 2385            pooledFullEvents.Add(eventCardComponentView);
 2386            ConfigureEventCardActions(eventCardComponentView, eventCardComponentModel);
 387        }
 1388        loadingAll.SetActive(false);
 1389        Utils.ForceRebuildLayoutImmediate(fullEventsParent);
 1390    }
 391
 392    public void ShowAllPlaces(List<PlaceCardComponentModel> places, bool showMoreButton)
 393    {
 1394        showMore.gameObject.SetActive(showMoreButton);
 6395        foreach (PlaceCardComponentModel placeCardComponentModel in places)
 396        {
 2397            PlaceCardComponentView placeCardComponentView = fullPlacesPool.Get();
 2398            placeCardComponentView.model = placeCardComponentModel;
 2399            placeCardComponentView.RefreshControl();
 2400            placeCardComponentView.OnLoseFocus();
 2401            placeCardComponentView.transform.SetAsLastSibling();
 2402            pooledFullPlaces.Add(placeCardComponentView);
 2403            ConfigurePlaceCardActions(placeCardComponentView, placeCardComponentModel);
 404        }
 1405        loadingAll.SetActive(false);
 1406        Utils.ForceRebuildLayoutImmediate(fullPlacesParent);
 1407    }
 408
 409    public void ShowAllWorlds(List<PlaceCardComponentModel> worlds, bool showMoreButton)
 410    {
 1411        showMore.gameObject.SetActive(showMoreButton);
 6412        foreach (PlaceCardComponentModel placeCardComponentModel in worlds)
 413        {
 2414            PlaceCardComponentView placeCardComponentView = fullWorldsPool.Get();
 2415            placeCardComponentView.model = placeCardComponentModel;
 2416            placeCardComponentView.RefreshControl();
 2417            placeCardComponentView.OnLoseFocus();
 2418            placeCardComponentView.transform.SetAsLastSibling();
 2419            pooledFullWorlds.Add(placeCardComponentView);
 2420            ConfigureWorldCardActions(placeCardComponentView, placeCardComponentModel);
 421        }
 1422        loadingAll.SetActive(false);
 1423        Utils.ForceRebuildLayoutImmediate(fullWorldsParent);
 1424    }
 425
 426    private void InitializePools()
 427    {
 47428        eventsPool = new UnityObjectPool<EventCardComponentView>(eventPrefab, eventsParent);
 47429        eventsPool.Prewarm(MAX_POOL_COUNT);
 47430        placesPool = new UnityObjectPool<PlaceCardComponentView>(placePrefab, placesParent);
 47431        placesPool.Prewarm(MAX_POOL_COUNT);
 47432        worldsPool = new UnityObjectPool<PlaceCardComponentView>(placePrefab, worldsParent);
 47433        worldsPool.Prewarm(MAX_POOL_COUNT);
 47434        fullEventsPool = new UnityObjectPool<EventCardComponentView>(eventPrefab, fullEventsParent);
 47435        fullEventsPool.Prewarm(MAX_POOL_COUNT);
 47436        fullPlacesPool = new UnityObjectPool<PlaceCardComponentView>(placePrefab, fullPlacesParent);
 47437        fullPlacesPool.Prewarm(MAX_POOL_COUNT);
 47438        fullWorldsPool = new UnityObjectPool<PlaceCardComponentView>(placePrefab, fullWorldsParent);
 47439        fullWorldsPool.Prewarm(MAX_POOL_COUNT);
 47440    }
 441
 442    public void RestartScrollViewPosition()
 443    {
 0444    }
 445
 446    private void CloseFullList()
 447    {
 0448        minimalSearchSection.SetActive(true);
 0449        fullSearchSection.SetActive(false);
 0450    }
 451
 452    public void SetAllAsLoading()
 453    {
 0454        CloseFullList();
 0455        eventsParent.gameObject.SetActive(false);
 0456        placesParent.gameObject.SetActive(false);
 0457        worldsParent.gameObject.SetActive(false);
 0458        loadingEvents.SetActive(true);
 0459        loadingPlaces.SetActive(true);
 0460        loadingWorlds.SetActive(true);
 0461    }
 462
 463    public void SetHeaderEnabled(string searchText)
 464    {
 37465        normalHeader.SetActive(string.IsNullOrEmpty(searchText));
 37466        searchHeader.SetActive(!string.IsNullOrEmpty(searchText));
 37467        favoritesHeader.SetActive(false);
 37468        searchTerm.text = $"\"{searchText}\"";
 37469    }
 470
 471    public void SetActive(bool isActive)
 472    {
 127473        if (canvas.enabled == isActive)
 91474            return;
 36475        canvas.enabled = isActive;
 476
 36477        if (isActive)
 0478            OnEnable();
 479        else
 480        {
 36481            OnDisable();
 482        }
 36483    }
 484
 485    public override void OnEnable()
 486    {
 47487        base.OnEnable();
 488
 489        //Temporary until the full feature is released
 47490        worldsSection.SetActive(DataStore.i.featureFlags.flags.Get().IsFeatureEnabled(WORLDS_SUBSECTION_FF));
 47491    }
 492
 493    public override void RefreshControl()
 494    {
 0495    }
 496
 497    public override void Dispose()
 498    {
 102499        ClearEventsPool();
 102500        ClearFullEventsPool();
 102501        ClearPlacesPool();
 102502        ClearFullPlacesPool();
 102503        ClearWorldsPool();
 102504        ClearFullWorldsPool();
 102505    }
 506
 507    private void ClearEventsPool()
 508    {
 214509        foreach (var pooledEvent in pooledEvents)
 2510            eventsPool.Release(pooledEvent);
 105511        pooledEvents.Clear();
 105512    }
 513
 514    private void ClearFullEventsPool()
 515    {
 208516        foreach (var pooledEvent in pooledFullEvents)
 2517            fullEventsPool.Release(pooledEvent);
 102518        pooledFullEvents.Clear();
 102519    }
 520
 521    private void ClearPlacesPool()
 522    {
 214523        foreach (var pooledEvent in pooledPlaces)
 2524            placesPool.Release(pooledEvent);
 105525        pooledPlaces.Clear();
 105526    }
 527
 528    private void ClearFullPlacesPool(){
 208529        foreach (var pooledEvent in pooledFullPlaces)
 2530            fullPlacesPool.Release(pooledEvent);
 102531        pooledFullPlaces.Clear();
 102532    }
 533
 534    private void ClearWorldsPool()
 535    {
 214536        foreach (var pooledWorld in pooledWorlds)
 2537            worldsPool.Release(pooledWorld);
 105538        pooledWorlds.Clear();
 105539    }
 540
 541    private void ClearFullWorldsPool(){
 208542        foreach (var pooledWorld in pooledFullWorlds)
 2543            fullWorldsPool.Release(pooledWorld);
 102544        pooledFullWorlds.Clear();
 102545    }
 546}

Methods/Properties

CurrentTilesPerRow()
CurrentGoingTilesPerRow()
SearchSubSectionComponentView()
Awake()
InitialiseButtonEvents()
RequestAdditionalPage()
OnBackButtonPressed()
RequestAllEvents()
RequestAllPlaces()
RequestAllWorlds()
ShowEvents(System.Collections.Generic.List[EventCardComponentModel], System.String)
ShowPlaces(System.Collections.Generic.List[PlaceCardComponentModel], System.String)
ShowWorlds(System.Collections.Generic.List[PlaceCardComponentModel], System.String)
CheckAndSetNoResults(System.String)
ConfigureEventCardActions(EventCardComponentView, EventCardComponentModel)
ConfigurePlaceCardActions(PlaceCardComponentView, PlaceCardComponentModel)
ConfigureWorldCardActions(PlaceCardComponentView, PlaceCardComponentModel)
HideWorldModal()
ViewOnVoteChanged(System.String, System.Nullable[Boolean])
ViewOnOnFavoriteChanged(System.String, System.Boolean)
ShowEventModal(EventCardComponentModel)
ShowPlaceModal(PlaceCardComponentModel)
ShowWorldModal(PlaceCardComponentModel)
ShowAllEvents(System.Collections.Generic.List[EventCardComponentModel], System.Boolean)
ShowAllPlaces(System.Collections.Generic.List[PlaceCardComponentModel], System.Boolean)
ShowAllWorlds(System.Collections.Generic.List[PlaceCardComponentModel], System.Boolean)
InitializePools()
RestartScrollViewPosition()
CloseFullList()
SetAllAsLoading()
SetHeaderEnabled(System.String)
SetActive(System.Boolean)
OnEnable()
RefreshControl()
Dispose()
ClearEventsPool()
ClearFullEventsPool()
ClearPlacesPool()
ClearFullPlacesPool()
ClearWorldsPool()
ClearFullWorldsPool()