ソースを参照

修改老师端我的课程页面部分样式效果

Pq 1 年間 前
コミット
77c510777a

+ 18 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/LiveCourseFragment.java

@@ -11,6 +11,7 @@ import android.widget.TextView;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.bigkoo.pickerview.builder.TimePickerBuilder;
 import com.bigkoo.pickerview.listener.CustomListener;
+import com.bigkoo.pickerview.listener.OnDismissListener;
 import com.bigkoo.pickerview.view.TimePickerView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemChildClickListener;
@@ -23,6 +24,7 @@ import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.PopupUtil;
 import com.cooleshow.base.utils.TimeUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
 import com.cooleshow.base.widgets.poplist.PopupListWindow;
@@ -275,12 +277,20 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayout
                     .isDialog(false)//是否显示为对话框样式
                     .setLabel("年", "月", "", "", "", "")
                     .build();
+
+            pvTime.setOnDismissListener(new OnDismissListener() {
+                @Override
+                public void onDismiss(Object o) {
+                    UiUtils.refreshFilterTextStyle2(false,mViewBinding.tvTime);
+                }
+            });
         }
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(currentSelectDate);
         pvTime.setDate(calendar);
         if (!pvTime.isShowing()) {
             pvTime.show();
+            UiUtils.refreshFilterTextStyle2(true,mViewBinding.tvTime);
         }
     }
 
@@ -328,9 +338,16 @@ public class LiveCourseFragment extends BaseMVPFragment<FragmentLiveCourseLayout
         }
     }
 
-    private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
+    private void initCoursePop(TextView targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
         PopupListWindow popWindow = new PopupListWindow(getContext());
         popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
+        UiUtils.refreshFilterTextStyle2(true, targetView);
+        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle2(false, targetView);
+            }
+        });
     }
 
     public void querySubjectItemSuccess(List<QuerySubjectBean> data) {

+ 37 - 20
teacher/src/main/java/com/cooleshow/teacher/ui/course/PianoRoomCourseFragment.java

@@ -11,6 +11,7 @@ import android.widget.TextView;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.bigkoo.pickerview.builder.TimePickerBuilder;
 import com.bigkoo.pickerview.listener.CustomListener;
+import com.bigkoo.pickerview.listener.OnDismissListener;
 import com.bigkoo.pickerview.view.TimePickerView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemChildClickListener;
@@ -22,6 +23,7 @@ import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.PopupUtil;
 import com.cooleshow.base.utils.TimeUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
 import com.cooleshow.base.widgets.poplist.PopupListWindow;
@@ -250,39 +252,47 @@ public class PianoRoomCourseFragment extends BaseMVPFragment<FragmentPianoRoomCo
             pvTime = new TimePickerBuilder(requireContext(), (date, v) -> {//选中事件回调
                 reBuildFilter(date, currentCourseFilterStatus);
             }).setLayoutRes(com.cooleshow.base.R.layout.pickerview_default_layout, new CustomListener() {
-                @Override
-                public void customLayout(View v) {
-                    //自定义布局中的控件初始化及事件处理
-                    final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
-                    TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
-                    tvSubmit.setOnClickListener(new View.OnClickListener() {
-                        @Override
-                        public void onClick(View v) {
-                            pvTime.returnData();
-                            pvTime.dismiss();
-                        }
-                    });
-                    ivCancel.setOnClickListener(new View.OnClickListener() {
                         @Override
-                        public void onClick(View v) {
-                            pvTime.dismiss();
-                        }
-                    });
+                        public void customLayout(View v) {
+                            //自定义布局中的控件初始化及事件处理
+                            final TextView tvSubmit = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_finish);
+                            TextView ivCancel = (TextView) v.findViewById(com.cooleshow.base.R.id.tv_cancel);
+                            tvSubmit.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvTime.returnData();
+                                    pvTime.dismiss();
+                                }
+                            });
+                            ivCancel.setOnClickListener(new View.OnClickListener() {
+                                @Override
+                                public void onClick(View v) {
+                                    pvTime.dismiss();
+                                }
+                            });
 
-                }
-            })
+                        }
+                    })
                     .setLineSpacingMultiplier(2.5f)
                     .setType(new boolean[]{true, true, false, false, false, false})// 默认全部显示
                     .setTextColorCenter(getResources().getColor(com.cooleshow.base.R.color.color_1a1a1a))//设置选中项的颜色
                     .isDialog(false)//是否显示为对话框样式
                     .setLabel("年", "月", "", "", "", "")
                     .build();
