Beispiel #1
0
        private async void InitValues()
        {
            Settings settings = new Settings(this);

            swUiMode.Checked        = settings.UseLegacyUI;
            swUiMode.CheckedChange += SwUiMode_CheckedChange;

            swStayInBackground.Checked        = settings.AllowToStayInBackground;
            swStayInBackground.CheckedChange += SwStayInBackground_CheckedChange;

            swCloudClipboardMode.Checked        = (settings.CloudClipboardReceiveMode == CloudClipboardReceiveMode.Automatic);
            swCloudClipboardMode.CheckedChange += SwCloudClipboardMode_CheckedChange;

            swCloudClipboardActivity.Visibility         = CrossSecureStorage.Current.HasKey("RoamitAccountId") ? ViewStates.Visible : ViewStates.Gone;
            swCloudClipboardMode.Visibility             = swCloudClipboardActivity.Visibility;
            txtCloudClipboardModeDescription.Visibility = swCloudClipboardActivity.Visibility;

            txtDeviceName.Text              = settings.DeviceName;
            txtDeviceName.AfterTextChanged += TxtDeviceName_AfterTextChanged;

            swDarkTheme.Checked        = (settings.Theme == AppTheme.Dark);
            swDarkTheme.CheckedChange += SwDarkTheme_CheckedChange;

            if (CrossSecureStorage.Current.HasKey("RoamitAccountId"))
            {
                swCloudClipboardMode.Enabled     = false;
                swCloudClipboardActivity.Enabled = false;

                var cloudClipboardActivated = await ServiceFunctions.GetCloudClipboardActivationStatus();

                swCloudClipboardActivity.Checked = cloudClipboardActivated;

                swCloudClipboardActivity.Enabled = true;
                if (cloudClipboardActivated)
                {
                    swCloudClipboardMode.Enabled = true;
                }

                swCloudClipboardActivity.CheckedChange += SwCloudClipboardActivity_CheckedChange;
            }
        }
Beispiel #2
0
        private async void InitValues()
        {
            Settings settings = new Settings(this);

            swUiMode.Checked        = settings.UseLegacyUI;
            swUiMode.CheckedChange += SwUiMode_CheckedChange;

            swCloudClipboardMode.Checked        = (settings.CloudClipboardReceiveMode == CloudClipboardReceiveMode.Automatic);
            swCloudClipboardMode.CheckedChange += SwCloudClipboardMode_CheckedChange;

            txtUniversalClipboardNotAvailable.Visibility = CrossSecureStorage.Current.HasKey("RoamitAccountId") ? ViewStates.Gone : ViewStates.Visible;
            swCloudClipboardActivity.Visibility          = CrossSecureStorage.Current.HasKey("RoamitAccountId") ? ViewStates.Visible : ViewStates.Gone;
            swCloudClipboardMode.Visibility             = swCloudClipboardActivity.Visibility;
            txtCloudClipboardModeDescription.Visibility = swCloudClipboardActivity.Visibility;

            txtDeviceName.Text              = settings.DeviceName;
            txtDeviceName.AfterTextChanged += TxtDeviceName_AfterTextChanged;

            swDarkTheme.Checked        = (settings.Theme == AppTheme.Dark);
            swDarkTheme.CheckedChange += SwDarkTheme_CheckedChange;

            swUseInAppRomeProcessOnWindows.Checked        = settings.UseInAppServiceOnWindowsDevices;
            swUseInAppRomeProcessOnWindows.CheckedChange += SwUseInAppRomeProcessOnWindows_CheckedChange;

            swUseSystemFolderPicker.Enabled        = (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop);
            swUseSystemFolderPicker.Checked        = settings.UseSystemFolderPicker;
            swUseSystemFolderPicker.CheckedChange += SwUseSystemFolderPicker_CheckedChange;

            swUseSystemFilePicker.Enabled        = (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop);
            swUseSystemFilePicker.Checked        = settings.UseSystemFilePicker;
            swUseSystemFilePicker.CheckedChange += SwUseSystemFilePicker_CheckedChange;

            txtReceiveLocation.FocusChange += TxtReceiveLocation_FocusChange;
            txtReceiveLocation.Click       += TxtReceiveLocation_Click;
            txtReceiveLocation.Text         = settings.DefaultDownloadFolder;

            groupReceivedByAdapter         = new SettingsReceivedGroupByAdapter(this);
            groupReceivedBySpinner.Adapter = groupReceivedByAdapter;
            groupReceivedBySpinner.SetSelection(groupReceivedByAdapter.SelectedItemPosition, false);
            groupReceivedBySpinner.ItemSelected += GroupReceivedBySpinner_ItemSelected;

            txtVersionNumber.Text = Application.Context.ApplicationContext.PackageManager.GetPackageInfo(Application.Context.ApplicationContext.PackageName, 0).VersionName;

            if (CrossSecureStorage.Current.HasKey("RoamitAccountId"))
            {
                swCloudClipboardMode.Enabled     = false;
                swCloudClipboardActivity.Enabled = false;

                var cloudClipboardActivated = await ServiceFunctions.GetCloudClipboardActivationStatus();

                swCloudClipboardActivity.Checked = cloudClipboardActivated;

                swCloudClipboardActivity.Enabled = true;
                if (cloudClipboardActivated)
                {
                    swCloudClipboardMode.Enabled = true;
                }

                swCloudClipboardActivity.CheckedChange += SwCloudClipboardActivity_CheckedChange;
            }
        }