Bladeren bron

修改老师端个人主页上传曲谱样式

Pq 3 maanden geleden
bovenliggende
commit
b055f4b4d1

BIN
chatModule/src/main/res/drawable-xhdpi/icon_upload_music_sheet_tag.png


BIN
chatModule/src/main/res/drawable-xxhdpi/icon_upload_music_sheet_tag.png


+ 0 - 1
chatModule/src/main/res/layout/fragment_has_mute_member_layout.xml

@@ -7,7 +7,6 @@
     <View
         android:background="@color/transparent"
         android:id="@+id/view_top_bg"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_filter"
         android:layout_width="match_parent"
         android:layout_height="0dp"/>
 

+ 0 - 1
chatModule/src/main/res/layout/fragment_no_mute_member_layout.xml

@@ -7,7 +7,6 @@
     <View
         android:background="@color/transparent"
         android:id="@+id/view_top_bg"
-        app:layout_constraintBottom_toBottomOf="@+id/tv_filter"
         android:layout_width="match_parent"
         android:layout_height="0dp"/>
     <View

+ 20 - 15
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/SheetMusicPageFragment.java

@@ -60,7 +60,7 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
 
     @Override
     protected void initView(View rootView) {
-        mViewBinding.tvUploadSheetMusic.setOnClickListener(this);
+        mViewBinding.headerView.setViewOnClickListener(this);
         presenter.querySubjectItem();
     }
 
@@ -96,7 +96,7 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
             @Override
             public void onSoftInputChanged(int height) {
                 if (height == 0) {
-                    mViewBinding.searchView.clearEditFocus();
+                    mViewBinding.headerView.clearEditFocus();
                 }
             }
         });
