Skip to content

Commit

Permalink
Revert "ADS: Framework related colors" (#2573)
Browse files Browse the repository at this point in the history
Reverts #2567
  • Loading branch information
malmstein committed Jan 12, 2023
1 parent 09ae2c1 commit 5d9dca3
Show file tree
Hide file tree
Showing 28 changed files with 738 additions and 221 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ internal class TrackersLottieAssetDelegate(
}

private val textPaint = Paint(Paint.ANTI_ALIAS_FLAG).apply {
color = context.getColorFromAttr(com.duckduckgo.mobile.android.R.attr.daxColorContainer)
color = context.getColorFromAttr(com.duckduckgo.mobile.android.R.attr.omnibarRoundedFieldBackgroundColor)
typeface = Typeface.SANS_SERIF
}

Expand Down
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
150 changes: 68 additions & 82 deletions app/src/main/res/layout/activity_accessibility_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,114 +14,100 @@
~ limitations under the License.
-->

<androidx.coordinatorlayout.widget.CoordinatorLayout 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"
tools:context="com.duckduckgo.app.accessibility.AccessibilityActivity">
<LinearLayout 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"
android:orientation="vertical">

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

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:ignore="Overdraw">
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:paddingTop="@dimen/keyline_4"
android:paddingBottom="@dimen/keyline_4"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/keyline_4">

<com.duckduckgo.mobile.android.ui.view.listitem.TwoLineListItem
android:id="@+id/appFontSizeToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:secondaryText="@string/accessibilityTextSizeOverrideSubtitle"
app:primaryText="@string/accessibilityTextSizeOverrideTitle"
app:showSwitch="true"/>
android:id="@+id/appFontSizeToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:primaryText="@string/accessibilityTextSizeOverrideTitle"
app:secondaryText="@string/accessibilityTextSizeOverrideSubtitle"
app:showSwitch="true" />

<LinearLayout
android:id="@+id/fontSizeSettingsGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="Overdraw">
android:id="@+id/fontSizeSettingsGroup"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
tools:ignore="Overdraw">

<com.duckduckgo.mobile.android.ui.view.text.SectionHeaderTextView
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/keyline_4"
android:orientation="horizontal"
android:paddingStart="@dimen/keyline_4"
android:paddingEnd="@dimen/keyline_4"
android:text="@string/accessibilityFontSizeTitle"
tools:text="Text goes here"/>
android:paddingEnd="@dimen/keyline_4">

<LinearLayout
android:layout_width="match_parent"
<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/accessibilitySliderValue"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingStart="@dimen/keyline_4"
android:paddingEnd="@dimen/keyline_4">

<TextView
android:id="@+id/accessibilitySliderValue"
style="@style/TextAppearance.DuckDuckGo.Body1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:gravity="center_vertical|start"
android:minWidth="50dp"
android:textColor="?attr/normalTextColor"/>
android:layout_gravity="center"
android:minWidth="50dp"
app:typography="body1" />

<com.google.android.material.slider.Slider
android:id="@+id/accessibilitySlider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="@dimen/keyline_4"
android:paddingBottom="@dimen/keyline_4"
android:stepSize="10"
android:valueFrom="70"
android:valueTo="170"
app:labelBehavior="gone"
app:tickVisible="false"/>
android:id="@+id/accessibilitySlider"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:paddingTop="@dimen/keyline_4"
android:paddingBottom="@dimen/keyline_4"
android:stepSize="10"
android:valueFrom="70"
android:valueTo="170"
app:labelBehavior="gone"
app:tickVisible="false" />
</LinearLayout>

<TextView
android:id="@+id/accessibilityHint"
style="@style/TextAppearance.DuckDuckGo.Body1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginStart="@dimen/keyline_4"
android:layout_marginTop="@dimen/keyline_4"
android:layout_marginEnd="@dimen/keyline_4"
android:background="?lightContainerBackground"
android:ellipsize="end"
android:padding="@dimen/keyline_2"
android:text="@string/accessibilityFontSizeHint"
android:textColor="?attr/normalTextColor"/>
<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/accessibilityHint"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/keyline_4"
android:layout_marginTop="@dimen/keyline_4"
android:layout_marginEnd="@dimen/keyline_4"
android:layout_marginBottom="16dp"
android:background="@drawable/background_text_view_container"
android:padding="@dimen/keyline_4"
android:text="@string/accessibilityFontSizeHint"
app:typography="body1" />
</LinearLayout>

<com.duckduckgo.mobile.android.ui.view.divider.HorizontalDivider
android:id="@+id/accessibilityDivider"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/accessibilityDivider"/>
android:layout_height="wrap_content" />

<com.duckduckgo.mobile.android.ui.view.listitem.TwoLineListItem
android:id="@+id/forceZoomToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:secondaryText="@string/accessibilityForceZoomSubtitle"
app:primaryText="@string/accessibilityForceZoomTitle"
app:showSwitch="true"/>
android:id="@+id/forceZoomToggle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:primaryText="@string/accessibilityForceZoomTitle"
app:secondaryText="@string/accessibilityForceZoomSubtitle"
app:showSwitch="true" />

</LinearLayout>
</ScrollView>
</androidx.coordinatorlayout.widget.CoordinatorLayout>
</LinearLayout>
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>
1 change: 0 additions & 1 deletion app/src/main/res/layout/include_new_browser_tab.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:clipChildren="false"
tools:context="com.duckduckgo.app.browser.BrowserActivity"
tools:showIn="@layout/fragment_browser_tab">

Expand Down
1 change: 1 addition & 0 deletions autoconsent/autoconsent-impl/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ dependencies {
implementation AndroidX.appCompat
implementation JakeWharton.timber
implementation KotlinX.coroutines.core
implementation Google.android.material

testImplementation (KotlinX.coroutines.test) {
// https://github.com/Kotlin/kotlinx.coroutines/issues/2023
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,30 @@
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
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"/>
layout="@layout/include_default_toolbar" />

<TextView
<com.duckduckgo.mobile.android.ui.view.text.DaxTextView
android:id="@+id/autoconsentDescription"
android:layout_width="match_parent"
android:layout_height="wrap_content"
style="@style/TextAppearance.AppCompat.Body2"
android:fontFamily="sans-serif"
android:layout_margin="16dp"
android:paddingTop="12dp"
android:lineSpacingExtra="4sp"
android:layout_margin="@dimen/keyline_4"
android:text="@string/autoconsentDescription"
android:textColor="?attr/settingsMinorTextColor"
android:textSize="14sp"
android:textStyle="normal"/>
app:textType="secondary"
app:typography="body2" />

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

</LinearLayout>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2022 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.autofill.ui.urlmatcher

interface AutofillUrlMatcher {
fun extractUrlPartsForAutofill(originalUrl: String): ExtractedUrlParts
fun matchingForAutofill(visitedSite: ExtractedUrlParts, savedSite: ExtractedUrlParts): Boolean

data class ExtractedUrlParts(val eTldPlus1: String?, val subdomain: String?)
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import com.duckduckgo.autofill.store.RealAutofillPrefsStore
import com.duckduckgo.autofill.store.RealInternalTestUserStore
import com.duckduckgo.autofill.store.RealLastUpdatedTimeProvider
import com.duckduckgo.autofill.store.SecureStoreBackedAutofillStore
import com.duckduckgo.autofill.store.urlmatcher.AutofillDomainNameUrlMatcher
import com.duckduckgo.autofill.ui.urlmatcher.AutofillUrlMatcher
import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.securestorage.api.SecureStorage
import com.squareup.anvil.annotations.ContributesTo
Expand All @@ -44,12 +46,17 @@ class AutofillModule {
secureStorage: SecureStorage,
context: Context,
internalTestUserChecker: InternalTestUserChecker,
autofillUrlMatcher: AutofillUrlMatcher,
): AutofillStore {
return SecureStoreBackedAutofillStore(
secureStorage,
internalTestUserChecker,
RealLastUpdatedTimeProvider(),
RealAutofillPrefsStore(context, internalTestUserChecker),
secureStorage = secureStorage,
internalTestUserChecker = internalTestUserChecker,
lastUpdatedTimeProvider = RealLastUpdatedTimeProvider(),
autofillPrefsStore = RealAutofillPrefsStore(context, internalTestUserChecker),
autofillUrlMatcher = autofillUrlMatcher,
)
}

@Provides
fun provideAutofillUrlMatcher(): AutofillUrlMatcher = AutofillDomainNameUrlMatcher()
}

0 comments on commit 5d9dca3

Please sign in to comment.