pull/83/head
kunfei 5 years ago
parent bee89db3dd
commit 943186974c
  1. 17
      app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt
  2. 8
      app/src/main/res/layout/activity_import_book.xml

@ -14,6 +14,7 @@ import io.legado.app.base.VMBaseActivity
import io.legado.app.help.AppConfig
import io.legado.app.utils.getViewModel
import kotlinx.android.synthetic.main.activity_import_book.*
import org.jetbrains.anko.sdk27.listeners.onClick
import java.io.File
@ -29,6 +30,7 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
override fun onActivityCreated(savedInstanceState: Bundle?) {
initView()
initEvent()
upRootDoc()
}
@ -50,6 +52,21 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
recycler_view.adapter = importBookAdapter
}
private fun initEvent() {
tv_go_back.onClick {
if (subDirs.isNotEmpty()) {
subDirs.removeAt(subDirs.lastIndex)
upPath()
}
}
btn_add_book.onClick {
}
btn_delete.onClick {
}
}
private fun upRootDoc() {
AppConfig.importBookPath?.let {
val rootUri = Uri.parse(it)

@ -68,7 +68,7 @@
tools:ignore="RtlHardcoded,RtlSymmetry">
<io.legado.app.lib.theme.view.ATECheckBox
android:id="@+id/file_system_cb_selected_all"
android:id="@+id/cb_selected_all"
android:layout_width="120dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
@ -76,7 +76,7 @@
android:textColor="@color/tv_text_default" />
<io.legado.app.lib.theme.view.ATEAccentStrokeTextView
android:id="@+id/file_system_btn_add_book"
android:id="@+id/btn_add_book"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:layout_alignParentRight="true"
@ -86,14 +86,14 @@
android:text="@string/add_to_shelf" />
<io.legado.app.lib.theme.view.ATEAccentStrokeTextView
android:id="@+id/file_system_btn_delete"
android:id="@+id/btn_delete"
android:layout_width="70dp"
android:layout_height="35dp"
android:layout_centerVertical="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:gravity="center"
android:layout_toLeftOf="@id/file_system_btn_add_book"
android:layout_toLeftOf="@id/btn_add_book"
android:text="@string/delete" />
</RelativeLayout>

Loading…
Cancel
Save