Skip to content
Draft
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 @@ -540,7 +540,7 @@ class SettingsActivity : DuckDuckGoActivity() {
BrowserActivity.intent(context = this, launchSource = InAppNavigation, queryExtra = OTHER_PLATFORMS_URL),
)
is Command.LaunchGetDesktopBrowser -> launchScreen(GetDesktopBrowserActivityParams(source = GetDesktopBrowserActivityParams.Source.OTHER))
is Command.LaunchWhatsNew -> launchScreen(ModalSurfaceActivityFromMessageId(it.messageId, it.messageType))
is Command.LaunchWhatsNew -> launchScreen(ModalSurfaceActivityFromMessageId(it.messageId, it.messageType, launchedFromSettings = true))
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.duckduckgo.daxprompts.impl

import android.app.ActivityOptions
import android.content.Context
import android.content.Intent
import com.duckduckgo.app.browser.defaultbrowsing.DefaultBrowserDetector
Expand Down Expand Up @@ -76,7 +77,8 @@ class ReEngagementPromptEvaluatorImpl @Inject constructor(
delay(MODAL_DISPLAY_DELAY)
appCoroutineScope.launch(dispatchers.main()) {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP
applicationContext.startActivity(intent)
val options = ActivityOptions.makeCustomAnimation(applicationContext, R.anim.slide_from_bottom, 0).toBundle()
applicationContext.startActivity(intent, options)
}

return@withContext ModalEvaluator.EvaluationResult.ModalShown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.duckduckgo.daxprompts.impl

import android.app.ActivityOptions
import android.content.Context
import android.content.Intent
import com.duckduckgo.app.browser.defaultbrowsing.DefaultBrowserDetector
Expand Down Expand Up @@ -74,7 +75,8 @@ class WinBackPromptEvaluatorImpl @Inject constructor(
delay(MODAL_DISPLAY_DELAY)
appCoroutineScope.launch(dispatchers.main()) {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP
applicationContext.startActivity(intent)
val options = ActivityOptions.makeCustomAnimation(applicationContext, R.anim.slide_from_bottom, 0).toBundle()
applicationContext.startActivity(intent, options)
}

return@withContext ModalEvaluator.EvaluationResult.ModalShown
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import android.content.Intent
import android.content.pm.ActivityInfo
import android.content.res.Configuration
import android.graphics.Color
import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import android.provider.Settings
import android.view.WindowManager
Expand Down Expand Up @@ -98,6 +99,10 @@ class DaxPromptBrowserComparisonActivity : DuckDuckGoActivity() {

setContentView(binding.root)

if (SDK_INT >= 34) {
overrideActivityTransition(OVERRIDE_TRANSITION_CLOSE, 0, R.anim.slide_to_bottom)
}

setupListeners()
setupObservers()
setupOnBackNavigation()
Expand Down Expand Up @@ -152,6 +157,10 @@ class DaxPromptBrowserComparisonActivity : DuckDuckGoActivity() {
setResult(RESULT_OK, resultIntent)
}
finish()
if (SDK_INT < 34) {
@Suppress("DEPRECATION")
overridePendingTransition(0, R.anim.slide_to_bottom)
}
}

is Command.BrowserComparisonChart -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 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.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="100%p"
android:interpolator="@android:anim/decelerate_interpolator"
android:toYDelta="0" />
</set>
24 changes: 24 additions & 0 deletions dax-prompts/dax-prompts-impl/src/main/res/anim/slide_to_bottom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 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.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="250"
android:fromYDelta="0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toYDelta="100%p" />
</set>
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ class ModalEvaluatorCoordinator @Inject constructor(
logcat { "ModalEvaluatorCoordinator: Starting coordinated evaluation" }

// Check 24-hour blocking first
if (completionStore.isBlockedBy24HourWindow()) {
logcat { "ModalEvaluatorCoordinator: Evaluation is blocked by 24-hour window" }
return@withLock
}
// if (completionStore.isBlockedBy24HourWindow()) {
// logcat { "ModalEvaluatorCoordinator: Evaluation is blocked by 24-hour window" }
// return@withLock
// }

val evaluators = modalEvaluatorPluginPoint.getPlugins().sortedBy { it.priority }
logcat { "ModalEvaluatorCoordinator: Found ${evaluators.size} evaluators" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.duckduckgo.remote.messaging.impl.modal

import android.os.Build.VERSION.SDK_INT
import android.os.Bundle
import androidx.activity.addCallback
import androidx.lifecycle.Lifecycle
Expand All @@ -28,6 +29,7 @@ import com.duckduckgo.common.ui.view.show
import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.di.scopes.ActivityScope
import com.duckduckgo.navigation.api.getActivityParams
import com.duckduckgo.remote.messaging.impl.R
import com.duckduckgo.remote.messaging.impl.databinding.ActivityModalSurfaceBinding
import com.duckduckgo.remote.messaging.impl.modal.ModalSurfaceViewModel.Command
import com.duckduckgo.remote.messaging.impl.modal.cardslist.CardsListRemoteMessageView
Expand All @@ -41,10 +43,18 @@ class ModalSurfaceActivity : DuckDuckGoActivity(), CardsListRemoteMessageView.Ca
private val viewModel: ModalSurfaceViewModel by bindViewModel()
private val binding: ActivityModalSurfaceBinding by viewBinding()

private var launchedFromSettings: Boolean = false

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(binding.root)

launchedFromSettings = intent.getActivityParams(ModalSurfaceActivityFromMessageId::class.java)?.launchedFromSettings ?: false

if (!launchedFromSettings && SDK_INT >= 34) {
overrideActivityTransition(OVERRIDE_TRANSITION_CLOSE, 0, R.anim.slide_to_bottom)
}

initialise()
setupObservers()
setupBackNavigationHandler()
Expand Down Expand Up @@ -84,6 +94,10 @@ class ModalSurfaceActivity : DuckDuckGoActivity(), CardsListRemoteMessageView.Ca
when (command) {
is Command.DismissMessage -> {
finish()
if (!launchedFromSettings && SDK_INT < 34) {
@Suppress("DEPRECATION")
overridePendingTransition(0, R.anim.slide_to_bottom)
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,8 @@ package com.duckduckgo.remote.messaging.impl.modal
import com.duckduckgo.navigation.api.GlobalActivityStarter
import com.duckduckgo.remote.messaging.api.Content.MessageType

data class ModalSurfaceActivityFromMessageId(val messageId: String, val messageType: MessageType) : GlobalActivityStarter.ActivityParams
data class ModalSurfaceActivityFromMessageId(
val messageId: String,
val messageType: MessageType,
val launchedFromSettings: Boolean = false,
) : GlobalActivityStarter.ActivityParams
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package com.duckduckgo.remote.messaging.impl.modal.evaluator

import android.app.ActivityOptions
import android.content.Context
import android.content.Intent
import android.os.SystemClock
Expand All @@ -26,6 +27,7 @@ import com.duckduckgo.di.scopes.AppScope
import com.duckduckgo.modalcoordinator.api.ModalEvaluator
import com.duckduckgo.navigation.api.GlobalActivityStarter
import com.duckduckgo.remote.messaging.api.Surface
import com.duckduckgo.remote.messaging.impl.R
import com.duckduckgo.remote.messaging.impl.RemoteMessagingFeatureToggles
import com.duckduckgo.remote.messaging.impl.RemoteMessagingRepository
import com.duckduckgo.remote.messaging.impl.modal.ModalSurfaceActivityFromMessageId
Expand Down Expand Up @@ -99,7 +101,8 @@ class RemoteMessageModalSurfaceEvaluatorImpl @Inject constructor(
delay(MODAL_DISPLAY_DELAY)
appCoroutineScope.launch(dispatchers.main()) {
intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK or Intent.FLAG_ACTIVITY_SINGLE_TOP
applicationContext.startActivity(intent)
val options = ActivityOptions.makeCustomAnimation(applicationContext, R.anim.slide_from_bottom, 0).toBundle()
applicationContext.startActivity(intent, options)
}

// Record this message as shown, and clear background timestamp
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 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.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="300"
android:fromYDelta="100%p"
android:interpolator="@android:anim/decelerate_interpolator"
android:toYDelta="0" />
</set>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2026 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.
-->

<set xmlns:android="http://schemas.android.com/apk/res/android">
<translate
android:duration="250"
android:fromYDelta="0"
android:interpolator="@android:anim/accelerate_interpolator"
android:toYDelta="100%p" />
</set>
Loading