Browse Source

修改作品草稿样式

Pq 1 year ago
parent
commit
3997ef80f4

+ 4 - 0
BaseLibrary/src/main/java/com/cooleshow/base/utils/TimeUtils.java

@@ -45,6 +45,10 @@ public final class TimeUtils {
         return getSafeDateFormat("yyyy-MM-dd");
     }
 
+    public static SimpleDateFormat getSafeDateFormatForMinutes() {
+        return getSafeDateFormat("yyyy-MM-dd HH:mm");
+    }
+
     /**
      * Checks whether the device is using Network Provided Time or not.
      * Useful in situations where you want to verify that the device has a correct time set, to avoid fraud, or if you want to prevent the user from messing with the time and abusing your "one-time" and "expiring" features.

+ 12 - 2
musicMerge/src/main/java/com/cooleshow/musicmerge/adapter/MyDraftWorkListAdapter.java

@@ -74,14 +74,24 @@ public class MyDraftWorkListAdapter extends BaseQuickAdapter<MyWorkListBean.Rows
 
         if (!TextUtils.isEmpty(bean.getCreateTime())) {
             Date date = TimeUtils.string2Date(bean.getCreateTime());
-            String dateStr = TimeUtils.date2String(date, TimeUtils.getSafeDateFormatForDay());
-            holder.setText(R.id.tv_date, dateStr);
+            String dateStr = TimeUtils.date2String(date, TimeUtils.getSafeDateFormatForMinutes());
+            holder.setText(R.id.tv_date, dateStr + " 创作");
         } else {
             holder.setText(R.id.tv_date, "");
         }
 
+        if (!TextUtils.isEmpty(bean.getExpireTime())) {
+            Date expireDate = TimeUtils.string2Date(bean.getExpireTime());
+            String expireDateStr = TimeUtils.date2String(expireDate, TimeUtils.getSafeDateFormatForMinutes());
+            holder.setText(R.id.tv_expire_date, expireDateStr);
+        } else {
+            holder.setText(R.id.tv_expire_date, "");
+        }
+
         View selectView = holder.getView(R.id.view_select);
+        View tv_go_publish = holder.getView(R.id.tv_go_publish);
         selectView.setVisibility(isEditMode ? View.VISIBLE : View.GONE);
+        tv_go_publish.setVisibility(isEditMode ? View.GONE : View.VISIBLE);
         int posResult = isContain(bean.getId());
         selectView.setSelected(posResult != -1);
 

+ 9 - 0
musicMerge/src/main/java/com/cooleshow/musicmerge/bean/MyWorkListBean.java

@@ -134,6 +134,15 @@ public class MyWorkListBean {
         private int likeNum;
         private String submitTime;
         private String createTime;
+        private String expireTime;
+
+        public String getExpireTime() {
+            return expireTime;
+        }
+
+        public void setExpireTime(String expireTime) {
+            this.expireTime = expireTime;
+        }
 
         public String getId() {
             return id;

+ 1 - 1
musicMerge/src/main/java/com/cooleshow/musicmerge/ui/MusicHandleActivity.java

@@ -1180,7 +1180,7 @@ public class MusicHandleActivity extends BaseMVPActivity<AcMusicHandleLayoutBind
         commonConfirmDialog.setWidth(SizeUtils.dp2px(387));
         commonConfirmDialog.show();
         commonConfirmDialog.setTitle("提示");
-        commonConfirmDialog.setContent("已成功保存到草稿,草稿7天未发布\n将自动清理。");
+        commonConfirmDialog.setContent("已成功保存到草稿,草稿7天未发布\n将自动删除。");
         commonConfirmDialog.setCancelText("确认");
         commonConfirmDialog.setConfirmText("查看草稿");
         commonConfirmDialog.setOnCancelClickListener(new View.OnClickListener() {

+ 6 - 0
musicMerge/src/main/res/drawable/shape_ffa673_9dp_border_ffbf9a_1dp.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="#12FFA673"/>
+    <stroke android:width="0.5dp" android:color="#FFBF9A"/>
+    <corners android:radius="9dp"/>
+</shape>

+ 59 - 2
musicMerge/src/main/res/layout/item_my_draft_work_layout.xml

@@ -10,7 +10,7 @@
     android:paddingStart="12dp"
     android:id="@+id/cs_root"
     android:paddingEnd="12dp"
-    android:paddingBottom="16dp"
+    android:paddingBottom="9dp"
     android:background="@drawable/shape_16dp_white"
     android:layout_height="wrap_content">
 
@@ -26,7 +26,7 @@
     <View
         android:id="@+id/view_select"
         app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/view_line"
         app:layout_constraintTop_toTopOf="parent"
         android:background="@drawable/selector_check_bt_20dp_v2"
         android:layout_width="18dp"
@@ -77,7 +77,64 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
+    <View
+        android:background="@color/color_f2f2f2"
+        android:id="@+id/view_line"
+        android:layout_marginTop="9dp"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/iv_icon"
+        android:layout_width="match_parent"
+        android:layout_height="1px"/>
+
+    <TextView
+        android:paddingEnd="6dp"
+        android:paddingStart="6dp"
+        android:id="@+id/tv_expire_time_title"
+        android:textSize="@dimen/sp_12"
+        android:textColor="@color/color_ff7b31"
+        android:text="过期时间"
+        android:includeFontPadding="false"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line"
+        android:layout_marginTop="11dp"
+        android:gravity="center"
+        android:background="@drawable/shape_ffa673_9dp_border_ffbf9a_1dp"
+        android:layout_width="wrap_content"
+        android:layout_height="18dp"/>
+
+    <TextView
+        android:layout_marginStart="6dp"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_expire_time_title"
+        app:layout_constraintTop_toTopOf="@+id/tv_expire_time_title"
+        app:layout_constraintLeft_toRightOf="@+id/tv_expire_time_title"
+        android:includeFontPadding="false"
+        tools:text="2023-04-27 23:59 "
+        android:textColor="@color/color_777777"
+        android:textSize="@dimen/sp_13"
+        android:id="@+id/tv_expire_date"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"/>
+
+
+    <TextView
+        android:id="@+id/tv_go_publish"
+        android:background="@drawable/shape_login_bt_bg"
+        android:textSize="@dimen/sp_13"
+        android:textColor="@color/white"
+        android:layout_marginTop="7dp"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/view_line"
+        android:text="去发布"
+        android:includeFontPadding="false"
+        android:gravity="center"
+        android:layout_width="62dp"
+        android:layout_height="25dp"/>
+
+
+
     <ImageView
+        android:visibility="gone"
         android:id="@+id/iv_play_tag"
         app:layout_constraintRight_toRightOf="parent"
         app:layout_constraintBottom_toBottomOf="parent"