加回共用布局 #189
This commit is contained in:
@@ -33,6 +33,7 @@ import splitties.init.appCtx
|
||||
import java.io.File
|
||||
import kotlin.String
|
||||
import androidx.core.graphics.drawable.toDrawable
|
||||
import io.legado.app.utils.putPrefBoolean
|
||||
|
||||
/**
|
||||
* 阅读界面配置
|
||||
|
||||
@@ -29,6 +29,11 @@ import io.legado.app.utils.viewbindingdelegate.viewBinding
|
||||
class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_style),
|
||||
FontSelectDialog.CallBack {
|
||||
|
||||
sealed class ReadStyleItem {
|
||||
data class ConfigItem(val config: ReadBookConfig.Config) : ReadStyleItem()
|
||||
data object ShareLayoutItem : ReadStyleItem()
|
||||
}
|
||||
|
||||
private val binding by viewBinding(DialogReadBookStyleBinding::bind)
|
||||
private val callBack get() = activity as? ReadBookActivity
|
||||
private lateinit var styleAdapter: StyleAdapter
|
||||
@@ -132,7 +137,7 @@ class ReadStyleDialog : BaseBottomSheetDialogFragment(R.layout.dialog_read_book_
|
||||
ReadBook.loadContent(false)
|
||||
}
|
||||
|
||||
cbShareLayout.setOnCheckedChangeListener { _, isChecked ->
|
||||
cbShareLayout.addOnCheckedChangeListener { _, isChecked ->
|
||||
ReadBookConfig.shareLayout = isChecked
|
||||
upView()
|
||||
postEvent(EventBus.UP_CONFIG, arrayListOf(1, 2, 5))
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="960"
|
||||
android:viewportHeight="960"
|
||||
android:tint="?attr/colorControlNormal">
|
||||
<path
|
||||
android:fillColor="@android:color/white"
|
||||
android:pathData="M340,680Q365,680 382.5,662.5Q400,645 400,620Q400,595 382.5,577.5Q365,560 340,560Q315,560 297.5,577.5Q280,595 280,620Q280,645 297.5,662.5Q315,680 340,680ZM340,400Q365,400 382.5,382.5Q400,365 400,340Q400,315 382.5,297.5Q365,280 340,280Q315,280 297.5,297.5Q280,315 280,340Q280,365 297.5,382.5Q315,400 340,400ZM620,680Q645,680 662.5,662.5Q680,645 680,620Q680,595 662.5,577.5Q645,560 620,560Q595,560 577.5,577.5Q560,595 560,620Q560,645 577.5,662.5Q595,680 620,680ZM620,400Q645,400 662.5,382.5Q680,365 680,340Q680,315 662.5,297.5Q645,280 620,280Q595,280 577.5,297.5Q560,315 560,340Q560,365 577.5,382.5Q595,400 620,400ZM200,840Q167,840 143.5,816.5Q120,793 120,760L120,200Q120,167 143.5,143.5Q167,120 200,120L760,120Q793,120 816.5,143.5Q840,167 840,200L840,760Q840,793 816.5,816.5Q793,840 760,840L200,840ZM200,760L760,760Q760,760 760,760Q760,760 760,760L760,200Q760,200 760,200Q760,200 760,200L200,200Q200,200 200,200Q200,200 200,200L200,760Q200,760 200,760Q200,760 200,760ZM200,200L200,200Q200,200 200,200Q200,200 200,200L200,760Q200,760 200,760Q200,760 200,760L200,760Q200,760 200,760Q200,760 200,760L200,200Q200,200 200,200Q200,200 200,200Z"/>
|
||||
</vector>
|
||||
@@ -242,27 +242,41 @@
|
||||
android:textSize="12sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<com.google.android.material.checkbox.MaterialCheckBox
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/cb_share_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="20dp"
|
||||
android:text="@string/share_layout"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginEnd="16dp" />
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="56dp"
|
||||
app:cornerRadius="16dp"
|
||||
style="@style/Widget.Material3Expressive.Button.TonalButton"
|
||||
android:checkable="true"
|
||||
android:clickable="true"
|
||||
android:layout_marginVertical="2dp"
|
||||
app:icon="@drawable/ic_share_layout"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="0dp"
|
||||
android:layout_marginStart="16dp"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:paddingHorizontal="8dp"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tool:listitem="@layout/item_read_style" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_style"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="2dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:clipToPadding="false"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="12dp"
|
||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
|
||||
tool:listitem="@layout/item_read_style" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user