Browse Source

增加VIP设置页面样式

Pq 3 months ago
parent
commit
de7935f0cc
19 changed files with 309 additions and 44 deletions
  1. 1 0
      BaseLibrary/src/main/java/com/cooleshow/base/router/RouterPath.kt
  2. BIN
      BaseLibrary/src/main/res/drawable-xhdpi/icon_close_dialog_32_32.png
  3. BIN
      BaseLibrary/src/main/res/drawable-xxhdpi/icon_close_dialog_32_32.png
  4. 6 0
      BaseLibrary/src/main/res/drawable/shape_f0fffc_4dp_border_2dc7aa_1dp.xml
  5. 5 0
      BaseLibrary/src/main/res/drawable/shape_f8f9fc_top_12dp.xml
  6. 1 0
      BaseLibrary/src/main/res/values/strings.xml
  7. 5 0
      classRoom/src/main/res/drawable/shape_f8f8f8_4dp.xml
  8. 64 0
      teacher/src/main/java/com/cooleshow/teacher/adapter/VIPCourseSettingSelectAdapter.java
  9. 42 11
      teacher/src/main/java/com/cooleshow/teacher/ui/course/VIPCourseSettingActivity.java
  10. 5 0
      teacher/src/main/res/color/selector_common_filter_item_text_color2.xml
  11. BIN
      teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_price_tag.png
  12. BIN
      teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_subject_tag.png
  13. BIN
      teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_time_tag.png
  14. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_price_tag.png
  15. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_subject_tag.png
  16. BIN
      teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_time_tag.png
  17. 6 0
      teacher/src/main/res/drawable/selector_common_filter_item2.xml
  18. 152 33
      teacher/src/main/res/layout/ac_vip_course_setting_layout.xml
  19. 22 0
      teacher/src/main/res/layout/item_vip_course_setting_select_layout.xml

+ 1 - 0
BaseLibrary/src/main/java/com/cooleshow/base/router/RouterPath.kt

@@ -96,6 +96,7 @@ object RouterPath {
                 "/teacher/ui/course/CreateLiveCourseArrangementActivity"
             const val TEACHER_MINE_VIDEO_COURSE = "/teacher/ui/course/MineVideoCourseActivity"
             const val SPARRING_EVALUATE_TEACHER = "/teacher/ui/course/EvaluateTeacherActivity"
+            const val VIP_COURSE_SETTING = "/teacher/ui/course/VIPCourseSettingActivity"
 
         }
     }

BIN
BaseLibrary/src/main/res/drawable-xhdpi/icon_close_dialog_32_32.png


BIN
BaseLibrary/src/main/res/drawable-xxhdpi/icon_close_dialog_32_32.png


+ 6 - 0
BaseLibrary/src/main/res/drawable/shape_f0fffc_4dp_border_2dc7aa_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="#E9FFF8"/>
+    <corners android:radius="4dp"/>
+    <stroke android:color="@color/color_2dc7aa" android:width="1dp"/>
+</shape>

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_f8f9fc_top_12dp.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_f8f9fc"/>
+    <corners android:topRightRadius="12dp" android:topLeftRadius="10dp"/>
+</shape>

+ 1 - 0
BaseLibrary/src/main/res/values/strings.xml

@@ -29,4 +29,5 @@
     <string name="app_version_tip">"版本号 %s"</string>
     <string name="error_tip">无网络连接,请检查网络后重试</string>
     <string name="cancel_upload_str">取消上传</string>
+    <string name="confirm_str">确认</string>
 </resources>

+ 5 - 0
classRoom/src/main/res/drawable/shape_f8f8f8_4dp.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <solid android:color="@color/color_F8F8F8"/>
+    <corners android:radius="4dp"/>
+</shape>

+ 64 - 0
teacher/src/main/java/com/cooleshow/teacher/adapter/VIPCourseSettingSelectAdapter.java

