0
0
mirror of https://github.com/mediathekview/zapp.git synced 2024-09-19 20:02:17 +02:00

Merge branch 'feature/sdk-34' into develop

This commit is contained in:
Christine Coenen 2023-07-22 10:48:41 +02:00
commit bd4eabfe62
5 changed files with 49 additions and 21 deletions

View File

@ -6,13 +6,13 @@ apply plugin: 'koin'
apply plugin: 'androidx.navigation.safeargs.kotlin'
android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
compileSdkVersion 34
buildToolsVersion '34.0.0'
defaultConfig {
applicationId "de.christinecoenen.code.zapp"
minSdkVersion 26
targetSdkVersion 33
targetSdkVersion 34
versionCode 67
versionName "8.3.1"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
@ -77,7 +77,7 @@ android {
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
def fragment_version = '1.5.7'
def fragment_version = '1.6.0'
// kotlin
implementation 'androidx.core:core-ktx:1.10.1'
@ -103,12 +103,12 @@ dependencies {
testImplementation 'junit:junit:4.13.2'
testImplementation "androidx.test:core-ktx:$androix_test_version"
testImplementation 'org.robolectric:robolectric:4.10.3'
testImplementation 'org.mockito.kotlin:mockito-kotlin:3.2.0'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.6.4'
testImplementation 'org.mockito.kotlin:mockito-kotlin:5.0.0'
testImplementation 'org.jetbrains.kotlinx:kotlinx-coroutines-test:1.7.2'
// support
implementation "androidx.fragment:fragment-ktx:$fragment_version"
implementation 'androidx.activity:activity-ktx:1.7.1'
implementation 'androidx.activity:activity-ktx:1.7.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.1.0"
@ -126,7 +126,7 @@ dependencies {
implementation "androidx.navigation:navigation-ui-ktx:$nav_version"
// room database
def room_version = "2.5.1"
def room_version = "2.5.2"
implementation "androidx.room:room-runtime:$room_version"
implementation "androidx.room:room-paging:$room_version"
kapt "androidx.room:room-compiler:$room_version"
@ -136,7 +136,7 @@ dependencies {
implementation 'com.google.code.gson:gson:2.10.1'
// sortable list
implementation 'com.github.woxthebox:draglistview:1.7.2'
implementation 'com.github.woxthebox:draglistview:1.7.3'
// markdown
implementation 'io.noties.markwon:core:4.6.2'
@ -146,7 +146,7 @@ dependencies {
implementation "androidx.work:work-runtime-ktx:$work_version"
// exo player
def exoplayer_version = "2.18.6"
def exoplayer_version = "2.19.0"
implementation "com.google.android.exoplayer:exoplayer-core:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-hls:$exoplayer_version"
implementation "com.google.android.exoplayer:exoplayer-ui:$exoplayer_version"
@ -159,7 +159,7 @@ dependencies {
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
// ACRA crash reporting
def acra_version = "5.9.7"
def acra_version = "5.11.0"
implementation "ch.acra:acra-mail:$acra_version"
implementation "ch.acra:acra-dialog:$acra_version"
@ -170,7 +170,7 @@ dependencies {
implementation 'com.jakewharton:process-phoenix:2.1.2'
// joda time
implementation 'joda-time:joda-time:2.12.2'
implementation 'joda-time:joda-time:2.12.5'
// about libraries view
implementation "com.mikepenz:aboutlibraries:$about_libraries_version"

View File

@ -7,6 +7,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_DATA_SYNC" />
<uses-feature
android:name="android.hardware.touchscreen"
@ -132,6 +134,11 @@
android:value="true" />
</service>
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
android:foregroundServiceType="dataSync"
tools:node="merge" />
<receiver
android:name=".app.mediathek.controller.downloads.RetryDownloadBroadcastReceiver"
android:exported="false" />

View File

@ -3,6 +3,8 @@ package de.christinecoenen.code.zapp.app.mediathek.controller.downloads
import android.annotation.SuppressLint
import android.app.PendingIntent
import android.content.Context
import android.content.pm.ServiceInfo
import android.os.Build
import androidx.core.app.NotificationManagerCompat
import androidx.work.*
import de.christinecoenen.code.zapp.app.mediathek.controller.downloads.notifications.DownloadCompletedEventNotification
@ -237,10 +239,18 @@ class DownloadWorker(appContext: Context, workerParams: WorkerParameters) :
}
override suspend fun getForegroundInfo() =
ForegroundInfo(
id.hashCode(),
downloadProgressNotification.build(progress, downloadedBytes, totalBytes)
)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
ForegroundInfo(
id.hashCode(),
downloadProgressNotification.build(progress, downloadedBytes, totalBytes),
ServiceInfo.FOREGROUND_SERVICE_TYPE_DATA_SYNC
)
} else {
ForegroundInfo(
id.hashCode(),
downloadProgressNotification.build(progress, downloadedBytes, totalBytes)
)
}
private suspend fun reportProgress() {
val update = workDataOf(ProgressKey to progress)
@ -256,16 +266,21 @@ class DownloadWorker(appContext: Context, workerParams: WorkerParameters) :
HttpURLConnection.HTTP_NOT_FOUND,
HttpURLConnection.HTTP_GONE ->
ErrorType.FileNotFound
HttpURLConnection.HTTP_UNAUTHORIZED,
HttpURLConnection.HTTP_FORBIDDEN,
451 ->
ErrorType.FileForbidden
429 ->
ErrorType.TooManyRequests
in 400..499 ->
ErrorType.ClientError
in 500..600 ->
ErrorType.ServerError
else ->
ErrorType.Unknown
}

View File

@ -192,12 +192,18 @@ class SwipeablePlayerView @JvmOverloads constructor(
return super.onDown(e)
}
// removing this leads to a compilation error with sdk 33
@Suppress("NOTHING_TO_OVERRIDE")
override fun onScroll(
e1: MotionEvent,
e1: MotionEvent?,
e2: MotionEvent,
distanceX: Float,
distanceY: Float
): Boolean {
if (e1 == null) {
return false
}
if (!canUseWipeControls || e1.y <= forbiddenAreaSizeTop) {
return super.onScroll(e1, e2, distanceX, distanceY)
}

View File

@ -1,9 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.koin_version = '3.3.3'
ext.about_libraries_version = '10.6.1'
ext.nav_version = '2.5.3'
ext.koin_version = '3.4.1'
ext.about_libraries_version = '10.8.3'
ext.nav_version = '2.6.0'
repositories {
google()
@ -14,7 +14,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:8.0.1'
classpath 'com.android.tools.build:gradle:8.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"