예제 #1
0
        /// <summary>
        /// Populate the grid from installed apps
        /// </summary>
        /// <returns></returns>
        private async Task PopulateAsync()
        {
            // Load configuration
            Config config = new Config();

            ConfigPersistence.LoadConfig(config);

            // Process apps in background
            var apps = await Task.Run(() =>
            {
                AndroidJNI.AttachCurrentThread();

                try
                {
                    return(AppProcessor.ProcessApps(config));
                }
                finally
                {
                    AndroidJNI.DetachCurrentThread();
                }
            });

            // Populate the panel content
            await PopulatePanelContentAsync(config, apps);
        }
예제 #2
0
        /// <summary>
        /// Populate the grid from installed apps
        /// </summary>
        /// <returns></returns>
        private async Task PopulateAsync(bool isRenameMode = false)
        {
            // Load configuration
            var config = ConfigPersistence.LoadConfig();

            // Set skybox
            if (!isRenameMode)
            {
                this.skyboxHandler.SetSkybox(config.background);
            }

            // Process apps in background
            var apps = await Task.Run(() =>
            {
                AndroidJNI.AttachCurrentThread();

                try
                {
                    return(AppProcessor.ProcessApps(config, isRenameMode));
                }
                finally
                {
                    AndroidJNI.DetachCurrentThread();
                }
            });

            // Download updates in the background
            if (!isRenameMode && config.autoUpdate && !GlobalState.Instance.CheckedForUpdate)
            {
                GlobalState.Instance.CheckedForUpdate = true;
                AssetsDownloader.DownloadAssetsAsync(config, this.downloadStatusIndicator);
            }

            // Populate the panel content
            if (!isRenameMode)
            {
                await PopulatePanelContentAsync(config, apps);
            }
            else
            {
                await PopulateRenamePanelContentAsync(config, apps);
            }
        }
예제 #3
0
        public void OpenSettings()
        {
            Debug.Log("Open Settings");
            this.panelContainer.SetActive(false);
            this.openSettingsButton.SetActive(false);
            this.closeSettingsButton.SetActive(true);
            this.settingsContainer.SetActive(true);

            // Load config
            ConfigPersistence.LoadConfig(this.config);

            // Set current cols & rows
            var colsSlider = this.gridCols.GetComponent <Slider>();

            colsSlider.value = this.config.gridSize.cols;
            var colsText = this.gridColsText.GetComponent <TextMeshProUGUI>();

            colsText.text = string.Format("{0} Cols", this.config.gridSize.cols);

            var rowsSlider = this.gridRows.GetComponent <Slider>();

            rowsSlider.value = this.config.gridSize.rows;

            var rowsText = this.gridRowsText.GetComponent <TextMeshProUGUI>();

            rowsText.text = string.Format("{0} Rows", this.config.gridSize.rows);

            // Set 2D toggle
            this.show2DToggle.GetComponent <Toggle>().SetIsOnWithoutNotify(this.config.show2D);

            // Set auto tab mode
            if (this.config.autoCategory.Equals(Config.Category_Top, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoTop.isOn = true;
            }
            else if (this.config.autoCategory.Equals(Config.Category_Left, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoLeft.isOn = true;
            }
            else if (this.config.autoCategory.Equals(Config.Category_Right, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoRight.isOn = true;
            }
            else
            {
                this.tabsAutoOff.isOn = true;
            }

            // Set custom tab mode
            if (this.config.customCategory.Equals(Config.Category_Top, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomTop.isOn = true;
            }
            else if (this.config.customCategory.Equals(Config.Category_Left, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomLeft.isOn = true;
            }
            else if (this.config.customCategory.Equals(Config.Category_Right, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomRight.isOn = true;
            }
            else
            {
                this.tabsCustomOff.isOn = true;
            }
        }
예제 #4
0
        public void OpenSettings()
        {
            Debug.Log("Open Settings");
            this.panelContainer.SetActive(false);
            this.openSettingsButton.SetActive(false);
            this.closeSettingsButton.SetActive(true);
            this.settingsContainer.SetActive(true);

            this.deletedHiddenAppsFile = false;
            this.deletedRenameFiles    = false;

            // Load config
            this.config = ConfigPersistence.LoadConfig();

            // Skybox callback
            this.skyboxHandler.OnSkyboxSelected = OnSkyboxSelected;

            // Set current cols & rows
            var colsSlider = this.gridCols.GetComponent <Slider>();

            colsSlider.value = this.config.gridSize.cols;
            var colsText = this.gridColsText.GetComponent <TextMeshProUGUI>();

            colsText.text = string.Format("{0} Cols", this.config.gridSize.cols);

            var rowsSlider = this.gridRows.GetComponent <Slider>();

            rowsSlider.value = this.config.gridSize.rows;

            var rowsText = this.gridRowsText.GetComponent <TextMeshProUGUI>();

            rowsText.text = string.Format("{0} Rows", this.config.gridSize.rows);

            // initialize sort mode
            InitializeSortMode();

            // Set 2D toggle
            this.show2DToggle.GetComponent <Toggle>().SetIsOnWithoutNotify(this.config.show2D);

            // Set skybox button text
            this.skyBoxButton.GetComponentInChildren <TextMeshProUGUI>().text = SkyboxHandler.GetSkyboxNameFromPath(this.config.background);

            // Set auto-update toggle
            this.autoUpdateToggle.GetComponent <Toggle>().SetIsOnWithoutNotify(this.config.autoUpdate);

            // Set auto tab mode
            if (this.config.autoCategory.Equals(Config.Category_Top, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoTop.isOn = true;
            }
            else if (this.config.autoCategory.Equals(Config.Category_Left, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoLeft.isOn = true;
            }
            else if (this.config.autoCategory.Equals(Config.Category_Right, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsAutoRight.isOn = true;
            }
            else
            {
                this.tabsAutoOff.isOn = true;
            }

            // Set custom tab mode
            if (this.config.customCategory.Equals(Config.Category_Top, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomTop.isOn = true;
            }
            else if (this.config.customCategory.Equals(Config.Category_Left, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomLeft.isOn = true;
            }
            else if (this.config.customCategory.Equals(Config.Category_Right, StringComparison.OrdinalIgnoreCase))
            {
                this.tabsCustomRight.isOn = true;
            }
            else
            {
                this.tabsCustomOff.isOn = true;
            }
        }