Skip to content

Commit

Permalink
Fix code formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
nalcalag committed Oct 9, 2024
1 parent b6d3d56 commit cf30363
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3831,8 +3831,10 @@ class BrowserTabViewModel @Inject constructor(

private fun getBackgroundResource(lightModeEnabled: Boolean): Int {
return when {
lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() -> R.drawable.onboarding_experiment_background_bitmap_light
!lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() -> R.drawable.onboarding_experiment_background_bitmap_dark
lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() ->
R.drawable.onboarding_experiment_background_bitmap_light
!lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() ->
R.drawable.onboarding_experiment_background_bitmap_dark
lightModeEnabled -> R.drawable.onboarding_background_bitmap_light
else -> R.drawable.onboarding_background_bitmap_dark
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,10 @@ class WelcomePageViewModel @Inject constructor(

fun setBackgroundResource(lightModeEnabled: Boolean) {
val backgroundRes = when {
lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() -> R.drawable.onboarding_experiment_background_bitmap_light
!lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() -> R.drawable.onboarding_experiment_background_bitmap_dark
lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() ->
R.drawable.onboarding_experiment_background_bitmap_light
!lightModeEnabled && highlightsOnboardingExperimentManager.isHighlightsEnabled() ->
R.drawable.onboarding_experiment_background_bitmap_dark
lightModeEnabled -> R.drawable.onboarding_background_bitmap_light
else -> R.drawable.onboarding_background_bitmap_dark
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
~ Copyright (c) 2022 DuckDuckGo
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2024 DuckDuckGo
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
Expand All @@ -15,6 +14,6 @@
~ limitations under the License.
-->

<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/onboarding_experiment_background_large_light"/>
<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/onboarding_background_large_dark"
android:tileMode="clamp" />
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?><!--
~ Copyright (c) 2024 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.
-->

<bitmap xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/onboarding_background_large_light"
android:tileMode="clamp" />

0 comments on commit cf30363

Please sign in to comment.