Skip to content

Commit

Permalink
Merge branch 'release/5.81.0' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosholgado committed Apr 20, 2021
2 parents ff6d35e + 8d792c9 commit 8ffa4e3
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ class VariantManagerTest {
@Test
fun serpControlVariantHasExpectedWeightAndNoFeatures() {
val variant = variants.first { it.key == "sc" }
assertEqualsDouble(0.0, variant.weight)
assertEqualsDouble(1.0, variant.weight)
assertEquals(0, variant.features.size)
}

@Test
fun serpExperimentalVariantHasExpectedWeightAndNoFeatures() {
val variant = variants.first { it.key == "se" }
assertEqualsDouble(0.0, variant.weight)
assertEqualsDouble(1.0, variant.weight)
assertEquals(0, variant.features.size)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ class BrowserActivity : DuckDuckGoActivity(), CoroutineScope by MainScope() {
@SuppressLint("MissingSuperCall")
override fun onCreate(savedInstanceState: Bundle?) {
super.daggerInject()
intent?.sanitize()
Timber.i("onCreate called. freshAppLaunch: ${dataClearer.isFreshAppLaunch}, savedInstanceState: $savedInstanceState")
dataClearerForegroundAppRestartPixel.registerIntent(intent)
renderer = BrowserStateRenderer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1674,7 +1674,6 @@ class BrowserTabFragment :

if (!viewState.isLoading && lastSeenBrowserViewState?.browserShowing == true) {
swipeRefreshContainer.isRefreshing = false
webView?.detectOverscrollBehavior()
}
}
}
Expand Down
15 changes: 0 additions & 15 deletions app/src/main/java/com/duckduckgo/app/browser/DuckDuckGoWebView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
lastY -= scrollOffset[1]
}

if (canSwipeToRefresh && scrollY == 0 && lastClampedTopY && nestedOffsetY == 0) {
// we are on a new gesture, have reached the top, are clamped vertically and nestedScrollY is done too -> enable swipeRefresh (by default always disabled)
enableSwipeRefresh(true)
}

lastDeltaY = deltaY
}

Expand Down Expand Up @@ -176,16 +171,6 @@ class DuckDuckGoWebView : WebView, NestedScrollingChild {
enableSwipeRefreshCallback = callback
}

/**
* Allows us to determine whether to (de)activate Swipe to Refresh behavior for the current page content, e.g. if page implements a swipe behavior of its
* own already (see twitter.com).
*/
fun detectOverscrollBehavior() {
evaluateJavascript("(function() { return getComputedStyle(document.querySelector('body')).overscrollBehaviorY; })();") { behavior ->
setContentAllowsSwipeToRefresh(behavior.replace("\"", "") == "auto")
}
}

