Skip to content
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

Fix onboarding background - Canvas: trying to draw too large bitmap #4888

Closed
wants to merge 4 commits into from
Closed
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
13 changes: 0 additions & 13 deletions app/src/main/java/com/duckduckgo/app/browser/BrowserTabFragment.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3883,12 +3883,6 @@ class BrowserTabFragment :
}
newBrowserTab.newTabLayout.setOnClickListener { daxDialogIntroBubbleCta.dialogTextCta.finishAnimation() }

if (appTheme.isLightModeEnabled()) {
newBrowserTab.browserBackground.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
} else {
newBrowserTab.browserBackground.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
}

viewModel.onCtaShown()
}

Expand All @@ -3909,13 +3903,6 @@ class BrowserTabFragment :
viewModel.onUserClickCtaOkButton(configuration)
}
}
if (appTheme.isLightModeEnabled()) {
binding.includeOnboardingDaxDialog.onboardingDaxDialogBackground
.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
} else {
binding.includeOnboardingDaxDialog.onboardingDaxDialogBackground
.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
}
binding.webViewContainer.setOnClickListener { daxDialogIntroBubbleCta.dialogTextCta.finishAnimation() }
viewModel.onCtaShown()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ import com.duckduckgo.common.ui.viewbinding.viewBinding
import com.duckduckgo.common.utils.FragmentViewModelFactory
import com.duckduckgo.common.utils.extensions.html
import com.duckduckgo.di.scopes.FragmentScope
import javax.inject.Inject
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import nl.dionsegijn.konfetti.models.Shape
import nl.dionsegijn.konfetti.models.Size
import javax.inject.Inject

@InjectWith(FragmentScope::class)
class WelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welcome_page) {
Expand Down Expand Up @@ -98,11 +98,7 @@ class WelcomePage : OnboardingPageFragment(R.layout.content_onboarding_welcome_p
savedInstanceState: Bundle?,
): View {
val binding = ContentOnboardingWelcomePageBinding.inflate(inflater, container, false)
if (appTheme.isLightModeEnabled()) {
binding.sceneBg.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_light)
} else {
binding.sceneBg.setBackgroundResource(R.drawable.onboarding_experiment_background_bitmap_dark)
}

viewModel.commands.flowWithLifecycle(lifecycle, Lifecycle.State.STARTED).onEach {
when (it) {
is ShowComparisonChart -> configureDaxCta(COMPARISON_CHART)
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@drawable/onboarding_experiment_background_light" />
app:layout_constraintBottom_toBottomOf="parent"
app:srcCompat="@drawable/onboarding_experiment_background" />

<LinearLayout
android:id="@+id/welcomeContent"
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/layout/content_onboarding_welcome_page.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@
android:tag="onboardingDefaultBrowser"
tools:context="com.duckduckgo.app.onboarding.ui.OnboardingActivity">

<androidx.appcompat.widget.AppCompatImageView
<ImageView
android:id="@+id/sceneBg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:srcCompat="@drawable/onboarding_experiment_background_small_light" />
app:layout_constraintBottom_toBottomOf="parent"
app:srcCompat="@drawable/onboarding_experiment_background" />

<ImageView
android:id="@+id/foregroundImageView"
Expand Down
10 changes: 10 additions & 0 deletions app/src/main/res/layout/include_new_browser_tab.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@
android:paddingTop="?attr/actionBarSize"
android:foreground="@android:color/transparent">

<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:scaleType="centerCrop"
app:srcCompat="@drawable/onboarding_experiment_background" />

<FrameLayout
android:id="@+id/newTabContainerLayout"
android:layout_width="match_parent"
Expand Down
11 changes: 10 additions & 1 deletion app/src/main/res/layout/include_onboarding_view_dax_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,18 @@
android:id="@+id/onboardingDaxDialogBackground"
android:layout_width="match_parent"
android:layout_height="wrap_content"
tools:background="@drawable/onboarding_experiment_background_bitmap_light"
android:clipChildren="false">

<ImageView
android:layout_width="0dp"
android:layout_height="0dp"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
android:scaleType="centerCrop"
app:srcCompat="@drawable/onboarding_experiment_background" />

<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/logo"
android:layout_width="56dp"
Expand Down