pull/32/head
gedoor 6 years ago
parent a6866cea1d
commit c2341b442c
  1. 5
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceAdapter.kt
  2. 2
      app/src/main/java/io/legado/app/ui/main/booksource/BookSourceFragment.kt

@ -4,6 +4,7 @@ import android.view.LayoutInflater
import android.view.Menu
import android.view.View
import android.view.ViewGroup
import android.widget.CompoundButton
import android.widget.PopupMenu
import androidx.paging.PagedListAdapter
import androidx.recyclerview.widget.DiffUtil
@ -54,9 +55,9 @@ class BookSourceAdapter : PagedListAdapter<BookSource, BookSourceAdapter.MyViewH
checkedList.remove(bookSource.origin)
}
}
sw_enabled.isEnabled = bookSource.isEnabled
sw_enabled.isChecked = bookSource.isEnabled
sw_enabled.setOnClickListener{
bookSource.isEnabled = sw_enabled.isEnabled
bookSource.isEnabled = sw_enabled.isChecked
callBack?.update(bookSource)
}
iv_more.setOnClickListener{

@ -65,6 +65,6 @@ class BookSourceFragment : BaseFragment(R.layout.fragment_book_source), BookSour
}
override fun edit(bookSource: BookSource) {
TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
context?.let { it.startActivity<SourceEditActivity>(Pair("data", bookSource.origin)) }
}
}
Loading…
Cancel
Save