-
Notifications
You must be signed in to change notification settings - Fork 916
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Settings design: Add new SettingsListItem (#5318)
Task/Issue URL: https://app.asana.com/0/1207908166761516/1208785622935231/f ### Description - Adds all new Icons for Settings (not all are implemented) - Adds new SettingsListItem - Also added to the ADS screen - [Designs](https://www.figma.com/design/CjH849hL53lhsPlf6Ufeo4/%E2%9A%99%EF%B8%8F-Browser-Settings-Documentation-(All-Platforms)?node-id=7605-431390&t=loz3Qauz2ZOadWY7-4) - Tackles the privacy section without any copy changes which will be done in a later PR ### Steps to test this PR Pre-requisites: - `newSettings` feature flag must be enabled - Easier to start with a fresh launch - Don't enable DDG as default browser _Default Browser On/Off_ - [x] Open New Settings screen - [x] Default browser should be `off` ⚪ - [x] Press default browser - [x] Select DDG - [x] Press back to get back to the New Settings screen - [x] Default browser should be `on` 🟢 - [x] Press default browser - [x] Select another browser - [x] Press back to get back to the New Settings screen - [x] Default browser should be `off` ⚪ _Private Search_ - [x] Should be `on` and is always on _Web Tracking Protection_ - [x] Should be `on` and is always on _Cookie Pop-Up Protection_ - [x] Open New Settings screen - [x] Cookie Pop-Up Protection should be `on` 🟢 - [x] Press Cookie Pop-Up Protection - [x] Toggle **off** "Let DuckDuckGo handle cookie pop-ups" - [x] Press back - [x] Cookie Pop-Up Protection should be `off` ⚪ - [x] Press Cookie Pop-Up Protection - [x] Toggle **on** "Let DuckDuckGo handle cookie pop-ups" - [x] Press back - [x] Cookie Pop-Up Protection should be `on` 🟢 _App Tracking Protection_ - [x] Open New Settings screen - [x] App Tracking Protection should be `off` ⚪ - [x] Press App Tracking Protection - [x] Toggle **on** App Tracking Protection - [x] Press back - [x] App Tracking Protection should be `on` 🟢 - [x] Press App Tracking Protection - [x] Toggle **off** App Tracking Protection - [x] Press back - [x] App Tracking Protection should be `off` ⚪ _Email Protection_ - [x] Open New Settings screen - [x] Email Protection should be `off` ⚪ - [x] Press Email Protection - [x] Follow steps to turn on Email Protection - [x] Open New Settings screen - [x] Email Protection should be `on` 🟢 - [x] Press Email Protection - [x] Sign out - [x] Open New Settings screen - [x] Email Protection should be `off` ⚪ ### UI changes | Before | After | | ------ | ----- | ![Screenshot_20241126_145126](https://github.com/user-attachments/assets/5ec4e3a0-4c0a-4e33-ae30-891115a1e9f7)|![Screenshot_20241126_145056](https://github.com/user-attachments/assets/11998eff-03eb-4449-99cc-4bf1ecb1b09e)| ![Screenshot_20241126_145134](https://github.com/user-attachments/assets/e354dbe9-dfd3-4040-a179-bff6ce5cd936)|![Screenshot_20241126_145109](https://github.com/user-attachments/assets/fd538cc6-f873-4a55-b373-6c02623e04cd) ![Screenshot_20241126_145502](https://github.com/user-attachments/assets/b3955b96-8c5d-49fd-a5eb-a15e2ec4d083)|![Screenshot_20241126_145543](https://github.com/user-attachments/assets/661c22ac-b037-460f-b62e-f37a8e89083d) ### Demo https://github.com/user-attachments/assets/df4c0a75-05f9-4ddd-afe8-b9dfb58b7fb9
- Loading branch information
1 parent
04e0326
commit 010d9cf
Showing
43 changed files
with
1,258 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright (c) 2017 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. | ||
--> | ||
|
||
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
xmlns:tools="http://schemas.android.com/tools" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
app:layout_behavior="@string/appbar_scrolling_view_behavior" | ||
tools:ignore="Overdraw"> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical" | ||
android:paddingBottom="20dp"> | ||
|
||
<include | ||
android:id="@+id/contentSettingsPrivacy" | ||
layout="@layout/content_settings_new_privacy" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_marginTop="@dimen/keyline_4" /> | ||
|
||
<LinearLayout | ||
android:id="@+id/settingsSectionPro" | ||
android:layout_width="match_parent" | ||
android:layout_height="match_parent" | ||
android:orientation="vertical" > | ||
<com.duckduckgo.common.ui.view.divider.HorizontalDivider | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
</LinearLayout> | ||
|
||
<include | ||
android:id="@+id/contentSettingsSettings" | ||
layout="@layout/content_settings_settings" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
|
||
<include | ||
android:id="@+id/contentSettingsMore" | ||
layout="@layout/content_settings_other" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
|
||
<include | ||
android:id="@+id/contentSettingsInternal" | ||
layout="@layout/content_settings_internal" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" /> | ||
|
||
</LinearLayout> | ||
|
||
</ScrollView> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<?xml version="1.0" encoding="utf-8"?><!-- | ||
~ Copyright (c) 2018 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. | ||
--> | ||
|
||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
xmlns:app="http://schemas.android.com/apk/res-auto" | ||
android:id="@+id/settingsSectionPrivacy" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:orientation="vertical"> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SectionHeaderListItem | ||
android:id="@+id/settingsPrivacyTitle" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:primaryText="@string/settingsHeadingPrivacy" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/setAsDefaultBrowserSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:leadingIcon="@drawable/ic_default_browser_mobile_color_24" | ||
app:primaryText="@string/settingsDefaultBrowserTitle" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/privateSearchSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:isOn="true" | ||
app:leadingIcon="@drawable/ic_find_search_color_24" | ||
app:primaryText="@string/settingsPrivateSearchTitle" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/webTrackingProtectionSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:isOn="true" | ||
app:leadingIcon="@drawable/ic_shield_color_24" | ||
app:primaryText="@string/settingsWebTrackingProtectionTitle" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/cookiePopupProtectionSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:leadingIcon="@drawable/ic_cookie_color_24" | ||
app:primaryText="@string/cookiePopupProtectionTitle" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/vpnSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:leadingIcon="@drawable/ic_lock_color_24" | ||
app:primaryText="@string/atp_SettingsTitle" /> | ||
|
||
<com.duckduckgo.common.ui.view.listitem.SettingsListItem | ||
android:id="@+id/emailSetting" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
app:leadingIcon="@drawable/ic_email_protection_color_24" | ||
app:primaryText="@string/settingsEmailProtectionTitle" | ||
app:showBetaPill="true" /> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
common/common-ui/src/main/java/com/duckduckgo/common/ui/view/StatusIndicator.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* 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" | ||
} | ||
} | ||
} |
Oops, something went wrong.