Skip to content

Commit

Permalink
all: smoother for older androids (fixes #3628) (#3634)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Okuro3499 and dogi authored Jun 20, 2024
1 parent 1593bf8 commit 009d4b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId "org.ole.planet.myplanet"
minSdkVersion 21
targetSdkVersion 34
versionCode 1603
versionName "0.16.3"
versionCode 1604
versionName "0.16.4"
ndkVersion '21.3.6528147'
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import android.view.ViewGroup
import android.widget.ArrayAdapter
import android.widget.ListView
import android.widget.TextView
import androidx.annotation.RequiresApi
import androidx.appcompat.app.AlertDialog
import androidx.fragment.app.Fragment
import androidx.localbroadcastmanager.content.LocalBroadcastManager
Expand Down Expand Up @@ -78,10 +77,14 @@ abstract class BaseResourceFragment : Fragment() {
}
}
private val broadcastReceiver: BroadcastReceiver = object : BroadcastReceiver() {
@RequiresApi(Build.VERSION_CODES.TIRAMISU)
override fun onReceive(context: Context, intent: Intent) {
if (intent.action == DashboardActivity.MESSAGE_PROGRESS) {
val download = intent.getParcelableExtra("download", Download::class.java)
val download: Download? = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
intent.getParcelableExtra("download", Download::class.java)
} else {
@Suppress("DEPRECATION")
intent.getParcelableExtra("download")
}
if (!download?.failed!!) {
setProgress(download)
} else {
Expand Down

0 comments on commit 009d4b0

Please sign in to comment.