From 68420c65caa95d15e0f870b6ea69c1473ef94438 Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Thu, 21 Nov 2024 16:21:17 +0000 Subject: [PATCH 1/7] duplicating content settings and privacy --- .../main/res/layout/activity_settings_new.xml | 2 +- .../main/res/layout/content_settings_new.xml | 68 ++++++++++++++++ .../layout/content_settings_new_privacy.xml | 81 +++++++++++++++++++ 3 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 app/src/main/res/layout/content_settings_new.xml create mode 100644 app/src/main/res/layout/content_settings_new_privacy.xml diff --git a/app/src/main/res/layout/activity_settings_new.xml b/app/src/main/res/layout/activity_settings_new.xml index 94b486d9afa3..b666d07abafd 100644 --- a/app/src/main/res/layout/activity_settings_new.xml +++ b/app/src/main/res/layout/activity_settings_new.xml @@ -26,6 +26,6 @@ + layout="@layout/content_settings_new" /> diff --git a/app/src/main/res/layout/content_settings_new.xml b/app/src/main/res/layout/content_settings_new.xml new file mode 100644 index 000000000000..b66805d5afaf --- /dev/null +++ b/app/src/main/res/layout/content_settings_new.xml @@ -0,0 +1,68 @@ + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/content_settings_new_privacy.xml b/app/src/main/res/layout/content_settings_new_privacy.xml new file mode 100644 index 000000000000..54ba13385690 --- /dev/null +++ b/app/src/main/res/layout/content_settings_new_privacy.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + From 6b40e08883d72cff841b6df55da6df22971fb354 Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Fri, 22 Nov 2024 15:16:33 +0000 Subject: [PATCH 2/7] add new icons --- .../drawable/ic_accessibility_color_24.xml | 21 +++++ .../res/drawable/ic_add_widget_color_24.xml | 35 ++++++++ ...c_address_bar_position_bottom_color_24.xml | 32 +++++++ .../res/drawable/ic_appearance_color_24.xml | 83 +++++++++++++++++++ .../main/res/drawable/ic_cookie_color_24.xml | 18 ++++ .../ic_default_browser_mobile_color_24.xml | 26 ++++++ .../res/drawable/ic_downloads_color_24.xml | 14 ++++ .../drawable/ic_email_protection_color_24.xml | 35 ++++++++ .../res/drawable/ic_find_search_color_24.xml | 17 ++++ .../main/res/drawable/ic_fire_color_24.xml | 20 +++++ .../res/drawable/ic_heart_gray_color_24.xml | 13 +++ .../drawable/ic_homescreen_lock_color_24.xml | 29 +++++++ .../ic_identity_blocked_pir_color_24.xml | 26 ++++++ ...dentity_blocked_pir_grayscale_color_24.xml | 26 ++++++ ...ic_identity_theft_restoration_color_24.xml | 22 +++++ ...y_theft_restoration_grayscale_color_24.xml | 22 +++++ .../src/main/res/drawable/ic_key_color_24.xml | 14 ++++ .../main/res/drawable/ic_lock_color_24.xml | 20 +++++ .../res/drawable/ic_microphone_color_24.xml | 16 ++++ .../res/drawable/ic_privacy_pro_color_24.xml | 19 +++++ .../res/drawable/ic_settings_color_24.xml | 14 ++++ .../main/res/drawable/ic_shield_color_24.xml | 25 ++++++ .../main/res/drawable/ic_sync_color_24.xml | 41 +++++++++ .../res/drawable/ic_video_player_color_24.xml | 54 ++++++++++++ .../src/main/res/drawable/ic_vpn_color_24.xml | 30 +++++++ .../drawable/ic_vpn_grayscale_color_24.xml | 30 +++++++ 26 files changed, 702 insertions(+) create mode 100644 common/common-ui/src/main/res/drawable/ic_accessibility_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_add_widget_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_address_bar_position_bottom_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_appearance_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_cookie_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_default_browser_mobile_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_downloads_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_email_protection_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_find_search_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_fire_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_heart_gray_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_homescreen_lock_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_grayscale_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_grayscale_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_key_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_lock_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_microphone_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_privacy_pro_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_settings_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_shield_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_sync_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_video_player_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_vpn_color_24.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_vpn_grayscale_color_24.xml diff --git a/common/common-ui/src/main/res/drawable/ic_accessibility_color_24.xml b/common/common-ui/src/main/res/drawable/ic_accessibility_color_24.xml new file mode 100644 index 000000000000..9405c25d9027 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_accessibility_color_24.xml @@ -0,0 +1,21 @@ + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_add_widget_color_24.xml b/common/common-ui/src/main/res/drawable/ic_add_widget_color_24.xml new file mode 100644 index 000000000000..75cdf66e5150 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_add_widget_color_24.xml @@ -0,0 +1,35 @@ + + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_address_bar_position_bottom_color_24.xml b/common/common-ui/src/main/res/drawable/ic_address_bar_position_bottom_color_24.xml new file mode 100644 index 000000000000..ad58fc26bb22 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_address_bar_position_bottom_color_24.xml @@ -0,0 +1,32 @@ + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_appearance_color_24.xml b/common/common-ui/src/main/res/drawable/ic_appearance_color_24.xml new file mode 100644 index 000000000000..79dd8196d0ff --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_appearance_color_24.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_cookie_color_24.xml b/common/common-ui/src/main/res/drawable/ic_cookie_color_24.xml new file mode 100644 index 000000000000..e5441f5635d5 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_cookie_color_24.xml @@ -0,0 +1,18 @@ + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_default_browser_mobile_color_24.xml b/common/common-ui/src/main/res/drawable/ic_default_browser_mobile_color_24.xml new file mode 100644 index 000000000000..aa545c377c5e --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_default_browser_mobile_color_24.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_downloads_color_24.xml b/common/common-ui/src/main/res/drawable/ic_downloads_color_24.xml new file mode 100644 index 000000000000..6344bdabf7d3 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_downloads_color_24.xml @@ -0,0 +1,14 @@ + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_email_protection_color_24.xml b/common/common-ui/src/main/res/drawable/ic_email_protection_color_24.xml new file mode 100644 index 000000000000..c6f600620067 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_email_protection_color_24.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_find_search_color_24.xml b/common/common-ui/src/main/res/drawable/ic_find_search_color_24.xml new file mode 100644 index 000000000000..328a7934ea77 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_find_search_color_24.xml @@ -0,0 +1,17 @@ + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_fire_color_24.xml b/common/common-ui/src/main/res/drawable/ic_fire_color_24.xml new file mode 100644 index 000000000000..0a6f8168869d --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_fire_color_24.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_heart_gray_color_24.xml b/common/common-ui/src/main/res/drawable/ic_heart_gray_color_24.xml new file mode 100644 index 000000000000..9cdc407a618e --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_heart_gray_color_24.xml @@ -0,0 +1,13 @@ + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_homescreen_lock_color_24.xml b/common/common-ui/src/main/res/drawable/ic_homescreen_lock_color_24.xml new file mode 100644 index 000000000000..76c8c58e9af4 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_homescreen_lock_color_24.xml @@ -0,0 +1,29 @@ + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_color_24.xml b/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_color_24.xml new file mode 100644 index 000000000000..9ca7a07a4df0 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_color_24.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_grayscale_color_24.xml b/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_grayscale_color_24.xml new file mode 100644 index 000000000000..de4052e7cf09 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_identity_blocked_pir_grayscale_color_24.xml @@ -0,0 +1,26 @@ + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_color_24.xml b/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_color_24.xml new file mode 100644 index 000000000000..a946854278a8 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_color_24.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_grayscale_color_24.xml b/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_grayscale_color_24.xml new file mode 100644 index 000000000000..96d02a09e4ea --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_identity_theft_restoration_grayscale_color_24.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_key_color_24.xml b/common/common-ui/src/main/res/drawable/ic_key_color_24.xml new file mode 100644 index 000000000000..4b152a801d18 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_key_color_24.xml @@ -0,0 +1,14 @@ + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_lock_color_24.xml b/common/common-ui/src/main/res/drawable/ic_lock_color_24.xml new file mode 100644 index 000000000000..27162cb109fa --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_lock_color_24.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_microphone_color_24.xml b/common/common-ui/src/main/res/drawable/ic_microphone_color_24.xml new file mode 100644 index 000000000000..a6cf82f52e11 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_microphone_color_24.xml @@ -0,0 +1,16 @@ + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_privacy_pro_color_24.xml b/common/common-ui/src/main/res/drawable/ic_privacy_pro_color_24.xml new file mode 100644 index 000000000000..1c64b3a19a68 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_privacy_pro_color_24.xml @@ -0,0 +1,19 @@ + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_settings_color_24.xml b/common/common-ui/src/main/res/drawable/ic_settings_color_24.xml new file mode 100644 index 000000000000..962fad1ff515 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_settings_color_24.xml @@ -0,0 +1,14 @@ + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_shield_color_24.xml b/common/common-ui/src/main/res/drawable/ic_shield_color_24.xml new file mode 100644 index 000000000000..6810b8f8e09c --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_shield_color_24.xml @@ -0,0 +1,25 @@ + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml b/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml new file mode 100644 index 000000000000..6dcb6d559970 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_video_player_color_24.xml b/common/common-ui/src/main/res/drawable/ic_video_player_color_24.xml new file mode 100644 index 000000000000..9197b6583a7b --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_video_player_color_24.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_vpn_color_24.xml b/common/common-ui/src/main/res/drawable/ic_vpn_color_24.xml new file mode 100644 index 000000000000..5cc01cc7fc4b --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_vpn_color_24.xml @@ -0,0 +1,30 @@ + + + + + + + + + diff --git a/common/common-ui/src/main/res/drawable/ic_vpn_grayscale_color_24.xml b/common/common-ui/src/main/res/drawable/ic_vpn_grayscale_color_24.xml new file mode 100644 index 000000000000..cc27e807a685 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_vpn_grayscale_color_24.xml @@ -0,0 +1,30 @@ + + + + + + + + + From 797440d531005463b04208f5e90bc99f3b233522 Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Tue, 26 Nov 2024 10:06:06 +0000 Subject: [PATCH 3/7] add new SettingsListItem --- .../common/ui/view/StatusIndicator.kt | 43 +++++++++ .../ui/view/listitem/SettingsListItem.kt | 88 +++++++++++++++++++ .../color/status_indicator_color_selector.xml | 20 +++++ .../main/res/drawable/ic_status_indicator.xml | 23 +++++ .../res/layout/view_settings_list_item.xml | 76 ++++++++++++++++ .../main/res/layout/view_status_indicator.xml | 44 ++++++++++ .../res/values/attrs-settings-list_item.xml | 24 +++++ .../main/res/values/design-system-colors.xml | 1 + 8 files changed, 319 insertions(+) create mode 100644 common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt create mode 100644 common/common-ui/src/main/java/com/duckduckgo/common/ui/view/listitem/SettingsListItem.kt create mode 100644 common/common-ui/src/main/res/color/status_indicator_color_selector.xml create mode 100644 common/common-ui/src/main/res/drawable/ic_status_indicator.xml create mode 100644 common/common-ui/src/main/res/layout/view_settings_list_item.xml create mode 100644 common/common-ui/src/main/res/layout/view_status_indicator.xml create mode 100644 common/common-ui/src/main/res/values/attrs-settings-list_item.xml diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt new file mode 100644 index 000000000000..0a817ee9c0fa --- /dev/null +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2024 DuckDuckGo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.duckduckgo.common.ui.view + +import android.content.Context +import android.util.AttributeSet +import android.widget.LinearLayout +import com.duckduckgo.common.ui.viewbinding.viewBinding +import com.duckduckgo.mobile.android.databinding.ViewStatusIndicatorBinding + +class StatusIndicator @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = 0, +) : LinearLayout(context, attrs, defStyleAttr) { + + private val binding: ViewStatusIndicatorBinding by viewBinding() + + fun setStatus(isOn: Boolean) { + if(isOn) { + binding.icon.isEnabled = true + // TODO copy changes + binding.label.text = "On" + } else { + binding.icon.isEnabled = false + // TODO copy changes + binding.label.text = "Off" } + } +} diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/listitem/SettingsListItem.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/listitem/SettingsListItem.kt new file mode 100644 index 000000000000..b1dbff16a977 --- /dev/null +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/listitem/SettingsListItem.kt @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2024 DuckDuckGo + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.duckduckgo.common.ui.view.listitem + +import android.content.Context +import android.util.AttributeSet +import android.widget.ImageView +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.core.view.isVisible +import com.duckduckgo.common.ui.view.StatusIndicator +import com.duckduckgo.common.ui.view.gone +import com.duckduckgo.common.ui.view.show +import com.duckduckgo.common.ui.view.text.DaxTextView +import com.duckduckgo.common.ui.viewbinding.viewBinding +import com.duckduckgo.mobile.android.R +import com.duckduckgo.mobile.android.databinding.ViewSettingsListItemBinding + +class SettingsListItem @JvmOverloads constructor( + context: Context, + attrs: AttributeSet? = null, + defStyleAttr: Int = R.attr.oneLineListItemStyle, +) : ConstraintLayout(context, attrs, defStyleAttr) { + + private val binding: ViewSettingsListItemBinding by viewBinding() + + val primaryText: DaxTextView + get() = binding.primaryText + val leadingIcon: ImageView + get() = binding.leadingIcon + val betaPill: ImageView + get() = binding.betaPill + val statusIndicator: StatusIndicator + get() = binding.statusIndicator + + init { + context.obtainStyledAttributes( + attrs, + R.styleable.SettingsListItem, + 0, + R.style.Widget_DuckDuckGo_OneLineListItem, + ).apply { + + primaryText.text = getString(R.styleable.SettingsListItem_primaryText) + + val leadingIconRes = getResourceId(R.styleable.SettingsListItem_leadingIcon, 0) + if (leadingIconRes != 0) { + leadingIcon.setImageResource(leadingIconRes) + leadingIcon.show() + } else { + leadingIcon.gone() + } + + setPillVisible(getBoolean(R.styleable.SettingsListItem_showBetaPill, false)) + + val isOn = getBoolean(R.styleable.SettingsListItem_isOn, false) + statusIndicator.setStatus(isOn) + + recycle() + } + } + + /** Sets the item click listener */ + fun setClickListener(onClick: () -> Unit) { + binding.root.setOnClickListener { onClick() } + } + + fun setStatus(isOn: Boolean) { + statusIndicator.setStatus(isOn) + } + + private fun setPillVisible(isVisible: Boolean) { + betaPill.isVisible = isVisible + } +} diff --git a/common/common-ui/src/main/res/color/status_indicator_color_selector.xml b/common/common-ui/src/main/res/color/status_indicator_color_selector.xml new file mode 100644 index 000000000000..f6a2a866b685 --- /dev/null +++ b/common/common-ui/src/main/res/color/status_indicator_color_selector.xml @@ -0,0 +1,20 @@ + + + + + + \ No newline at end of file diff --git a/common/common-ui/src/main/res/drawable/ic_status_indicator.xml b/common/common-ui/src/main/res/drawable/ic_status_indicator.xml new file mode 100644 index 000000000000..51a4b6ea7700 --- /dev/null +++ b/common/common-ui/src/main/res/drawable/ic_status_indicator.xml @@ -0,0 +1,23 @@ + + + + + + + \ No newline at end of file diff --git a/common/common-ui/src/main/res/layout/view_settings_list_item.xml b/common/common-ui/src/main/res/layout/view_settings_list_item.xml new file mode 100644 index 000000000000..f31d09a85c5a --- /dev/null +++ b/common/common-ui/src/main/res/layout/view_settings_list_item.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/common-ui/src/main/res/layout/view_status_indicator.xml b/common/common-ui/src/main/res/layout/view_status_indicator.xml new file mode 100644 index 000000000000..dc087aa43e29 --- /dev/null +++ b/common/common-ui/src/main/res/layout/view_status_indicator.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/common/common-ui/src/main/res/values/attrs-settings-list_item.xml b/common/common-ui/src/main/res/values/attrs-settings-list_item.xml new file mode 100644 index 000000000000..db021c437cf9 --- /dev/null +++ b/common/common-ui/src/main/res/values/attrs-settings-list_item.xml @@ -0,0 +1,24 @@ + + + + + + + + + + diff --git a/common/common-ui/src/main/res/values/design-system-colors.xml b/common/common-ui/src/main/res/values/design-system-colors.xml index b9c14b43201a..dd0e27a0a8cb 100644 --- a/common/common-ui/src/main/res/values/design-system-colors.xml +++ b/common/common-ui/src/main/res/values/design-system-colors.xml @@ -101,6 +101,7 @@ #59000000 + #21C000 #EB102D #2EEB102D #C10D25 From 7799cb0f36303dbf80f5bf7988bd6d3dc8973cde Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Tue, 26 Nov 2024 10:20:36 +0000 Subject: [PATCH 4/7] switch to SettingsListItem in privacy section Also adding all the new icons, removing secondary text and itemState, and adding the new isOn for search and web tracking settings Next commit we'll ensure the indicators are on/off --- .../app/settings/NewSettingsActivity.kt | 11 ----- .../layout/content_settings_new_privacy.xml | 46 ++++++++----------- 2 files changed, 20 insertions(+), 37 deletions(-) diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt index b88de6a32bf8..ee3599fcc0a7 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt @@ -248,10 +248,8 @@ class NewSettingsActivity : DuckDuckGoActivity() { private fun updateEmailSubtitle(emailAddress: String?) { if (emailAddress.isNullOrEmpty()) { - viewsPrivacy.emailSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.settingsEmailProtectionSubtitle)) viewsPrivacy.emailSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) } else { - viewsPrivacy.emailSetting.setSecondaryText(emailAddress) viewsPrivacy.emailSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) } } @@ -264,12 +262,8 @@ class NewSettingsActivity : DuckDuckGoActivity() { private fun updateAutoconsent(enabled: Boolean) { if (enabled) { - viewsPrivacy.cookiePopupProtectionSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.cookiePopupProtectionEnabled)) viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) } else { - viewsPrivacy.cookiePopupProtectionSetting.setSecondaryText( - getString(com.duckduckgo.app.browser.R.string.cookiePopupProtectionDescription), - ) viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) } } @@ -304,10 +298,8 @@ class NewSettingsActivity : DuckDuckGoActivity() { visibility = if (it.showDefaultBrowserSetting) { if (it.isAppDefaultBrowser) { setItemStatus(CheckListItem.CheckItemStatus.ENABLED) - setSecondaryText(getString(com.duckduckgo.app.browser.R.string.settingsDefaultBrowserSetDescription)) } else { setItemStatus(CheckListItem.CheckItemStatus.DISABLED) - setSecondaryText(getString(com.duckduckgo.app.browser.R.string.settingsDefaultBrowserNotSetDescription)) } View.VISIBLE } else { @@ -322,14 +314,11 @@ class NewSettingsActivity : DuckDuckGoActivity() { ) { with(viewsPrivacy) { if (appTPEnabled) { - vpnSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.atp_SettingsDeviceShieldEnabled)) vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) } else { if (appTrackingProtectionOnboardingShown) { - vpnSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.atp_SettingsDeviceShieldDisabled)) vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.WARNING) } else { - vpnSetting.setSecondaryText(getString(com.duckduckgo.app.browser.R.string.atp_SettingsDeviceShieldNeverEnabled)) vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) } } diff --git a/app/src/main/res/layout/content_settings_new_privacy.xml b/app/src/main/res/layout/content_settings_new_privacy.xml index 54ba13385690..f8a7b076896a 100644 --- a/app/src/main/res/layout/content_settings_new_privacy.xml +++ b/app/src/main/res/layout/content_settings_new_privacy.xml @@ -27,55 +27,49 @@ android:layout_height="wrap_content" app:primaryText="@string/settingsHeadingPrivacy" /> - + app:leadingIcon="@drawable/ic_default_browser_mobile_color_24" + app:primaryText="@string/settingsDefaultBrowserTitle" /> - + app:isOn="true" + app:leadingIcon="@drawable/ic_find_search_color_24" + app:primaryText="@string/settingsPrivateSearchTitle" /> - + app:isOn="true" + app:leadingIcon="@drawable/ic_shield_color_24" + app:primaryText="@string/settingsWebTrackingProtectionTitle" /> - + app:leadingIcon="@drawable/ic_cookie_color_24" + app:primaryText="@string/cookiePopupProtectionTitle" /> - + app:leadingIcon="@drawable/ic_lock_color_24" + app:primaryText="@string/atp_SettingsTitle" /> - From fac2d06b9ba02d639ec106533a34baf5ef335583 Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Tue, 26 Nov 2024 10:54:43 +0000 Subject: [PATCH 5/7] set items to on/off based on state I've removed appTrackingProtectionOnboardingShown state as only have 2 states now, on/off, but I will follow up and ask Thomas if this is expected --- .../app/settings/NewSettingsActivity.kt | 39 +++---------------- .../app/settings/NewSettingsViewModel.kt | 22 ++++++++--- 2 files changed, 23 insertions(+), 38 deletions(-) diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt index ee3599fcc0a7..ba87ade83387 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt @@ -50,7 +50,6 @@ import com.duckduckgo.autofill.api.AutofillScreens.AutofillSettingsScreen import com.duckduckgo.autofill.api.AutofillSettingsLaunchSource import com.duckduckgo.common.ui.DuckDuckGoActivity import com.duckduckgo.common.ui.view.gone -import com.duckduckgo.common.ui.view.listitem.CheckListItem import com.duckduckgo.common.ui.view.listitem.TwoLineListItem import com.duckduckgo.common.ui.view.show import com.duckduckgo.common.ui.viewbinding.viewBinding @@ -65,11 +64,11 @@ import com.duckduckgo.settings.api.DuckPlayerSettingsPlugin import com.duckduckgo.settings.api.ProSettingsPlugin import com.duckduckgo.sync.api.SyncActivityWithEmptyParams import com.duckduckgo.windows.api.ui.WindowsScreenWithEmptyParams -import javax.inject.Inject import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import timber.log.Timber +import javax.inject.Inject @InjectWith(ActivityScope::class) class NewSettingsActivity : DuckDuckGoActivity() { @@ -204,7 +203,6 @@ class NewSettingsActivity : DuckDuckGoActivity() { updateDefaultBrowserViewVisibility(it) updateDeviceShieldSettings( it.appTrackingProtectionEnabled, - it.appTrackingProtectionOnboardingShown, ) updateEmailSubtitle(it.emailAddress) updateAutofill(it.showAutofill) @@ -247,11 +245,7 @@ class NewSettingsActivity : DuckDuckGoActivity() { } private fun updateEmailSubtitle(emailAddress: String?) { - if (emailAddress.isNullOrEmpty()) { - viewsPrivacy.emailSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) - } else { - viewsPrivacy.emailSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) - } + viewsPrivacy.emailSetting.setStatus(isOn = !emailAddress.isNullOrEmpty()) } private fun updateSyncSetting(visible: Boolean) { @@ -261,11 +255,7 @@ class NewSettingsActivity : DuckDuckGoActivity() { } private fun updateAutoconsent(enabled: Boolean) { - if (enabled) { - viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) - } else { - viewsPrivacy.cookiePopupProtectionSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) - } + viewsPrivacy.cookiePopupProtectionSetting.setStatus(isOn = enabled) } private fun processCommand(it: Command?) { @@ -296,11 +286,7 @@ class NewSettingsActivity : DuckDuckGoActivity() { private fun updateDefaultBrowserViewVisibility(it: NewSettingsViewModel.ViewState) { with(viewsPrivacy.setAsDefaultBrowserSetting) { visibility = if (it.showDefaultBrowserSetting) { - if (it.isAppDefaultBrowser) { - setItemStatus(CheckListItem.CheckItemStatus.ENABLED) - } else { - setItemStatus(CheckListItem.CheckItemStatus.DISABLED) - } + setStatus(isOn = it.isAppDefaultBrowser) View.VISIBLE } else { View.GONE @@ -308,21 +294,8 @@ class NewSettingsActivity : DuckDuckGoActivity() { } } - private fun updateDeviceShieldSettings( - appTPEnabled: Boolean, - appTrackingProtectionOnboardingShown: Boolean, - ) { - with(viewsPrivacy) { - if (appTPEnabled) { - vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.ENABLED) - } else { - if (appTrackingProtectionOnboardingShown) { - vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.WARNING) - } else { - vpnSetting.setItemStatus(CheckListItem.CheckItemStatus.DISABLED) - } - } - } + private fun updateDeviceShieldSettings(appTPEnabled: Boolean) { + viewsPrivacy.vpnSetting.setStatus(isOn = appTPEnabled) } private fun launchDefaultAppScreen() { diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt index cbe93507e5f1..9f62f331bffb 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt @@ -24,7 +24,22 @@ import androidx.lifecycle.ViewModel import androidx.lifecycle.viewModelScope import com.duckduckgo.anvil.annotations.ContributesViewModel import com.duckduckgo.app.browser.defaultbrowsing.DefaultBrowserDetector -import com.duckduckgo.app.pixels.AppPixelName.* +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_ABOUT_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_ACCESSIBILITY_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_APPEARANCE_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_APPTP_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_COOKIE_POPUP_PROTECTION_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_DEFAULT_BROWSER_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_EMAIL_PROTECTION_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_FIRE_BUTTON_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_GENERAL_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_MAC_APP_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_OPENED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_PERMISSIONS_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_PRIVATE_SEARCH_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_SYNC_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_WEB_TRACKING_PROTECTION_PRESSED +import com.duckduckgo.app.pixels.AppPixelName.SETTINGS_WINDOWS_APP_PRESSED import com.duckduckgo.app.settings.NewSettingsViewModel.Command.LaunchAboutScreen import com.duckduckgo.app.settings.NewSettingsViewModel.Command.LaunchAccessibilitySettings import com.duckduckgo.app.settings.NewSettingsViewModel.Command.LaunchAddHomeScreenWidget @@ -57,7 +72,6 @@ import com.duckduckgo.duckplayer.api.DuckPlayer.DuckPlayerState.ENABLED import com.duckduckgo.mobile.android.app.tracking.AppTrackingProtection import com.duckduckgo.subscriptions.api.Subscriptions import com.duckduckgo.sync.api.DeviceSyncState -import javax.inject.Inject import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.delay @@ -67,6 +81,7 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.isActive import kotlinx.coroutines.launch +import javax.inject.Inject @SuppressLint("NoLifecycleObserver") @ContributesViewModel(ActivityScope::class) @@ -86,7 +101,6 @@ class NewSettingsViewModel @Inject constructor( data class ViewState( val showDefaultBrowserSetting: Boolean = false, val isAppDefaultBrowser: Boolean = false, - val appTrackingProtectionOnboardingShown: Boolean = false, val appTrackingProtectionEnabled: Boolean = false, val emailAddress: String? = null, val showAutofill: Boolean = false, @@ -147,7 +161,6 @@ class NewSettingsViewModel @Inject constructor( currentViewState().copy( isAppDefaultBrowser = defaultBrowserAlready, showDefaultBrowserSetting = defaultWebBrowserCapability.deviceSupportsDefaultBrowserConfiguration(), - appTrackingProtectionOnboardingShown = appTrackingProtection.isOnboarded(), appTrackingProtectionEnabled = appTrackingProtection.isRunning(), emailAddress = emailManager.getEmailAddress(), showAutofill = autofillCapabilityChecker.canAccessCredentialManagementScreen(), @@ -170,7 +183,6 @@ class NewSettingsViewModel @Inject constructor( val isDeviceShieldEnabled = appTrackingProtection.isRunning() val currentState = currentViewState() viewState.value = currentState.copy( - appTrackingProtectionOnboardingShown = appTrackingProtection.isOnboarded(), appTrackingProtectionEnabled = isDeviceShieldEnabled, isPrivacyProEnabled = subscriptions.isEligible(), ) From f475c8764308a3426532818b90b0c74d98daa74e Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Tue, 26 Nov 2024 12:02:47 +0000 Subject: [PATCH 6/7] add SettingsListItem to ADS I think this is worth having on the ADS screen, even if not officially a component. Happy to move it if needs be. --- .../ui/themepreview/ui/component/Component.kt | 1 + .../ui/component/ComponentViewHolder.kt | 4 ++ .../ComponentListItemsElementsFragment.kt | 3 +- .../main/res/layout/component_settings.xml | 62 +++++++++++++++++++ 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 common/common-ui/src/main/res/layout/component_settings.xml diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/Component.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/Component.kt index 15801bef6c26..ce224e22ea39 100644 --- a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/Component.kt +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/Component.kt @@ -44,5 +44,6 @@ enum class Component { SECTION_HEADER_LIST_ITEM, SINGLE_LINE_LIST_ITEM, TWO_LINE_LIST_ITEM, + SETTINGS_LIST_ITEM, SECTION_DIVIDER, } diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/ComponentViewHolder.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/ComponentViewHolder.kt index 7fce077d5bee..10816aec5641 100644 --- a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/ComponentViewHolder.kt +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/ComponentViewHolder.kt @@ -384,6 +384,9 @@ sealed class ComponentViewHolder(val view: View) : RecyclerView.ViewHolder(view) } } + class SettingsListItemComponentViewHolder(parent: ViewGroup) : + ComponentViewHolder(inflate(parent, R.layout.component_settings)) + companion object { fun create( parent: ViewGroup, @@ -408,6 +411,7 @@ sealed class ComponentViewHolder(val view: View) : RecyclerView.ViewHolder(view) Component.SECTION_DIVIDER -> DividerComponentViewHolder(parent) Component.CARD -> CardComponentViewHolder(parent) Component.EXPANDABLE_LAYOUT -> ExpandableComponentViewHolder(parent) + Component.SETTINGS_LIST_ITEM -> SettingsListItemComponentViewHolder(parent) else -> { TODO() } diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/listitems/ComponentListItemsElementsFragment.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/listitems/ComponentListItemsElementsFragment.kt index e7797aab898f..e64636191f07 100644 --- a/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/listitems/ComponentListItemsElementsFragment.kt +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/themepreview/ui/component/listitems/ComponentListItemsElementsFragment.kt @@ -20,12 +20,13 @@ import com.duckduckgo.common.ui.themepreview.ui.component.Component import com.duckduckgo.common.ui.themepreview.ui.component.Component.MENU_ITEM import com.duckduckgo.common.ui.themepreview.ui.component.Component.POPUP_MENU_ITEM import com.duckduckgo.common.ui.themepreview.ui.component.Component.SECTION_HEADER_LIST_ITEM +import com.duckduckgo.common.ui.themepreview.ui.component.Component.SETTINGS_LIST_ITEM import com.duckduckgo.common.ui.themepreview.ui.component.Component.SINGLE_LINE_LIST_ITEM import com.duckduckgo.common.ui.themepreview.ui.component.Component.TWO_LINE_LIST_ITEM import com.duckduckgo.common.ui.themepreview.ui.component.ComponentFragment class ComponentListItemsElementsFragment : ComponentFragment() { override fun getComponents(): List { - return listOf(SECTION_HEADER_LIST_ITEM, SINGLE_LINE_LIST_ITEM, TWO_LINE_LIST_ITEM, MENU_ITEM, POPUP_MENU_ITEM) + return listOf(SECTION_HEADER_LIST_ITEM, SINGLE_LINE_LIST_ITEM, TWO_LINE_LIST_ITEM, SETTINGS_LIST_ITEM, MENU_ITEM, POPUP_MENU_ITEM) } } diff --git a/common/common-ui/src/main/res/layout/component_settings.xml b/common/common-ui/src/main/res/layout/component_settings.xml new file mode 100644 index 000000000000..a22c55224d89 --- /dev/null +++ b/common/common-ui/src/main/res/layout/component_settings.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + \ No newline at end of file From d8f02fdf093916958fcf541ab8fa2d3584f2136e Mon Sep 17 00:00:00 2001 From: Mike Scamell Date: Tue, 26 Nov 2024 11:18:30 +0000 Subject: [PATCH 7/7] formatting --- .../java/com/duckduckgo/app/settings/NewSettingsActivity.kt | 2 +- .../com/duckduckgo/app/settings/NewSettingsViewModel.kt | 2 +- .../java/com/duckduckgo/common/ui/view/StatusIndicator.kt | 5 +++-- common/common-ui/src/main/res/drawable/ic_sync_color_24.xml | 4 ++-- .../src/main/res/drawable/ic_video_player_color_24.xml | 6 +++--- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt index ba87ade83387..5afdc8bc9a70 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsActivity.kt @@ -64,11 +64,11 @@ import com.duckduckgo.settings.api.DuckPlayerSettingsPlugin import com.duckduckgo.settings.api.ProSettingsPlugin import com.duckduckgo.sync.api.SyncActivityWithEmptyParams import com.duckduckgo.windows.api.ui.WindowsScreenWithEmptyParams +import javax.inject.Inject import kotlinx.coroutines.flow.distinctUntilChanged import kotlinx.coroutines.flow.launchIn import kotlinx.coroutines.flow.onEach import timber.log.Timber -import javax.inject.Inject @InjectWith(ActivityScope::class) class NewSettingsActivity : DuckDuckGoActivity() { diff --git a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt index 9f62f331bffb..14d316c51289 100644 --- a/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt +++ b/app/src/main/java/com/duckduckgo/app/settings/NewSettingsViewModel.kt @@ -72,6 +72,7 @@ import com.duckduckgo.duckplayer.api.DuckPlayer.DuckPlayerState.ENABLED import com.duckduckgo.mobile.android.app.tracking.AppTrackingProtection import com.duckduckgo.subscriptions.api.Subscriptions import com.duckduckgo.sync.api.DeviceSyncState +import javax.inject.Inject import kotlinx.coroutines.channels.BufferOverflow import kotlinx.coroutines.channels.Channel import kotlinx.coroutines.delay @@ -81,7 +82,6 @@ import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.receiveAsFlow import kotlinx.coroutines.isActive import kotlinx.coroutines.launch -import javax.inject.Inject @SuppressLint("NoLifecycleObserver") @ContributesViewModel(ActivityScope::class) diff --git a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt index 0a817ee9c0fa..48b4be2b75a0 100644 --- a/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt +++ b/common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt @@ -31,13 +31,14 @@ class StatusIndicator @JvmOverloads constructor( private val binding: ViewStatusIndicatorBinding by viewBinding() fun setStatus(isOn: Boolean) { - if(isOn) { + if (isOn) { binding.icon.isEnabled = true // TODO copy changes binding.label.text = "On" } else { binding.icon.isEnabled = false // TODO copy changes - binding.label.text = "Off" } + binding.label.text = "Off" + } } } diff --git a/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml b/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml index 6dcb6d559970..2ec36b36353f 100644 --- a/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml +++ b/common/common-ui/src/main/res/drawable/ic_sync_color_24.xml @@ -8,7 +8,7 @@ android:pathData="M4.094,11.393A6.974,6.974 0,0 1,16.28 8.805h3.829a8.717,8.717 0,0 0,-16.776 2.284l0.76,0.304Z" android:fillType="evenOdd"> - - - - -