Initial support for external sources
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.widget.preference
|
||||
|
||||
import android.app.Activity
|
||||
import android.app.Dialog
|
||||
import android.content.DialogInterface
|
||||
import android.content.Intent
|
||||
@@ -70,7 +71,8 @@ abstract class LoginDialogPreference : DialogFragment() {
|
||||
|
||||
override fun onDismiss(dialog: DialogInterface) {
|
||||
super.onDismiss(dialog)
|
||||
targetFragment?.onActivityResult(targetRequestCode, arguments.getInt("key"), Intent())
|
||||
val intent = Intent().putExtras(arguments)
|
||||
targetFragment?.onActivityResult(targetRequestCode, Activity.RESULT_OK, intent)
|
||||
}
|
||||
|
||||
protected abstract fun checkLogin()
|
||||
|
||||
@@ -19,7 +19,7 @@ class SourceLoginDialog : LoginDialogPreference() {
|
||||
fun newInstance(source: Source): LoginDialogPreference {
|
||||
val fragment = SourceLoginDialog()
|
||||
val bundle = Bundle(1)
|
||||
bundle.putInt("key", source.id)
|
||||
bundle.putLong("key", source.id)
|
||||
fragment.arguments = bundle
|
||||
return fragment
|
||||
}
|
||||
@@ -32,7 +32,7 @@ class SourceLoginDialog : LoginDialogPreference() {
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
super.onCreate(savedInstanceState)
|
||||
|
||||
val sourceId = arguments.getInt("key")
|
||||
val sourceId = arguments.getLong("key")
|
||||
source = sourceManager.get(sourceId) as LoginSource
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user