|
|
@ -24,12 +24,12 @@ class ChangeSourceDialog : DialogFragment(), |
|
|
|
companion object { |
|
|
|
companion object { |
|
|
|
const val tag = "changeSourceDialog" |
|
|
|
const val tag = "changeSourceDialog" |
|
|
|
|
|
|
|
|
|
|
|
fun newInstance(name: String, author: String, bookUrl: String? = null): ChangeSourceDialog { |
|
|
|
fun newInstance(name: String, author: String, origin: String): ChangeSourceDialog { |
|
|
|
val changeSourceDialog = ChangeSourceDialog() |
|
|
|
val changeSourceDialog = ChangeSourceDialog() |
|
|
|
val bundle = Bundle() |
|
|
|
val bundle = Bundle() |
|
|
|
bundle.putString("name", name) |
|
|
|
bundle.putString("name", name) |
|
|
|
bundle.putString("author", author) |
|
|
|
bundle.putString("author", author) |
|
|
|
bundle.putString("bookUrl", bookUrl) |
|
|
|
bundle.putString("origin", origin) |
|
|
|
changeSourceDialog.arguments = bundle |
|
|
|
changeSourceDialog.arguments = bundle |
|
|
|
return changeSourceDialog |
|
|
|
return changeSourceDialog |
|
|
|
} |
|
|
|
} |
|
|
@ -53,8 +53,8 @@ class ChangeSourceDialog : DialogFragment(), |
|
|
|
bundle.getString("author")?.let { |
|
|
|
bundle.getString("author")?.let { |
|
|
|
viewModel.author = it |
|
|
|
viewModel.author = it |
|
|
|
} |
|
|
|
} |
|
|
|
bundle.getString("bookUrl")?.let { |
|
|
|
bundle.getString("origin")?.let { |
|
|
|
viewModel.curBookUrl = it |
|
|
|
viewModel.curOrigin = it |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
tool_bar.inflateMenu(R.menu.search_view) |
|
|
|
tool_bar.inflateMenu(R.menu.search_view) |
|
|
@ -127,8 +127,8 @@ class ChangeSourceDialog : DialogFragment(), |
|
|
|
dismiss() |
|
|
|
dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun curBookUrl(): String { |
|
|
|
override fun curOrigin(): String { |
|
|
|
return viewModel.curBookUrl |
|
|
|
return viewModel.curOrigin |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun adapter(): ChangeSourceAdapter { |
|
|
|
override fun adapter(): ChangeSourceAdapter { |
|
|
|