Merge pull request #161 from yangyxd/master

调整发现页面UI
pull/164/head
kunfei 5 years ago committed by GitHub
commit 2322e2ec69
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt
  2. 7
      app/src/main/res/drawable/bg_find_book_group.xml
  3. 9
      app/src/main/res/drawable/ic_arrow_down.xml
  4. 9
      app/src/main/res/drawable/ic_arrow_right.xml
  5. 2
      app/src/main/res/drawable/shape_fillet_btn.xml
  6. 2
      app/src/main/res/drawable/shape_fillet_btn_press.xml
  7. 5
      app/src/main/res/layout/item_fillet_text.xml
  8. 32
      app/src/main/res/layout/item_find_book.xml

@ -32,7 +32,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
tv_name.text = item.bookSourceName tv_name.text = item.bookSourceName
} }
if (exIndex == holder.layoutPosition) { if (exIndex == holder.layoutPosition) {
iv_status.setImageResource(R.drawable.ic_remove) iv_status.setImageResource(R.drawable.ic_arrow_down)
rotate_loading.loadingColor = context.accentColor rotate_loading.loadingColor = context.accentColor
rotate_loading.show() rotate_loading.show()
if (scrollTo >= 0) { if (scrollTo >= 0) {
@ -68,7 +68,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca
} }
} }
} else { } else {
iv_status.setImageResource(R.drawable.ic_add) iv_status.setImageResource(R.drawable.ic_arrow_right)
rotate_loading.hide() rotate_loading.hide()
gl_child.gone() gl_child.gone()
} }

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" >
<!-- 角度 -->
<corners android:radius="6dp"/>
<!-- 填充色 -->
<solid android:color="@color/transparent10" />
</shape>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M512,685.25l-278.62,-278.62 45.25,-45.25L512,594.75l233.38,-233.38 45.25,45.25z"
android:fillColor="#181818"/>
</vector>

@ -0,0 +1,9 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="64dp"
android:height="64dp"
android:viewportWidth="1024"
android:viewportHeight="1024">
<path
android:pathData="M434.94,790.62l-45.25,-45.25L623.04,512l-233.38,-233.38 45.25,-45.25L713.57,512z"
android:fillColor="#181818"/>
</vector>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="3dp" /> <corners android:radius="16dp" />
<solid android:color="@color/btn_bg_press" /> <solid android:color="@color/btn_bg_press" />
</shape> </shape>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<corners android:radius="3dp" /> <corners android:radius="16dp" />
<solid android:color="@color/btn_bg_press_2" /> <solid android:color="@color/btn_bg_press_2" />
</shape> </shape>

@ -8,7 +8,10 @@
android:background="@drawable/selector_fillet_btn_bg" android:background="@drawable/selector_fillet_btn_bg"
android:ellipsize="end" android:ellipsize="end"
android:gravity="center" android:gravity="center"
android:padding="5dp" android:paddingTop="4dp"
android:paddingBottom="4dp"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:maxLines="1" android:maxLines="1"
android:textColor="@color/tv_text_default" android:textColor="@color/tv_text_default"
android:textSize="14sp" android:textSize="14sp"

@ -4,8 +4,9 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="10dp" android:paddingTop="15dp"
android:paddingRight="10dp" android:paddingLeft="16dp"
android:paddingRight="16dp"
android:gravity="center" android:gravity="center"
android:orientation="vertical"> android:orientation="vertical">
@ -17,8 +18,7 @@
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingTop="6dp" android:paddingTop="6dp"
android:paddingBottom="6dp" android:paddingBottom="6dp"
android:layout_margin="4dp" android:background="@drawable/bg_find_book_group"
android:background="@color/btn_bg_press"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="center_vertical"> android:gravity="center_vertical">
@ -28,11 +28,21 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" /> android:layout_weight="1" />
<io.legado.app.ui.widget.anima.RotateLoading
android:id="@+id/rotate_loading"
android:layout_width="20dp"
android:layout_height="20dp"
android:visibility="gone"
android:layout_gravity="center"
android:layout_marginRight="4dp"
app:hide_mode="gone"
app:loading_width="1dp" />
<ImageView <ImageView
android:id="@+id/iv_status" android:id="@+id/iv_status"
android:layout_width="20dp" android:layout_width="20dp"
android:layout_height="20dp" android:layout_height="20dp"
android:src="@drawable/ic_add" android:src="@drawable/ic_arrow_right"
app:tint="@color/tv_text_secondary" app:tint="@color/tv_text_secondary"
tools:ignore="ContentDescription" /> tools:ignore="ContentDescription" />
@ -41,6 +51,8 @@
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:paddingLeft="8dp"
android:paddingRight="8dp"
android:layout_gravity="center"> android:layout_gravity="center">
<com.google.android.flexbox.FlexboxLayout <com.google.android.flexbox.FlexboxLayout
@ -50,21 +62,13 @@
android:clipToPadding="false" android:clipToPadding="false"
android:overScrollMode="never" android:overScrollMode="never"
android:padding="3dp" android:padding="3dp"
android:layout_marginTop="8dp"
android:visibility="gone" android:visibility="gone"
app:dividerDrawable="@drawable/shape_space_divider" app:dividerDrawable="@drawable/shape_space_divider"
app:flexDirection="row" app:flexDirection="row"
app:flexWrap="wrap" app:flexWrap="wrap"
app:showDivider="middle" /> app:showDivider="middle" />
<io.legado.app.ui.widget.anima.RotateLoading
android:id="@+id/rotate_loading"
android:layout_width="36dp"
android:layout_height="36dp"
android:visibility="gone"
android:layout_gravity="center"
app:hide_mode="gone"
app:loading_width="2dp" />
</FrameLayout> </FrameLayout>
</LinearLayout> </LinearLayout>
Loading…
Cancel
Save