@@ -0,0 +1,64 @@
+package com.cooleshow.teacher.adapter;
+
+import android.text.TextUtils;
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.viewholder.BaseViewHolder;
+import com.cooleshow.base.iml.ICommonFilterData;
+import com.cooleshow.teacher.R;
+
+import java.util.ArrayList;
+
+import androidx.annotation.NonNull;
+
+/**
+ * Author by pq, Date on 2023/10/17.
+ */
+public class VIPCourseSettingSelectAdapter extends BaseQuickAdapter<ICommonFilterData, BaseViewHolder> {
+    private ArrayList<String> selectIds;
+
+
+    public VIPCourseSettingSelectAdapter() {
+        super(R.layout.item_vip_course_setting_select_layout);
+        selectIds = new ArrayList<>();
+    }
+
+    public void clearSelect() {
+        selectIds.clear();
+        notifyDataSetChanged();
+    }
+
+    public ArrayList<String> getSelectList() {
+        return selectIds;
+    }
+
+    public void setSelectId(String id) {
+        if (isContain(id)) {
+            selectIds.remove(id);
+        } else {
+            //单选 去掉clear即为多选
+            selectIds.clear();
+            selectIds.add(id);
+        }
+        notifyDataSetChanged();
+    }
+
+    @Override
+    protected void convert(@NonNull BaseViewHolder holder, ICommonFilterData rowsBean) {
+        TextView tv_text = holder.getView(R.id.tv_text);
+        tv_text.setSelected(isContain(rowsBean.getFilterId()));
+        tv_text.setText(rowsBean.getText());
+    }
+
+    private boolean isContain(String id) {
+        for (int i = 0; i < selectIds.size(); i++) {
+            String s = selectIds.get(i);
+            if (TextUtils.equals(s, id)) {
+                return true;
+            }
+        }
+        return false;
+    }
+
+}

+ 42 - 11
teacher/src/main/java/com/cooleshow/teacher/ui/course/VIPCourseSettingActivity.java

@@ -2,25 +2,33 @@ package com.cooleshow.teacher.ui.course;
 
 import android.view.View;
 
+import com.alibaba.android.arouter.facade.annotation.Route;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
+import com.cooleshow.base.iml.ICommonFilterData;
+import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.activity.BaseMVPActivity;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.teacher.R;
 import com.cooleshow.teacher.adapter.HomePageVipCourseAdapter;
+import com.cooleshow.teacher.adapter.VIPCourseSettingSelectAdapter;
 import com.cooleshow.teacher.databinding.AcVipCourseSettingLayoutBinding;
 import com.cooleshow.teacher.presenter.course.VIPCourseSettingPresenter;
 
 import androidx.annotation.NonNull;
+import androidx.recyclerview.widget.GridLayoutManager;
 import androidx.recyclerview.widget.LinearLayoutManager;
 import androidx.recyclerview.widget.RecyclerView;
 
 /**
  * Author by pq, Date on 2024/11/15.
  */
+@Route(path = RouterPath.CourseCenter.VIP_COURSE_SETTING)
 public class VIPCourseSettingActivity extends BaseMVPActivity<AcVipCourseSettingLayoutBinding, VIPCourseSettingPresenter> implements View.OnClickListener {
 
-    private HomePageVipCourseAdapter mAdapter;
+
+    private VIPCourseSettingSelectAdapter subjectAdapter;
+    private VIPCourseSettingSelectAdapter timeSelectAdapter;
 
     @Override
     protected void initView() {
@@ -33,23 +41,37 @@ public class VIPCourseSettingActivity extends BaseMVPActivity<AcVipCourseSetting
     @Override
     public void initData() {
         super.initData();
+        GridLayoutManager gridLayoutManager =new GridLayoutManager(this,3);
+        subjectAdapter = new VIPCourseSettingSelectAdapter();
+        viewBinding.recyclerViewSubject.setLayoutManager(gridLayoutManager);
+        viewBinding.recyclerViewSubject.setAdapter(subjectAdapter);
 
-        RecyclerView rvAddress = viewBinding.recyclerView;
-        LinearLayoutManager manager = new LinearLayoutManager(this);
-        rvAddress.setLayoutManager(manager);
-        mAdapter = new HomePageVipCourseAdapter();
-        EmptyViewLayout mEmptyView = new EmptyViewLayout(this);
-        mEmptyView.setContent(com.cooleshow.base.R.drawable.icon_empty_course, "暂无课程");
-        mAdapter.setEmptyView(mEmptyView);
-        rvAddress.setAdapter(mAdapter);
+        GridLayoutManager gridLayoutManager2 =new GridLayoutManager(this,3);
+        timeSelectAdapter = new VIPCourseSettingSelectAdapter();
+        viewBinding.recyclerViewTime.setLayoutManager(gridLayoutManager2);
+        viewBinding.recyclerViewTime.setAdapter(timeSelectAdapter);
 
         initListener();
     }
 
     private void initListener() {
-        mAdapter.setOnItemClickListener(new OnItemClickListener() {
+        subjectAdapter.setOnItemClickListener(new OnItemClickListener() {
+            @Override
+            public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                if (position < subjectAdapter.getData().size()) {
+                    ICommonFilterData filterData = subjectAdapter.getData().get(position);
+                    subjectAdapter.setSelectId(filterData.getFilterId());
+                }
+            }
+        });
+
+        timeSelectAdapter.setOnItemClickListener(new OnItemClickListener() {
             @Override
             public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
+                if (position < timeSelectAdapter.getData().size()) {
+                    ICommonFilterData filterData = timeSelectAdapter.getData().get(position);
+                    timeSelectAdapter.setSelectId(filterData.getFilterId());
+                }
             }
         });
     }
@@ -60,12 +82,21 @@ public class VIPCourseSettingActivity extends BaseMVPActivity<AcVipCourseSetting
     }
 
     @Override
+    protected void onResume() {
+        super.onResume();
+
+    }
+
+    @Override
     protected VIPCourseSettingPresenter createPresenter() {
         return new VIPCourseSettingPresenter();
     }
 
     @Override
     public void onClick(View v) {
-
+        int id = v.getId();
+        if(id == R.id.tv_confirm){
+            return;
+        }
     }
 }

