Skip to content

use colored backdrop for Input Screen alpha transitions on API 33+ #6421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,6 @@ import com.duckduckgo.browser.api.ui.BrowserScreens.PrivateSearchScreenNoParams
import com.duckduckgo.browser.api.ui.BrowserScreens.WebViewActivityWithParams
import com.duckduckgo.common.ui.DuckDuckGoActivity
import com.duckduckgo.common.ui.DuckDuckGoFragment
import com.duckduckgo.common.ui.anim.AnimationResourceProvider
import com.duckduckgo.common.ui.experiments.visual.store.ExperimentalThemingDataStore
import com.duckduckgo.common.ui.store.BrowserAppTheme
import com.duckduckgo.common.ui.tabs.SwipingTabsFeatureProvider
Expand Down Expand Up @@ -288,6 +287,7 @@ import com.duckduckgo.downloads.api.DownloadsFileActions
import com.duckduckgo.downloads.api.FileDownloader
import com.duckduckgo.downloads.api.FileDownloader.PendingFileDownload
import com.duckduckgo.duckchat.api.DuckChat
import com.duckduckgo.duckchat.api.inputscreen.BrowserAndInputScreenTransitionProvider
import com.duckduckgo.duckchat.impl.inputscreen.ui.InputScreenActivity.Companion.QUERY
import com.duckduckgo.duckchat.impl.inputscreen.ui.InputScreenActivity.Companion.TAB_ID
import com.duckduckgo.duckchat.impl.inputscreen.ui.InputScreenActivityParams
Expand Down Expand Up @@ -574,6 +574,9 @@ class BrowserTabFragment :
@Inject
lateinit var omnibarTypeResolver: OmnibarTypeResolver

@Inject
lateinit var browserAndInputScreenTransitionProvider: BrowserAndInputScreenTransitionProvider

/**
* We use this to monitor whether the user was seeing the in-context Email Protection signup prompt
* This is needed because the activity stack will be cleared if an external link is opened in our browser
Expand Down Expand Up @@ -1075,8 +1078,8 @@ class BrowserTabFragment :
requireContext(),
InputScreenActivityParams(query = query),
)
val enterTransition = AnimationResourceProvider.getSlideInFromTopFadeIn()
val exitTransition = AnimationResourceProvider.getSlideOutToBottomFadeOut()
val enterTransition = browserAndInputScreenTransitionProvider.getInputScreenEnterAnimation()
val exitTransition = browserAndInputScreenTransitionProvider.getBrowserExitAnimation()
val options = ActivityOptionsCompat.makeCustomAnimation(
requireActivity(),
enterTransition,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Copyright (c) 2025 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.duckchat.api.inputscreen

/**
* Provides animation resources for activity transitions between browser and input screen.
*/
interface BrowserAndInputScreenTransitionProvider {

fun getBrowserEnterAnimation(): Int

fun getBrowserExitAnimation(): Int

fun getInputScreenEnterAnimation(): Int

fun getInputScreenExitAnimation(): Int
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,18 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@anim/overshoot_interpolator_tension_1">
android:backdropColor="@color/background_background_dark"
android:duration="@integer/slide_animation_duration_ms"
android:showBackdrop="true">

<translate
android:fromYDelta="56dp"
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="0dp" />

<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,18 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@anim/overshoot_interpolator_tension_1">
android:backdropColor="@color/background_background_light"
android:duration="@integer/slide_animation_duration_ms"
android:showBackdrop="true">

<translate
android:fromYDelta="-56dp"
android:fromYDelta="56dp"
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="0dp" />

<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,16 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator">
android:duration="@integer/slide_animation_duration_ms">

<translate
android:fromYDelta="-56dp"
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="0dp" />

<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,18 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@anim/overshoot_interpolator_tension_1">
android:backdropColor="@color/background_background_dark"
android:duration="@integer/slide_animation_duration_ms"
android:showBackdrop="true">

<translate
android:fromYDelta="0dp"
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="56dp" />

<alpha
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,18 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@anim/overshoot_interpolator_tension_1">
android:backdropColor="@color/background_background_light"
android:duration="@integer/slide_animation_duration_ms"
android:showBackdrop="true">

<translate
android:fromYDelta="0dp"
android:toYDelta="-56dp" />
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="56dp" />

<alpha
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,16 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator">
android:duration="@integer/slide_animation_duration_ms">

<translate
android:fromYDelta="0dp"
android:interpolator="@anim/overshoot_interpolator_tension_1"
android:toYDelta="-56dp" />

<alpha
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,11 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator">

<translate
android:fromYDelta="56dp"
android:toYDelta="0dp" />
android:duration="@integer/slide_animation_duration_ms">

<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />

</set>
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2025 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,15 +15,11 @@
-->

<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="300"
android:interpolator="@android:anim/decelerate_interpolator">

<translate
android:fromYDelta="0dp"
android:toYDelta="56dp" />
android:duration="@integer/slide_animation_duration_ms">

<alpha
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />

</set>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,5 @@
~ limitations under the License.
-->

<overshootInterpolator
xmlns:android="http://schemas.android.com/apk/res/android"
<overshootInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:tension="1.0" />
Loading
Loading