Browse Source

修改个人主页样式

Pq 7 months ago
parent
commit
37de22e00e

+ 24 - 19
teacher/src/main/java/com/cooleshow/teacher/ui/homepage/HomePageActivity.java

@@ -129,6 +129,25 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
                 createTab(tab, titles[position]);
                 createTab(tab, titles[position]);
             }
             }
         });
         });
+        initListener();
+        VIPCustomCoursePageFragment vipCustomCoursePageFragment = new VIPCustomCoursePageFragment();
+        InterestCorrectCoursePageFragment  interestCorrectCoursePageFragment = new InterestCorrectCoursePageFragment();
+        LiveCoursePageFragment liveCoursePageFragment = new LiveCoursePageFragment();
+        VideoCoursePageFragment videoCoursePageFragment = new VideoCoursePageFragment();
+        mMusicPageFragment = new SheetMusicPageFragment();
+        fragments.add(vipCustomCoursePageFragment);
+        fragments.add(interestCorrectCoursePageFragment);
+        fragments.add(liveCoursePageFragment);
+        fragments.add(videoCoursePageFragment);
+        fragments.add(mMusicPageFragment);
+        HomePagerAdapter homePagerAdapter = new HomePagerAdapter(this);
+        homePagerAdapter.setData(fragments);
+        viewBinding.viewPager.setOffscreenPageLimit(fragments.size());
+        viewBinding.viewPager.setAdapter(homePagerAdapter);
+        tabLayoutMediator.attach();
+    }
+
+    private void initListener() {
         viewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
         viewBinding.tabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
             @Override
             @Override
             public void onTabSelected(TabLayout.Tab tab) {
             public void onTabSelected(TabLayout.Tab tab) {
@@ -160,21 +179,11 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
             public void onTabReselected(TabLayout.Tab tab) {
             public void onTabReselected(TabLayout.Tab tab) {
             }
             }
         });
         });
-        VIPCustomCoursePageFragment vipCustomCoursePageFragment = new VIPCustomCoursePageFragment();
-        InterestCorrectCoursePageFragment  interestCorrectCoursePageFragment = new InterestCorrectCoursePageFragment();
-        LiveCoursePageFragment liveCoursePageFragment = new LiveCoursePageFragment();
-        VideoCoursePageFragment videoCoursePageFragment = new VideoCoursePageFragment();
-        mMusicPageFragment = new SheetMusicPageFragment();
-        fragments.add(vipCustomCoursePageFragment);
-        fragments.add(interestCorrectCoursePageFragment);
-        fragments.add(liveCoursePageFragment);
-        fragments.add(videoCoursePageFragment);
-        fragments.add(mMusicPageFragment);
-        HomePagerAdapter homePagerAdapter = new HomePagerAdapter(this);
-        homePagerAdapter.setData(fragments);
-        viewBinding.viewPager.setOffscreenPageLimit(fragments.size());
-        viewBinding.viewPager.setAdapter(homePagerAdapter);
-        tabLayoutMediator.attach();
+
+        viewBinding.selfIntroductionEmpty.setOpeBtnClickListener(v -> {
+            ARouter.getInstance().build(RouterPath.MineCenter.MINE_STYLE_PAGE)
+                    .navigation();
+        });
     }
     }
 
 
     @Override
     @Override
@@ -246,10 +255,6 @@ public class HomePageActivity extends BaseMVPActivity<ActivityHomePageNewLayoutB
         if(TextUtils.isEmpty(info.getIntroduction())){
         if(TextUtils.isEmpty(info.getIntroduction())){
             viewBinding.tvIntroduce.setVisibility(View.GONE);
             viewBinding.tvIntroduce.setVisibility(View.GONE);
             viewBinding.selfIntroductionEmpty.setVisibility(View.VISIBLE);
             viewBinding.selfIntroductionEmpty.setVisibility(View.VISIBLE);
-            viewBinding.selfIntroductionEmpty.setOpeBtnClickListener(v -> {
-                ARouter.getInstance().build(RouterPath.MineCenter.MINE_STYLE_PAGE)
-                        .navigation();
-            });
         }else{
         }else{
             viewBinding.tvIntroduce.setText(info.getIntroduction());
             viewBinding.tvIntroduce.setText(info.getIntroduction());
             viewBinding.tvIntroduce.setVisibility(View.VISIBLE);
             viewBinding.tvIntroduce.setVisibility(View.VISIBLE);

+ 4 - 2
teacher/src/main/res/layout/activity_home_page_new_layout.xml

@@ -431,8 +431,9 @@
             android:id="@+id/tab_layout"
             android:id="@+id/tab_layout"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginStart="14dp"
-            android:layout_marginEnd="14dp"
+            android:paddingStart="14dp"
+            android:paddingEnd="14dp"
+            android:background="@color/color_f8f9fc"
             app:layout_constraintLeft_toLeftOf="parent"
             app:layout_constraintLeft_toLeftOf="parent"
             app:tabBackground="@color/transparent"
             app:tabBackground="@color/transparent"
             app:tabGravity="fill"
             app:tabGravity="fill"
@@ -449,6 +450,7 @@
     </com.google.android.material.appbar.AppBarLayout>
     </com.google.android.material.appbar.AppBarLayout>
 
 
     <androidx.viewpager2.widget.ViewPager2
     <androidx.viewpager2.widget.ViewPager2
+        android:background="@color/color_f8f9fc"
         android:id="@+id/view_pager"
         android:id="@+id/view_pager"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:layout_height="match_parent"

+ 5 - 4
teacher/src/main/res/layout/teacher_empty_view.xml

@@ -26,12 +26,13 @@
 
 
     <TextView
     <TextView
         android:id="@+id/ope_btn"
         android:id="@+id/ope_btn"
-        android:layout_width="@dimen/dp_77"
-        android:layout_height="@dimen/dp_30"
-        android:layout_marginTop="@dimen/dp_10"
+        android:minWidth="@dimen/dp_66"
+        android:layout_width="wrap_content"
+        android:layout_height="@dimen/dp_24"
+        android:layout_marginTop="@dimen/dp_12"
         android:background="@drawable/bg_i_konw_btn"
         android:background="@drawable/bg_i_konw_btn"
         android:gravity="center"
         android:gravity="center"
         android:textColor="@color/color_2dc7aa"
         android:textColor="@color/color_2dc7aa"
-        android:textSize="@dimen/sp_14"
+        android:textSize="@dimen/sp_13"
         tools:text="去创建" />
         tools:text="去创建" />
 </androidx.appcompat.widget.LinearLayoutCompat>
 </androidx.appcompat.widget.LinearLayoutCompat>