diff --git a/CHANGELOG.md b/CHANGELOG.md index 274507acb7..3a1b976c9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 ๐Ÿงช diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 5bd5cc06bc..77c601a0b3 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -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" } } } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 3266a7186b..798b53ddeb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -41,13 +41,12 @@ - 0) { val i = TraktCommentsActivity.intentMovie(requireContext(), movieTitle, tmdbId) - Utils.startActivityWithAnimation(activity, i, v) + requireActivity().startActivityWithAnimation(i, v) } } } @@ -607,7 +608,7 @@ class MovieDetailsFragment : Fragment(), MovieActionsContract { smallImageUrl, largeImageUrl ) - Utils.startActivityWithAnimation(activity, intent, view) + requireActivity().startActivityWithAnimation(intent, view) } } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/people/PeopleListHelper.kt b/app/src/main/java/com/battlelancer/seriesguide/people/PeopleListHelper.kt index 8e6358e5b1..0497bfb083 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/people/PeopleListHelper.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/people/PeopleListHelper.kt @@ -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 /** @@ -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) } } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt index 93c786619f..c09623edd8 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/ShowsFragment.kt @@ -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 @@ -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 @@ -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) { diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/calendar/CalendarFragment2.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/calendar/CalendarFragment2.kt index 11d5a25402..e59cde6fbf 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/calendar/CalendarFragment2.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/calendar/CalendarFragment2.kt @@ -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 @@ -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) { diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt index 88b5393cca..171f98b77f 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/episodes/EpisodeDetailsFragment.kt @@ -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 @@ -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) @@ -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) } } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/history/ShowsHistoryFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/history/ShowsHistoryFragment.kt index 0a0cce89a4..5f4e967488 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/history/ShowsHistoryFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/history/ShowsHistoryFragment.kt @@ -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 @@ -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 @@ -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?) { diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt index b2022f24cd..361582d073 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/OverviewFragment.kt @@ -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 @@ -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) } } @@ -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) } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/SeasonsFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/SeasonsFragment.kt index e1f51ae367..c7507e4123 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/SeasonsFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/SeasonsFragment.kt @@ -13,8 +13,6 @@ import android.view.View import android.view.ViewGroup import androidx.appcompat.widget.PopupMenu import androidx.appcompat.widget.TooltipCompat -import androidx.core.app.ActivityCompat -import androidx.core.app.ActivityOptionsCompat import androidx.core.os.bundleOf import androidx.core.view.MenuProvider import androidx.fragment.app.Fragment @@ -32,6 +30,7 @@ import com.battlelancer.seriesguide.shows.episodes.EpisodesActivity import com.battlelancer.seriesguide.ui.BaseMessageActivity import com.battlelancer.seriesguide.ui.dialogs.SingleChoiceDialogFragment import com.battlelancer.seriesguide.util.ThemeUtils +import com.battlelancer.seriesguide.util.startActivityWithAnimation import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.greenrobot.eventbus.EventBus @@ -167,12 +166,7 @@ class SeasonsFragment() : Fragment() { private val listOnItemClickListener = object : SeasonsAdapter.ItemClickListener { override fun onItemClick(v: View, seasonRowId: Long) { val intent = EpisodesActivity.intentSeason(seasonRowId, requireActivity()) - ActivityCompat.startActivity( - requireActivity(), intent, - ActivityOptionsCompat - .makeScaleUpAnimation(v, 0, 0, v.width, v.height) - .toBundle() - ) + requireActivity().startActivityWithAnimation(intent, v) } override fun onMoreOptionsClick(v: View, seasonRowId: Long) { diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/ShowFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/ShowFragment.kt index 4cffcb7639..30a9433908 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/overview/ShowFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/overview/ShowFragment.kt @@ -52,6 +52,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.google.android.material.button.MaterialButton import com.google.android.material.snackbar.Snackbar import com.uwetrottmann.androidutils.AndroidUtils @@ -477,7 +478,7 @@ class ShowFragment() : Fragment() { val showId = showId if (showId > 0) { val i = TraktCommentsActivity.intentShow(requireContext(), show.title, showId) - Utils.startActivityWithAnimation(activity, i, v) + requireActivity().startActivityWithAnimation(i, v) } } @@ -501,7 +502,7 @@ class ShowFragment() : Fragment() { originalSize = true ) ) - Utils.startActivityWithAnimation(activity, intent, v) + requireActivity().startActivityWithAnimation(intent, v) } } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/search/EpisodeSearchFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/search/EpisodeSearchFragment.kt index 36f5d43011..f6f53cfb4b 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/search/EpisodeSearchFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/search/EpisodeSearchFragment.kt @@ -15,7 +15,7 @@ import com.battlelancer.seriesguide.databinding.FragmentSearchBinding import com.battlelancer.seriesguide.shows.episodes.EpisodesActivity import com.battlelancer.seriesguide.shows.search.EpisodeSearchFragment.Companion.ARG_SHOW_TITLE import com.battlelancer.seriesguide.util.TabClickEvent -import com.battlelancer.seriesguide.util.Utils +import com.battlelancer.seriesguide.util.startActivityWithAnimation import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -96,7 +96,7 @@ class EpisodeSearchFragment : BaseSearchFragment() { private val onItemClickListener = object : EpisodeSearchAdapter.OnItemClickListener { override fun onItemClick(anchor: View, episodeId: Long) { EpisodesActivity.intentEpisode(episodeId, requireContext()) - .also { Utils.startActivityWithAnimation(activity, it, anchor) } + .also { requireActivity().startActivityWithAnimation(it, anchor) } } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/search/ShowSearchFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/search/ShowSearchFragment.kt index 39bd6841e1..bc6ba03e1a 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/search/ShowSearchFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/search/ShowSearchFragment.kt @@ -13,8 +13,6 @@ import android.view.View import android.view.ViewGroup import android.widget.GridView import androidx.appcompat.widget.PopupMenu -import androidx.core.app.ActivityCompat -import androidx.core.app.ActivityOptionsCompat import androidx.core.view.MenuProvider import androidx.fragment.app.viewModels import androidx.lifecycle.Lifecycle @@ -27,6 +25,7 @@ import com.battlelancer.seriesguide.shows.search.discover.ShowsDiscoverPagingAct import com.battlelancer.seriesguide.ui.OverviewActivity import com.battlelancer.seriesguide.ui.widgets.EmptyView import com.battlelancer.seriesguide.util.TabClickEvent +import com.battlelancer.seriesguide.util.startActivityWithAnimation import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.ThreadMode @@ -132,13 +131,7 @@ class ShowSearchFragment : BaseSearchFragment() { override fun onItemClick(anchor: View, showId: Long) { OverviewActivity.intentShow(requireContext(), showId).let { - ActivityCompat.startActivity( - requireActivity(), it, - ActivityOptionsCompat.makeScaleUpAnimation( - anchor, 0, 0, - anchor.width, anchor.height - ).toBundle() - ) + requireActivity().startActivityWithAnimation(it, anchor) } } diff --git a/app/src/main/java/com/battlelancer/seriesguide/shows/search/discover/ShowsDiscoverFragment.kt b/app/src/main/java/com/battlelancer/seriesguide/shows/search/discover/ShowsDiscoverFragment.kt index d5b04fb11c..bd7827f227 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/shows/search/discover/ShowsDiscoverFragment.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/shows/search/discover/ShowsDiscoverFragment.kt @@ -28,10 +28,10 @@ import com.battlelancer.seriesguide.traktapi.TraktCredentials import com.battlelancer.seriesguide.ui.dialogs.L10nDialogFragment import com.battlelancer.seriesguide.ui.dialogs.LanguagePickerDialogFragment import com.battlelancer.seriesguide.ui.dialogs.YearPickerDialogFragment -import com.battlelancer.seriesguide.util.Utils import com.battlelancer.seriesguide.util.ViewTools import com.battlelancer.seriesguide.util.findDialog import com.battlelancer.seriesguide.util.safeShow +import com.battlelancer.seriesguide.util.startActivityWithAnimation import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.launch import org.greenrobot.eventbus.Subscribe @@ -137,7 +137,7 @@ class ShowsDiscoverFragment : BaseAddShowsFragment() { } } - Utils.startActivityWithAnimation(activity, intent, anchor) + requireActivity().startActivityWithAnimation(intent, anchor) } override fun onHeaderButtonClick(anchor: View) { diff --git a/app/src/main/java/com/battlelancer/seriesguide/ui/BaseThemeActivity.kt b/app/src/main/java/com/battlelancer/seriesguide/ui/BaseThemeActivity.kt index ca4321b2bd..088290809d 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/ui/BaseThemeActivity.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/ui/BaseThemeActivity.kt @@ -51,7 +51,7 @@ abstract class BaseThemeActivity : AppCompatActivity() { android.R.id.home -> { val upIntent = NavUtils.getParentActivityIntent(this) if (upIntent != null) { - if (NavUtils.shouldUpRecreateTask(this, upIntent)) { + if (shouldUpRecreateTask(upIntent)) { // This activity is NOT part of this app's task, so create a new task // when navigating up, with a synthesized back stack. TaskStackBuilder.create(this) @@ -62,7 +62,7 @@ abstract class BaseThemeActivity : AppCompatActivity() { } else { // This activity is part of this app's task, so simply // navigate up to the logical parent activity. - NavUtils.navigateUpTo(this, upIntent) + navigateUpTo(upIntent) } } else { // No parent activity defined in AndroidManifest, let back press handle up diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/ActivityTools.kt b/app/src/main/java/com/battlelancer/seriesguide/util/ActivityTools.kt index 9ee77b1d35..3a3b625c21 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/ActivityTools.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/util/ActivityTools.kt @@ -1,10 +1,13 @@ -// Copyright 2023 Uwe Trottmann // SPDX-License-Identifier: Apache-2.0 +// Copyright 2014-2024 Uwe Trottmann package com.battlelancer.seriesguide.util +import android.app.ActivityOptions import android.content.ActivityNotFoundException import android.content.Context +import android.content.Intent +import android.view.View import android.widget.Toast import androidx.activity.result.ActivityResultLauncher import com.battlelancer.seriesguide.R @@ -19,4 +22,16 @@ fun ActivityResultLauncher.tryLaunch(input: I, context: Context) { } catch (e: ActivityNotFoundException) { Toast.makeText(context, R.string.app_not_available, Toast.LENGTH_LONG).show() } +} + +/** + * Uses [ActivityOptions.makeScaleUpAnimation] on the [sourceView]. + */ +fun Context.startActivityWithAnimation(intent: Intent, sourceView: View) { + startActivity( + intent, + ActivityOptions + .makeScaleUpAnimation(sourceView, 0, 0, sourceView.width, sourceView.height) + .toBundle() + ) } \ No newline at end of file diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/PackageTools.kt b/app/src/main/java/com/battlelancer/seriesguide/util/PackageTools.kt index 32557bbdf4..43f04547bd 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/PackageTools.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/util/PackageTools.kt @@ -1,5 +1,5 @@ -// Copyright 2023 Uwe Trottmann // SPDX-License-Identifier: Apache-2.0 +// Copyright 2023-2024 Uwe Trottmann package com.battlelancer.seriesguide.util @@ -26,11 +26,12 @@ object PackageTools { * Get version name from this apps package. */ fun getVersion(context: Context): String { - return try { + val version = try { getAppPackage(context).versionName } catch (e: PackageManager.NameNotFoundException) { - "UnknownVersion" + null } + return version ?: "UnknownVersion" } /** @@ -72,7 +73,8 @@ object PackageTools { ) val sgSignatures = appInfoSeriesGuide.signatures val xSignatures = appInfoSeriesGuideX.signatures - if (sgSignatures.size == xSignatures.size) { + if (sgSignatures != null && xSignatures != null + && sgSignatures.size == xSignatures.size) { for (i in sgSignatures.indices) { if (sgSignatures[i].toCharsString() != xSignatures[i].toCharsString()) { return false // a signature does not match diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/ThemeUtils.kt b/app/src/main/java/com/battlelancer/seriesguide/util/ThemeUtils.kt index 565eff9a76..9fdc532018 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/ThemeUtils.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/util/ThemeUtils.kt @@ -1,5 +1,5 @@ -// Copyright 2023 Uwe Trottmann // SPDX-License-Identifier: Apache-2.0 +// Copyright 2015-2024 Uwe Trottmann package com.battlelancer.seriesguide.util @@ -167,7 +167,7 @@ object ThemeUtils { return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) { // A light status bar is only supported on M+. // Use a translucent black status bar instead. - val opaqueStatusBarColor: Int = + @Suppress("DEPRECATION") val opaqueStatusBarColor: Int = MaterialColors.getColor(context, android.R.attr.statusBarColor, Color.BLACK) ColorUtils.setAlphaComponent(opaqueStatusBarColor, EDGE_TO_EDGE_BAR_ALPHA) } else { @@ -179,7 +179,7 @@ object ThemeUtils { return if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O_MR1) { // A light navigation bar is only supported on O_MR1+. // Use a translucent black navigation bar instead. - val opaqueNavBarColor = + @Suppress("DEPRECATION") val opaqueNavBarColor = MaterialColors.getColor(context, android.R.attr.navigationBarColor, Color.BLACK) ColorUtils.setAlphaComponent(opaqueNavBarColor, EDGE_TO_EDGE_BAR_ALPHA) } else { diff --git a/app/src/main/java/com/battlelancer/seriesguide/util/Utils.java b/app/src/main/java/com/battlelancer/seriesguide/util/Utils.java index e9bbcaf18e..f64edd6576 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/util/Utils.java +++ b/app/src/main/java/com/battlelancer/seriesguide/util/Utils.java @@ -1,5 +1,5 @@ -// Copyright 2023 Uwe Trottmann // SPDX-License-Identifier: Apache-2.0 +// Copyright 2011-2024 Uwe Trottmann package com.battlelancer.seriesguide.util; @@ -8,11 +8,8 @@ import android.content.Context; import android.content.Intent; import android.util.Log; -import android.view.View; import android.widget.Toast; import androidx.annotation.NonNull; -import androidx.core.app.ActivityCompat; -import androidx.core.app.ActivityOptionsCompat; import androidx.fragment.app.Fragment; import com.battlelancer.seriesguide.BuildConfig; import com.battlelancer.seriesguide.R; @@ -62,8 +59,8 @@ public static boolean hasXpass(Context context) { } /** - * Launches {@link com.battlelancer.seriesguide.billing.amazon.AmazonBillingActivity} or {@link - * BillingActivity} and notifies that something is only available with the subscription. + * Launches {@link com.battlelancer.seriesguide.billing.amazon.AmazonBillingActivity} or + * {@link BillingActivity} and notifies that something is only available with the subscription. */ public static void advertiseSubscription(Context context) { Toast.makeText(context, R.string.onlyx, Toast.LENGTH_SHORT).show(); @@ -81,15 +78,15 @@ public static boolean isAmazonVersion() { @NonNull public static Intent getBillingActivityIntent(Context context) { if (Utils.isAmazonVersion()) { - return new Intent(context, AmazonBillingActivity.class); + return new Intent(context, AmazonBillingActivity.class); } else { return new Intent(context, BillingActivity.class); } } /** - * Returns false if there is an active, but metered connection and - * the user did not approve it for large data downloads (e.g. images). + * Returns false if there is an active, but metered connection and the user did not approve it + * for large data downloads (e.g. images). */ static boolean isAllowedLargeDataConnection(Context context) { boolean isConnected; @@ -174,14 +171,6 @@ public static void tryStartActivityForResult(Fragment fragment, Intent intent, } } - public static void startActivityWithAnimation(Context context, Intent intent, View view) { - ActivityCompat.startActivity(context, intent, - ActivityOptionsCompat - .makeScaleUpAnimation(view, 0, 0, view.getWidth(), view.getHeight()) - .toBundle() - ); - } - /** * Tries to start the given intent as a new document (e.g. opening a website, other app) so it * appears as a new entry in the task switcher using {@link #tryStartActivity}. @@ -191,5 +180,4 @@ public static boolean openNewDocument(@NonNull Context context, @NonNull Intent intent.addFlags(Intent.FLAG_ACTIVITY_NEW_DOCUMENT); return Utils.tryStartActivity(context, intent, true); } - } diff --git a/build.gradle.kts b/build.gradle.kts index e7df379445..478039ec43 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -14,7 +14,7 @@ plugins { } buildscript { - val sgCompileSdk by extra(34) // Android 14 (UPSIDE_DOWN_CAKE) + val sgCompileSdk by extra(35) // Android 15 (VANILLA_ICE_CREAM) val sgMinSdk by extra(21) // Android 5 (L) val sgTargetSdk by extra(34) // Android 14 (UPSIDE_DOWN_CAKE) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index aba5e3064d..92570f9a4e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -11,28 +11,28 @@ retrofit2 = "2.11.0" # https://github.com/square/retrofit/blob/master/CHANGELOG. amazon-appstore-sdk = "com.amazon.device:amazon-appstore-sdk:3.0.5" # https://developer.amazon.com/docs/in-app-purchasing/iap-whats-new.html androidutils = "com.uwetrottmann.androidutils:androidutils:4.0.0" # https://github.com/UweTrottmann/AndroidUtils/releases # https://developer.android.com/jetpack/androidx/releases/activity -androidx-activity = "androidx.activity:activity:1.9.1" +androidx-activity = "androidx.activity:activity:1.9.3" # https://developer.android.com/jetpack/androidx/releases/annotation -androidx-annotation = "androidx.annotation:annotation:1.8.0" +androidx-annotation = "androidx.annotation:annotation:1.9.1" # https://developer.android.com/jetpack/androidx/releases/appcompat androidx-appcompat = "androidx.appcompat:appcompat:1.7.0" # https://developer.android.com/jetpack/androidx/releases/browser androidx-browser = "androidx.browser:browser:1.8.0" # https://developer.android.com/jetpack/androidx/releases/collection -androidx-collection = "androidx.collection:collection:1.4.2" -androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" # https://developer.android.com/jetpack/androidx/releases/constraintlayout +androidx-collection = "androidx.collection:collection:1.4.5" +androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.2.0" # https://developer.android.com/jetpack/androidx/releases/constraintlayout androidx-coordinatorlayout = "androidx.coordinatorlayout:coordinatorlayout:1.2.0" # https://developer.android.com/jetpack/androidx/releases/coordinatorlayout # https://developer.android.com/jetpack/androidx/releases/core -androidx-core = "androidx.core:core:1.13.1" -androidx-core-ktx = "androidx.core:core-ktx:1.13.1" +androidx-core = "androidx.core:core:1.15.0" +androidx-core-ktx = "androidx.core:core-ktx:1.15.0" # https://developer.android.com/jetpack/androidx/releases/fragment -androidx-fragment = "androidx.fragment:fragment-ktx:1.8.2" +androidx-fragment = "androidx.fragment:fragment-ktx:1.8.5" androidx-lifecycle-livedata = { module = "androidx.lifecycle:lifecycle-livedata-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-runtime = { module = "androidx.lifecycle:lifecycle-runtime-ktx", version.ref = "androidx-lifecycle" } androidx-lifecycle-viewmodel = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" } # https://developer.android.com/jetpack/androidx/releases/paging # 3.3.0 and 3.3.1 crash when the data is refreshed while scrolling ("Inconsistency detected.") -# https://issuetracker.google.com/issues/343124454 +# https://issuetracker.google.com/issues/381024738 androidx-paging = "androidx.paging:paging-runtime:3.2.1" androidx-palette = "androidx.palette:palette-ktx:1.0.0" # https://developer.android.com/jetpack/androidx/releases/preference @@ -105,7 +105,7 @@ retrofit2-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" } # https://github.com/robolectric/robolectric/releases/ robolectric = "org.robolectric:robolectric:4.13" -threetenabp = "com.jakewharton.threetenabp:threetenabp:1.4.7" # https://github.com/JakeWharton/ThreeTenABP/blob/master/CHANGELOG.md +threetenabp = "com.jakewharton.threetenabp:threetenabp:1.4.8" # https://github.com/JakeWharton/ThreeTenABP/blob/master/CHANGELOG.md timber = "com.jakewharton.timber:timber:5.0.1" # https://github.com/JakeWharton/timber/blob/master/CHANGELOG.md tmdb-java = "com.uwetrottmann.tmdb2:tmdb-java:2.11.0" # https://github.com/UweTrottmann/tmdb-java/blob/main/CHANGELOG.md trakt-java = "com.uwetrottmann.trakt5:trakt-java:6.16.0" # https://github.com/UweTrottmann/trakt-java/blob/main/CHANGELOG.md @@ -120,7 +120,7 @@ compose = "androidx.compose:compose-bom:2024.06.00" compose-material3 = { module = "androidx.compose.material3:material3" } compose-tooling = { module = "androidx.compose.ui:ui-tooling" } compose-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview" } -androidx-activity-compose = "androidx.activity:activity-compose:1.9.1" +androidx-activity-compose = "androidx.activity:activity-compose:1.9.3" androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" } [plugins] @@ -129,6 +129,9 @@ androidx-lifecycle-compose = { module = "androidx.lifecycle:lifecycle-viewmodel- android = { id = "com.android.application", version = "8.6.1" } # https://kotlinlang.org/docs/releases.html#release-details # When updating, must also update kotlinCompilerExtensionVersion in app/build.gradle +# Also look for compatible Gradle and Android Plugin versions: +# https://kotlinlang.org/docs/gradle-configure-project.html#apply-the-plugin +# Also coroutines version must be compatible. kotlin = { id = "org.jetbrains.kotlin.android", version = "1.9.24" } # https://github.com/ben-manes/gradle-versions-plugin/releases versions = { id = "com.github.ben-manes.versions", version = "0.51.0" }