private fun enableSwipeRefresh(enable: Boolean) {
enableSwipeRefreshCallback?.invoke(enable && contentAllowsSwipeToRefresh)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ import com.duckduckgo.app.pixels.AppPixelName
import com.duckduckgo.app.systemsearch.SystemSearchViewModel.Command.*
import com.duckduckgo.app.systemsearch.SystemSearchViewModel.SystemSearchResultsViewState
import kotlinx.android.synthetic.main.activity_system_search.*
import kotlinx.android.synthetic.main.activity_system_search.appBarLayout
import kotlinx.android.synthetic.main.activity_system_search.autocompleteSuggestions
import kotlinx.android.synthetic.main.activity_system_search.clearTextButton
import kotlinx.android.synthetic.main.activity_system_search.deviceAppSuggestions
import kotlinx.android.synthetic.main.activity_system_search.deviceLabel
import kotlinx.android.synthetic.main.activity_system_search.logo
import kotlinx.android.synthetic.main.activity_system_search.omnibarTextInput
import kotlinx.android.synthetic.main.activity_system_search.results
import kotlinx.android.synthetic.main.activity_system_search.resultsContent
import kotlinx.android.synthetic.main.include_system_search_onboarding.*
import javax.inject.Inject

Expand Down Expand Up @@ -165,10 +174,10 @@ class SystemSearchActivity : DuckDuckGoActivity() {
private fun updateScroll() {
val scrollable = resultsContent.height > (results.height - results.paddingTop - results.paddingBottom)
if (scrollable) {
omnibarScrolling.enableOmnibarScrolling(toolbar)
omnibarScrolling.enableOmnibarScrolling(toolbarContainer)
} else {
showOmnibar()
omnibarScrolling.disableOmnibarScrolling(toolbar)
omnibarScrolling.disableOmnibarScrolling(toolbarContainer)
}
}

Expand Down
163 changes: 88 additions & 75 deletions app/src/main/res/layout/activity_system_search.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,84 +25,96 @@
android:id="@+id/appBarLayout"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
android:theme="@style/AppTheme.Dark.AppBarOverlay">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/toolbarContainer"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
android:theme="@style/OmnibarToolbarTheme"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.Dark.PopupOverlay">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/omniBarContainer"
android:layout_height="match_parent"
android:background="?toolbarBgColor">

<androidx.appcompat.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginStart="16dp"
android:layout_marginTop="8dp"
android:layout_marginEnd="16dp"
android:layout_marginBottom="8dp">

<ImageView
android:id="@+id/logo"
android:layout_width="30dp"
android:layout_height="30dp"
android:importantForAccessibility="no"
android:src="@drawable/logo_mini"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/omnibarTextInput"
style="@style/Base.V7.Widget.AppCompat.EditText"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="16dp"
android:layout_marginEnd="16dp"
android:background="@android:color/transparent"
android:fontFamily="sans-serif-medium"
android:hint="@string/systemSearchOmnibarInputHint"
android:imeOptions="flagNoExtractUi|actionGo|flagNoPersonalizedLearning"
android:inputType="textUri|textNoSuggestions"
android:maxLines="1"
android:selectAllOnFocus="true"
android:textColor="?attr/omnibarTextColor"
android:textColorHint="?attr/omnibarHintColor"
android:textCursorDrawable="@drawable/text_cursor"
android:textSize="16sp"
android:textStyle="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/clearTextButton"
app:layout_constraintStart_toEndOf="@id/logo"
app:layout_constraintTop_toTopOf="parent"
tools:text="https://duckduckgo.com/?q=areallylongexampleexample">

<requestFocus />

</androidx.appcompat.widget.AppCompatEditText>

<ImageView
android:id="@+id/clearTextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:contentDescription="@string/clearButtonContentDescription"
android:padding="3dp"
android:src="@drawable/ic_close_24dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>

</androidx.appcompat.widget.Toolbar>
android:layout_height="?attr/actionBarSize"
android:background="?attr/toolbarBgColor"
app:contentInsetEnd="0dp"
app:contentInsetStart="0dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:layout_scrollFlags="scroll|enterAlways"
app:popupTheme="@style/AppTheme.Dark.PopupOverlay">

<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/omniBarContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_margin="8dp"
android:background="@drawable/omnibar_field_background"
android:paddingStart="6dp"
android:paddingEnd="6dp">

<ImageView
android:id="@+id/logo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:importantForAccessibility="no"
android:src="@drawable/ic_ddg_logo"
android:padding="4dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />

<androidx.appcompat.widget.AppCompatEditText
android:id="@+id/omnibarTextInput"
style="@style/Base.V7.Widget.AppCompat.EditText"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginStart="8dp"
android:background="@null"
android:fontFamily="sans-serif"
android:hint="@string/systemSearchOmnibarInputHint"
android:imeOptions="flagNoExtractUi|actionGo|flagNoPersonalizedLearning"
android:inputType="textUri|textNoSuggestions"
android:maxLines="1"
android:selectAllOnFocus="true"
android:textColor="?attr/omnibarTextColor"
android:textColorHint="?attr/omnibarHintColor"
android:textCursorDrawable="@drawable/text_cursor"
android:textSize="16sp"
android:textStyle="normal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@id/clearTextButton"
app:layout_constraintStart_toEndOf="@id/logo"
app:layout_constraintTop_toTopOf="parent"
tools:text="https://duckduckgo.com/?q=areallylongexampleexample">

<requestFocus />

</androidx.appcompat.widget.AppCompatEditText>

<ImageView
android:id="@+id/clearTextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="?selectableItemBackground"
android:contentDescription="@string/clearButtonContentDescription"
android:padding="3dp"
android:src="@drawable/ic_close"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible" />

</androidx.constraintlayout.widget.ConstraintLayout>


</androidx.appcompat.widget.Toolbar>

</androidx.constraintlayout.widget.ConstraintLayout>


</com.google.android.material.appbar.AppBarLayout>

Expand All @@ -119,8 +131,9 @@
android:id="@+id/resultsContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/colorPrimary"
android:clipToPadding="false"
android:background="?toolbarBgColor"
android:backgroundTint="?toolbarBgColor"
android:elevation="4dp">

<androidx.recyclerview.widget.RecyclerView
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/layout/include_omnibar_toolbar.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
app:layout_constraintBottom_toBottomOf="@id/omnibarIconContainer"
app:layout_constraintStart_toStartOf="@id/omnibarIconContainer"
app:layout_constraintTop_toTopOf="@id/omnibarIconContainer"

tools:ignore="RtlSymmetry" >
</androidx.constraintlayout.widget.ConstraintLayout>

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/values-cs/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
<string name="settingsHeadingGeneral">Obecné</string>
<string name="settingsHeadingOther">Jiné</string>
<string name="settingsHeadingPrivacy">Soukromí</string>
<string name="settingsLightTheme">Lehký motiv</string>
<string name="settingsLightTheme">Světlý motiv</string>
<string name="settingsAboutDuckduckgo">O DuckDuckGo</string>
<string name="settingsVersion">Verze</string>
<string name="leaveFeedback">Podělte se o zpětnou vazbu</string>
Expand Down
2 changes: 1 addition & 1 deletion app/version/release-notes
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## What's new in this release?
In this release we fixed some problems with Google 3rd party Authentication.
Squashed some bugs that were running around.

Join our fully distributed team and help raise the standard of trust online — from anywhere! https://duckduckgo.com/hiring

Expand Down
2 changes: 1 addition & 1 deletion app/version/version.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION=5.80.0
VERSION=5.81.0
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ interface VariantManager {
val ACTIVE_VARIANTS = listOf(
// SERP variants. "sc" may also be used as a shared control for mobile experiments in
// the future if we can filter by app version
Variant(key = "sc", weight = 0.0, features = emptyList(), filterBy = { isSerpRegionToggleCountry() }),
Variant(key = "se", weight = 0.0, features = emptyList(), filterBy = { isSerpRegionToggleCountry() }),
Variant(key = "sc", weight = 1.0, features = emptyList(), filterBy = { isSerpRegionToggleCountry() }),
Variant(key = "se", weight = 1.0, features = emptyList(), filterBy = { isSerpRegionToggleCountry() }),

// InAppUsage Experiments
Variant(key = "ma", weight = 1.0, features = emptyList(), filterBy = { isEnglishLocale() }),
Expand Down

0 comments on commit 8ffa4e3

Please sign in to comment.