pull/48/head
kunfei 5 years ago
parent da1a3c1f54
commit e79f8b7e5a
  1. 15
      app/src/main/java/io/legado/app/ui/widget/page/ContentView.kt

@ -5,6 +5,7 @@ import android.content.Context
import android.graphics.Typeface import android.graphics.Typeface
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import android.util.AttributeSet import android.util.AttributeSet
import android.view.Gravity
import android.widget.FrameLayout import android.widget.FrameLayout
import android.widget.ImageView import android.widget.ImageView
import androidx.appcompat.widget.AppCompatImageView import androidx.appcompat.widget.AppCompatImageView
@ -102,10 +103,16 @@ class ContentView : FrameLayout {
} }
fun setContent(textPage: TextPage?) { fun setContent(textPage: TextPage?) {
content_text_view.text = textPage?.text if (textPage != null) {
tv_bottom_left.text = textPage?.title content_text_view.gravity = Gravity.START
pageSize = textPage?.pageSize ?: 0 content_text_view.text = textPage.text
setPageIndex(textPage?.index) tv_bottom_left.text = textPage.title
pageSize = textPage.pageSize
setPageIndex(textPage.index)
} else {
content_text_view.gravity = Gravity.CENTER
content_text_view.setText(R.string.data_loading)
}
} }
@SuppressLint("SetTextI18n") @SuppressLint("SetTextI18n")

Loading…
Cancel
Save