瀏覽代碼

修改学生端首页进入教室样式

Pq 8 月之前
父節點
當前提交
9b7ba07248

+ 5 - 0
BaseLibrary/src/main/res/drawable/shape_2dc7aa_13dp.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_2dc7aa" />
+    <corners android:radius="13dp" />
+</shape>

+ 2 - 1
BaseLibrary/src/main/res/drawable/shape_bottom_18dp_white.xml

@@ -1,5 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <shape xmlns:android="http://schemas.android.com/apk/res/android">
     <solid android:color="@color/white" />
-    <corners android:radius="10dp" />
+    <corners android:bottomLeftRadius="18dp"
+        android:bottomRightRadius="18dp"/>
 </shape>

+ 1 - 0
student/src/main/java/com/cooleshow/student/constants/CourseConstants.java

@@ -18,6 +18,7 @@ public class CourseConstants {
     public static final int COURSE_HOMEWORK_STU_SUBMIT = 1;//学员已提交课后作业
     public static final int COURSE_HOMEWORK_STU_NO_SUBMIT = 0;//学员未提交课后作业
 
+    public static final String VIP_COURSE = "VIP";//VIP课
     public static final String LIVE_COURSE = "LIVE";//直播课
     public static final String OTHER_COURSE = "PRACTICE";//陪练课
     public static final String PIANO_ROOM_COURSE = "PIANO_ROOM_CLASS";//琴房课

+ 11 - 8
student/src/main/java/com/cooleshow/student/ui/main/NewHomeFragmentV2.java

@@ -80,6 +80,7 @@ import androidx.viewpager2.widget.ViewPager2;
 import static com.cooleshow.student.constants.CourseConstants.LIVE_COURSE;
 import static com.cooleshow.student.constants.CourseConstants.OTHER_COURSE;
 import static com.cooleshow.student.constants.CourseConstants.PIANO_ROOM_COURSE;
+import static com.cooleshow.student.constants.CourseConstants.VIP_COURSE;
 
 /**
  * Author by pq, Date on 2022/8/29.
@@ -135,7 +136,7 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
 
     @Override
     protected void initData() {
-        UiUtils.setCustomFont_DIN_Alternate_Bold(getContext(),mViewBinding.tvPracticeMinutes,mViewBinding.tvPracticeSecond,mViewBinding.tvCourseInfo);
+        UiUtils.setCustomFont_DIN_Alternate_Bold(getContext(), mViewBinding.tvPracticeMinutes, mViewBinding.tvPracticeSecond, mViewBinding.tvCourseInfo);
         //推荐老师
         mRecommendTalentAdapter = new HomeRecommendTalentAdapter();
         CommonItemDecoration commonItemDecoration = new CommonItemDecoration(0, 0, 0, SizeUtils.dp2px(12), 0);
@@ -267,7 +268,6 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
         });
 
 
-
         mViewBinding.viewpagerMenu.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
             @Override
             public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
@@ -479,14 +479,16 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
                     "yyyy-MM-dd"
             );
             if (TextUtils.equals(currentTime, startTime)) {
-                String timeText =
-                        TimeUtils.date2String(TimeUtils.getDate(mRecentCourses.courseStartTime), "HH:mm");
-                mViewBinding.tvLiveTime.setText(String.format("今日 %s", timeText));
+                String timeText = TimeUtils.date2String(TimeUtils.getDate(mRecentCourses.courseStartTime), "HH:mm");
+                String endTimeText = TimeUtils.date2String(TimeUtils.getDate(mRecentCourses.courseEndTime), "HH:mm");
+                mViewBinding.tvLiveTime.setText(String.format("今日 %s-%s", timeText, endTimeText));
             } else {
-                mViewBinding.tvLiveTime.setText(TimeUtils.date2String(
+                String startTimeText = TimeUtils.date2String(
                         TimeUtils.getDate(mRecentCourses.courseStartTime),
                         "yyyy-MM-dd HH:mm"
-                ));
+                );
+                String endTimeText = TimeUtils.date2String(TimeUtils.getDate(mRecentCourses.courseEndTime), "yyyy-MM-dd HH:mm");
+                mViewBinding.tvLiveTime.setText(startTimeText + "-" + endTimeText);
             }
         }
     }
@@ -766,7 +768,8 @@ public class NewHomeFragmentV2 extends BaseMVPFragment<FgNewHomeV2LayoutBinding,
                         .navigation();
                 break;
             case OTHER_COURSE:
-                //陪练课
+            case VIP_COURSE:
+                //趣纠课 VIP课
                 ARouter.getInstance().build(RouterPath.CourseCenter.SPARRING_COURSE_DETAIL)
                         .withString(CourseConstants.COURSE_ID, String.valueOf(bean.courseId))
                         .withString(CourseConstants.COURSE_GROUP_ID, String.valueOf(bean.courseGroupId))

二進制
student/src/main/res/drawable-xhdpi/small_alarm_clock_green.png


二進制
student/src/main/res/drawable-xxhdpi/small_alarm_clock_green.png


+ 17 - 4
student/src/main/res/layout/fg_new_home_v2_layout.xml

@@ -287,11 +287,11 @@
                                 android:id="@+id/tv_live_title"
                                 android:layout_width="wrap_content"
                                 android:layout_height="wrap_content"
-                                android:layout_marginStart="128dp"
                                 android:includeFontPadding="false"
                                 android:text="您有新课程即将开始"
                                 android:textColor="@color/color_1a1a1a"
                                 android:textSize="@dimen/sp_16"
+                                android:layout_marginStart="16dp"
                                 app:layout_constraintBottom_toTopOf="@+id/alarm_icon"
                                 app:layout_constraintLeft_toLeftOf="parent"
                                 app:layout_constraintTop_toTopOf="parent"
@@ -302,7 +302,7 @@
                                 android:layout_width="@dimen/dp_15"
                                 android:layout_height="@dimen/dp_15"
                                 android:layout_marginTop="10dp"
-                                android:src="@drawable/small_alarm_clock"
+                                android:src="@drawable/small_alarm_clock_green"
                                 app:layout_constraintBottom_toBottomOf="parent"
                                 app:layout_constraintLeft_toLeftOf="@+id/tv_live_title"
                                 app:layout_constraintTop_toBottomOf="@+id/tv_live_title" />
@@ -315,7 +315,7 @@
                                 android:layout_marginTop="@dimen/dp_1"
                                 android:layout_marginBottom="@dimen/dp_5"
                                 android:paddingStart="5dp"
-                                android:textColor="@color/color_FF806F"
+                                android:textColor="@color/color_2dc7aa"
                                 android:textSize="@dimen/sp_13"
                                 app:layout_constraintBottom_toBottomOf="@+id/alarm_icon"
                                 app:layout_constraintLeft_toRightOf="@+id/alarm_icon"
@@ -331,7 +331,20 @@
                                 app:layout_constraintBottom_toBottomOf="parent"
                                 app:layout_constraintRight_toRightOf="parent"
                                 app:layout_constraintTop_toTopOf="parent" />
-
+                            
+                            <TextView
+                                android:textSize="@dimen/sp_14"
+                                android:gravity="center"
+                                android:layout_marginEnd="16dp"
+                                app:layout_constraintRight_toRightOf="parent"
+                                app:layout_constraintBottom_toBottomOf="parent"
+                                app:layout_constraintTop_toTopOf="parent"
+                                android:background="@drawable/shape_2dc7aa_13dp"
+                                android:textColor="@color/white"
+                                android:text="进入教室"
+                                android:includeFontPadding="false"
+                                android:layout_width="76dp"
+                                android:layout_height="26dp"/>
 
                         </androidx.constraintlayout.widget.ConstraintLayout>