Example #1
0
    private ListView GetOrCreateList(LokiSearchTree tree, int pageIndex)
    {
        if (pageIndex < pageStack.Count)
        {
            var existingList = pageStack[pageIndex];
            if (tree != null)
            {
                BindList(existingList, tree);
            }
            return(existingList);
        }

        var listView = new ListView(null, ITEM_HEIGHT, MakeEntryElement, BindEntryElement);

        listView.AddToClassList("search-list");
        listView.showBorder     = false;
        listView.style.width    = size.x;
        listView.style.minWidth = size.x;
        listView.style.maxWidth = size.x;

        pageContainer.Add(listView);
        pageStack.Add(listView);

        BindList(listView, tree);

        return(listView);
    }
Example #2
0
    private void BindList(ListView listView, LokiSearchTree tree)
    {
        listView.userData    = tree;
        currentItems         = tree.Flatten();
        listView.itemsSource = currentItems;

        listView.Refresh();
    }
Example #3
0
    private void Initialize()
    {
        rootTree = provider.GetEntryTree();

        currentPage = 0;
        GetOrCreateList(rootTree, 0);

        textFieldFocusController.Focus();
    }
Example #4
0
    private void MoveRight(LokiSearchTree tree)
    {
        if (!canInteract)
        {
            return;
        }

        GetOrCreateList(tree, ++currentPage);
        AnimatePageContainer(currentPage);
    }