+ 5 - 0
teacher/src/main/res/color/selector_common_filter_item_text_color2.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:color="@color/color_2dc7aa" android:state_selected="true"/>
+    <item android:color="@color/color_999999"/>
+</selector>

BIN
teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_price_tag.png


BIN
teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_subject_tag.png


BIN
teacher/src/main/res/drawable-xhdpi/icon_vip_course_setting_time_tag.png


BIN
teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_price_tag.png


BIN
teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_subject_tag.png


BIN
teacher/src/main/res/drawable-xxhdpi/icon_vip_course_setting_time_tag.png


+ 6 - 0
teacher/src/main/res/drawable/selector_common_filter_item2.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@drawable/shape_f0fffc_4dp_border_2dc7aa_1dp" android:state_selected="true"/>
+    <item android:drawable="@drawable/shape_f8f8f8_4dp"/>
+
+</selector>

+ 152 - 33
teacher/src/main/res/layout/ac_vip_course_setting_layout.xml

@@ -2,54 +2,173 @@
 <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:app="http://schemas.android.com/apk/res-auto">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    xmlns:tools="http://schemas.android.com/tools">
     <include
         android:id="@+id/toolbar_include"
         layout="@layout/common_toolbar_layout" />
 
-    <FrameLayout
+    <LinearLayout
+        android:layout_marginTop="12dp"
         android:layout_marginEnd="14dp"
         android:layout_marginStart="14dp"
-        android:id="@+id/fl_setting"
+        android:paddingBottom="12dp"
+        android:paddingStart="12dp"
+        android:paddingEnd="12dp"
+        android:paddingTop="12dp"
+        app:layout_constraintTop_toBottomOf="@+id/toolbar_include"
+        android:id="@+id/ll_subject"
+        android:orientation="vertical"
+        android:background="@drawable/shape_white_10dp"
         android:layout_width="match_parent"
-        android:layout_height="36dp"
-        android:layout_marginTop="12dp"
-        android:background="@drawable/shape_ffffff_6dp_border_e3efed_1dp"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/toolbar_include">
-
+        android:layout_height="wrap_content">
         <TextView
-            android:layout_width="wrap_content"
-            android:layout_height="wrap_content"
-            android:layout_gravity="center"
-            android:drawableStart="@drawable/icon_create_vip_course_options"
             android:drawablePadding="4dp"
-            android:text="添加课程方案"
+            android:drawableStart="@drawable/icon_vip_course_setting_subject_tag"
+            android:textSize="@dimen/sp_16"
             android:textColor="@color/color_333333"
-            android:textSize="@dimen/sp_15" />
-    </FrameLayout>
+            android:text="课程声部"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
 
-    <com.scwang.smart.refresh.layout.SmartRefreshLayout
-        android:id="@+id/refreshLayout"
-        app:layout_constraintLeft_toLeftOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/fl_setting"
-        android:layout_width="match_parent"
-        android:layout_height="0dp"
-        app:layout_constraintBottom_toBottomOf="parent"
-        app:srlEnableLoadMore="false">
+        <androidx.recyclerview.widget.RecyclerView
+            android:scrollbars="none"
+            android:layout_marginTop="12dp"
+            android:id="@+id/recyclerView_subject"
+            android:overScrollMode="never"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
 
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:layout_marginTop="12dp"
+        android:layout_marginEnd="14dp"
+        android:layout_marginStart="14dp"
+        android:paddingBottom="12dp"
+        android:paddingStart="12dp"
+        android:paddingEnd="12dp"
+        android:paddingTop="12dp"
+        app:layout_constraintTop_toBottomOf="@+id/ll_subject"
+        android:id="@+id/ll_time"
+        android:orientation="vertical"
+        android:background="@drawable/shape_white_10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <TextView
+            android:drawablePadding="4dp"
+            android:drawableStart="@drawable/icon_vip_course_setting_time_tag"
+            android:textSize="@dimen/sp_16"
+            android:textColor="@color/color_333333"
+            android:text="课程时长"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
 
         <androidx.recyclerview.widget.RecyclerView
