徐勤民 il y a 3 mois
Parent
commit
797d084cea

+ 11 - 3
app/src/main/java/com/xuqinmin/android/app/ui/ChatActivity.kt

@@ -6,6 +6,8 @@ import android.widget.ImageView
 import android.widget.LinearLayout
 import android.widget.TextView
 import androidx.activity.viewModels
+import com.gyf.immersionbar.BarHide
+import com.gyf.immersionbar.ImmersionBar
 import com.luck.picture.lib.basic.PictureSelector
 import com.luck.picture.lib.config.SelectMimeType
 import com.luck.picture.lib.config.SelectModeConfig
@@ -13,7 +15,6 @@ import com.luck.picture.lib.entity.LocalMedia
 import com.luck.picture.lib.interfaces.OnResultCallbackListener
 import com.oikawaii.library.outline.CircleProvider
 import com.oikawaii.library.outline.FilletProvider
-import com.xuqinmin.android.app.MyApplication
 import com.xuqinmin.android.app.R
 import com.xuqinmin.android.app.common.CountryHelper
 import com.xuqinmin.android.app.common.GenderHelper
@@ -57,7 +58,7 @@ import java.io.File
 
 class ChatActivity : BaseActivity<ActivityChatBinding>() {
 
-    override fun getLayoutId(): Int = R.layout.activity_chat
+    override fun getLayoutId(): Int = 0
     override fun fullscreen(): Boolean = true
 
     private var toUser: ToUser? = null
@@ -66,6 +67,13 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
 
     private val listMsg = mutableListOf<MessagModel>()
 
+    override fun setContentView() {
+        super.setContentView()
+        bindUi(R.layout.activity_chat)
+        ImmersionBar.with(this).statusBarDarkFont(true)
+            .hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR).init()
+    }
+
     override fun initView(savedInstanceState: Bundle?) {
         super.initView(savedInstanceState)
 
@@ -196,7 +204,7 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
         }
         putInt(MSG_COUNT + "_" + toUser?.userId, 0)//消息全部已读
         if (intent?.getBooleanExtra("isSys", false) == true){
-            binding.startVideo.gone()
+            binding.empty.gone()
             binding.startVideo2.gone()
             binding.msgStartVideo.gone()
             binding.more.gone()

+ 14 - 2
app/src/main/java/com/xuqinmin/android/app/ui/MainActivity.kt

@@ -1,6 +1,9 @@
 package com.xuqinmin.android.app.ui
 
+import android.os.Build
 import android.os.Bundle
+import android.view.WindowInsets
+import android.view.WindowManager
 import androidx.activity.viewModels
 import com.xuqinmin.android.app.MyApplication
 import com.xuqinmin.android.app.R
@@ -23,6 +26,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
 
     override fun initView(savedInstanceState: Bundle?) {
         super.initView(savedInstanceState)
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
+            window?.insetsController?.hide(WindowInsets.Type.statusBars())
+            window?.insetsController?.show(WindowInsets.Type.navigationBars())
+        }
+
+        window.setFlags(
+            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS,
+            WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS
+        )
         setupBottomNavigationBar()
         MyApplication.startConnection()
         MyApplication.modelInit.let {
@@ -42,8 +54,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
                 LoadingDialog.dismissDialog()
                 DialogBalanceNew.show(
                     it.coins.toString(),
-                    it.money?:"",
-                    it.price?:"",
+                    it.money ?: "",
+                    it.price ?: "",
                     it.payCode,
                     it.content ?: ""
                 ) { ite ->

+ 11 - 12
app/src/main/res/layout/activity_chat.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <layout xmlns:android="http://schemas.android.com/apk/res/android"
-    xmlns:app="http://schemas.android.com/apk/res-auto"
-    xmlns:tools="http://schemas.android.com/tools">
+    xmlns:app="http://schemas.android.com/apk/res-auto">
 
     <androidx.constraintlayout.widget.ConstraintLayout
         android:layout_width="match_parent"
@@ -242,12 +241,12 @@
                 app:layout_constraintTop_toBottomOf="@+id/line" />
         </androidx.constraintlayout.widget.ConstraintLayout>
 
-        <View
-            android:id="@id/view"
-            android:layout_width="match_parent"
-            android:layout_height="50dp"
-            android:visibility="gone"
-            app:layout_constraintBottom_toBottomOf="parent" />
+        <!--        <View-->
+        <!--            android:id="@id/view"-->
+        <!--            android:layout_width="match_parent"-->
+        <!--            android:layout_height="50dp"-->
+        <!--            android:visibility="gone"-->
+        <!--            app:layout_constraintBottom_toBottomOf="parent" />-->
 
         <androidx.constraintlayout.widget.ConstraintLayout
             android:id="@+id/toolbar"
@@ -255,7 +254,7 @@
             android:layout_height="wrap_content"
             android:minHeight="80dp"
             android:paddingVertical="16dp"
-            app:layout_constraintBottom_toTopOf="@+id/view">
+            app:layout_constraintBottom_toBottomOf="parent">
 
             <ImageView
                 android:id="@+id/send_pic"
@@ -284,7 +283,6 @@
                 android:background="@drawable/bg_cfd4e0_20"
                 android:gravity="center_vertical|end"
                 android:orientation="horizontal"
-                android:paddingVertical="10dp"
                 android:paddingStart="15dp"
                 android:paddingEnd="6dp"
                 app:layout_constraintBottom_toBottomOf="parent"
@@ -299,7 +297,7 @@
                     android:layout_marginEnd="10dp"
                     android:background="@null"
                     android:maxLines="3"
-                    android:minHeight="30dp"
+                    android:minHeight="52dp"
                     android:textColor="#ff222222"
                     android:textSize="14sp"
                     android:textStyle="bold" />
@@ -308,6 +306,7 @@
                     android:id="@+id/can_send"
                     android:layout_width="32dp"
                     android:layout_height="32dp"
+                    android:layout_marginVertical="10dp"
                     android:src="@mipmap/can_send"
                     app:layout_constraintBottom_toBottomOf="parent"
                     app:layout_constraintEnd_toStartOf="@+id/view_send"
@@ -320,7 +319,7 @@
             android:id="@+id/baseRefreshLayout"
             android:layout_width="match_parent"
             android:layout_height="0dp"
-            android:layout_marginTop="3dp"
+            android:paddingTop="3dp"
             android:visibility="gone"
             app:layout_constraintBottom_toTopOf="@+id/toolbar"
             app:layout_constraintEnd_toEndOf="parent"