Skip to content

Commit

Permalink
Merge branch 'updates' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
UweTrottmann committed Dec 15, 2023
2 parents cbc69fe + 10cabc3 commit 4874f03
Show file tree
Hide file tree
Showing 8 changed files with 51 additions and 48 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2012-2023 Uwe Trottmann

package com.battlelancer.seriesguide.comments

Expand Down Expand Up @@ -156,6 +156,7 @@ class TraktCommentsFragment : Fragment() {
// comment for an episode?
val episodeId = args.getLong(InitBundle.EPISODE_ID)
if (episodeId != 0L) {
@Suppress("DEPRECATION") // AsyncTask
TraktTask(context).commentEpisode(episodeId, comment, isSpoiler)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
return
Expand All @@ -164,6 +165,7 @@ class TraktCommentsFragment : Fragment() {
// comment for a movie?
val movieTmdbId = args.getInt(InitBundle.MOVIE_TMDB_ID)
if (movieTmdbId != 0) {
@Suppress("DEPRECATION") // AsyncTask
TraktTask(context).commentMovie(movieTmdbId, comment, isSpoiler)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
return
Expand All @@ -172,6 +174,7 @@ class TraktCommentsFragment : Fragment() {
// comment for a show?
val showId = args.getLong(InitBundle.SHOW_ID)
if (showId != 0L) {
@Suppress("DEPRECATION") // AsyncTask
TraktTask(context).commentShow(showId, comment, isSpoiler)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2019-2023 Uwe Trottmann

package com.battlelancer.seriesguide.shows.episodes

Expand Down Expand Up @@ -114,6 +114,7 @@ class EpisodesActivity : BaseMessageActivity() {
}

val episodeRowId = intent.getLongExtra(EXTRA_LONG_EPISODE_ID, 0)
@Suppress("DEPRECATION") // For backwards-compat
val episodeTvdbId = intent.getIntExtra(EXTRA_EPISODE_TVDBID, 0)
val seasonId = intent.getLongExtra(EXTRA_LONG_SEASON_ID, 0)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2011-2023 Uwe Trottmann

package com.battlelancer.seriesguide.shows.search.discover

Expand Down Expand Up @@ -140,11 +140,13 @@ class TraktAddFragment : AddFragment() {
override fun onMenuItemClick(item: MenuItem): Boolean {
val itemId = item.itemId
if (itemId == R.id.menu_action_show_watchlist_add) {
@Suppress("DEPRECATION") // AsyncTask
AddShowToWatchlistTask(context, showTmdbId)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
return true
}
if (itemId == R.id.menu_action_show_watchlist_remove) {
@Suppress("DEPRECATION") // AsyncTask
RemoveShowFromWatchlistTask(context, showTmdbId)
.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR)
return true
Expand Down Expand Up @@ -189,7 +191,7 @@ class TraktAddFragment : AddFragment() {
}

@Subscribe(threadMode = ThreadMode.MAIN)
fun onEventMainThread(event: ShowChangedEvent?) {
fun onEventMainThread(@Suppress("UNUSED_PARAMETER") event: ShowChangedEvent?) {
if (listType == TraktShowsLink.WATCHLIST) {
// reload watchlist if a show was removed
LoaderManager.getInstance(this)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2012-2018, 2020-2023 Uwe Trottmann

package com.battlelancer.seriesguide.traktapi

Expand All @@ -18,6 +18,7 @@ import com.battlelancer.seriesguide.util.safeShow
class CheckInDialogFragment : GenericCheckInDialogFragment() {

override fun checkInTrakt(message: String) {
@Suppress("DEPRECATION") // AsyncTask
TraktTask(requireContext()).checkInEpisode(
requireArguments().getLong(ARG_EPISODE_ID),
requireArguments().getString(ARG_ITEM_TITLE),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2013, 2014, 2016-2018, 2022, 2023 Uwe Trottmann

package com.battlelancer.seriesguide.traktapi

Expand All @@ -15,6 +15,7 @@ import com.battlelancer.seriesguide.util.safeShow
class MovieCheckInDialogFragment : GenericCheckInDialogFragment() {

override fun checkInTrakt(message: String) {
@Suppress("DEPRECATION") // AsyncTask
TraktTask(context).checkInMovie(
requireArguments().getInt(ARG_MOVIE_TMDB_ID),
requireArguments().getString(ARG_ITEM_TITLE),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
// Copyright 2023 Uwe Trottmann
// SPDX-License-Identifier: Apache-2.0
// Copyright 2013-2019, 2022, 2023 Uwe Trottmann

@file:Suppress("DEPRECATION")
// Not using WindowInsetsControllerCompat due to bugs, see note in FullscreenImageActivity

package com.battlelancer.seriesguide.util

Expand Down
24 changes: 7 additions & 17 deletions app/src/main/java/com/battlelancer/seriesguide/util/ThemeUtils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -145,20 +145,20 @@ object ThemeUtils {
// For transparent status bars (M+), check if the background has a light color;
// for colored status bars check if itself has a light color.
// If a light color, tell the system to color icons accordingly.
setLightStatusBar(
window,
val isLightStatusBar =
if (forceDarkStatusBars) {
false
} else {
isUsingLightSystemBar(statusBarColor, isLightBackground)
}
)
// Do the same check for nav bars
// (only difference: transparent nav bars supported since O_MR1+).
setLightNavigationBar(
window,
isUsingLightSystemBar(navigationBarColor, isLightBackground)
)
val isLightNavigationBar = isUsingLightSystemBar(navigationBarColor, isLightBackground)

WindowCompat.getInsetsController(window, window.decorView).run {
isAppearanceLightStatusBars = isLightStatusBar
isAppearanceLightNavigationBars = isLightNavigationBar
}
}

private fun getStatusBarColor(context: Context): Int {
Expand Down Expand Up @@ -193,16 +193,6 @@ object ThemeUtils {
}
}

private fun setLightStatusBar(window: Window, isLight: Boolean) {
WindowCompat.getInsetsController(window, window.decorView)
.isAppearanceLightStatusBars = isLight
}

private fun setLightNavigationBar(window: Window, isLight: Boolean) {
WindowCompat.getInsetsController(window, window.decorView)
.isAppearanceLightNavigationBars = isLight
}

private fun isUsingLightSystemBar(
systemBarColor: Int,
isLightBackground: Boolean
Expand Down
50 changes: 26 additions & 24 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,40 @@
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
androidx-lifecycle = "2.6.1" # https://developer.android.com/jetpack/androidx/releases/lifecycle
androidx-lifecycle = "2.6.2" # https://developer.android.com/jetpack/androidx/releases/lifecycle
debugdrawer = "0.9.0" # https://github.com/lenguyenthanh/DebugDrawer
eventbus = "3.3.1"
google-api-client = "2.2.0" # https://github.com/googleapis/google-api-java-client/releases
retrofit2 = "2.9.0" # https://github.com/square/retrofit/blob/master/CHANGELOG.md

[libraries]
amazon-appstore-sdk = "com.amazon.device:amazon-appstore-sdk:3.0.4" # https://developer.amazon.com/docs/in-app-purchasing/iap-whats-new.html
androidutils = "com.uwetrottmann.androidutils:androidutils:3.1.0" # https://github.com/UweTrottmann/AndroidUtils/releases
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.7.2"
androidx-activity-ktx = "androidx.activity:activity-ktx:1.7.2"
androidx-annotation = "androidx.annotation:annotation:1.6.0"
androidx-activity = "androidx.activity:activity:1.8.2"
# https://developer.android.com/jetpack/androidx/releases/annotation
androidx-annotation = "androidx.annotation:annotation:1.7.1"
# https://developer.android.com/jetpack/androidx/releases/appcompat
androidx-appcompat = "androidx.appcompat:appcompat:1.6.1"
# https://developer.android.com/jetpack/androidx/releases/browser
# Note: 1.6.0 requires SDK 34
androidx-browser = "androidx.browser:browser:1.5.0"
androidx-browser = "androidx.browser:browser:1.7.0"
androidx-constraintlayout = "androidx.constraintlayout:constraintlayout:2.1.4" # 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.10.1"
androidx-core-ktx = "androidx.core:core-ktx:1.10.1"
androidx-core = "androidx.core:core:1.12.0"
androidx-core-ktx = "androidx.core:core-ktx:1.12.0"
# https://developer.android.com/jetpack/androidx/releases/fragment
androidx-fragment = "androidx.fragment:fragment-ktx:1.6.1"
androidx-fragment = "androidx.fragment:fragment-ktx:1.6.2"
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
androidx-paging = "androidx.paging:paging-runtime-ktx:3.2.0"
androidx-paging = "androidx.paging:paging-runtime-ktx:3.2.1"
androidx-palette = "androidx.palette:palette-ktx:1.0.0"
# https://developer.android.com/jetpack/androidx/releases/preference
androidx-preference = "androidx.preference:preference-ktx:1.2.1"
# https://developer.android.com/jetpack/androidx/releases/recyclerview
androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.1"
androidx-recyclerview = "androidx.recyclerview:recyclerview:1.3.2"
# https://developer.android.com/jetpack/androidx/releases/room
androidx-room-compiler = "androidx.room:room-compiler:2.5.2"
androidx-room-ktx = "androidx.room:room-ktx:2.5.2"
Expand All @@ -57,16 +56,16 @@ androidx-viewpager = "androidx.viewpager:viewpager:1.0.0"
androidx-viewpager2 = "androidx.viewpager2:viewpager2:1.1.0-beta02"
billing = "com.android.billingclient:billing-ktx:6.0.1" # https://developer.android.com/google/play/billing/billing_library_releases_notes
# https://github.com/google/dagger/releases
dagger = "com.google.dagger:dagger:2.47"
dagger-compiler = "com.google.dagger:dagger-compiler:2.47"
dagger = "com.google.dagger:dagger:2.49"
dagger-compiler = "com.google.dagger:dagger-compiler:2.49"
debugdrawer-actions = { module = "com.github.lenguyenthanh.debugdrawer:debugdrawer-actions", version.ref = "debugdrawer" }
debugdrawer-base = { module = "com.github.lenguyenthanh.debugdrawer:debugdrawer-base", version.ref = "debugdrawer" }
debugdrawer-commons = { module = "com.github.lenguyenthanh.debugdrawer:debugdrawer-commons", version.ref = "debugdrawer" }
debugdrawer-timber = { module = "com.github.lenguyenthanh.debugdrawer:debugdrawer-timber", version.ref = "debugdrawer" }
debugdrawer-view = { module = "com.github.lenguyenthanh.debugdrawer:debugdrawer-view", version.ref = "debugdrawer" }
findbugs-jsr305 = "com.google.code.findbugs:jsr305:3.0.2"
# https://firebase.google.com/support/release-notes/android
firebase = "com.google.firebase:firebase-bom:32.2.2"
firebase = "com.google.firebase:firebase-bom:32.7.0"
firebase-ui-auth = "com.firebaseui:firebase-ui-auth:8.0.2" # https://github.com/firebase/FirebaseUI-Android/releases
flatbuffers = "com.google.flatbuffers:flatbuffers-java:1.12.0"
google-api-client = { module = "com.google.api-client:google-api-client", version.ref = "google-api-client" }
Expand All @@ -84,33 +83,36 @@ kotlinx-coroutines-test = "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.3"
# https://github.com/michaelbull/kotlin-result/releases
kotlinx-result = "com.michael-bull.kotlin-result:kotlin-result:1.1.18"
material = "com.google.android.material:material:1.10.0" # https://github.com/material-components/material-components-android/releases
mockito = "org.mockito:mockito-core:4.5.1"
okhttp = "com.squareup.okhttp3:okhttp:4.11.0" # https://github.com/square/okhttp/blob/master/CHANGELOG.md
# https://github.com/mockito/mockito/releases
# mockito 5 requires JDK 11
mockito = "org.mockito:mockito-core:4.11.0"
okhttp = "com.squareup.okhttp3:okhttp:4.12.0" # https://github.com/square/okhttp/blob/master/CHANGELOG.md
photoview = "com.github.chrisbanes:PhotoView:2.3.0"
picasso = "com.squareup.picasso:picasso:2.8" # https://github.com/square/picasso/releases
# https://developers.google.com/android/guides/releases
play-services-auth = "com.google.android.gms:play-services-auth:20.6.0"
play-services-auth = "com.google.android.gms:play-services-auth:20.7.0"
retrofit2-gson = { module = "com.squareup.retrofit2:converter-gson", version.ref = "retrofit2" }
retrofit2 = { module = "com.squareup.retrofit2:retrofit", version.ref = "retrofit2" }
# https://github.com/robolectric/robolectric/releases/
robolectric = "org.robolectric:robolectric:4.9.2"
robolectric = "org.robolectric:robolectric:4.11.1"
taptargetview = "com.getkeepsafe.taptargetview:taptargetview:1.13.3"
threetenabp = "com.jakewharton.threetenabp:threetenabp:1.4.6" # 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.8.1" # https://github.com/UweTrottmann/tmdb-java/blob/master/CHANGELOG.md
tmdb-java = "com.uwetrottmann.tmdb2:tmdb-java:2.10.0" # https://github.com/UweTrottmann/tmdb-java/blob/master/CHANGELOG.md
trakt-java = "com.uwetrottmann.trakt5:trakt-java:6.11.2" # https://github.com/UweTrottmann/trakt-java/blob/master/CHANGELOG.md
truth = "com.google.truth:truth:1.1.5" # https://github.com/google/truth/releases

[plugins]
# https://developer.android.com/build/releases/gradle-plugin
android = { id = "com.android.application", version = "8.1.2" }
android = { id = "com.android.application", version = "8.2.0" }
# https://kotlinlang.org/docs/releases.html#release-details
kotlin = { id = "org.jetbrains.kotlin.android", version = "1.8.22" }
# https://github.com/ben-manes/gradle-versions-plugin/releases
versions = { id = "com.github.ben-manes.versions", version = "0.47.0" }
versions = { id = "com.github.ben-manes.versions", version = "0.50.0" }
# https://github.com/gradle-nexus/publish-plugin/releases
publish = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" }
google-services = { id = "com.google.gms.google-services", version = "4.3.15" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.8" }
# https://firebase.google.com/support/release-notes/android
google-services = { id = "com.google.gms.google-services", version = "4.4.0" }
firebase-crashlytics = { id = "com.google.firebase.crashlytics", version = "2.9.9" }
# For endpoints plugin, version is actually set in settings.gradle.kts!
endpoints = { id = "com.google.cloud.tools.endpoints-framework-gradle-plugin", version = "2.1.0" }

0 comments on commit 4874f03

Please sign in to comment.