[6.2.0]修改小智语音文字样式
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
package com.mogo.eagle.core.function.hmi.ui.msgbox.adapter
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.LinearGradient
|
||||
import android.graphics.Shader
|
||||
import android.os.CountDownTimer
|
||||
import android.view.LayoutInflater
|
||||
import android.view.View
|
||||
@@ -21,6 +19,7 @@ import com.mogo.eagle.core.function.hmi.R
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils
|
||||
import com.mogo.eagle.core.utilcode.util.TimeUtils.getHourMinFormat
|
||||
import com.mogo.eagle.core.widget.AlignTextView
|
||||
import com.mogo.eagle.core.widget.AlignTwoTextView
|
||||
import com.mogo.eagle.core.widget.RoundCanClickConstraintLayout
|
||||
|
||||
/**
|
||||
@@ -130,23 +129,16 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
is BubbleVoiceHolder -> {
|
||||
data?.let {
|
||||
val voiceMsg = it[position].msgBoxBean.bean as VoiceMsg
|
||||
holder.tvPassengerVoiceContent.text = voiceMsg.msg
|
||||
if(voiceMsg.isResp){
|
||||
//小智说的
|
||||
holder.tvPassengerVoiceContent.paint.shader = null
|
||||
holder.tvPassengerVoiceContent.setTextColor(activity.resources.getColor(R.color.voice_resp))
|
||||
holder.tvVoiceRes.text = voiceMsg.msg
|
||||
holder.tvVoiceRes.visibility = View.VISIBLE
|
||||
holder.tvPassengerVoiceContent.visibility = View.GONE
|
||||
}else{
|
||||
//用户说的
|
||||
val mUserGradient = LinearGradient(
|
||||
0f,
|
||||
0f,
|
||||
0f,
|
||||
holder.tvPassengerVoiceContent.paint.textSize,
|
||||
activity.resources.getColor(R.color.voice_user_start)
|
||||
,activity.resources.getColor(R.color.voice_user_end),
|
||||
Shader.TileMode.CLAMP
|
||||
)
|
||||
holder.tvPassengerVoiceContent.paint.setShader(mUserGradient)
|
||||
holder.tvPassengerVoiceContent.text = voiceMsg.msg
|
||||
holder.tvVoiceRes.visibility = View.GONE
|
||||
holder.tvPassengerVoiceContent.visibility = View.VISIBLE
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -211,6 +203,7 @@ class PassengerMsgBoxBubbleAdapter(private val activity: Activity): RecyclerView
|
||||
//小智语音消息
|
||||
class BubbleVoiceHolder(itemView: View): RecyclerView.ViewHolder(itemView){
|
||||
var tvPassengerVoiceContent: AlignTextView = itemView.findViewById(R.id.tvPassengerVoiceContent)
|
||||
var tvVoiceRes: AlignTwoTextView = itemView.findViewById(R.id.tvVoiceRes)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,20 +14,39 @@
|
||||
|
||||
<com.mogo.eagle.core.widget.AlignTextView
|
||||
android:id="@+id/tvPassengerVoiceContent"
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:textColor="#243959"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:layout_marginBottom="@dimen/dp_54"
|
||||
android:layout_marginStart="@dimen/dp_49"
|
||||
android:layout_marginEnd="@dimen/dp_49"
|
||||
android:maxWidth="@dimen/dp_502"
|
||||
android:textStyle="bold"
|
||||
android:gravity="start"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
<com.mogo.eagle.core.widget.AlignTwoTextView
|
||||
android:id="@+id/tvVoiceRes"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp_32"
|
||||
android:layout_marginTop="@dimen/dp_54"
|
||||
android:textColor="@color/voice_resp"
|
||||
android:layout_marginBottom="@dimen/dp_54"
|
||||
android:layout_marginStart="@dimen/dp_49"
|
||||
android:layout_marginEnd="@dimen/dp_49"
|
||||
android:maxWidth="@dimen/dp_502"
|
||||
android:textStyle="bold"
|
||||
android:gravity="start"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
|
||||
</com.mogo.eagle.core.widget.RoundCanClickConstraintLayout>
|
||||
Reference in New Issue
Block a user