From d3d4cca0e812c49d7d6c8e851c11016e71e4413d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Tue, 15 Jan 2019 11:30:13 -0500 Subject: [PATCH] remove analytics settings --- src/App/Pages/Settings/SettingsOptionsPage.cs | 52 ++----------------- src/App/Resources/AppResources.Designer.cs | 18 ------- src/App/Resources/AppResources.resx | 6 --- 3 files changed, 3 insertions(+), 73 deletions(-) diff --git a/src/App/Pages/Settings/SettingsOptionsPage.cs b/src/App/Pages/Settings/SettingsOptionsPage.cs index 1ec087f59..df7465986 100644 --- a/src/App/Pages/Settings/SettingsOptionsPage.cs +++ b/src/App/Pages/Settings/SettingsOptionsPage.cs @@ -13,13 +13,11 @@ namespace Bit.App.Pages { private readonly ISettings _settings; private readonly IAppSettingsService _appSettings; - private readonly IGoogleAnalyticsService _googleAnalyticsService; public SettingsOptionsPage() { _settings = Resolver.Resolve(); _appSettings = Resolver.Resolve(); - _googleAnalyticsService = Resolver.Resolve(); Init(); } @@ -27,8 +25,6 @@ namespace Bit.App.Pages private RedrawableStackLayout StackLayout { get; set; } private ExtendedSwitchCell CopyTotpCell { get; set; } private Label CopyTotpLabel { get; set; } - private ExtendedSwitchCell AnalyticsCell { get; set; } - private Label AnalyticsLabel { get; set; } private ExtendedSwitchCell WebsiteIconsCell { get; set; } private Label WebsiteIconsLabel { get; set; } private ExtendedSwitchCell AutofillPersistNotificationCell { get; set; } @@ -74,33 +70,11 @@ namespace Bit.App.Pages } }; - AnalyticsCell = new ExtendedSwitchCell - { - Text = AppResources.DisableGA, - On = _settings.GetValueOrDefault(Constants.SettingGaOptOut, false) - }; - - var analyticsTable = new FormTableView(this) - { - Root = new TableRoot - { - new TableSection(Helpers.GetEmptyTableSectionTitle()) - { - AnalyticsCell - } - } - }; - CopyTotpLabel = new FormTableLabel(this) { Text = AppResources.DisableAutoTotpCopyDescription }; - AnalyticsLabel = new FormTableLabel(this) - { - Text = AppResources.DisableGADescription - }; - WebsiteIconsLabel = new FormTableLabel(this) { Text = AppResources.DisableWebsiteIconsDescription @@ -111,10 +85,7 @@ namespace Bit.App.Pages Children = { websiteIconsTable, WebsiteIconsLabel, - totpTable, CopyTotpLabel, -#if !FDROID - analyticsTable, AnalyticsLabel -#endif + totpTable, CopyTotpLabel }, Spacing = 0 }; @@ -202,9 +173,6 @@ namespace Bit.App.Pages if(Device.RuntimePlatform == Device.iOS || Device.RuntimePlatform == Device.UWP) { - analyticsTable.RowHeight = websiteIconsTable.RowHeight = totpTable.RowHeight = -1; - analyticsTable.EstimatedRowHeight = websiteIconsTable.EstimatedRowHeight = - totpTable.EstimatedRowHeight = 70; ToolbarItems.Add(new DismissModalToolBarItem(this, AppResources.Close)); } @@ -215,8 +183,7 @@ namespace Bit.App.Pages protected override void OnAppearing() { base.OnAppearing(); - - AnalyticsCell.OnChanged += AnalyticsCell_Changed; + WebsiteIconsCell.OnChanged += WebsiteIconsCell_Changed; CopyTotpCell.OnChanged += CopyTotpCell_OnChanged; @@ -231,8 +198,7 @@ namespace Bit.App.Pages protected override void OnDisappearing() { base.OnDisappearing(); - - AnalyticsCell.OnChanged -= AnalyticsCell_Changed; + WebsiteIconsCell.OnChanged -= WebsiteIconsCell_Changed; CopyTotpCell.OnChanged -= CopyTotpCell_OnChanged; @@ -255,18 +221,6 @@ namespace Bit.App.Pages _appSettings.DisableWebsiteIcons = cell.On; } - private void AnalyticsCell_Changed(object sender, ToggledEventArgs e) - { - var cell = sender as ExtendedSwitchCell; - if(cell == null) - { - return; - } - - _settings.AddOrUpdateValue(Constants.SettingGaOptOut, cell.On); - _googleAnalyticsService.SetAppOptOut(cell.On); - } - private void CopyTotpCell_OnChanged(object sender, ToggledEventArgs e) { var cell = sender as ExtendedSwitchCell; diff --git a/src/App/Resources/AppResources.Designer.cs b/src/App/Resources/AppResources.Designer.cs index f8f6add74..1b23eb613 100644 --- a/src/App/Resources/AppResources.Designer.cs +++ b/src/App/Resources/AppResources.Designer.cs @@ -1122,24 +1122,6 @@ namespace Bit.App.Resources { } } - /// - /// Looks up a localized string similar to Disable Analytics. - /// - public static string DisableGA { - get { - return ResourceManager.GetString("DisableGA", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to We use analytics to better learn how the app is being used so that we can make it better. All data collection is completely anonymous.. - /// - public static string DisableGADescription { - get { - return ResourceManager.GetString("DisableGADescription", resourceCulture); - } - } - /// /// Looks up a localized string similar to Disable Website Icons. /// diff --git a/src/App/Resources/AppResources.resx b/src/App/Resources/AppResources.resx index 705cf0cea..2e8ef35d5 100644 --- a/src/App/Resources/AppResources.resx +++ b/src/App/Resources/AppResources.resx @@ -302,9 +302,6 @@ Ok Acknowledgement. - - Disable Analytics - Password Label for a password. @@ -812,9 +809,6 @@ Create an organization to securely share your items with other users. - - We use analytics to better learn how the app is being used so that we can make it better. All data collection is completely anonymous. - Scan When Password Field Focused