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

Dependency updates, compile SDK 35, re-enable predictive back #1079

Merged
merged 8 commits into from
Dec 4, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Releases marked with 🧪 (or previously with the "beta" suffix) were released o
filter from sort options.
* 🔨 Show scrollbars for show filter and sort options.
* 🔧 Use common "Sort by" action name.
* 🔧 Android 15: turn predictive back animation back on after more issues are resolved.
* 📝 Latest user interface translations from Crowdin.

### 2024.5.1 - 2024-11-21 🧪
Expand Down
3 changes: 3 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ android {
// Based on https://docs.oracle.com/en/java/javase/17/docs/specs/jar/jar.html#jar-index
// only used by network applications like applets, so safe to exclude.
excludes += "/META-INF/INDEX.LIST"
// Exclude Coroutines debug file
// https://github.com/Kotlin/kotlinx.coroutines?tab=readme-ov-file#avoiding-including-the-debug-infrastructure-in-the-resulting-apk
excludes += "DebugProbesKt.bin"
}
}
}
Expand Down
3 changes: 1 addition & 2 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@
</queries>

<!-- enableOnBackInvokedCallback: opt-in to predictive back gesture https://developer.android.com/guide/navigation/custom-back/predictive-back-gesture -->
<!-- Note: temporarily do not enable predictive back gesture due to crashes https://issuetracker.google.com/issues/342316801 -->
<application
android:name="com.battlelancer.seriesguide.SgApp"
android:allowBackup="true"
android:backupAgent="com.battlelancer.seriesguide.SgBackupAgent"
android:dataExtractionRules="@xml/sg_backup_rules_android_12"
android:enableOnBackInvokedCallback="false"
android:enableOnBackInvokedCallback="true"
android:fullBackupContent="@xml/sg_backup_rules"
android:fullBackupOnly="true"
android:hardwareAccelerated="true"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2014-2024 Uwe Trottmann

package com.battlelancer.seriesguide.history