+
+            pvTime.setOnDismissListener(new OnDismissListener() {
+                @Override
+                public void onDismiss(Object o) {
+                    UiUtils.refreshFilterTextStyle2(false, mViewBinding.tvTime);
+                }
+            });
         }
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(currentSelectDate);
         pvTime.setDate(calendar);
         if (!pvTime.isShowing()) {
             pvTime.show();
+            UiUtils.refreshFilterTextStyle2(true, mViewBinding.tvTime);
         }
     }
 
@@ -330,9 +340,16 @@ public class PianoRoomCourseFragment extends BaseMVPFragment<FragmentPianoRoomCo
         }
     }
 
-    private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
+    private void initCoursePop(TextView targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
         PopupListWindow popWindow = new PopupListWindow(getContext());
         popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
+        UiUtils.refreshFilterTextStyle2(true, targetView);
+        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle2(false, targetView);
+            }
+        });
     }
 
     public void querySubjectItemSuccess(List<QuerySubjectBean> data) {

+ 17 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/SparringCourseFragment.java

@@ -11,6 +11,7 @@ import android.widget.TextView;
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.bigkoo.pickerview.builder.TimePickerBuilder;
 import com.bigkoo.pickerview.listener.CustomListener;
+import com.bigkoo.pickerview.listener.OnDismissListener;
 import com.bigkoo.pickerview.view.TimePickerView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemChildClickListener;
@@ -22,6 +23,7 @@ import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.PopupUtil;
 import com.cooleshow.base.utils.TimeUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
 import com.cooleshow.base.widgets.poplist.PopupListWindow;
@@ -259,12 +261,19 @@ public class SparringCourseFragment extends BaseMVPFragment<FragmentSparringCour
                     .isDialog(false)//是否显示为对话框样式
                     .setLabel("年", "月", "", "", "", "")
                     .build();
+            pvTime.setOnDismissListener(new OnDismissListener() {
+                @Override
+                public void onDismiss(Object o) {
+                    UiUtils.refreshFilterTextStyle2(false, mViewBinding.tvTime);
+                }
+            });
         }
         Calendar calendar = Calendar.getInstance();
         calendar.setTime(currentSelectDate);
         pvTime.setDate(calendar);
         if (!pvTime.isShowing()) {
             pvTime.show();
+            UiUtils.refreshFilterTextStyle2(true, mViewBinding.tvTime);
         }
     }
 
@@ -311,9 +320,16 @@ public class SparringCourseFragment extends BaseMVPFragment<FragmentSparringCour
         }
     }
 
-    private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
+    private void initCoursePop(TextView targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
         PopupListWindow popWindow = new PopupListWindow(getContext());
         popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
+        UiUtils.refreshFilterTextStyle2(true, targetView);
+        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle2(false, targetView);
+            }
+        });
     }
 
     public void querySubjectItemSuccess(List<QuerySubjectBean> data) {

+ 9 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/course/VideoCourseFragment.java

@@ -18,6 +18,7 @@ import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.LogUtils;
 import com.cooleshow.base.utils.PopupUtil;
 import com.cooleshow.base.utils.SizeUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
 import com.cooleshow.base.widgets.poplist.PopupListWindow;
@@ -265,9 +266,16 @@ public class VideoCourseFragment extends BaseMVPFragment<FragmentVideoCourseLayo
         }
     }
 
