|
|
@ -6,6 +6,7 @@ import android.graphics.drawable.Drawable |
|
|
|
import android.widget.FrameLayout |
|
|
|
import android.widget.FrameLayout |
|
|
|
import androidx.core.view.isGone |
|
|
|
import androidx.core.view.isGone |
|
|
|
import androidx.core.view.isInvisible |
|
|
|
import androidx.core.view.isInvisible |
|
|
|
|
|
|
|
import io.legado.app.App |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.R |
|
|
|
import io.legado.app.base.BaseActivity |
|
|
|
import io.legado.app.base.BaseActivity |
|
|
|
import io.legado.app.constant.AppConst.timeFormat |
|
|
|
import io.legado.app.constant.AppConst.timeFormat |
|
|
@ -51,49 +52,42 @@ class ContentView(context: Context) : FrameLayout(context) { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun onSizeChanged(w: Int, h: Int, oldw: Int, oldh: Int) { |
|
|
|
fun upStyle() = ReadBookConfig.apply { |
|
|
|
super.onSizeChanged(w, h, oldw, oldh) |
|
|
|
bv_header_left.typeface = ChapterProvider.typeface |
|
|
|
upStyle() |
|
|
|
tv_header_left.typeface = ChapterProvider.typeface |
|
|
|
} |
|
|
|
tv_header_middle.typeface = ChapterProvider.typeface |
|
|
|
|
|
|
|
tv_header_right.typeface = ChapterProvider.typeface |
|
|
|
fun upStyle() { |
|
|
|
bv_footer_left.typeface = ChapterProvider.typeface |
|
|
|
ReadBookConfig.apply { |
|
|
|
tv_footer_left.typeface = ChapterProvider.typeface |
|
|
|
bv_header_left.typeface = ChapterProvider.typeface |
|
|
|
tv_footer_middle.typeface = ChapterProvider.typeface |
|
|
|
tv_header_left.typeface = ChapterProvider.typeface |
|
|
|
tv_footer_right.typeface = ChapterProvider.typeface |
|
|
|
tv_header_middle.typeface = ChapterProvider.typeface |
|
|
|
bv_header_left.setColor(textColor) |
|
|
|
tv_header_right.typeface = ChapterProvider.typeface |
|
|
|
tv_header_left.setColor(textColor) |
|
|
|
bv_footer_left.typeface = ChapterProvider.typeface |
|
|
|
tv_header_middle.setColor(textColor) |
|
|
|
tv_footer_left.typeface = ChapterProvider.typeface |
|
|
|
tv_header_right.setColor(textColor) |
|
|
|
tv_footer_middle.typeface = ChapterProvider.typeface |
|
|
|
bv_footer_left.setColor(textColor) |
|
|
|
tv_footer_right.typeface = ChapterProvider.typeface |
|
|
|
tv_footer_left.setColor(textColor) |
|
|
|
bv_header_left.setColor(textColor) |
|
|
|
tv_footer_middle.setColor(textColor) |
|
|
|
tv_header_left.setColor(textColor) |
|
|
|
tv_footer_right.setColor(textColor) |
|
|
|
tv_header_middle.setColor(textColor) |
|
|
|
upStatusBar() |
|
|
|
tv_header_right.setColor(textColor) |
|
|
|
ll_header.setPadding( |
|
|
|
bv_footer_left.setColor(textColor) |
|
|
|
headerPaddingLeft.dp, |
|
|
|
tv_footer_left.setColor(textColor) |
|
|
|
headerPaddingTop.dp, |
|
|
|
tv_footer_middle.setColor(textColor) |
|
|
|
headerPaddingRight.dp, |
|
|
|
tv_footer_right.setColor(textColor) |
|
|
|
headerPaddingBottom.dp |
|
|
|
upStatusBar() |
|
|
|
) |
|
|
|
ll_header.setPadding( |
|
|
|
ll_footer.setPadding( |
|
|
|
headerPaddingLeft.dp, |
|
|
|
footerPaddingLeft.dp, |
|
|
|
headerPaddingTop.dp, |
|
|
|
footerPaddingTop.dp, |
|
|
|
headerPaddingRight.dp, |
|
|
|
footerPaddingRight.dp, |
|
|
|
headerPaddingBottom.dp |
|
|
|
footerPaddingBottom.dp |
|
|
|
) |
|
|
|
) |
|
|
|
ll_footer.setPadding( |
|
|
|
vw_top_divider.visible(showHeaderLine) |
|
|
|
footerPaddingLeft.dp, |
|
|
|
vw_bottom_divider.visible(showFooterLine) |
|
|
|
footerPaddingTop.dp, |
|
|
|
page_nv_bar.layoutParams = page_nv_bar.layoutParams.apply { |
|
|
|
footerPaddingRight.dp, |
|
|
|
height = if (hideNavigationBar) 0 else App.navigationBarHeight |
|
|
|
footerPaddingBottom.dp |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
vw_top_divider.visible(showHeaderLine) |
|
|
|
|
|
|
|
vw_bottom_divider.visible(showFooterLine) |
|
|
|
|
|
|
|
page_nv_bar.layoutParams = page_nv_bar.layoutParams.apply { |
|
|
|
|
|
|
|
height = if (hideNavigationBar) 0 else activity!!.navigationBarHeight |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
content_text_view.upVisibleRect() |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
content_text_view.upVisibleRect() |
|
|
|
upTime() |
|
|
|
upTime() |
|
|
|
upBattery(battery) |
|
|
|
upBattery(battery) |
|
|
|
} |
|
|
|
} |
|
|
|