Commit 17b23399 authored by fallenstardust's avatar fallenstardust

优化卡组广场布局list

parent 8a9d5d8c
...@@ -38,7 +38,7 @@ public class DeckSquareFragment extends Fragment { ...@@ -38,7 +38,7 @@ public class DeckSquareFragment extends Fragment {
binding = FragmentDeckSquareBinding.inflate(inflater, container, false); binding = FragmentDeckSquareBinding.inflate(inflater, container, false);
deckSquareListAdapter = new DeckSquareListAdapter(R.layout.item_deck_info); deckSquareListAdapter = new DeckSquareListAdapter(R.layout.item_deck_info);
GridLayoutManager linearLayoutManager = new GridLayoutManager(getContext(), 2); GridLayoutManager linearLayoutManager = new GridLayoutManager(getContext(), 3);
binding.listDeckInfo.setLayoutManager(linearLayoutManager); binding.listDeckInfo.setLayoutManager(linearLayoutManager);
binding.listDeckInfo.setAdapter(deckSquareListAdapter); binding.listDeckInfo.setAdapter(deckSquareListAdapter);
deckSquareListAdapter.loadData(); deckSquareListAdapter.loadData();
......
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:height="24dp" android:tint="#FFFFFF" android:viewportHeight="24" android:viewportWidth="24" android:width="24dp">
<path android:fillColor="@android:color/white" android:pathData="M1,21h4L5,9L1,9v12zM23,10c0,-1.1 -0.9,-2 -2,-2h-6.31l0.95,-4.57 0.03,-0.32c0,-0.41 -0.17,-0.79 -0.44,-1.06L14.17,1 7.59,7.59C7.22,7.95 7,8.45 7,9v10c0,1.1 0.9,2 2,2h9c0.83,0 1.54,-0.5 1.84,-1.22l3.02,-7.05c0.09,-0.23 0.14,-0.47 0.14,-0.73v-2z"/>
</vector>
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<item> <item>
<shape> <shape>
<corners android:radius="5dp" /> <corners android:radius="5dp" />
<solid android:color="@color/white" /> <solid android:color="@color/blackLinght" />
</shape> </shape>
</item> </item>
</selector> </selector>
\ No newline at end of file
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<com.tubb.smrv.SwipeMenuRecyclerView <com.tubb.smrv.SwipeMenuRecyclerView
android:id="@+id/list_deck_info" android:id="@+id/list_deck_info"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:divider="@android:color/transparent" android:divider="@android:color/transparent"
android:dividerHeight="4dp" android:dividerHeight="4dp"
android:padding="5dp" android:padding="5dp"
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="wrap_content"
xmlns:tools="http://schemas.android.com/tools" android:layout_height="wrap_content">
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="16dp">
<!-- 封面卡片图片 -->
<ImageView <ImageView
android:id="@+id/deck_info_image" android:id="@+id/deck_info_image"
android:layout_width="279dp" android:layout_width="80dp"
android:layout_height="465dp" android:layout_height="115dp"
android:layout_marginStart="76dp" android:layout_marginLeft="14dp"
android:adjustViewBounds="true" android:layout_marginTop="14dp"
android:scaleType="centerInside" android:layout_marginRight="15dp"
app:layout_constraintBottom_toBottomOf="@id/deck_background" android:layout_marginBottom="10dp"
app:layout_constraintStart_toStartOf="parent" android:src="@drawable/unknown" />
app:layout_constraintTop_toTopOf="@id/deck_background"
app:layout_constraintVertical_bias="0.701" />
<!-- 背景图片 -->
<ImageView <ImageView
android:id="@+id/deck_background" android:id="@+id/deck_background"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:adjustViewBounds="true" android:adjustViewBounds="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/box" android:src="@drawable/box"/>
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<!--TextView <!-- <TextView
android:id="@+id/deck_id" android:id="@+id/deck_id"
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content" />-->
android:text="ID: 12345"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintStart_toEndOf="@id/deck_info_image"
android:layout_marginStart="16dp"/-->
<LinearLayout <LinearLayout
android:layout_width="216dp" android:layout_width="30dp"
android:layout_height="110dp" android:layout_height="10dp"
android:orientation="vertical" android:layout_marginLeft="10dp"
tools:layout_editor_absoluteX="109dp" android:layout_marginTop="5dp"
tools:layout_editor_absoluteY="353dp"> android:background="@drawable/chat_message_background"
<!-- 卡组名称 --> android:orientation="horizontal">
<ImageView
android:layout_width="10dp"
android:layout_height="10dp"
android:layout_marginLeft="1dp"
android:src="@drawable/baseline_thumb_up_24"/>
<TextView
android:id="@+id/like_count"
android:layout_width="20dp"
android:layout_height="10dp"
android:text="23333"
android:lines="1"
android:gravity="center"
android:layout_marginLeft="1dp"
android:layout_marginRight="1dp"
android:textSize="5sp"/>
</LinearLayout>
<TextView <TextView
android:id="@+id/deck_info_name" android:id="@+id/deck_info_name"
android:layout_width="match_parent" android:layout_width="57dp"
android:layout_height="wrap_content" /> android:layout_height="27dp"
<!-- 贡献者 --> android:layout_marginLeft="28dp"
android:layout_marginTop="93dp"
android:text="deck_name"
android:textColor="@color/white"
android:gravity="center"
android:textSize="8sp"/>
<TextView <TextView
android:id="@+id/deck_contributor" android:id="@+id/deck_contributor"
android:layout_width="match_parent" android:layout_width="72dp"
android:layout_height="wrap_content" android:layout_height="15dp"
android:layout_weight="1" android:layout_marginLeft="21dp"
app:layout_constraintBottom_toTopOf="@+id/deck_background" android:layout_marginTop="15dp"
app:layout_constraintStart_toStartOf="@+id/deck_background" /> android:text="contributor_name"
<!-- 最后修改时间 --> android:lines="1"
android:gravity="center"
android:textSize="6sp"/>
<TextView <TextView
android:id="@+id/deck_last_date" android:id="@+id/deck_last_date"
android:layout_width="match_parent" android:layout_width="72dp"
android:layout_height="wrap_content" android:layout_height="15dp"
android:layout_weight="1" android:layout_marginLeft="21dp"
tools:layout_editor_absoluteX="130dp" android:layout_marginTop="122dp"
tools:layout_editor_absoluteY="372dp" /> android:text="1900-02-03"
android:lines="1"
</LinearLayout> android:gravity="center"
android:textSize="6sp"/>
</FrameLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment