tongmengxiao před 6 měsíci
rodič
revize
9deb85f9ca

+ 5 - 0
baseswago/src/main/res/drawable/shape_9b20fc_20.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="#9b20fc"/>
+    <corners android:radius="20dp"/>
+</shape>

+ 11 - 1
home/src/main/java/com/swago/home/HomeFragment.kt

@@ -12,6 +12,7 @@ import com.permissionx.guolindev.PermissionX
 import com.swago.baseswago.GradientIndicator
 import com.swago.baseswago.SwagoAdapter
 import com.swago.baseswago.constant.ARouteConstant
+import com.swago.baseswago.constant.UrlConstant
 import com.swago.baseswago.fragment.BaseXFragment
 import com.swago.baseswago.util.AppContext
 import com.swago.baseswago.util.DpPxUtil
@@ -112,7 +113,16 @@ class HomeFragment : BaseXFragment<FragmentHomeBinding>() {
                     }
             }
         })
-        binding.ivLive.setOnClickListener(object :NoDoubleClickListener(){
+
+        binding.ivRanking.setOnClickListener(object :NoDoubleClickListener(){
+            override fun onClick() {
+                ARouter.getInstance().build(ARouteConstant.Base.webView)
+                    .withString("url", UrlConstant.USER_AGREEMENT)
+                    .navigation()
+            }
+        })
+
+        binding.mtvLive.setOnClickListener(object :NoDoubleClickListener(){
             override fun onClick() {
                 binding.tvStartLive.isEnabled = false
                 PermissionX.init(this@HomeFragment)

+ 36 - 3
home/src/main/res/layout/fragment_home.xml

@@ -25,12 +25,23 @@
         android:id="@+id/ivSearch"
         app:layout_constraintTop_toTopOf="@+id/magicIndicator"
         app:layout_constraintBottom_toBottomOf="@+id/magicIndicator"
-        app:layout_constraintEnd_toEndOf="parent"
-        android:layout_marginEnd="96dp"
+        android:layout_marginEnd="16dp"
+        android:layout_marginTop="4dp"
         android:src="@mipmap/search"
         android:layout_width="26dp"
+        app:layout_constraintRight_toLeftOf="@+id/ivRanking"
         android:layout_height="52dp"/>
 
+    <ImageView
+        android:id="@+id/ivRanking"
+        android:layout_width="30dp"
+        android:layout_height="30dp"
+        app:layout_constraintTop_toTopOf="@+id/magicIndicator"
+        app:layout_constraintBottom_toBottomOf="@+id/magicIndicator"
+        app:layout_constraintEnd_toEndOf="parent"
+        android:layout_marginEnd="10dp"
+        android:src="@mipmap/ic_live"/>
+
     <com.swago.baseswago.cusview.MediumTextView
         android:id="@+id/tvStartLive"
         android:gravity="center_vertical"
@@ -48,6 +59,7 @@
         android:layout_marginEnd="10dp"
         android:background="@drawable/shape_white_20"
         android:text="@string/live"
+        android:visibility="gone"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"/>
 
@@ -66,6 +78,27 @@
         app:layout_constraintBottom_toBottomOf="parent"
         app:layout_constraintRight_toRightOf="parent"
         android:layout_marginRight="10dp"
-        android:layout_marginBottom="10dp"/>
+        android:layout_marginBottom="10dp"
+        android:visibility="gone"/>
+
+    <com.swago.baseswago.cusview.MediumTextView
+        android:id="@+id/mtv_live"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        app:layout_constraintBottom_toBottomOf="parent"
+        app:layout_constraintRight_toRightOf="parent"
+        android:layout_marginRight="10dp"
+        android:layout_marginBottom="10dp"
+        android:gravity="center_vertical"
+        android:drawablePadding="4dp"
+        android:paddingStart="16dp"
+        android:paddingEnd="16dp"
+        android:paddingTop="10dp"
+        android:paddingBottom="10dp"
+        android:textSize="14dp"
+        android:background="@drawable/shape_9b20fc_20"
+        android:text="@string/live"
+        android:textColor="@color/_ffffff"
+        android:drawableStart="@mipmap/ic_voice"/>
 
 </androidx.constraintlayout.widget.ConstraintLayout>

binární
home/src/main/res/mipmap-xxhdpi/ic_live.png


binární
home/src/main/res/mipmap-xxhdpi/ic_voice.png


binární
home/src/main/res/mipmap-xxhdpi/search.png