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

Add Folders upsell flow to the podcast screen #3115

Merged
merged 3 commits into from
Oct 28, 2024
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 @@ -224,6 +224,7 @@ private fun Content(
OnboardingUpgradeSource.END_OF_YEAR,
OnboardingUpgradeSource.FILES,
OnboardingUpgradeSource.FOLDERS,
OnboardingUpgradeSource.FOLDERS_PODCAST_SCREEN,
OnboardingUpgradeSource.HEADPHONE_CONTROLS_SETTINGS,
OnboardingUpgradeSource.LOGIN,
OnboardingUpgradeSource.LOGIN_PLUS_PROMOTION,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package au.com.shiftyjelly.pocketcasts.podcasts.view.folders

import androidx.compose.foundation.clickable
import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
Expand Down Expand Up @@ -68,7 +69,10 @@ fun FolderChooserPage(
onNewFolderClick = onNewFolderClick,
modifier = Modifier.weight(1f),
)
Card(elevation = 8.dp) {
Card(
elevation = if (isSystemInDarkTheme()) 0.dp else 8.dp,
backgroundColor = Color.Transparent,
) {
RowButton(
text = stringResource(LR.string.done),
onClick = { onCloseClick() },
Expand Down Expand Up @@ -100,8 +104,6 @@ private fun FolderList(
onNewFolderClick()
}
HorizontalDivider()
Spacer(modifier = Modifier.height(24.dp))
HorizontalDivider()
}
}
items(folders) { folder ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -332,9 +332,13 @@ class PodcastAdapter(
holder.binding.top.subscribedButton.toCircle(true)
holder.binding.top.header.setBackgroundColor(ThemeColor.podcastUi03(theme.activeTheme, podcast.backgroundColor))
holder.binding.top.folders.setImageResource(
if (podcast.folderUuid != null) R.drawable.ic_folder_check else IR.drawable.ic_folder,
when {
!isPlusOrPatronUser -> IR.drawable.folder_lock_light
podcast.folderUuid != null -> R.drawable.ic_folder_check
else -> IR.drawable.ic_folder
},
)
holder.binding.top.folders.isVisible = podcast.isSubscribed && isPlusOrPatronUser
holder.binding.top.folders.isVisible = podcast.isSubscribed
with(holder.binding.top.notifications) {
val notificationsIconText =
context.getString(if (podcast.isShowNotifications) LR.string.podcast_notifications_on else LR.string.podcast_notifications_off)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ import au.com.shiftyjelly.pocketcasts.repositories.podcast.EpisodeManager
import au.com.shiftyjelly.pocketcasts.repositories.podcast.PodcastManager
import au.com.shiftyjelly.pocketcasts.settings.HeadphoneControlsSettingsFragment
import au.com.shiftyjelly.pocketcasts.settings.SettingsFragment
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingFlow
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingLauncher
import au.com.shiftyjelly.pocketcasts.settings.onboarding.OnboardingUpgradeSource
import au.com.shiftyjelly.pocketcasts.sharing.SharingClient
import au.com.shiftyjelly.pocketcasts.sharing.SharingRequest
import au.com.shiftyjelly.pocketcasts.ui.extensions.getThemeColor
Expand Down Expand Up @@ -441,6 +444,11 @@ class PodcastFragment : BaseFragment(), Toolbar.OnMenuItemClickListener {
private val onFoldersClicked: () -> Unit = {
lifecycleScope.launch {
analyticsTracker.track(AnalyticsEvent.PODCAST_SCREEN_FOLDER_TAPPED)
val isSignedInAsPlusOrPatron = viewModel.signInState.value?.isSignedInAsPlusOrPatron == true
if (!isSignedInAsPlusOrPatron) {
OnboardingLauncher.openOnboardingFlow(activity, OnboardingFlow.Upsell(OnboardingUpgradeSource.FOLDERS_PODCAST_SCREEN))
return@launch
}
val folder = viewModel.getFolder()
if (folder == null) {
analyticsTracker.track(AnalyticsEvent.FOLDER_CHOOSE_SHOWN)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ enum class OnboardingUpgradeSource(val analyticsValue: String) {
END_OF_YEAR("end_of_year"),
FILES("files"),
FOLDERS("folders"),
FOLDERS_PODCAST_SCREEN("folders_podcast_screen"),
HEADPHONE_CONTROLS_SETTINGS("headphone_controls_settings"),
LOGIN("login"), // for login from within upsell screen
LOGIN_PLUS_PROMOTION("login_plus_promotion"), // for login from outside upsell screen
Expand Down