Skip to content

Commit

Permalink
ADS: GPC screen migration (#2557)
Browse files Browse the repository at this point in the history
<!--
Note: This checklist is a reminder of our shared engineering
expectations.
The items in Bold are required
If your PR involves UI changes:
1. Upload screenshots or screencasts that illustrate the changes before
/ after
2. Add them under the UI changes section (feel free to add more columns
if needed)
    3. Make sure these changes are tested in API 23 and API 26
If your PR does not involve UI changes, you can remove the **UI
changes** section
-->

Task/Issue URL: https://app.asana.com/0/0/1203418963160798/f

### Description
Global Privacy Control screen 100% migrated to new components

### Steps to test this PR

- Install from this branch
- Go to Settings > Global Privacy Control (GPC)
- [ ] Check screen looks as expected

### UI changes
| Before  | After |
| ------ | ----- |

![Screenshot_20221124-100149_DuckDuckGo](https://user-images.githubusercontent.com/20798495/203757021-1b931a7a-dfbb-41fb-92af-e30c6faa88f9.jpg)|![Screenshot_20221124-100405_DuckDuckGo](https://user-images.githubusercontent.com/20798495/203757276-10fd5129-0a87-45ae-a864-695c2b1c6793.jpg)|

![Screenshot_20221124-100341_DuckDuckGo](https://user-images.githubusercontent.com/20798495/203757037-57eb0cff-cd1b-4342-bece-42d22f06ea46.jpg)|![Screenshot_20221124-100356_DuckDuckGo](https://user-images.githubusercontent.com/20798495/203757306-54f4072d-22c1-4bd5-91a7-dc9fc4b73851.jpg)|
  • Loading branch information
nalcalag authored and malmstein committed Jan 12, 2023
1 parent d27c6fd commit ee20046
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class GlobalPrivacyControlActivity : DuckDuckGoActivity() {
gpcSpannableString.getSpanFlags(it),
)
removeSpan(it)
trim()
}
}
binding.globalPrivacyControlDescription.apply {
Expand Down
49 changes: 18 additions & 31 deletions app/src/main/res/layout/activity_global_privacy_control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,42 +17,29 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.duckduckgo.app.globalprivacycontrol.ui.GlobalPrivacyControlActivity">
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">

<include
android:id="@+id/includeToolbar"
layout="@layout/include_default_toolbar" />

<LinearLayout
android:orientation="vertical"
<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/globalPrivacyControlDescription"
android:layout_width="match_parent"
android:layout_height="match_parent">

<com.google.android.material.textview.MaterialTextView
android:id="@+id/globalPrivacyControlDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:layout_margin="16dp"
android:paddingTop="12dp"
android:lineSpacingExtra="4sp"
android:text="@string/globalPrivacyControlDescription"
android:textColor="?attr/settingsMinorTextColor"
android:textSize="14sp"
android:textStyle="normal" />

<com.duckduckgo.mobile.android.ui.view.listitem.OneLineListItem
android:id="@+id/globalPrivacyControlToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:primaryText="@string/globalPrivacyControlToggle"
app:showSwitch="true"/>

</LinearLayout>
android:layout_height="wrap_content"
android:layout_margin="@dimen/keyline_4"
android:text="@string/globalPrivacyControlDescription"
app:textType="secondary"
app:typography="body2" />

<com.duckduckgo.mobile.android.ui.view.listitem.OneLineListItem
android:id="@+id/globalPrivacyControlToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:primaryText="@string/globalPrivacyControlToggle"
app:showSwitch="true" />

</LinearLayout>

0 comments on commit ee20046

Please sign in to comment.