import android.os.Bundle
import android.view.View
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityOptionsCompat
import androidx.lifecycle.lifecycleScope
import androidx.loader.app.LoaderManager
import androidx.loader.content.Loader
import com.battlelancer.seriesguide.provider.SgRoomDatabase
import com.battlelancer.seriesguide.shows.episodes.EpisodesActivity
import com.battlelancer.seriesguide.shows.search.discover.AddShowDialogFragment
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.uwetrottmann.trakt5.entities.HistoryEntry
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand Down Expand Up @@ -73,12 +72,7 @@ class UserEpisodeStreamFragment : StreamFragment() {
// Is in database, show details.
val intent =
EpisodesActivity.intentEpisode(episodeIdOrNull, requireContext())
ActivityCompat.startActivity(
requireActivity(), intent,
ActivityOptionsCompat
.makeScaleUpAnimation(view, 0, 0, view.width, view.height)
.toBundle()
)
requireActivity().startActivityWithAnimation(intent, view)
} else {
// Offer to add the show if not in database.
AddShowDialogFragment.show(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2014-2024 Uwe Trottmann

package com.battlelancer.seriesguide.history

import android.os.Bundle
import android.view.View
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityOptionsCompat
import androidx.loader.app.LoaderManager
import androidx.loader.content.Loader
import com.battlelancer.seriesguide.movies.details.MovieDetailsActivity
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.uwetrottmann.trakt5.entities.HistoryEntry

/**
Expand Down Expand Up @@ -46,11 +45,7 @@ class UserMovieStreamFragment : StreamFragment() {
// display movie details
val tmdb = item.movie?.ids?.tmdb ?: return
val i = MovieDetailsActivity.intentMovie(requireContext(), tmdb)
ActivityCompat.startActivity(
requireContext(), i, ActivityOptionsCompat
.makeScaleUpAnimation(view, 0, 0, view.width, view.height)
.toBundle()
)
requireContext().startActivityWithAnimation(i, view)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.battlelancer.seriesguide.shows.tools.ShowSync
import com.battlelancer.seriesguide.ui.AutoGridLayoutManager
import com.battlelancer.seriesguide.ui.OverviewActivity
import com.battlelancer.seriesguide.ui.widgets.SgFastScroller
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
Expand Down Expand Up @@ -112,8 +112,7 @@ class SgListFragment : Fragment() {
private val itemClickListener: SgListItemViewHolder.ItemClickListener =
object : SgListItemViewHolder.ItemClickListener {
override fun onItemClick(anchor: View, item: SgListItemWithDetails) {
Utils.startActivityWithAnimation(
requireActivity(),
requireActivity().startActivityWithAnimation(
OverviewActivity.intentShow(requireActivity(), item.showId),
anchor
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import com.battlelancer.seriesguide.movies.details.MovieDetailsActivity
import com.battlelancer.seriesguide.movies.tools.MovieTools
import com.battlelancer.seriesguide.provider.SgRoomDatabase
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.startActivityWithAnimation

open class MovieClickListenerImpl(val context: Context) : MovieClickListener {

Expand All @@ -21,7 +22,7 @@ open class MovieClickListenerImpl(val context: Context) : MovieClickListener {

// launch details activity
val intent = MovieDetailsActivity.intentMovie(context, movieTmdbId)
Utils.startActivityWithAnimation(context, intent, posterView)
context.startActivityWithAnimation(intent, posterView)
}

override fun onMoreOptionsClick(movieTmdbId: Int, anchor: View) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ import com.battlelancer.seriesguide.movies.MovieLocalizationDialogFragment.Local
import com.battlelancer.seriesguide.movies.MoviesActivityViewModel.ScrollTabToTopEvent
import com.battlelancer.seriesguide.movies.search.MoviesSearchActivity
import com.battlelancer.seriesguide.ui.AutoGridLayoutManager
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode
Expand Down Expand Up @@ -144,7 +144,7 @@ class MoviesDiscoverFragment : Fragment() {
MoviesDiscoverAdapter.ItemClickListener {
override fun onLinkClick(link: MoviesDiscoverLink, anchor: View) {
MoviesSearchActivity.intentLink(context, link)
.let { Utils.startActivityWithAnimation(context, it, anchor) }
.let { context.startActivityWithAnimation(it, anchor) }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ import com.battlelancer.seriesguide.shows.history.ShowsHistoryAdapter
import com.battlelancer.seriesguide.shows.history.ShowsHistoryAdapter.Item
import com.battlelancer.seriesguide.shows.history.TraktRecentEpisodeHistoryLoader
import com.battlelancer.seriesguide.traktapi.TraktCredentials
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.startActivityWithAnimation

/**
* From Trakt, displays recently watched movies of the user and Trakt friends.
Expand Down Expand Up @@ -254,9 +254,8 @@ class MoviesHistoryFragment : Fragment() {

// display movie details
val i = MovieDetailsActivity.intentMovie(requireContext(), movieTmdbId)

// simple scale up animation as there are no images
Utils.startActivityWithAnimation(activity, i, view)
requireActivity().startActivityWithAnimation(i, view)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.WebTools
import com.battlelancer.seriesguide.util.copyTextToClipboardOnLongClick
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.squareup.picasso.Callback
import com.squareup.picasso.Picasso
import com.uwetrottmann.androidutils.AndroidUtils
Expand Down Expand Up @@ -476,7 +477,7 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
val tmdbId = tmdbId
if (tmdbId > 0) {
val i = TraktCommentsActivity.intentMovie(requireContext(), movieTitle, tmdbId)
Utils.startActivityWithAnimation(activity, i, v)
requireActivity().startActivityWithAnimation(i, v)
}
}
}
Expand Down Expand Up @@ -607,7 +608,7 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract {
smallImageUrl,
largeImageUrl
)
Utils.startActivityWithAnimation(activity, intent, view)
requireActivity().startActivityWithAnimation(intent, view)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import com.battlelancer.seriesguide.tmdbapi.TmdbTools
import com.battlelancer.seriesguide.util.CircleTransformation
import com.battlelancer.seriesguide.util.ImageTools
import com.battlelancer.seriesguide.util.ThemeUtils
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import timber.log.Timber

/**
Expand Down Expand Up @@ -230,7 +230,7 @@ class PeopleListHelper {
// showing a specific person
i.putExtra(PersonFragment.ARG_PERSON_TMDB_ID, personTmdbId)
}
Utils.startActivityWithAnimation(context, i, v)
context.startActivityWithAnimation(i, v)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import android.view.ViewGroup
import android.widget.Button
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.widget.PopupMenu
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityOptionsCompat
import androidx.fragment.app.Fragment
import androidx.fragment.app.viewModels
import androidx.lifecycle.Lifecycle
Expand All @@ -48,6 +46,7 @@ import com.battlelancer.seriesguide.ui.SearchActivity
import com.battlelancer.seriesguide.ui.menus.ManualSyncMenu
import com.battlelancer.seriesguide.ui.widgets.SgFastScroller
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.google.android.material.snackbar.Snackbar
import com.uwetrottmann.androidutils.AndroidUtils
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -254,13 +253,7 @@ class ShowsFragment : Fragment() {
override fun onItemClick(anchor: View, showRowId: Long) {
// display overview for this show
val intent = intentShow(requireContext(), showRowId)
ActivityCompat.startActivity(
requireContext(), intent,
ActivityOptionsCompat.makeScaleUpAnimation(
anchor, 0, 0, anchor.width,
anchor.height
).toBundle()
)
requireContext().startActivityWithAnimation(intent, anchor)
}

override fun onMoreOptionsClick(anchor: View, show: ShowItem) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import com.battlelancer.seriesguide.ui.AutoGridLayoutManager
import com.battlelancer.seriesguide.ui.SearchActivity
import com.battlelancer.seriesguide.ui.menus.ManualSyncMenu
import com.battlelancer.seriesguide.ui.widgets.SgFastScroller
import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.conflate
Expand Down Expand Up @@ -231,7 +231,7 @@ abstract class CalendarFragment2 : Fragment() {
CalendarAdapter2.ItemClickListener {
override fun onItemClick(episodeId: Long) {
val intent = EpisodesActivity.intentEpisode(episodeId, requireContext())
Utils.startActivityWithAnimation(activity, intent, view)
requireActivity().startActivityWithAnimation(intent, view!!)
}

override fun onMoreOptionsClick(anchor: View, episode: SgEpisode2WithShow) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ import com.battlelancer.seriesguide.util.Utils
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.copyTextToClipboardOnLongClick
import com.battlelancer.seriesguide.util.safeShow
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.squareup.picasso.Callback
import com.squareup.picasso.Picasso
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -447,13 +448,13 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {

// episode image
val imagePath = episode.image
binding.containerImage.setOnClickListener { v: View? ->
binding.containerImage.setOnClickListener { v: View ->
val intent = intent(
requireContext(),
ImageTools.buildEpisodeImageUrl(imagePath, requireContext()),
ImageTools.buildEpisodeImageUrl(imagePath, requireContext(), originalSize = true)
)
Utils.startActivityWithAnimation(requireActivity(), intent, v)
requireActivity().startActivityWithAnimation(intent, v)
}
loadImage(imagePath, hideDetails)

Expand Down Expand Up @@ -594,12 +595,12 @@ class EpisodeDetailsFragment : Fragment(), EpisodeActionsContract {
}

// Trakt comments
bindingButtons.buttonEpisodeComments.setOnClickListener { v: View? ->
bindingButtons.buttonEpisodeComments.setOnClickListener { v: View ->
val episodeId = episodeId
if (episodeId > 0) {
val intent =
TraktCommentsActivity.intentEpisode(requireContext(), episodeTitle, episodeId)
Utils.startActivityWithAnimation(requireActivity(), intent, v)
requireActivity().startActivityWithAnimation(intent, v)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import android.view.MenuItem
import android.view.View
import android.view.ViewGroup
import android.view.animation.AnimationUtils
import androidx.core.app.ActivityCompat
import androidx.core.app.ActivityOptionsCompat
import androidx.core.view.MenuProvider
import androidx.fragment.app.Fragment
import androidx.lifecycle.Lifecycle
Expand All @@ -36,6 +34,7 @@ import com.battlelancer.seriesguide.traktapi.TraktCredentials
import com.battlelancer.seriesguide.ui.BaseMessageActivity.ServiceCompletedEvent
import com.battlelancer.seriesguide.ui.SearchActivity
import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import org.greenrobot.eventbus.EventBus
Expand Down Expand Up @@ -266,13 +265,7 @@ class ShowsHistoryFragment : Fragment() {
*/
private fun showDetails(view: View, episodeId: Long) {
val intent = EpisodesActivity.intentEpisode(episodeId, requireContext())

ActivityCompat.startActivity(
requireContext(), intent,
ActivityOptionsCompat
.makeScaleUpAnimation(view, 0, 0, view.width, view.height)
.toBundle()
)
requireContext().startActivityWithAnimation(intent, view)
}

private fun showError(errorText: String?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ import com.battlelancer.seriesguide.util.ViewTools
import com.battlelancer.seriesguide.util.WebTools
import com.battlelancer.seriesguide.util.copyTextToClipboardOnLongClick
import com.battlelancer.seriesguide.util.safeShow
import com.battlelancer.seriesguide.util.startActivityWithAnimation
import com.squareup.picasso.Callback
import com.squareup.picasso.Picasso
import kotlinx.coroutines.Job
Expand Down Expand Up @@ -146,11 +147,11 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
}
buttonOverviewFavoriteShow.setOnClickListener { onButtonFavoriteClick() }

containerOverviewEpisodeCard.setOnClickListener { v: View? ->
containerOverviewEpisodeCard.setOnClickListener { v: View ->
runIfHasEpisode { episode ->
// display episode details
val intent = EpisodesActivity.intentEpisode(episode.id, requireContext())
Utils.startActivityWithAnimation(activity, intent, v)
requireActivity().startActivityWithAnimation(intent, v)
}
}

Expand Down Expand Up @@ -341,10 +342,10 @@ class OverviewFragment() : Fragment(), EpisodeActionsContract {
}
}

private fun onButtonCommentsClick(v: View?) {
private fun onButtonCommentsClick(v: View) {
runIfHasEpisode { episode ->
val i = TraktCommentsActivity.intentEpisode(requireContext(), episode.title, episode.id)
Utils.startActivityWithAnimation(activity, i, v)
requireActivity().startActivityWithAnimation(i, v)
}
}

Expand Down
Loading