more offline stuff/bugfixes
This commit is contained in:
parent
3dfcc9fc31
commit
4db301ca7a
29 changed files with 341 additions and 119 deletions
|
@ -0,0 +1,23 @@
|
|||
package ani.dantotsu.download
|
||||
|
||||
import android.os.Bundle
|
||||
import androidx.appcompat.app.AppCompatActivity
|
||||
import androidx.fragment.app.Fragment
|
||||
import ani.dantotsu.R
|
||||
import ani.dantotsu.themes.ThemeManager
|
||||
|
||||
class DownloadContainerActivity : AppCompatActivity() {
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
ThemeManager(this).applyTheme()
|
||||
setContentView(R.layout.activity_container)
|
||||
|
||||
val fragmentClassName = intent.getStringExtra("FRAGMENT_CLASS_NAME")
|
||||
val fragment = Class.forName(fragmentClassName).newInstance() as Fragment
|
||||
|
||||
supportFragmentManager.beginTransaction()
|
||||
.replace(R.id.fragment_container, fragment)
|
||||
.commit()
|
||||
}
|
||||
}
|
|
@ -60,7 +60,7 @@ class MangaDownloaderService : Service() {
|
|||
|
||||
private val downloadJobs = mutableMapOf<String, Job>()
|
||||
private val mutex = Mutex()
|
||||
var isCurrentlyProcessing = false
|
||||
private var isCurrentlyProcessing = false
|
||||
|
||||
override fun onBind(intent: Intent?): IBinder? {
|
||||
// This is only required for bound services.
|
||||
|
@ -78,7 +78,7 @@ class MangaDownloaderService : Service() {
|
|||
setProgress(0, 0, false)
|
||||
}
|
||||
startForeground(NOTIFICATION_ID, builder.build())
|
||||
registerReceiver(cancelReceiver, IntentFilter(ACTION_CANCEL_DOWNLOAD))
|
||||
ContextCompat.registerReceiver(this, cancelReceiver, IntentFilter(ACTION_CANCEL_DOWNLOAD), ContextCompat.RECEIVER_NOT_EXPORTED)
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
|
|
@ -17,7 +17,7 @@ class OfflineMangaAdapter(private val context: Context, private val items: List<
|
|||
return items.size
|
||||
}
|
||||
|
||||
override fun getItem(position: Int): Any? {
|
||||
override fun getItem(position: Int): Any {
|
||||
return items[position]
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue