Skip to content

Commit 42a7c77

Browse files
committed
Upgrade all libs, remove all casting related libs and classes
Use nextlib-media3ext for H264/HEVC support in videos Change date format for all non english locales (don't include "nth", "st" etc.)
1 parent cbe6823 commit 42a7c77

File tree

14 files changed

+119
-257
lines changed

14 files changed

+119
-257
lines changed

app/build.gradle

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,10 @@ dependencies {
7272
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
7373

7474
// AndroidX libraries
75-
def leanback_version = "1.2.0-alpha04"
76-
def fragment_version = "1.4.1"
77-
def cast_tv_version = "21.0.1"
78-
def cast_version = "21.4.0"
79-
implementation "androidx.appcompat:appcompat:1.4.1"
80-
implementation "androidx.core:core-ktx:1.7.0"
75+
def leanback_version = "1.2.0"
76+
def fragment_version = "1.8.8"
77+
implementation "androidx.appcompat:appcompat:1.7.1"
78+
implementation "androidx.core:core-ktx:1.16.0"
8179
implementation "androidx.fragment:fragment-ktx:$fragment_version"
8280
implementation "androidx.leanback:leanback:$leanback_version"
8381
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
@@ -87,37 +85,37 @@ dependencies {
8785
implementation "androidx.leanback:leanback-preference:$leanback_version"
8886
implementation 'io.arrow-kt:arrow-core:1.2.0'
8987

90-
implementation platform('com.google.firebase:firebase-bom:32.7.1')
88+
implementation platform('com.google.firebase:firebase-bom:33.16.0')
9189
implementation 'com.google.firebase:firebase-crashlytics'
9290
implementation("com.google.firebase:firebase-analytics")
9391

9492
// Cast library used for Cast Connect feature
95-
implementation "com.google.android.gms:play-services-cast-tv:$cast_tv_version"
96-
implementation "com.google.android.gms:play-services-cast:$cast_version"
93+
// implementation "com.google.android.gms:play-services-cast-tv:$cast_tv_version"
94+
// implementation "com.google.android.gms:play-services-cast:$cast_version"
9795

9896
debugImplementation "androidx.fragment:fragment-testing:$fragment_version"
9997

10098
// Work library used for simplifying work done in the background
101-
def work_version = "2.7.1"
102-
implementation "androidx.work:work-runtime:$work_version"
99+
// def work_version = "2.7.1"
100+
// implementation "androidx.work:work-runtime:$work_version"
103101

104102
// TV provider library used for updating home screen channels
105-
implementation 'androidx.tvprovider:tvprovider:1.0.0'
103+
// implementation 'androidx.tvprovider:tvprovider:1.0.0'
106104

107105
implementation 'io.reactivex.rxjava3:rxandroid:3.0.2'
108106
implementation group: 'io.reactivex.rxjava3', name: 'rxjava', version: '3.1.8'
109107

110108
// Exoplayer for playback
111-
implementation 'androidx.media3:media3-exoplayer:1.2.1'
109+
implementation 'androidx.media3:media3-exoplayer:1.7.1'
112110

113-
implementation "com.android.billingclient:billing-ktx:6.1.0"
111+
implementation "com.android.billingclient:billing-ktx:8.0.0"
114112

115-
implementation "com.google.code.gson:gson:2.8.2"
113+
implementation "com.google.code.gson:gson:2.11.0"
116114
implementation 'com.github.bumptech.glide:glide:4.16.0'
117115
implementation 'com.github.bumptech.glide:okhttp3-integration:4.16.0'
118116

119117
// Google Play Services for identity
120-
def playservices_version = "21.0.0"
118+
def playservices_version = "21.3.0"
121119
implementation "com.google.android.gms:play-services-auth:$playservices_version"
122120

123121
// Retrofit for HTTP requests
@@ -139,7 +137,7 @@ dependencies {
139137
testImplementation 'androidx.test:rules:1.4.0'
140138
testImplementation 'androidx.test:runner:1.4.0'
141139
testImplementation 'androidx.test.ext:junit:1.1.3'
142-
testImplementation "androidx.work:work-testing:$work_version"
140+
// testImplementation "androidx.work:work-testing:$work_version"
143141
testImplementation "com.google.truth:truth:1.1.3"
144142
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.0-native-mt"
145143
testImplementation "org.mockito:mockito-core:4.4.0"

app/src/main/java/nl/giejay/android/tv/immich/ImmichApplication.kt

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,15 @@ package nl.giejay.android.tv.immich
1717

1818
import android.app.Application
1919
import android.content.Context
20-
import android.os.StrictMode
2120
import android.util.Log
2221
import androidx.lifecycle.Lifecycle
2322
import androidx.lifecycle.LifecycleObserver
2423
import androidx.lifecycle.OnLifecycleEvent
2524
import androidx.lifecycle.ProcessLifecycleOwner
26-
import com.google.android.gms.cast.tv.CastReceiverContext
2725
import com.google.firebase.crashlytics.FirebaseCrashlytics
2826
import nl.giejay.android.tv.immich.shared.prefs.DEBUG_MODE
2927
import nl.giejay.android.tv.immich.shared.prefs.PreferenceManager
3028
import nl.giejay.android.tv.immich.shared.prefs.USER_ID
31-
import nl.giejay.mediaslider.adapter.MetaDataItem
32-
import nl.giejay.mediaslider.adapter.MetaDataSerializer
3329
import timber.log.Timber
3430
import java.util.UUID
3531

@@ -51,14 +47,6 @@ class ImmichApplication : Application() {
5147
Timber.plant(CrashReportingTree())
5248
}
5349

54-
/**
55-
* This initialises an instance of the CastReceiverContext object which is needed to
56-
* interact with Cast while in the TV app. This object allows for passing media signals
57-
* and the data load and so needs to exist while the app is in the foreground so that all
58-
* cast commands can be picked up by the TV App.
59-
*/
60-
CastReceiverContext.initInstance((this))
61-
ProcessLifecycleOwner.get().lifecycle.addObserver(AppLifecycleObserver(ProcessLifecycleOwner.get().lifecycle))
6250
var userId = PreferenceManager.get(USER_ID)
6351
if(userId.isBlank()){
6452
userId = UUID.randomUUID().toString()
@@ -67,23 +55,6 @@ class ImmichApplication : Application() {
6755
FirebaseCrashlytics.getInstance().setUserId(userId)
6856
}
6957

70-
/**
71-
* TVs only have at most one app in the foreground so we can use onResume/onPause.
72-
* For other form factors, this registration may vary.
73-
*/
74-
class AppLifecycleObserver(val lifecycle: Lifecycle) : LifecycleObserver {
75-
76-
@OnLifecycleEvent(Lifecycle.Event.ON_RESUME)
77-
fun onResume() {
78-
CastReceiverContext.getInstance().start()
79-
}
80-
81-
@OnLifecycleEvent(Lifecycle.Event.ON_PAUSE)
82-
fun onPause() {
83-
CastReceiverContext.getInstance().stop()
84-
}
85-
}
86-
8758
companion object {
8859
var appContext: Context? = null
8960
}

app/src/main/java/nl/giejay/android/tv/immich/MainActivity.kt

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ import androidx.lifecycle.ViewModelProvider
2424
import androidx.navigation.NavController
2525
import androidx.navigation.NavGraph
2626
import androidx.navigation.fragment.NavHostFragment
27-
import nl.giejay.android.tv.immich.castconnect.CastHelper
2827
import nl.giejay.android.tv.immich.shared.prefs.MetaDataScreen
2928
import nl.giejay.android.tv.immich.shared.prefs.PreferenceManager
3029
import nl.giejay.android.tv.immich.shared.viewmodel.KeyEventsViewModel
@@ -39,7 +38,6 @@ class MainActivity : FragmentActivity() {
3938
private lateinit var keyEventsModel: KeyEventsViewModel
4039
private lateinit var navGraph: NavGraph
4140
private lateinit var navController: NavController
42-
private lateinit var castHelper: CastHelper
4341

4442
override fun onCreate(savedInstanceState: Bundle?) {
4543
super.onCreate(savedInstanceState)
@@ -55,16 +53,6 @@ class MainActivity : FragmentActivity() {
5553
navController = navHostFragment.navController
5654
navGraph = navController.navInflater.inflate(R.navigation.nav_graph)
5755

58-
castHelper = CastHelper(
59-
{ videoToCast ->
60-
// loadPlaybackFragment(videoToCast)
61-
},
62-
application
63-
)
64-
if (castHelper.validateAndProcessCastIntent(intent)) {
65-
return
66-
}
67-
6856
if(!PreferenceManager.hasMetaDataForScreen(MetaDataScreen.VIEWER, AlignOption.RIGHT) || !PreferenceManager.hasMetaDataForScreen(MetaDataScreen.SCREENSAVER, AlignOption.RIGHT)){
6957
// first time using the customizer, do a migration
7058
val viewMetaDataFromOldPrefs = PreferenceManager.getViewMetaDataFromOldPrefs()
@@ -115,30 +103,4 @@ class MainActivity : FragmentActivity() {
115103
super.onDestroy()
116104
Timber.i("Main activity got destroyed")
117105
}
118-
119-
override fun onNewIntent(intent: Intent?) {
120-
super.onNewIntent(intent)
121-
setIntent(intent)
122-
123-
if (intent == null) {
124-
return
125-
}
126-
127-
// Return early if intent is a valid Cast intent and is processed by the Cast SDK.
128-
if (castHelper.validateAndProcessCastIntent(intent)) {
129-
return
130-
}
131-
132-
// Include logic to process other types of intents here, if any.
133-
}
134-
135-
// private fun loadPlaybackFragment(video: Video) {
136-
// // Set the default graph and go to playback for the loaded Video
137-
// navController.graph = navGraph
138-
// navController.navigate(
139-
// BrowseFragmentDirections.actionBrowseFragmentToPlaybackFragment(
140-
// video
141-
// )
142-
// )
143-
// }
144106
}

app/src/main/java/nl/giejay/android/tv/immich/album/AlbumDetailsFragment.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import nl.giejay.android.tv.immich.shared.prefs.PhotosOrder
1616

1717

1818
class AlbumDetailsFragment : GenericAssetFragment() {
19-
private lateinit var albumId: String
20-
private lateinit var albumName: String
19+
lateinit var albumId: String
20+
lateinit var albumName: String
2121
private var pageToBucket: Map<Int, String>? = null
2222

2323
override fun getFilterKey(): EnumByTitlePref<ContentType> {

app/src/main/java/nl/giejay/android/tv/immich/api/interceptor/ResponseLoggingInterceptor.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import okhttp3.ResponseBody
88
import okio.BufferedSource
99
import okio.GzipSource
1010
import okio.Okio
11+
import okio.buffer
1112
import timber.log.Timber
1213

1314
// https://gist.github.com/erickok/e371a9e0b9e702ed441d
@@ -20,7 +21,7 @@ class ResponseLoggingInterceptor : Interceptor {
2021
val contentType: MediaType? = it.contentType()
2122
val contentEncoding: String? = response.header(CONTENT_ENCODING)
2223
if ("gzip" == contentEncoding) {
23-
val buffer: BufferedSource = Okio.buffer(GzipSource(it.source()))
24+
val buffer: BufferedSource = GzipSource(it.source()).buffer()
2425
content = buffer.readUtf8()
2526
val wrappedBody: ResponseBody = ResponseBody.create(contentType, content)
2627
response =

app/src/main/java/nl/giejay/android/tv/immich/castconnect/CastHelper.kt

Lines changed: 0 additions & 67 deletions
This file was deleted.

app/src/main/java/nl/giejay/android/tv/immich/castconnect/CastMediaLoadCommandCallback.kt

Lines changed: 0 additions & 61 deletions
This file was deleted.

app/src/main/java/nl/giejay/android/tv/immich/castconnect/CastReceiverOptionsProvider.kt

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)