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

End Of Year: Intro story design #553

Merged
merged 10 commits into from
Nov 10, 2022
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import au.com.shiftyjelly.pocketcasts.compose.AppTheme
import au.com.shiftyjelly.pocketcasts.databinding.ActivityMainBinding
import au.com.shiftyjelly.pocketcasts.discover.view.DiscoverFragment
import au.com.shiftyjelly.pocketcasts.endofyear.StoriesDataSource
import au.com.shiftyjelly.pocketcasts.endofyear.StoriesFragment
import au.com.shiftyjelly.pocketcasts.endofyear.StoriesPage
import au.com.shiftyjelly.pocketcasts.endofyear.StoriesViewModel
import au.com.shiftyjelly.pocketcasts.endofyear.views.EndOfYearLaunchBottomSheet
import au.com.shiftyjelly.pocketcasts.filters.FiltersFragment
import au.com.shiftyjelly.pocketcasts.localization.helper.LocaliseHelper
Expand Down Expand Up @@ -167,6 +168,7 @@ class MainActivity :
private lateinit var observeUpNext: LiveData<UpNextQueue.State>

private val viewModel: MainActivityViewModel by viewModels()
private val storiesViewModel: StoriesViewModel by viewModels()
private val disposables = CompositeDisposable()
private var videoPlayerShown: Boolean = false
private var overrideNextRefreshTimer: Boolean = false
Expand Down Expand Up @@ -496,11 +498,19 @@ class MainActivity :

private fun setupEndOfYearLaunchBottomSheet() {
binding.modalBottomSheet.setContent {
AppTheme(themeType = theme.activeTheme) {
var showDialog by rememberSaveable { mutableStateOf(false) }
if (showDialog) {
StoriesPage(
viewModel = storiesViewModel,
showDialog = showDialog,
theme = theme,
onCloseClicked = { showDialog = false },
)
}
AppTheme(theme.activeTheme) {
EndOfYearLaunchBottomSheet(
onClick = {
StoriesFragment.newInstance()
.show(supportFragmentManager, "stories_dialog")
showDialog = true
}
)
}
Expand Down

This file was deleted.

Loading