-    private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
+    private void initCoursePop(TextView targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
         PopupListWindow popWindow = new PopupListWindow(getContext());
         popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
+        UiUtils.refreshFilterTextStyle2(true, targetView);
+        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle2(false, targetView);
+            }
+        });
     }
 
     public void querySubjectItemSuccess(List<QuerySubjectBean> data) {

+ 9 - 1
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/SheetMusicPageFragment.java

@@ -6,6 +6,7 @@ import android.widget.TextView;
 
 import com.alibaba.android.arouter.launcher.ARouter;
 import com.bigkoo.pickerview.builder.OptionsPickerBuilder;
+import com.bigkoo.pickerview.listener.OnDismissListener;
 import com.bigkoo.pickerview.view.OptionsPickerView;
 import com.chad.library.adapter.base.BaseQuickAdapter;
 import com.chad.library.adapter.base.listener.OnItemClickListener;
@@ -15,6 +16,7 @@ import com.cooleshow.base.constanst.Constants;
 import com.cooleshow.base.router.RouterPath;
 import com.cooleshow.base.ui.fragment.BaseMVPFragment;
 import com.cooleshow.base.utils.KeyboardUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.helper.WebStartHelper;
 import com.cooleshow.base.widgets.EmptyViewLayout;
 import com.cooleshow.base.widgets.poplist.PopMenuBean;
@@ -187,8 +189,14 @@ public class SheetMusicPageFragment extends BaseMVPFragment<FragmentSheetMusicPa
         if (currentSelectSubjectPosition < subjectBeanList.size()) {
             pvOptions.setSelectOptions(currentSelectSubjectPosition);
         }
+        pvOptions.setOnDismissListener(new OnDismissListener() {
+            @Override
+            public void onDismiss(Object o) {
+                UiUtils.refreshFilterTextStyle2(false, mViewBinding.searchView.getLeftText());
+            }
+        });
         pvOptions.show();
-
+        UiUtils.refreshFilterTextStyle2(true, mViewBinding.searchView.getLeftText());
     }
 
     private void queryList(boolean isShowLoading) {

+ 12 - 0
teacher/src/main/java/com/cooleshow/teacher/ui/score/MineScoreActivity.java

@@ -6,6 +6,8 @@ import android.graphics.Bitmap;
 import android.os.Bundle;
 import android.text.TextUtils;
 import android.view.View;
+import android.widget.PopupWindow;
+import android.widget.TextView;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
@@ -21,6 +23,7 @@ import com.cooleshow.base.utils.KeyboardUtils;
 import com.cooleshow.base.utils.SoftKeyboardUtils;
 import com.cooleshow.base.utils.ToastUtil;
 import com.cooleshow.base.utils.ToastUtils;
+import com.cooleshow.base.utils.UiUtils;
 import com.cooleshow.base.utils.Utils;
 import com.cooleshow.base.utils.helper.QMUIStatusBarHelper;
 import com.cooleshow.base.utils.helper.WebStartHelper;
@@ -193,6 +196,15 @@ public class MineScoreActivity extends BaseMVPActivity<ActivityMineScoreBinding,
     private void initCoursePop(View targetView, List<PopMenuBean> popList, PopupListWindow.PopupListListener listener) {
         PopupListWindow popWindow = new PopupListWindow(this);
         popWindow.showListPop(targetView, popList, position -> listener.onPopupListClick(position));
+
+        TextView textView = viewBinding.searchView.getLeftText();
+        UiUtils.refreshFilterTextStyle2(true, textView);
+        popWindow.getPopupWindow().setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                UiUtils.refreshFilterTextStyle2(false, textView);
+            }
+        });
     }
 
     @Override

+ 15 - 13
teacher/src/main/java/com/cooleshow/teacher/widgets/CourseSearchView.java