@@ -115,13 +115,6 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
         String teacherCertificationStatus = UserHelper.getTeacherCertificationStatus();
         if (TextUtils.equals(teacherCertificationStatus, TeacherInfoConstants.ENTRY_STATUS_PASS)) {
             mViewBinding.groupContent.setVisibility(View.VISIBLE);
-            mViewBinding.searchView.setOnLeftClickListener(v -> {
-                selectVocalPart();
-            });
-            mViewBinding.searchView.setOnSearchListener(v -> {
-                mViewBinding.searchView.clearEditFocus();
-                musicSearch();
-            });
             currentPage = 1;
             queryList(true);
             if (mCertTipView != null) {
@@ -142,7 +135,7 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
      * 乐谱搜索
      */
     private void musicSearch() {
-        mIdNames = mViewBinding.searchView.getSearchEdit().getText().toString();
+        mIdNames = mViewBinding.headerView.getSearchEdit().getText().toString().trim();
         currentPage = 1;
         queryList(true);
     }
@@ -173,7 +166,7 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
             QuerySubjectBean bean = subjectBeanList.get(options1);
             currentSubjectId = bean.id;
             currentPage = 1;
-            mViewBinding.searchView.getLeftText().setText(bean.name);
+            mViewBinding.headerView.getLeftText().setText(bean.name);
             queryList(true);
         }).setLayoutRes(com.cooleshow.base.R.layout.pickerview_address_layout, v -> {
             //自定义布局中的控件初始化及事件处理
@@ -195,12 +188,12 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
         pvOptions.setOnDismissListener(new OnDismissListener() {
             @Override
             public void onDismiss(Object o) {
-                UiUtils.refreshFilterTextStyle2(false, mViewBinding.searchView.getLeftText());
+                UiUtils.refreshFilterTextStyle2(false, mViewBinding.headerView.getLeftText());
             }
 
             @Override
             public void onShow() {
-                UiUtils.refreshFilterTextStyle2(true, mViewBinding.searchView.getLeftText());
+                UiUtils.refreshFilterTextStyle2(true, mViewBinding.headerView.getLeftText());
             }
         });
         pvOptions.show();
@@ -314,16 +307,28 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
 
     @Override
     public void onClick(View v) {
-        if (v.getId() == R.id.tv_go_cert) {
+        int id = v.getId();
+        if (id == R.id.tv_go_cert) {
             //去认证音乐人
             WebStartHelper.startCertPage();
             return;
         }
-        if (v.getId() == R.id.tv_upload_sheet_music) {
+        if (id == R.id.fl_setting) {
             //上传乐谱
             WebStartHelper.startUploadSheetMusicPage();
             return;
         }
+
+        if(id == R.id.tv_filter){
+            //声部筛选
+            selectVocalPart();
+            return;
+        }
+        if(id == R.id.tv_search){
+            mViewBinding.headerView.clearEditFocus();
+            musicSearch();
+            return;
+        }
     }
 
     @Override

+ 92 - 0
teacher/src/main/java/com/cooleshow/teacher/widgets/HomePageUploadMusicSheetHeaderView.java

@@ -0,0 +1,92 @@
+package com.cooleshow.teacher.widgets;
+
+import android.content.Context;
+import android.util.AttributeSet;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.EditText;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.cooleshow.teacher.R;
+import com.cooleshow.usercenter.helper.UserHelper;
+
+import androidx.annotation.NonNull;
+import androidx.annotation.Nullable;
+import androidx.constraintlayout.widget.ConstraintLayout;
+import androidx.core.widget.NestedScrollView;
+
+/**
+ * Author by pq, Date on 2024/11/15.
+ */
+public class HomePageUploadMusicSheetHeaderView extends NestedScrollView implements View.OnClickListener {
+    private ImageView mIvCloseDes;
+    private TextView mTvNotRemind;
+    private FrameLayout mFlSetting;
+    private TextView mTvFilter;
+    private TextView mTvSearch;
+    private EditText mEtTargetName;
+
+
+    public HomePageUploadMusicSheetHeaderView(@NonNull Context context) {
+        this(context,null);
+    }
+
+    public HomePageUploadMusicSheetHeaderView(@NonNull Context context, @Nullable AttributeSet attrs) {
+        this(context, attrs,-1);
+    }
+
+    public HomePageUploadMusicSheetHeaderView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init();
+    }
+
+    private void init(){
+        LayoutInflater.from(getContext()).inflate(R.layout.item_hp_upload_music_sheet_header_layout,this);
+        initView();
+        initData();
+    }
+
+
+    private void initView() {
+        mIvCloseDes = findViewById(R.id.iv_close_des);
+        mTvNotRemind = findViewById(R.id.tv_not_remind);
+        mFlSetting = findViewById(R.id.fl_setting);
+        mTvFilter = findViewById(R.id.tv_filter);
+        mTvSearch = findViewById(R.id.tv_search);
+        mEtTargetName = findViewById(R.id.et_target_name);
+    }
+
+    private void initData() {
+        mIvCloseDes.setOnClickListener(this);
+        mTvNotRemind.setOnClickListener(this);
+        mFlSetting.setOnClickListener(this);
+    }
+
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+    }
+
+    public void setViewOnClickListener(View.OnClickListener listener){
+        mFlSetting.setOnClickListener(listener);
+        mTvFilter.setOnClickListener(listener);
+        mTvSearch.setOnClickListener(listener);
+    }
+
+    public void clearEditFocus(){
+        if (mEtTargetName != null) {
+            mEtTargetName.clearFocus();
+        }
+    }
+
+    public TextView getSearchEdit() {
+        return mEtTargetName;
+    }
+
+    public TextView getLeftText() {
+        return mTvFilter;
+    }
+}

+ 10 - 36
teacher/src/main/res/layout/fragment_sheet_music_page_layout.xml

@@ -3,53 +3,26 @@
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    android:paddingTop="14dp">
+    xmlns:tools="http://schemas.android.com/tools">
 
-    <View
-        android:id="@+id/view_top_bg"
-        android:layout_width="match_parent"
-        android:layout_height="56dp"
+    <com.cooleshow.teacher.widgets.HomePageUploadMusicSheetHeaderView
+        android:id="@+id/header_view"
+        android:layout_width="0dp"
         android:layout_marginStart="14dp"
+        android:layout_height="wrap_content"
         android:layout_marginEnd="14dp"
-        android:background="@drawable/bg_white_10dp"
-        app:layout_constraintLeft_toLeftOf="parent"
         app:layout_constraintRight_toRightOf="parent"
-        app:layout_constraintTop_toTopOf="parent" />
-
-    <com.cooleshow.teacher.widgets.CourseSearchView
-        android:id="@+id/search_view"
-        android:layout_width="0dp"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="10dp"
-        app:layout_constraintBottom_toBottomOf="@+id/view_top_bg"
-        app:layout_constraintLeft_toLeftOf="@+id/view_top_bg"
-        app:layout_constraintRight_toLeftOf="@+id/tv_upload_sheet_music"
-        app:layout_constraintTop_toTopOf="@+id/view_top_bg"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
         app:left_search_text="声部"
         app:search_edit_hint="曲目" />
 
-    <TextView
-        android:id="@+id/tv_upload_sheet_music"
-        android:layout_width="wrap_content"
-        android:layout_height="wrap_content"
-        android:layout_marginEnd="14dp"
-        android:drawableRight="@drawable/icon_arrow_right_small_green"
-        android:drawablePadding="5dp"
-        android:gravity="center"
-        android:text="上传曲谱"
-        android:textColor="@color/color_2dc7aa"
-        android:textSize="@dimen/sp_16"
-        android:textStyle="bold"
-        app:layout_constraintBottom_toBottomOf="@+id/view_top_bg"
-        app:layout_constraintRight_toRightOf="@+id/view_top_bg"
-        app:layout_constraintTop_toTopOf="@+id/view_top_bg" />
-
     <com.scwang.smart.refresh.layout.SmartRefreshLayout
         android:id="@+id/refreshLayout"
         android:layout_width="match_parent"
         android:layout_height="0dp"
         app:layout_constraintBottom_toBottomOf="parent"
-        app:layout_constraintTop_toBottomOf="@+id/view_top_bg">
+        app:layout_constraintTop_toBottomOf="@+id/header_view">
 
 
         <androidx.recyclerview.widget.RecyclerView
@@ -66,7 +39,8 @@
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
         android:visibility="gone"
-        app:constraint_referenced_ids="view_top_bg,search_view,refreshLayout,tv_upload_sheet_music" />
+        tools:visibility="visible"
+        app:constraint_referenced_ids="refreshLayout,header_view" />
 
     <ViewStub
         android:id="@+id/vs_no_cert"

+ 183 - 0
teacher/src/main/res/layout/item_hp_upload_music_sheet_header_layout.xml

@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="utf-8"?>
+<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical"
+    xmlns:app="http://schemas.android.com/apk/res-auto">
+    <androidx.constraintlayout.widget.ConstraintLayout
+        android:id="@+id/cs_des"
+        android:visibility="gone"
+        android:layout_marginBottom="12dp"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/bg_white_6dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent">
+
+        <ImageView
+            android:id="@+id/iv_tag"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginStart="12dp"
+            android:layout_marginTop="12dp"
+            android:src="@drawable/icon_vip_custom_course_des_tag"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintTop_toTopOf="parent" />
+
+        <TextView
+            android:id="@+id/tv_des_title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:paddingStart="6dp"
+            android:text="什么是VIP定制课?"
+            android:textColor="@color/color_333333"
+            android:textSize="@dimen/sp_15"
+            app:layout_constraintBottom_toBottomOf="@+id/iv_tag"
+            app:layout_constraintLeft_toRightOf="@+id/iv_tag"
+            app:layout_constraintTop_toTopOf="@+id/iv_tag" />
+
+        <ImageView
+            android:id="@+id/iv_close_des"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:padding="13dp"
+            android:src="@drawable/icon_close_gray"
+            app:layout_constraintBottom_toBottomOf="@+id/tv_des_title"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toTopOf="@+id/tv_des_title" />
+
+        <TextView
+            android:id="@+id/tv_des"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:paddingStart="13dp"
+            android:paddingTop="10dp"
+            android:paddingEnd="13dp"
+            android:text="@string/vip_custom_course_des"
+            android:textColor="@color/color_777777"
+            android:textSize="@dimen/sp_13"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/tv_des_title" />
+
+
+        <View
+            android:id="@+id/view_line"
+            android:layout_width="match_parent"
+            android:layout_height="1dp"
+            android:layout_marginStart="13dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginEnd="13dp"
+            android:background="@color/color_f2f2f2"
+            app:layout_constraintTop_toBottomOf="@+id/tv_des" />
+
+        <TextView
+            android:id="@+id/tv_not_remind"
+            android:layout_width="0dp"
+            android:layout_height="38dp"
+            android:gravity="center"
+            android:text="不再提醒"
+            android:textColor="@color/color_2dc7aa"
+            android:textSize="@dimen/sp_13"
+            app:layout_constraintLeft_toLeftOf="parent"
+            app:layout_constraintRight_toRightOf="parent"
+            app:layout_constraintTop_toBottomOf="@+id/view_line" />
+
+    </androidx.constraintlayout.widget.ConstraintLayout>
+
+    <FrameLayout
+        android:id="@+id/fl_setting"
+        android:layout_width="match_parent"
+        android:layout_height="36dp"
+        android:background="@drawable/shape_2dc7aa_51e1d0_6dp"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/cs_des">
+
+        <TextView
+            android:id="@+id/tv_confirm"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_gravity="center"
+            android:drawableStart="@drawable/icon_upload_music_sheet_tag"
+            android:drawablePadding="4dp"
+            android:text="@string/upload_music_sheet_str"
+            android:textColor="@color/white"
+            android:textSize="@dimen/sp_15" />
+    </FrameLayout>
+
+
+    <TextView
+        android:drawableRight="@drawable/icon_arrow_down"
+        android:id="@+id/tv_filter"
+        android:layout_width="wrap_content"
+        android:layout_height="0dp"
+        android:drawablePadding="5dp"
+        android:ellipsize="end"
+        android:gravity="center"
+        android:includeFontPadding="false"
+        android:maxLength="6"
+        android:maxLines="1"
+        android:text="全部声部"
+        android:textColor="@color/color_333333"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <View
+        android:id="@+id/view_search_bg"
+        android:layout_width="0dp"
+        android:layout_height="34dp"
+        android:layout_marginStart="8dp"
+        android:layout_marginTop="12dp"
+        android:background="@drawable/bg_white_18dp"
+        app:layout_constraintLeft_toRightOf="@+id/tv_filter"
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintTop_toBottomOf="@+id/fl_setting" />
+
+    <ImageView
+        android:id="@+id/iv_search_icon"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="12dp"
+        android:src="@drawable/icon_search"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintLeft_toLeftOf="@+id/view_search_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <com.cooleshow.base.widgets.ClearEditText
+        android:id="@+id/et_target_name"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_marginEnd="5dp"
+        android:background="@null"
+        android:ellipsize="end"
+        android:hint="请输入曲目关键词"
+        android:maxLines="1"
+        android:paddingStart="8dp"
+        android:includeFontPadding="false"
+        android:theme="@style/MyEditText"
+        android:textCursorDrawable="@drawable/shape_2dc7aa_1dp"
+        android:textColor="@color/color_999999"
+        android:textSize="@dimen/sp_14"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintLeft_toRightOf="@+id/iv_search_icon"
+        app:layout_constraintRight_toLeftOf="@+id/tv_search"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+
+    <TextView
+        android:id="@+id/tv_search"
+        android:layout_width="56dp"
+        android:layout_height="28dp"
+        android:layout_marginEnd="3dp"
+        android:background="@drawable/shape_1ecdac_18dp"
+        android:gravity="center"
+        android:text="搜索"
+        android:textColor="@color/white"
+        android:textSize="@dimen/sp_14"
+        android:includeFontPadding="false"
+        app:layout_constraintBottom_toBottomOf="@+id/view_search_bg"
+        app:layout_constraintRight_toRightOf="@+id/view_search_bg"
+        app:layout_constraintTop_toTopOf="@+id/view_search_bg" />
+</androidx.constraintlayout.widget.ConstraintLayout>

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

@@ -65,5 +65,6 @@
     <string name="video_course_des_title">什么是视频课?</string>
     <string name="video_course_des">视频课是由老师根据教学内容精心录制的课程,购买后永久有效,您可以随时观看学习。</string>
     <string name="create_video_course_text">创建视频课</string>
+    <string name="upload_music_sheet_str">上传乐谱</string>
 
 </resources>