|
|
@ -8,6 +8,8 @@ import io.legado.app.base.VMBaseActivity |
|
|
|
import io.legado.app.constant.Theme |
|
|
|
import io.legado.app.constant.Theme |
|
|
|
import io.legado.app.ui.main.MainActivity |
|
|
|
import io.legado.app.ui.main.MainActivity |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
import io.legado.app.utils.getViewModel |
|
|
|
|
|
|
|
import kotlinx.android.synthetic.main.activity_translucence.* |
|
|
|
|
|
|
|
import org.jetbrains.anko.startActivity |
|
|
|
import org.jetbrains.anko.toast |
|
|
|
import org.jetbrains.anko.toast |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -20,11 +22,13 @@ class FileAssociationActivity : VMBaseActivity<FileAssociationViewModel>( |
|
|
|
get() = getViewModel(FileAssociationViewModel::class.java) |
|
|
|
get() = getViewModel(FileAssociationViewModel::class.java) |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
override fun onActivityCreated(savedInstanceState: Bundle?) { |
|
|
|
|
|
|
|
rotate_loading.show() |
|
|
|
viewModel.errorLiveData.observe(this, Observer { |
|
|
|
viewModel.errorLiveData.observe(this, Observer { |
|
|
|
|
|
|
|
rotate_loading.hide() |
|
|
|
toast(it) |
|
|
|
toast(it) |
|
|
|
gotoMainActivity() |
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
viewModel.successLiveData.observe(this, Observer { |
|
|
|
viewModel.successLiveData.observe(this, Observer { |
|
|
|
|
|
|
|
rotate_loading.hide() |
|
|
|
startActivity(it) |
|
|
|
startActivity(it) |
|
|
|
finish() |
|
|
|
finish() |
|
|
|
}) |
|
|
|
}) |
|
|
@ -35,13 +39,12 @@ class FileAssociationActivity : VMBaseActivity<FileAssociationViewModel>( |
|
|
|
|
|
|
|
|
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { |
|
|
|
super.onActivityResult(requestCode, resultCode, data) |
|
|
|
super.onActivityResult(requestCode, resultCode, data) |
|
|
|
|
|
|
|
finish() |
|
|
|
//返回后直接跳转到主页面 |
|
|
|
//返回后直接跳转到主页面 |
|
|
|
gotoMainActivity() |
|
|
|
gotoMainActivity() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private fun gotoMainActivity() { |
|
|
|
private fun gotoMainActivity() { |
|
|
|
val mIntent = Intent() |
|
|
|
startActivity<MainActivity>() |
|
|
|
mIntent.setClass(this, MainActivity::class.java) |
|
|
|
|
|
|
|
startActivity(mIntent) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|