pull/83/head
kunfei 5 years ago
parent 563f989703
commit f7e731ce40
  1. 4
      app/src/main/java/io/legado/app/ui/importbook/ImportBookAdapter.kt
  2. 25
      app/src/main/res/layout/item_import_book.xml

@ -25,14 +25,10 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) :
iv_icon.visible() iv_icon.visible()
cb_select.invisible() cb_select.invisible()
ll_brief.gone() ll_brief.gone()
tv_sub_count.visible()
tv_sub_count.text =
context.getString(R.string.nb_file_sub_count, item.listFiles().size)
} else { } else {
iv_icon.invisible() iv_icon.invisible()
cb_select.visible() cb_select.visible()
ll_brief.visible() ll_brief.visible()
tv_sub_count.gone()
tv_tag.text = item.name?.substringAfterLast(".") tv_tag.text = item.name?.substringAfterLast(".")
tv_size.text = StringUtils.toSize(item.length()) tv_size.text = StringUtils.toSize(item.length())
tv_date.text = AppConst.DATE_FORMAT.format(Date(item.lastModified())) tv_date.text = AppConst.DATE_FORMAT.format(Date(item.lastModified()))

@ -31,26 +31,28 @@
app:tint="@color/tv_text_default" /> app:tint="@color/tv_text_default" />
</FrameLayout> </FrameLayout>
<RelativeLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1" android:layout_weight="1"
android:paddingTop="8dp" android:orientation="vertical">
android:paddingBottom="8dp">
<TextView <TextView
android:id="@+id/tv_name" android:id="@+id/tv_name"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_weight="1"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" android:text="@string/app_name"
android:textSize="16sp" /> android:textSize="16sp"
android:gravity="center_vertical"
tools:ignore="NestedWeights" />
<LinearLayout <LinearLayout
android:id="@+id/ll_brief" android:id="@+id/ll_brief"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="0dp"
android:layout_alignParentBottom="true" android:layout_weight="1"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
@ -82,12 +84,5 @@
tools:text="2017-05-22" /> tools:text="2017-05-22" />
</LinearLayout> </LinearLayout>
<TextView </LinearLayout>
android:id="@+id/tv_sub_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:visibility="gone"
tools:text="0 项" />
</RelativeLayout>
</LinearLayout> </LinearLayout>
Loading…
Cancel
Save