@@ -13,6 +13,7 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 
 import com.cooleshow.base.utils.SoftKeyboardUtils;
+import com.cooleshow.base.utils.helper.QMUIDeviceHelper;
 import com.cooleshow.teacher.R;
 
 /**
@@ -29,7 +30,6 @@ public class CourseSearchView extends FrameLayout {
     private String mSearchHintText;
     private String mSearchBtnText;
     private View mViewSubjectBg;
-    private ImageView mIvArrowDown;
 
     public CourseSearchView(@NonNull Context context) {
         this(context, null);
@@ -56,27 +56,29 @@ public class CourseSearchView extends FrameLayout {
         mSearchEdit = view.findViewById(R.id.search_edit);
         mSearchBtn = view.findViewById(R.id.search_btn);
         mViewSubjectBg = view.findViewById(R.id.view_subject);
-        mIvArrowDown = view.findViewById(R.id.iv_arrow_down);
 
         setLeftText(mLeftSearchText);
         setSearchHint(mSearchHintText);
         setBtnText(mSearchBtnText);
-        mSearchEdit.setOnFocusChangeListener(new OnFocusChangeListener() {
-            @Override
-            public void onFocusChange(View v, boolean hasFocus) {
-                if(hasFocus){
-                    switchSubjectUI(false);
-                }else{
-                    switchSubjectUI(true);
+        boolean isTablet = QMUIDeviceHelper.isTablet(getContext());
+        mSearchBtn.setText(isTablet ? "搜索" : "搜");
+        if (!isTablet) {
+            mSearchEdit.setOnFocusChangeListener(new OnFocusChangeListener() {
+                @Override
+                public void onFocusChange(View v, boolean hasFocus) {
+                    if (hasFocus) {
+                        switchSubjectUI(false);
+                    } else {
+                        switchSubjectUI(true);
+                    }
                 }
-            }
-        });
+            });
+        }
     }
 
     private void switchSubjectUI(boolean isShow) {
         mTvAgency.setVisibility(isShow ? View.VISIBLE : View.GONE);
         mViewSubjectBg.setVisibility(isShow ? View.VISIBLE : View.GONE);
-        mIvArrowDown.setVisibility(isShow ? View.VISIBLE : View.GONE);
     }
 
     public void setLeftText(String text) {
@@ -107,7 +109,7 @@ public class CourseSearchView extends FrameLayout {
         mSearchBtn.setOnClickListener(listener);
     }
 
-    public void clearEditFocus(){
+    public void clearEditFocus() {
         if (mSearchEdit != null) {
             mSearchEdit.clearFocus();
         }

+ 1 - 0
teacher/src/main/res/layout/activity_mine_course_layout.xml

@@ -81,6 +81,7 @@
     </RadioGroup>
 
     <View
+        android:visibility="gone"
         android:id="@+id/top_line"
         android:layout_width="match_parent"
         android:layout_height="1px"

+ 17 - 14
teacher/src/main/res/layout/course_search_view.xml

@@ -14,18 +14,18 @@
         android:gravity="center"
         android:background="@drawable/shape_f8f8f8_14dp_border_1dp"
         android:id="@+id/view_subject"
-        android:layout_width="82dp"
+        android:layout_width="@dimen/qb_px_82"
         android:layout_height="28dp"/>
 
     <TextView
-        app:layout_constraintRight_toLeftOf="@+id/iv_arrow_down"
+        app:layout_constraintRight_toRightOf="@+id/view_subject"
         app:layout_constraintBottom_toBottomOf="@+id/view_subject"
         app:layout_constraintTop_toTopOf="@+id/view_subject"
         app:layout_constraintLeft_toLeftOf="@+id/view_subject"
         android:id="@+id/tv_agency"
         android:layout_width="0dp"
         android:layout_height="wrap_content"
-        android:layout_marginLeft="@dimen/dp_14"
+        android:layout_marginEnd="10dp"
         android:ellipsize="end"
         android:gravity="center"
         android:includeFontPadding="false"
@@ -34,19 +34,20 @@
         android:layout_marginStart="10dp"
         tools:text="声部声部声部声部"
         android:textColor="@color/color_999999"
+        android:drawableRight="@drawable/icon_arrow_down"
         android:textSize="@dimen/sp_14"
         />
 
-    <ImageView
-        android:layout_marginEnd="10dp"
-        app:layout_constraintBottom_toBottomOf="@+id/view_subject"
-        app:layout_constraintTop_toTopOf="@+id/view_subject"
-        app:layout_constraintRight_toRightOf="@+id/view_subject"
-        android:id="@+id/iv_arrow_down"
-        android:layout_width="8dp"
-        android:layout_height="wrap_content"
-        android:src="@drawable/icon_arrow_down"
-        app:tint="@color/color_2dc7aa" />
+<!--    <ImageView-->
+<!--        android:layout_marginEnd="10dp"-->
+<!--        app:layout_constraintBottom_toBottomOf="@+id/view_subject"-->
+<!--        app:layout_constraintTop_toTopOf="@+id/view_subject"-->
+<!--        app:layout_constraintRight_toRightOf="@+id/view_subject"-->
+<!--        android:id="@+id/iv_arrow_down"-->
+<!--        android:layout_width="8dp"-->
+<!--        android:layout_height="wrap_content"-->
+<!--        android:src="@drawable/icon_arrow_down"-->
+<!--        app:tint="@color/color_2dc7aa" />-->
 
     <View
         android:id="@+id/search_view"
@@ -85,11 +86,13 @@
 
     <TextView
         android:id="@+id/search_btn"
-        android:layout_width="@dimen/dp_37"
+        android:layout_width="wrap_content"
         android:layout_height="@dimen/dp_26"
         android:layout_marginRight="@dimen/dp_4"
         android:background="@drawable/bg_white_13dp"
         android:gravity="center"
+        android:paddingStart="12dp"
+        android:paddingEnd="12dp"
         android:text="搜"
         android:textColor="@color/color_2dc7aa"
         android:textSize="@dimen/sp_14"

+ 10 - 0
teacher/src/main/res/layout/fragment_live_course_layout.xml

@@ -5,6 +5,16 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
+    <View
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:background="@color/white"
+        android:layout_width="0dp"
+        android:layout_height="0dp"/>
+
+
     <TextView
         android:id="@+id/tv_time"
         android:layout_width="wrap_content"

+ 8 - 0
teacher/src/main/res/layout/fragment_piano_room_course_layout.xml

@@ -5,6 +5,14 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
+    <View
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:background="@color/white"
+        android:layout_width="0dp"
+        android:layout_height="0dp"/>
     <TextView
         android:id="@+id/tv_time"
         android:layout_width="wrap_content"

+ 10 - 0
teacher/src/main/res/layout/fragment_sparring_course_layout.xml

@@ -5,6 +5,16 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent">
 
+    <View
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_time"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:background="@color/white"
+        android:layout_width="0dp"
+        android:layout_height="0dp"/>
+
+
     <TextView
         android:id="@+id/tv_time"
         android:layout_width="wrap_content"

+ 10 - 0
teacher/src/main/res/layout/fragment_video_course_layout.xml

@@ -7,6 +7,16 @@
     android:layout_height="match_parent"
     tools:ignore="MissingDefaultResource">
 
+    <View
+        app:layout_constraintRight_toRightOf="parent"
+        app:layout_constraintBottom_toBottomOf="@+id/tv_subject"
+        app:layout_constraintLeft_toLeftOf="parent"
+        app:layout_constraintTop_toTopOf="parent"
+        android:background="@color/white"
+        android:layout_width="0dp"
+        android:layout_height="0dp"/>
+
+
     <TextView
         android:id="@+id/tv_subject"
         android:layout_width="wrap_content"