Skip to content

Commit fd47562

Browse files
committed
Merge branch 'hotfix/5.203.1'
2 parents 7bfffff + d908474 commit fd47562

19 files changed

+69
-9
lines changed

app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2270,6 +2270,11 @@ class BrowserTabFragment :
22702270
@SuppressLint("SetJavaScriptEnabled")
22712271
private fun configureWebView() {
22722272
binding.daxDialogOnboardingCtaContent.layoutTransition.enableTransitionType(LayoutTransition.CHANGING)
2273+
if (appTheme.isLightModeEnabled()) {
2274+
newBrowserTab.browserBackground.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
2275+
} else {
2276+
newBrowserTab.browserBackground.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
2277+
}
22732278

22742279
webView = layoutInflater.inflate(
22752280
R.layout.include_duckduckgo_browser_webview,
@@ -3872,6 +3877,13 @@ class BrowserTabFragment :
38723877
viewModel.onUserClickCtaOkButton()
38733878
}
38743879
}
3880+
if (appTheme.isLightModeEnabled()) {
3881+
binding.includeOnboardingDaxDialog.onboardingDaxDialogBackground
3882+
.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
3883+
} else {
3884+
binding.includeOnboardingDaxDialog.onboardingDaxDialogBackground
3885+
.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
3886+
}
38753887
binding.webViewContainer.setOnClickListener { daxDialogIntroBubbleCta.dialogTextCta.finishAnimation() }
38763888
viewModel.onCtaShown()
38773889
}

app/src/main/java/com/duckduckgo/app/onboarding/ui/page/WelcomePage.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import com.duckduckgo.app.onboarding.ui.page.WelcomePageViewModel.Command.ShowCo
4747
import com.duckduckgo.app.onboarding.ui.page.WelcomePageViewModel.Command.ShowDefaultBrowserDialog
4848
import com.duckduckgo.app.onboarding.ui.page.WelcomePageViewModel.Command.ShowSuccessDialog
4949
import com.duckduckgo.appbuildconfig.api.AppBuildConfig
50+
import com.duckduckgo.common.ui.store.AppTheme
5051
import com.duckduckgo.common.ui.view.gone
5152
import com.duckduckgo.common.ui.view.show
5253
import com.duckduckgo.common.ui.viewbinding.viewBinding
@@ -68,6 +69,9 @@ class WelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welcome_p
6869
@Inject
6970
lateinit var appBuildConfig: AppBuildConfig
7071

72+
@Inject
73+
lateinit var appTheme: AppTheme
74+
7175
private val binding: ContentOnboardingWelcomePageBinding by viewBinding()
7276
private val viewModel by lazy {
7377
ViewModelProvider(this, viewModelFactory)[WelcomePageViewModel::class.java]
@@ -94,6 +98,11 @@ class WelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welcome_p
9498
savedInstanceState: Bundle?,
9599
): View {
96100
val binding = ContentOnboardingWelcomePageBinding.inflate(inflater, container, false)
101+
if (appTheme.isLightModeEnabled()) {
102+
binding.sceneBg.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
103+
} else {
104+
binding.sceneBg.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
105+
}
97106
viewModel.commands.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach {
98107
when (it) {
99108
is ShowComparisonChart -> configureDaxCta(COMPARISON_CHART)
Binary file not shown.
Binary file not shown.

app/src/main/res/drawable-w600dp/onboarding_experiment_background_bitmap.xml renamed to app/src/main/res/drawable-w600dp/onboarding_experiment_background_bitmap_dark.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@
1515
-->
1616

1717
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
18-
android:src="@drawable/onboarding_experiment_background_large"
18+
android:src="@drawable/onboarding_experiment_background_large_dark"
1919
android:tileMode="clamp" />
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (c) 2024 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:src="@drawable/onboarding_experiment_background_large_light"
19+
android:tileMode="clamp" />

app/src/main/res/drawable-w600dp/onboarding_experiment_background.xml renamed to app/src/main/res/drawable-w600dp/onboarding_experiment_background_light.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717

1818
<bitmap
1919
xmlns:android="http://schemas.android.com/apk/res/android"
20-
android:src="@drawable/onboarding_experiment_background_large"/>
20+
android:src="@drawable/onboarding_experiment_background_large_light"/>

app/src/main/res/drawable/onboarding_experiment_background_bitmap.xml renamed to app/src/main/res/drawable/onboarding_experiment_background_bitmap_dark.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616

1717
<bitmap
1818
xmlns:android="http://schemas.android.com/apk/res/android"
19-
android:src="@drawable/onboarding_experiment_background_small"
19+
android:src="@drawable/onboarding_experiment_background_small_dark"
2020
android:tileMode="clamp" />
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<?xml version="1.0" encoding="utf-8"?><!--
2+
~ Copyright (c) 2024 DuckDuckGo
3+
~
4+
~ Licensed under the Apache License, Version 2.0 (the "License");
5+
~ you may not use this file except in compliance with the License.
6+
~ You may obtain a copy of the License at
7+
~
8+
~ http://www.apache.org/licenses/LICENSE-2.0
9+
~
10+
~ Unless required by applicable law or agreed to in writing, software
11+
~ distributed under the License is distributed on an "AS IS" BASIS,
12+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
~ See the License for the specific language governing permissions and
14+
~ limitations under the License.
15+
-->
16+
17+
<bitmap
18+
xmlns:android="http://schemas.android.com/apk/res/android"
19+
android:src="@drawable/onboarding_experiment_background_small_light"
20+
android:tileMode="clamp" />

0 commit comments

Comments
 (0)