refactor
This commit is contained in:
parent
2a4e3745f0
commit
be46e5d517
|
@ -2755,6 +2755,7 @@ class ActMain : AsyncActivity()
|
|||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Suppress("BlockingMethodInNonBlockingContext")
|
||||
private fun importAppData(uri : Uri?) {
|
||||
uri ?: return
|
||||
|
||||
|
@ -2931,7 +2932,10 @@ class ActMain : AsyncActivity()
|
|||
}
|
||||
|
||||
var auto_cw = status.auto_cw
|
||||
if(auto_cw != null && auto_cw.refActivity?.get() === this@ActMain && auto_cw.cell_width == nAutoCwCellWidth) {
|
||||
if(auto_cw != null &&
|
||||
auto_cw.refActivity?.get() === this@ActMain &&
|
||||
auto_cw.cell_width == nAutoCwCellWidth
|
||||
) {
|
||||
// 以前に計算した値がまだ使える
|
||||
return
|
||||
}
|
||||
|
@ -2947,19 +2951,18 @@ class ActMain : AsyncActivity()
|
|||
auto_cw.decoded_spoiler_text = null
|
||||
|
||||
// テキストをレイアウトして行数を測定
|
||||
|
||||
val lp = LinearLayout.LayoutParams(nAutoCwCellWidth, LinearLayout.LayoutParams.WRAP_CONTENT)
|
||||
val tv = TextView(this)
|
||||
tv.layoutParams = lp
|
||||
if(! timeline_font_size_sp.isNaN()) {
|
||||
tv.textSize = timeline_font_size_sp
|
||||
val tv = TextView(this).apply{
|
||||
layoutParams = LinearLayout.LayoutParams(nAutoCwCellWidth, LinearLayout.LayoutParams.WRAP_CONTENT)
|
||||
if(! timeline_font_size_sp.isNaN())
|
||||
textSize = timeline_font_size_sp
|
||||
|
||||
val fv = timeline_spacing
|
||||
if(fv != null) setLineSpacing(0f, fv)
|
||||
|
||||
typeface = timeline_font
|
||||
this.text = text
|
||||
}
|
||||
|
||||
val fv = timeline_spacing
|
||||
if(fv != null) tv.setLineSpacing(0f, fv)
|
||||
|
||||
tv.typeface = timeline_font
|
||||
tv.text = text
|
||||
tv.measure(
|
||||
View.MeasureSpec.makeMeasureSpec(nAutoCwCellWidth, View.MeasureSpec.EXACTLY),
|
||||
View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED)
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ScrollView
|
||||
|
@ -619,7 +620,7 @@
|
|||
android:layout_height="match_parent"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_followed_by"
|
||||
android:tint="?attr/colorImageButtonAccent"
|
||||
app:tint="?attr/colorImageButtonAccent"
|
||||
tools:ignore="ContentDescription" />
|
||||
</FrameLayout>
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
android:contentDescription="@string/drag_handle"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_order"
|
||||
android:tint="?attr/colorVectorDrawable"
|
||||
app:tint="?attr/colorVectorDrawable"
|
||||
/>
|
||||
|
||||
<LinearLayout
|
||||
|
@ -94,7 +94,7 @@
|
|||
android:layout_marginEnd="4dp"
|
||||
android:id="@+id/ivColumnIcon"
|
||||
android:importantForAccessibility="no"
|
||||
android:tint="?attr/colorVectorDrawable"
|
||||
app:tint="?attr/colorVectorDrawable"
|
||||
/>
|
||||
<TextView
|
||||
android:id="@+id/tvName"
|
||||
|
@ -111,7 +111,7 @@
|
|||
android:contentDescription="@string/last_selection"
|
||||
android:scaleType="center"
|
||||
android:src="@drawable/ic_bookmark"
|
||||
android:tint="?attr/colorVectorDrawable"
|
||||
app:tint="?attr/colorVectorDrawable"
|
||||
/>
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
android:scaleType="center"
|
||||
android:src="@drawable/ic_order"
|
||||
android:visibility="gone"
|
||||
android:tint="?attr/colorVectorDrawable"
|
||||
app:tint="?attr/colorVectorDrawable"
|
||||
/>
|
||||
|
||||
<TextView
|
||||
|
|
Loading…
Reference in New Issue