OSDN Git Service

DEPRECATION の supress をいれておく...。
authorMRSa <mrsa@myad.jp>
Wed, 30 Dec 2020 09:21:33 +0000 (18:21 +0900)
committerMRSa <mrsa@myad.jp>
Wed, 30 Dec 2020 09:21:33 +0000 (18:21 +0900)
app/src/main/java/net/osdn/gokigen/pkremote/playback/MyContentDownloader.kt

index bbcc768..890d8ee 100644 (file)
@@ -1,8 +1,9 @@
+@file:Suppress("DEPRECATION")
+
 package net.osdn.gokigen.pkremote.playback
 
 import android.app.Activity
 import android.app.AlertDialog
-import android.app.ProgressDialog
 import android.content.ContentValues
 import android.content.Intent
 import android.database.DatabaseUtils
@@ -24,10 +25,11 @@ import java.io.File
 import java.io.OutputStream
 import java.text.SimpleDateFormat
 import java.util.*
+import android.app.ProgressDialog as ProgressDialogOld
 
 class MyContentDownloader(private val activity : Activity, private val playbackControl : IPlaybackControl, private val receiver : IContentDownloadNotify?) : IDownloadContentCallback
 {
-    private lateinit var downloadDialog : ProgressDialog //= ProgressDialog(activity)
+    private lateinit var downloadDialog : ProgressDialogOld //= ProgressDialog(activity)
     private val dumpLog = false
     private var outputStream: OutputStream? = null
     private var targetFileName = ""
@@ -52,11 +54,6 @@ class MyContentDownloader(private val activity : Activity, private val playbackC
         return (target)
     }
 
-    private fun isExternalStorageWritable(): Boolean
-    {
-        return (Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED)
-    }
-
     /**
      * ダウンロードの開始
      *
@@ -148,11 +145,11 @@ class MyContentDownloader(private val activity : Activity, private val playbackC
             activity.runOnUiThread {
                 if (!::downloadDialog.isInitialized)
                 {
-                    downloadDialog = ProgressDialog(activity)
+                    downloadDialog = ProgressDialogOld(activity)
                 }
                 downloadDialog.setTitle(activity.getString(R.string.dialog_download_file_title) + appendTitle)
                 downloadDialog.setMessage(activity.getString(R.string.dialog_download_message) + " " + targetFileName)
-                downloadDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL)
+                downloadDialog.setProgressStyle(ProgressDialogOld.STYLE_HORIZONTAL)
                 downloadDialog.setCancelable(false)
                 downloadDialog.show()
             }