发布作品界面代码的编写提交
This commit is contained in:
parent
b5fdbf1319
commit
dbcd9fce42
|
|
@ -284,10 +284,10 @@ public class PublishWorkActivity extends AppCompatActivity {
|
|||
View view = getLayoutInflater().inflate(R.layout.bottom_sheet_media_picker, null);
|
||||
dialog.setContentView(view);
|
||||
|
||||
View pickImage = view.findViewById(R.id.actionPickImage);
|
||||
View pickVideo = view.findViewById(R.id.actionPickVideo);
|
||||
View takePhoto = view.findViewById(R.id.actionTakePhoto);
|
||||
View takeVideo = view.findViewById(R.id.actionTakeVideo);
|
||||
LinearLayout pickImage = view.findViewById(R.id.actionPickImage);
|
||||
LinearLayout pickVideo = view.findViewById(R.id.actionPickVideo);
|
||||
LinearLayout takePhoto = view.findViewById(R.id.actionTakePhoto);
|
||||
LinearLayout takeVideo = view.findViewById(R.id.actionTakeVideo);
|
||||
View cancel = view.findViewById(R.id.actionCancel);
|
||||
|
||||
pickImage.setOnClickListener(v -> {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle">
|
||||
<stroke
|
||||
android:width="3dp"
|
||||
android:color="@color/purple_500" />
|
||||
<corners android:radius="8dp" />
|
||||
</shape>
|
||||
|
|
@ -3,22 +3,23 @@
|
|||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#FFFFFF">
|
||||
android:background="#F8F8F8">
|
||||
|
||||
<com.google.android.material.appbar.AppBarLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
|
||||
app:elevation="0dp">
|
||||
app:elevation="2dp">
|
||||
|
||||
<androidx.appcompat.widget.Toolbar
|
||||
android:id="@+id/toolbar"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="?attr/actionBarSize"
|
||||
android:background="#FFFFFF"
|
||||
android:background="@color/purple_500"
|
||||
app:title="发布作品"
|
||||
app:titleTextColor="#111111"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_24" />
|
||||
app:titleTextColor="#FFFFFF"
|
||||
app:navigationIcon="@drawable/ic_arrow_back_24"
|
||||
app:navigationIconTint="#FFFFFF" />
|
||||
|
||||
</com.google.android.material.appbar.AppBarLayout>
|
||||
|
||||
|
|
@ -39,14 +40,16 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="false">
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="4dp"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="300dp">
|
||||
android:minHeight="280dp"
|
||||
android:background="#FFFFFF">
|
||||
|
||||
<!-- 图片/视频预览容器 -->
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
|
|
@ -114,32 +117,33 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical"
|
||||
android:padding="32dp"
|
||||
android:minHeight="300dp">
|
||||
android:padding="40dp"
|
||||
android:minHeight="280dp">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="80dp"
|
||||
android:src="@drawable/ic_add_24"
|
||||
android:layout_width="72dp"
|
||||
android:layout_height="72dp"
|
||||
android:src="@drawable/ic_image_24"
|
||||
android:background="@drawable/bg_purple_circle"
|
||||
android:padding="20dp"
|
||||
android:padding="18dp"
|
||||
android:tint="#FFFFFF" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="选择图片或视频"
|
||||
android:textColor="#666666"
|
||||
android:textSize="16sp" />
|
||||
android:layout_marginTop="20dp"
|
||||
android:text="添加图片或视频"
|
||||
android:textColor="#333333"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="支持多张图片或单个视频"
|
||||
android:text="最多9张图片或1个视频"
|
||||
android:textColor="#999999"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
@ -151,14 +155,18 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/selectMediaButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="52dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="选择图片/视频"
|
||||
android:textSize="16sp"
|
||||
app:cornerRadius="12dp"
|
||||
android:text="添加图片/视频"
|
||||
android:textSize="15sp"
|
||||
android:textColor="@color/purple_500"
|
||||
app:cornerRadius="26dp"
|
||||
app:icon="@drawable/ic_add_24"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="8dp"
|
||||
app:iconTint="@color/purple_500"
|
||||
app:strokeColor="@color/purple_500"
|
||||
app:strokeWidth="1.5dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
|
||||
|
||||
<!-- 封面选择区域 -->
|
||||
|
|
@ -168,9 +176,10 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:visibility="gone"
|
||||
app:cardCornerRadius="16dp"
|
||||
app:cardElevation="2dp"
|
||||
app:cardUseCompatPadding="false">
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="4dp"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -181,9 +190,9 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="封面"
|
||||
android:textColor="#111111"
|
||||
android:textSize="16sp"
|
||||
android:text="📷 封面图片"
|
||||
android:textColor="#333333"
|
||||
android:textSize="15sp"
|
||||
android:textStyle="bold"
|
||||
android:layout_marginBottom="12dp" />
|
||||
|
||||
|
|
@ -217,14 +226,18 @@
|
|||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/selectCoverButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="48dp"
|
||||
android:layout_height="44dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:text="选择封面"
|
||||
android:text="更换封面"
|
||||
android:textSize="14sp"
|
||||
app:cornerRadius="12dp"
|
||||
app:icon="@drawable/ic_grid_24"
|
||||
android:textColor="@color/purple_500"
|
||||
app:cornerRadius="22dp"
|
||||
app:icon="@drawable/ic_image_24"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="8dp"
|
||||
app:iconTint="@color/purple_500"
|
||||
app:strokeColor="@color/purple_500"
|
||||
app:strokeWidth="1dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -232,19 +245,21 @@
|
|||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 标题输入 -->
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="12dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:hint="作品标题"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="1dp"
|
||||
app:boxStrokeWidthFocused="2dp"
|
||||
app:hintTextColor="#999999"
|
||||
app:boxStrokeColor="#E0E0E0">
|
||||
android:hint="✏️ 作品标题(必填)"
|
||||
app:boxBackgroundMode="none"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/titleEditText"
|
||||
|
|
@ -253,24 +268,31 @@
|
|||
android:inputType="textCapSentences"
|
||||
android:maxLines="1"
|
||||
android:maxLength="50"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
android:textColor="#333333"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 描述输入 -->
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
<com.google.android.material.card.MaterialCardView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="24dp"
|
||||
android:hint="作品描述(可选)"
|
||||
app:boxCornerRadiusTopStart="12dp"
|
||||
app:boxCornerRadiusTopEnd="12dp"
|
||||
app:boxCornerRadiusBottomStart="12dp"
|
||||
app:boxCornerRadiusBottomEnd="12dp"
|
||||
app:boxStrokeWidth="1dp"
|
||||
app:boxStrokeWidthFocused="2dp"
|
||||
app:hintTextColor="#999999"
|
||||
app:boxStrokeColor="#E0E0E0">
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeWidth="0dp"
|
||||
app:cardUseCompatPadding="true">
|
||||
|
||||
<com.google.android.material.textfield.TextInputLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:hint="💬 添加描述(可选)"
|
||||
app:boxBackgroundMode="none"
|
||||
app:hintTextColor="#999999">
|
||||
|
||||
<com.google.android.material.textfield.TextInputEditText
|
||||
android:id="@+id/descriptionEditText"
|
||||
|
|
@ -281,23 +303,32 @@
|
|||
android:maxLength="500"
|
||||
android:gravity="top|start"
|
||||
android:minHeight="120dp"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="15sp"
|
||||
android:textColor="#333333"
|
||||
android:padding="16dp"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
<!-- 发布按钮 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/publishButton"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="54dp"
|
||||
android:layout_marginBottom="16dp"
|
||||
android:text="发布"
|
||||
android:textSize="16sp"
|
||||
android:text="发布作品"
|
||||
android:textSize="17sp"
|
||||
android:textStyle="bold"
|
||||
app:cornerRadius="12dp"
|
||||
android:textColor="#FFFFFF"
|
||||
app:cornerRadius="27dp"
|
||||
app:backgroundTint="@color/purple_500"
|
||||
app:icon="@drawable/ic_check_24"
|
||||
app:iconGravity="textStart"
|
||||
app:iconPadding="8dp" />
|
||||
app:iconPadding="8dp"
|
||||
app:iconTint="#FFFFFF"
|
||||
android:elevation="4dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,83 +1,161 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="8dp"
|
||||
android:paddingBottom="12dp">
|
||||
android:paddingTop="16dp"
|
||||
android:paddingBottom="16dp"
|
||||
android:background="@drawable/bottom_sheet_background">
|
||||
|
||||
<!-- 标题 -->
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="选择媒体"
|
||||
android:textColor="#333333"
|
||||
android:textSize="18sp"
|
||||
android:textStyle="bold"
|
||||
android:gravity="center"
|
||||
android:paddingBottom="12dp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#E0E0E0"
|
||||
android:layout_marginBottom="8dp" />
|
||||
|
||||
<!-- 从相册选择图片 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/actionPickImage"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:text="从相册选择图片"
|
||||
android:textColor="#111111"
|
||||
android:textSize="16sp" />
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#11000000" />
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_image_24"
|
||||
android:tint="@color/purple_500" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="从相册选择图片"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 从相册选择视频 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/actionPickVideo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:text="从相册选择视频"
|
||||
android:textColor="#111111"
|
||||
android:textSize="16sp" />
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#11000000" />
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_videocam"
|
||||
android:tint="@color/purple_500" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="从相册选择视频"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 拍照 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/actionTakePhoto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:text="拍照"
|
||||
android:textColor="#111111"
|
||||
android:textSize="16sp" />
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
android:background="#11000000" />
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_camera_24"
|
||||
android:tint="@color/purple_500" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="拍照"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<!-- 录像 -->
|
||||
<LinearLayout
|
||||
android:id="@+id/actionTakeVideo"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_height="60dp"
|
||||
android:orientation="horizontal"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="20dp"
|
||||
android:paddingEnd="20dp"
|
||||
android:paddingStart="24dp"
|
||||
android:paddingEnd="24dp"
|
||||
android:background="?attr/selectableItemBackground">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:src="@drawable/ic_videocam"
|
||||
android:tint="@color/purple_500" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:layout_marginStart="16dp"
|
||||
android:text="录像"
|
||||
android:textColor="#111111"
|
||||
android:textColor="#333333"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="8dp"
|
||||
android:background="@android:color/transparent" />
|
||||
|
||||
<TextView
|
||||
<!-- 取消按钮 -->
|
||||
<com.google.android.material.button.MaterialButton
|
||||
android:id="@+id/actionCancel"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:gravity="center"
|
||||
android:layout_height="48dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:text="取消"
|
||||
android:textColor="#666666"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="16sp"
|
||||
app:cornerRadius="24dp"
|
||||
app:strokeColor="#E0E0E0"
|
||||
app:strokeWidth="1dp"
|
||||
style="@style/Widget.MaterialComponents.Button.OutlinedButton" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,50 +1,42 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="100dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="8dp"
|
||||
app:cardElevation="2dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="120dp"
|
||||
android:layout_margin="4dp"
|
||||
android:background="?attr/selectableItemBackground"
|
||||
android:clickable="true"
|
||||
android:focusable="true">
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/coverImage"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:scaleType="centerCrop"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 选中标记 -->
|
||||
<ImageView
|
||||
android:id="@+id/selectedIndicator"
|
||||
android:layout_width="32dp"
|
||||
android:layout_height="32dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:background="@drawable/bg_circle_red"
|
||||
android:padding="6dp"
|
||||
android:src="@drawable/ic_check_24"
|
||||
android:tint="#FFFFFF"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="centerCrop" />
|
||||
|
||||
<!-- 选中边框 -->
|
||||
<View
|
||||
android:id="@+id/selectedBorder"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="0dp"
|
||||
android:background="#6200EE"
|
||||
android:padding="3dp"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/bg_cover_selected_border"
|
||||
android:visibility="gone" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
<!-- 选中指示器 -->
|
||||
<ImageView
|
||||
android:id="@+id/selectedIndicator"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_gravity="end|bottom"
|
||||
android:layout_margin="4dp"
|
||||
android:src="@drawable/ic_check_circle_24"
|
||||
android:tint="@color/purple_500"
|
||||
android:visibility="gone" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,16 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.google.android.material.card.MaterialCardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="160dp"
|
||||
android:layout_marginEnd="8dp">
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="140dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
app:cardCornerRadius="12dp"
|
||||
app:cardElevation="4dp"
|
||||
app:strokeWidth="0dp">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/mediaImage"
|
||||
|
|
@ -15,19 +22,23 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<!-- 删除按钮 -->
|
||||
<ImageButton
|
||||
android:id="@+id/removeButton"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="4dp"
|
||||
android:layout_marginTop="4dp"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:layout_marginTop="6dp"
|
||||
android:background="@drawable/bg_circle_red"
|
||||
android:contentDescription="删除"
|
||||
android:padding="6dp"
|
||||
android:src="@android:drawable/ic_menu_close_clear_cancel"
|
||||
android:src="@drawable/ic_close_24"
|
||||
android:tint="#FFFFFF"
|
||||
android:elevation="4dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
</com.google.android.material.card.MaterialCardView>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user