Esempio n. 1
0
        public HMSRemoteConfigSettingsDrawer()
        {
            _defaultValueSettings     = HMSRemoteDefaultValueSettings.Instance.Settings;
            _remoteConfigSettings     = HMSRemoteConfigSettings.Instance.Settings;
            _defaultValueManipulator  = new DefaultValueManipulator(_defaultValueSettings);
            _developerModeToggle      = new Toggle.Toggle("Developer Mode", _remoteConfigSettings.GetBool(HMSRemoteConfigSettings.DeveloperMode), OnDeveloperModeToggle);
            _applyDefaultValuesToggle = new Toggle.Toggle("Apply Default Values*", _remoteConfigSettings.GetBool(HMSRemoteConfigSettings.ApplyDefaultValues), OnApplyDefaultValuesToggle).SetTooltip("This will apply default values on start");

            _defaultValueManipulator.OnRefreshRequired += OnDefaultValueChanged;

            OnDefaultValueChanged();
            SetupSequence();
        }
        public HMSAdsSettingsDrawer()
        {
            _settings = HMSAdsKitSettings.Instance.Settings;
            _enableBannerAdsToggle    = new Toggle.Toggle("Enable Banner Ads", _settings.GetBool(HMSAdsKitSettings.EnableBannerAd), OnBannerAdsToggleChanged, false);
            _bannerAdsTextField       = new TextFieldWithAccept("Banner Ad ID", _settings.Get(HMSAdsKitSettings.BannerAdID), "Save", OnBannerAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _bannerAdsRefreshField    = new TextFieldWithAccept("Banner Refresh Interval*", _settings.Get(HMSAdsKitSettings.BannerRefreshInterval), "Save", OnBannerRefreshIntervalSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100).AddTooltip("Default is 60 seconds. Value can be between 30 and 120 seconds");
            _enableBannerAdLoadToggle = new Toggle.Toggle("Show Banner on Load*", _settings.GetBool(HMSAdsKitSettings.ShowBannerOnLoad), OnShowBannerOnLoadChanged, false).SetTooltip("Enabling this will make the banner to be shown right after it finishes loading.");
            _bannerAdsDisabledDrawer  = new DisabledDrawer(new VerticalSequenceDrawer(_bannerAdsTextField, _bannerAdsRefreshField, _enableBannerAdLoadToggle)).SetEnabled(!_enableBannerAdsToggle.IsChecked());

            _enableInterstitialAdsToggle   = new Toggle.Toggle("Enable Interstitial Ads", _settings.GetBool(HMSAdsKitSettings.EnableInterstitialAd), OnInterstitialAdsToggleChanged, false);
            _interstitialAdsTextField      = new TextFieldWithAccept("Interstitial Ad ID", _settings.Get(HMSAdsKitSettings.InterstitialAdID), "Save", OnInterstitialAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _interstitialAdsDisabledDrawer = new DisabledDrawer(_interstitialAdsTextField).SetEnabled(!_enableInterstitialAdsToggle.IsChecked());

            _enableRewardedAdsToggle   = new Toggle.Toggle("Enable Rewarded Ads", _settings.GetBool(HMSAdsKitSettings.EnableRewardedAd), OnRewardedAdsToggleChanged, false);
            _rewardedAdsTextField      = new TextFieldWithAccept("Rewarded Ad ID", _settings.Get(HMSAdsKitSettings.RewardedAdID), "Save", OnRewardedAdIDSaveButtonClick).SetLabelWidth(0).SetButtonWidth(100);
            _rewardedAdsDisabledDrawer = new DisabledDrawer(_rewardedAdsTextField).SetEnabled(!_enableRewardedAdsToggle.IsChecked());

            _testAdstoggle = new Toggle.Toggle("Use Test Ads*", _settings.GetBool(HMSAdsKitSettings.UseTestAds), OnTestAdsToggleChanged);
            _testAdstoggle.SetTooltip("This will overwrite all ads with test ads.");
            SetupSequence();
        }