-            app:layout_constraintBottom_toBottomOf="parent"
-            android:id="@+id/recyclerView"
-            app:layout_constraintTop_toBottomOf="@+id/fl_setting"
-            app:layout_constraintLeft_toLeftOf="parent"
-            android:layout_width="match_parent"
-            android:layout_height="match_parent"
+            android:scrollbars="none"
             android:layout_marginTop="12dp"
+            android:id="@+id/recyclerView_time"
             android:overScrollMode="never"
-            android:scrollbars="none" />
-    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"/>
+
+    </LinearLayout>
+
+
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:layout_marginTop="12dp"
+        android:layout_marginEnd="14dp"
+        android:layout_marginStart="14dp"
+        android:paddingBottom="12dp"
+        android:paddingStart="12dp"
+        android:paddingEnd="12dp"
+        android:paddingTop="12dp"
+        app:layout_constraintTop_toBottomOf="@+id/ll_time"
+        android:id="@+id/ll_price"
+        android:orientation="vertical"
+        android:background="@drawable/shape_white_10dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <TextView
+            android:id="@+id/tv_price_title"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent"
+            android:drawablePadding="4dp"
+            android:drawableStart="@drawable/icon_vip_course_setting_price_tag"
+            android:textSize="@dimen/sp_16"
+            android:textColor="@color/color_333333"
+            android:text="课时单价"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+        
+        <androidx.appcompat.widget.AppCompatEditText
+            android:layout_width="wrap_content"
+            android:minWidth="75dp"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_price_title"
+            android:hint="200~500"
+            android:paddingStart="5dp"
+            android:maxLines="1"
+            android:maxLength="5"
+            android:inputType="number"
+            android:id="@+id/edit_price"
+            android:textColorHint="@color/color_66000000"
+            android:textSize="@dimen/sp_14"
+            android:layout_marginTop="9dp"
+            android:background="@drawable/shape_f8f8f8_4dp"
+            android:layout_height="26dp"/>
+
+
+        <TextView
+            app:layout_constraintLeft_toRightOf="@+id/edit_price"
+            app:layout_constraintBottom_toBottomOf="@+id/edit_price"
+            app:layout_constraintTop_toTopOf="@+id/edit_price"
+            android:id="@+id/tv_price_unit"
+            android:layout_marginStart="8dp"
+            android:textSize="@dimen/sp_16"
+            android:textColor="@color/color_333333"
+            android:text="元"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"/>
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+    <TextView
+        android:id="@+id/tv_tip1"
+        app:layout_constraintRight_toRightOf="@+id/ll_price"
+        app:layout_constraintLeft_toLeftOf="@+id/ll_price"
+        app:layout_constraintTop_toBottomOf="@+id/ll_price"
+        tools:text="扣除应缴税金和平台服务费后\n您的课程预计收入为:单课时 224.00 元/节"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        android:layout_width="0dp"
+        android:paddingTop="12dp"
+        android:layout_height="wrap_content"/>
 
+    <TextView
+        android:id="@+id/tv_tip2"
+        app:layout_constraintRight_toRightOf="@+id/tv_tip1"
+        app:layout_constraintLeft_toLeftOf="@+id/tv_tip1"
+        app:layout_constraintTop_toBottomOf="@+id/tv_tip1"
+        tools:text="元/节 实际课程收入按学生实际付款金额计算\n您的课程收入将在课程结束"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"/>
+    
+    <TextView
+        android:id="@+id/tv_confirm"
+        android:layout_marginEnd="28dp"
+        android:layout_marginStart="28dp"
+        android:layout_marginTop="12dp"
+        android:gravity="center"
+        android:background="@drawable/shape_2dc7aa_39dp"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/tv_tip2"
+        android:textSize="@dimen/sp_18"
+        android:textColor="@color/white"
+        android:text="@string/confirm_str"
+        android:layout_width="0dp"
+        android:layout_height="44dp"/>
 </androidx.constraintlayout.widget.ConstraintLayout>

+ 22 - 0
teacher/src/main/res/layout/item_vip_course_setting_select_layout.xml

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:layout_marginStart="4dp"
+    android:layout_marginEnd="4dp"
+    android:layout_marginBottom="12dp"
+    xmlns:tools="http://schemas.android.com/tools">
+    <TextView
+        android:id="@+id/tv_text"
+        tools:text="长笛"
+        android:paddingEnd="8dp"
+        android:paddingStart="8dp"
+        android:gravity="center"
+        android:minWidth="70dp"
+        android:background="@drawable/selector_common_filter_item2"
+        android:textSize="@dimen/sp_14"
+        android:textColor="@color/selector_common_filter_item_text_color2"
+        android:layout_width="wrap_content"
+        android:layout_height="32dp"/>
+</FrameLayout>