pull/83/head
kunfei 5 years ago
parent 2fe5dd57e8
commit e460cf1718
  1. 22
      app/src/main/java/io/legado/app/ui/importbook/ImportBookActivity.kt
  2. 1
      app/src/main/java/io/legado/app/ui/importbook/ImportBookAdapter.kt

@ -161,4 +161,26 @@ class ImportBookActivity : VMBaseActivity<ImportBookViewModel>(R.layout.activity
super.onBackPressed()
}
}
override fun upCountView() {
if (importBookAdapter.selectedUris.isEmpty()) {
btn_add_book.setText(R.string.nb_file_add_shelf)
//设置某些按钮的是否可点击
setMenuClickable(false)
} else {
btn_add_book.text =
getString(R.string.nb_file_add_shelves, importBookAdapter.selectedUris.size)
//设置某些按钮的是否可点击
setMenuClickable(true)
}
}
private fun setMenuClickable(isClickable: Boolean) {
//设置是否可删除
btn_delete.isEnabled = isClickable
btn_delete.isClickable = isClickable
//设置是否可添加书籍
btn_add_book.isEnabled = isClickable
btn_add_book.isClickable = isClickable
}
}

@ -68,6 +68,7 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) :
interface CallBack {
fun findFolder(dirName: String)
fun upCountView()
}
}
Loading…
Cancel
Save