commit
3712feff2e
@ -0,0 +1,39 @@ |
|||||||
|
package io.legado.app.data.entities |
||||||
|
|
||||||
|
data class ExploreKind( |
||||||
|
val title: String, |
||||||
|
val url: String? = null, |
||||||
|
val style: Style? = null |
||||||
|
) { |
||||||
|
|
||||||
|
companion object { |
||||||
|
val defaultStyle = Style() |
||||||
|
} |
||||||
|
|
||||||
|
fun style(): Style { |
||||||
|
return style ?: defaultStyle |
||||||
|
} |
||||||
|
|
||||||
|
data class Style( |
||||||
|
val layout_flexGrow: Float = 0F, |
||||||
|
val layout_flexShrink: Float = 1F, |
||||||
|
val layout_alignSelf: String = "auto", |
||||||
|
val layout_flexBasisPercent: Float = -1F, |
||||||
|
val layout_wrapBefore: Boolean = false, |
||||||
|
) { |
||||||
|
|
||||||
|
fun alignSelf(): Int { |
||||||
|
return when (layout_alignSelf) { |
||||||
|
"auto" -> -1 |
||||||
|
"flex_start" -> 0 |
||||||
|
"flex_end" -> 1 |
||||||
|
"center" -> 2 |
||||||
|
"baseline" -> 3 |
||||||
|
"stretch" -> 4 |
||||||
|
else -> -1 |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
@ -1,11 +1,18 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content"> |
android:layout_height="wrap_content" |
||||||
|
android:padding="16dp"> |
||||||
|
|
||||||
<TextView |
<TextView |
||||||
android:id="@+id/tv_dict" |
android:id="@+id/tv_dict" |
||||||
android:layout_width="match_parent" |
android:layout_width="match_parent" |
||||||
android:layout_height="wrap_content" /> |
android:layout_height="wrap_content" /> |
||||||
|
|
||||||
</LinearLayout> |
<io.legado.app.ui.widget.anima.RotateLoading |
||||||
|
android:id="@+id/rotate_loading" |
||||||
|
android:layout_width="60dp" |
||||||
|
android:layout_height="60dp" |
||||||
|
android:layout_gravity="center" /> |
||||||
|
|
||||||
|
</FrameLayout> |
@ -1,46 +1,9 @@ |
|||||||
<?xml version="1.0" encoding="utf-8"?> |
<?xml version="1.0" encoding="utf-8"?> |
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
<com.google.android.flexbox.FlexboxLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto" |
xmlns:app="http://schemas.android.com/apk/res-auto" |
||||||
|
android:layout_width="match_parent" |
||||||
|
android:layout_height="wrap_content" |
||||||
android:background="@drawable/shape_card_view" |
android:background="@drawable/shape_card_view" |
||||||
android:padding="5dp" |
android:padding="5dp" |
||||||
android:orientation="vertical"> |
app:flexDirection="row" |
||||||
|
app:flexWrap="wrap" /> |
||||||
<LinearLayout |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:orientation="horizontal" |
|
||||||
android:gravity="center_vertical"> |
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView |
|
||||||
android:id="@+id/recycler_view" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:layout_gravity="center" |
|
||||||
android:orientation="horizontal" |
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> |
|
||||||
|
|
||||||
<androidx.appcompat.widget.AppCompatImageView |
|
||||||
android:id="@+id/iv_menu_more" |
|
||||||
android:layout_width="24dp" |
|
||||||
android:layout_height="24dp" |
|
||||||
android:background="?attr/selectableItemBackgroundBorderless" |
|
||||||
android:src="@drawable/ic_more_vert" |
|
||||||
android:tint="@color/primaryText" |
|
||||||
android:visibility="gone" |
|
||||||
android:contentDescription="@string/more_menu" /> |
|
||||||
|
|
||||||
</LinearLayout> |
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView |
|
||||||
android:id="@+id/recycler_view_more" |
|
||||||
android:layout_width="wrap_content" |
|
||||||
android:layout_height="wrap_content" |
|
||||||
android:layout_gravity="center" |
|
||||||
android:visibility="gone" |
|
||||||
android:orientation="vertical" |
|
||||||
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> |
|
||||||
|
|
||||||
</LinearLayout> |
|
||||||
|
|
Loading…
Reference in new issue