微调
这个提交包含在:
父节点
797d084cea
当前提交
32467c7fff
@ -43,7 +43,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".ui.ChatActivity"
|
android:name=".ui.ChatActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
android:windowSoftInputMode="adjustResize"
|
android:windowSoftInputMode="adjustNothing"
|
||||||
/>
|
/>
|
||||||
<activity
|
<activity
|
||||||
android:name=".ui.FeedbackActivity"
|
android:name=".ui.FeedbackActivity"
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package com.xuqinmin.android.app.ui
|
package com.xuqinmin.android.app.ui
|
||||||
|
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
|
import android.graphics.Rect
|
||||||
import android.os.Bundle
|
import android.os.Bundle
|
||||||
|
import android.view.WindowManager
|
||||||
import android.widget.ImageView
|
import android.widget.ImageView
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
@ -72,6 +74,7 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
|
|||||||
bindUi(R.layout.activity_chat)
|
bindUi(R.layout.activity_chat)
|
||||||
ImmersionBar.with(this).statusBarDarkFont(true)
|
ImmersionBar.with(this).statusBarDarkFont(true)
|
||||||
.hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR).init()
|
.hideBar(BarHide.FLAG_HIDE_NAVIGATION_BAR).init()
|
||||||
|
window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
@ -188,8 +191,34 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
|
|||||||
}
|
}
|
||||||
binding.tags.adapter = adapter1
|
binding.tags.adapter = adapter1
|
||||||
binding.tags2.adapter = adapter1
|
binding.tags2.adapter = adapter1
|
||||||
binding.tags.linearLayoutManagerForHorizontal(mContext,0)
|
binding.tags.linearLayoutManagerForHorizontal(mContext, 0)
|
||||||
binding.tags2.linearLayoutManagerForHorizontal(mContext,0)
|
binding.tags2.linearLayoutManagerForHorizontal(mContext, 0)
|
||||||
|
|
||||||
|
// binding.text.onFocusChangeListener =
|
||||||
|
// OnFocusChangeListener { _, hasFocus ->
|
||||||
|
// if (hasFocus) {
|
||||||
|
// window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE)
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
window.decorView.viewTreeObserver.addOnGlobalLayoutListener {
|
||||||
|
val r = Rect()
|
||||||
|
window.decorView.getWindowVisibleDisplayFrame(r);
|
||||||
|
val screenHeight = window.decorView.rootView.height;
|
||||||
|
val keypadHeight = screenHeight - r.bottom;
|
||||||
|
|
||||||
|
if (keypadHeight > screenHeight * 0.15) {
|
||||||
|
// 输入法弹出
|
||||||
|
val params = binding.bto.layoutParams as LinearLayout.LayoutParams
|
||||||
|
params.height = keypadHeight;
|
||||||
|
binding.bto.layoutParams = params
|
||||||
|
} else {
|
||||||
|
// 输入法隐藏
|
||||||
|
val params = binding.bto.layoutParams as LinearLayout.LayoutParams
|
||||||
|
params.height = 0;
|
||||||
|
binding.bto.layoutParams = params
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun changeView() {
|
private fun changeView() {
|
||||||
@ -203,7 +232,7 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
|
|||||||
binding.empty.gone()
|
binding.empty.gone()
|
||||||
}
|
}
|
||||||
putInt(MSG_COUNT + "_" + toUser?.userId, 0)//消息全部已读
|
putInt(MSG_COUNT + "_" + toUser?.userId, 0)//消息全部已读
|
||||||
if (intent?.getBooleanExtra("isSys", false) == true){
|
if (intent?.getBooleanExtra("isSys", false) == true) {
|
||||||
binding.empty.gone()
|
binding.empty.gone()
|
||||||
binding.startVideo2.gone()
|
binding.startVideo2.gone()
|
||||||
binding.msgStartVideo.gone()
|
binding.msgStartVideo.gone()
|
||||||
@ -253,9 +282,9 @@ class ChatActivity : BaseActivity<ActivityChatBinding>() {
|
|||||||
binding.country.text = CountryHelper.getCountryName(toUser?.country)
|
binding.country.text = CountryHelper.getCountryName(toUser?.country)
|
||||||
ImageHelper.load(binding.gender, GenderHelper.getImage(toUser?.gender ?: 1))
|
ImageHelper.load(binding.gender, GenderHelper.getImage(toUser?.gender ?: 1))
|
||||||
|
|
||||||
ImageHelper.load(binding.avatar,toUser?.avatar)
|
ImageHelper.load(binding.avatar, toUser?.avatar)
|
||||||
ImageHelper.load(binding.avatar3,toUser?.avatar)
|
ImageHelper.load(binding.avatar3, toUser?.avatar)
|
||||||
val color = when(toUser?.online){
|
val color = when (toUser?.online) {
|
||||||
0 -> Color.parseColor("#FFB9BECC")
|
0 -> Color.parseColor("#FFB9BECC")
|
||||||
1 -> Color.parseColor("#FF26D526")
|
1 -> Color.parseColor("#FF26D526")
|
||||||
else -> Color.parseColor("#FFEA2D2D")
|
else -> Color.parseColor("#FFEA2D2D")
|
||||||
|
|||||||
@ -2,7 +2,8 @@
|
|||||||
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
<layout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<LinearLayout
|
||||||
|
android:orientation="vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
@ -71,9 +72,9 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/empty"
|
android:id="@+id/empty"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="0dp"
|
||||||
android:visibility="visible"
|
android:layout_weight="1"
|
||||||
app:layout_constraintTop_toBottomOf="@+id/top">
|
android:visibility="gone">
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/head"
|
android:id="@+id/head"
|
||||||
@ -149,12 +150,10 @@
|
|||||||
android:layout_width="345dp"
|
android:layout_width="345dp"
|
||||||
android:layout_height="145dp"
|
android:layout_height="145dp"
|
||||||
android:layout_marginTop="-14dp"
|
android:layout_marginTop="-14dp"
|
||||||
|
android:layout_gravity="center_horizontal"
|
||||||
android:background="@drawable/bg_tag_match"
|
android:background="@drawable/bg_tag_match"
|
||||||
android:padding="15dp"
|
android:padding="15dp"
|
||||||
android:visibility="gone"
|
android:visibility="visible">
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/top">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/avatar3"
|
android:id="@+id/avatar3"
|
||||||
@ -241,20 +240,27 @@
|
|||||||
app:layout_constraintTop_toBottomOf="@+id/line" />
|
app:layout_constraintTop_toBottomOf="@+id/line" />
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
|
||||||
<!-- <View-->
|
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
||||||
<!-- android:id="@id/view"-->
|
android:id="@+id/baseRefreshLayout"
|
||||||
<!-- android:layout_width="match_parent"-->
|
android:layout_width="match_parent"
|
||||||
<!-- android:layout_height="50dp"-->
|
android:layout_height="0dp"
|
||||||
<!-- android:visibility="gone"-->
|
android:paddingTop="3dp"
|
||||||
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
|
android:layout_weight="1"
|
||||||
|
android:visibility="visible">
|
||||||
|
|
||||||
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/baseRecyclerView"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_weight="2"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:overScrollMode="never" />
|
||||||
|
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
||||||
<androidx.constraintlayout.widget.ConstraintLayout
|
<androidx.constraintlayout.widget.ConstraintLayout
|
||||||
android:id="@+id/toolbar"
|
android:id="@+id/toolbar"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:minHeight="80dp"
|
android:minHeight="80dp"
|
||||||
android:paddingVertical="16dp"
|
android:paddingVertical="16dp">
|
||||||
app:layout_constraintBottom_toBottomOf="parent">
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/send_pic"
|
android:id="@+id/send_pic"
|
||||||
@ -283,6 +289,7 @@
|
|||||||
android:background="@drawable/bg_cfd4e0_20"
|
android:background="@drawable/bg_cfd4e0_20"
|
||||||
android:gravity="center_vertical|end"
|
android:gravity="center_vertical|end"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
|
android:paddingVertical="10dp"
|
||||||
android:paddingStart="15dp"
|
android:paddingStart="15dp"
|
||||||
android:paddingEnd="6dp"
|
android:paddingEnd="6dp"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
@ -297,7 +304,8 @@
|
|||||||
android:layout_marginEnd="10dp"
|
android:layout_marginEnd="10dp"
|
||||||
android:background="@null"
|
android:background="@null"
|
||||||
android:maxLines="3"
|
android:maxLines="3"
|
||||||
android:minHeight="52dp"
|
android:layout_weight="1"
|
||||||
|
android:minHeight="30dp"
|
||||||
android:textColor="#ff222222"
|
android:textColor="#ff222222"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold" />
|
||||||
@ -306,7 +314,6 @@
|
|||||||
android:id="@+id/can_send"
|
android:id="@+id/can_send"
|
||||||
android:layout_width="32dp"
|
android:layout_width="32dp"
|
||||||
android:layout_height="32dp"
|
android:layout_height="32dp"
|
||||||
android:layout_marginVertical="10dp"
|
|
||||||
android:src="@mipmap/can_send"
|
android:src="@mipmap/can_send"
|
||||||
app:layout_constraintBottom_toBottomOf="parent"
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
app:layout_constraintEnd_toStartOf="@+id/view_send"
|
app:layout_constraintEnd_toStartOf="@+id/view_send"
|
||||||
@ -314,24 +321,11 @@
|
|||||||
app:layout_constraintTop_toTopOf="parent" />
|
app:layout_constraintTop_toTopOf="parent" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||||
|
<View
|
||||||
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
|
android:id="@+id/bto"
|
||||||
android:id="@+id/baseRefreshLayout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"/>
|
||||||
android:paddingTop="3dp"
|
|
||||||
android:visibility="gone"
|
|
||||||
app:layout_constraintBottom_toTopOf="@+id/toolbar"
|
|
||||||
app:layout_constraintEnd_toEndOf="parent"
|
|
||||||
app:layout_constraintStart_toStartOf="parent"
|
|
||||||
app:layout_constraintTop_toBottomOf="@+id/chat_top">
|
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
|
||||||
android:id="@+id/baseRecyclerView"
|
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_height="match_parent"
|
|
||||||
android:overScrollMode="never" />
|
|
||||||
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
|
|
||||||
|
|
||||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
</LinearLayout>
|
||||||
</layout>
|
</layout>
|
||||||
正在加载...
在新工单中引用
屏蔽一个用户