diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index eec10578c..64aac5e6e 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -29,7 +29,6 @@ import io.legado.app.utils.getViewModelOfActivity import io.legado.app.utils.observeEvent import io.legado.app.utils.startActivity import kotlinx.android.synthetic.main.fragment_books.* -import org.jetbrains.anko.startActivity import kotlin.math.max /** @@ -61,7 +60,6 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), position = it.getInt("position", 0) groupId = it.getLong("groupId", -1) } - tv_empty_msg.setText(R.string.bookshelf_empty) initRecyclerView() upRecyclerData() } @@ -139,8 +137,8 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), override fun open(book: Book) { when (book.type) { BookType.audio -> - context?.startActivity(Pair("bookUrl", book.bookUrl)) - else -> context?.startActivity( + startActivity(Pair("bookUrl", book.bookUrl)) + else -> startActivity( Pair("bookUrl", book.bookUrl), Pair("key", IntentDataHelp.putData(book)) ) diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt index e1fb1c814..2ae13605d 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreFragment.kt @@ -46,7 +46,6 @@ class ExploreFragment : VMBaseFragment(R.layout.fragment_find_ override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { setSupportToolbar(toolbar) - tv_empty_msg.setText(R.string.explore_empty) initSearchView() initRecyclerView() initGroupData() diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt index 34e9f0dc5..834c77121 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt @@ -34,7 +34,6 @@ class RssFragment : VMBaseFragment(R.layout.fragment_rss), override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { setSupportToolbar(toolbar) - tv_empty_msg.setText(R.string.rss_source_empty) initRecyclerView() initData() } diff --git a/app/src/main/res/layout/fragment_books.xml b/app/src/main/res/layout/fragment_books.xml index 9ad51b407..8da85f913 100644 --- a/app/src/main/res/layout/fragment_books.xml +++ b/app/src/main/res/layout/fragment_books.xml @@ -25,6 +25,7 @@ android:gravity="center" android:layout_gravity="center" android:visibility="gone" + android:text="@string/bookshelf_empty" tools:text="TextView" /> diff --git a/app/src/main/res/layout/fragment_find_book.xml b/app/src/main/res/layout/fragment_find_book.xml index 826d713ad..45b4292e3 100644 --- a/app/src/main/res/layout/fragment_find_book.xml +++ b/app/src/main/res/layout/fragment_find_book.xml @@ -30,6 +30,7 @@ android:layout_margin="16dp" android:gravity="center" android:visibility="gone" + android:text="@string/explore_empty" app:layout_constraintTop_toBottomOf="@+id/title_bar" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent" diff --git a/app/src/main/res/layout/fragment_rss.xml b/app/src/main/res/layout/fragment_rss.xml index 6d4bfdeeb..49456ce20 100644 --- a/app/src/main/res/layout/fragment_rss.xml +++ b/app/src/main/res/layout/fragment_rss.xml @@ -31,6 +31,7 @@ android:layout_margin="16dp" android:gravity="center" android:visibility="gone" + android:text="@string/rss_source_empty" app:layout_constraintTop_toBottomOf="@+id/title_bar" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintLeft_toLeftOf="parent"