feat: 创建必要的布局文件

pull/1894/head
谢意帆 3 years ago
parent b404a1831e
commit d24eef36fe
  1. 34
      app/src/main/java/io/legado/app/ui/book/remote/RemoteBookActivity.kt
  2. 7
      app/src/main/java/io/legado/app/ui/book/remote/RemoteBookViewModel.kt
  3. 25
      app/src/main/res/layout/activity_remote_book.xml

@ -0,0 +1,34 @@
package io.legado.app.ui.book.remote
import android.os.Bundle
import androidx.activity.viewModels
import io.legado.app.base.VMBaseActivity
import io.legado.app.databinding.ActivityRemoteBookBinding
import io.legado.app.utils.toastOnUi
import io.legado.app.utils.viewbindingdelegate.viewBinding
/**
* 展示远程书籍
* @author qianfanguojin
* @time 2022/05/12
*/
class RemoteBookActivity : VMBaseActivity<ActivityRemoteBookBinding,RemoteBookViewModel>() {
override val binding by viewBinding(ActivityRemoteBookBinding::inflate)
override val viewModel by viewModels<RemoteBookViewModel>()
override fun onActivityCreated(savedInstanceState: Bundle?) {
toastOnUi("远程书籍")
}
private fun initView() {
// binding.layTop.setBackgroundColor(backgroundColor)
// binding.recyclerView.layoutManager = LinearLayoutManager(this)
// binding.recyclerView.adapter = adapter
// binding.selectActionBar.setMainActionText(R.string.add_to_shelf)
// binding.selectActionBar.inflateMenu(R.menu.import_book_sel)
// binding.selectActionBar.setOnMenuItemClickListener(this)
// binding.selectActionBar.setCallBack(this)
}
}

@ -0,0 +1,7 @@
package io.legado.app.ui.book.remote
import android.app.Application
import io.legado.app.base.BaseViewModel
class RemoteBookViewModel(application: Application): BaseViewModel(application){
}

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent">
<io.legado.app.ui.widget.TitleBar
android:id="@+id/titleBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintTop_toTopOf="parent"
app:title="远程书籍" />
<!-- <io.legado.app.ui.widget.anima.RefreshProgressBar-->
<!-- android:id="@+id/refresh_progress_bar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="2dp"-->
<!-- app:layout_constraintTop_toBottomOf="@id/lay_top" />-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save