更新界面
增加搜索进度 增加初次使用引导界面
This commit is contained in:
@@ -43,6 +43,12 @@ class WebDavFragment : BaseFragment(R.layout.fragment_webdav_auth) {
|
||||
private var restoreJob: Job? = null
|
||||
private val waitDialog by lazy { WaitDialog(requireContext()) }
|
||||
|
||||
interface WebDavActions {
|
||||
fun onSaveWebDavConfig()
|
||||
}
|
||||
|
||||
var listener: WebDavActions? = null
|
||||
|
||||
private val restoreDoc = registerForActivityResult(HandleFileContract()) {
|
||||
it.uri?.let { uri ->
|
||||
waitDialog.setText("恢复中…")
|
||||
|
||||
@@ -17,6 +17,8 @@ class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
|
||||
|
||||
override val binding by viewBinding(ActivityWelcomeBinding::inflate)
|
||||
|
||||
private val webDavFragment: WebDavFragment
|
||||
get() = pages[1] as WebDavFragment
|
||||
private val pages = listOf(
|
||||
PrivacyFragment(),
|
||||
WebDavFragment(),
|
||||
@@ -69,6 +71,13 @@ class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
|
||||
// 初始化按钮文字
|
||||
binding.btnNext.text = "阅读并同意"
|
||||
|
||||
(webDavFragment).listener = object : WebDavFragment.WebDavActions {
|
||||
override fun onSaveWebDavConfig() {
|
||||
webDavFragment.saveWebDavConfig()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
binding.btnNext.setOnClickListener {
|
||||
val current = binding.viewPager.currentItem
|
||||
when (current) {
|
||||
@@ -82,7 +91,10 @@ class WelcomeActivity : BaseActivity<ActivityWelcomeBinding>() {
|
||||
finishSetup()
|
||||
}
|
||||
|
||||
else -> binding.viewPager.currentItem = current + 1
|
||||
else -> {
|
||||
webDavFragment.listener?.onSaveWebDavConfig()
|
||||
binding.viewPager.currentItem = current + 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user