引入ai model 可选UI
This commit is contained in:
parent
39095b9762
commit
94467ea83b
|
|
@ -199,6 +199,10 @@
|
||||||
"border.m": "$glo.border.2",
|
"border.m": "$glo.border.2",
|
||||||
"border.l": "$glo.border.4",
|
"border.l": "$glo.border.4",
|
||||||
|
|
||||||
"color.chat.setting.item.bg": "$glo.color.chat.setting.item.bg"
|
"color.chat.setting.item.bg": "$glo.color.chat.setting.item.bg",
|
||||||
|
"color.switch.view.normal": "$glo.color.switchview.normal",
|
||||||
|
"color.switch.view.checked": "$glo.color.switchview.checked",
|
||||||
|
"color.switch.view.stroke": "$glo.color.switchview.stroke"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,6 +28,7 @@ import com.remax.visualnovel.manager.nim.NimManager
|
||||||
import com.remax.visualnovel.ui.chat.setting.model.ChatModelDialog
|
import com.remax.visualnovel.ui.chat.setting.model.ChatModelDialog
|
||||||
import com.remax.visualnovel.ui.chat.ui.HoldToTalkDialog
|
import com.remax.visualnovel.ui.chat.ui.HoldToTalkDialog
|
||||||
import com.remax.visualnovel.utils.RecordHelper
|
import com.remax.visualnovel.utils.RecordHelper
|
||||||
|
import com.remax.visualnovel.utils.StatusBarUtil2
|
||||||
import dagger.hilt.android.AndroidEntryPoint
|
import dagger.hilt.android.AndroidEntryPoint
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
import timber.log.Timber
|
import timber.log.Timber
|
||||||
|
|
@ -45,11 +46,12 @@ class ChatActivity : BaseBindingActivity<ActivityActorChatBinding>() {
|
||||||
|
|
||||||
|
|
||||||
override fun initView() {
|
override fun initView() {
|
||||||
ARouter.getInstance().inject(this)
|
/*ARouter.getInstance().inject(this)
|
||||||
|
|
||||||
StatusBarUtils.setStatusBarAndNavBarIsLight(this, false)
|
StatusBarUtils.setStatusBarAndNavBarIsLight(this, false)
|
||||||
StatusBarUtils.setTransparent(this)
|
StatusBarUtils.setTransparent(this)*/
|
||||||
binding.root.setPadding(binding.root.paddingLeft, binding.root.paddingTop + StatusBarUtils.statusBarHeight, binding.root.paddingRight, binding.root.paddingBottom)
|
StatusBarUtil2.initImmersive(this, lightStatusBar = true)
|
||||||
|
binding.root.setPadding(binding.root.paddingStart, binding.root.paddingTop + StatusBarUtil2.getStatusBarHeight(this) * 2,
|
||||||
|
binding.root.paddingEnd, binding.root.paddingBottom)
|
||||||
binding.toolbar.addRightIcon(R.mipmap.chat_title_setting) {
|
binding.toolbar.addRightIcon(R.mipmap.chat_title_setting) {
|
||||||
binding.drawerMenu.openDrawer(GravityCompat.END)
|
binding.drawerMenu.openDrawer(GravityCompat.END)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,35 @@
|
||||||
|
package com.remax.visualnovel.ui.chat.ui
|
||||||
|
|
||||||
|
|
||||||
|
import android.content.Context
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import com.remax.visualnovel.databinding.ChatSettingItemBinding
|
||||||
|
|
||||||
|
class ChatSettingItemView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet? = null,
|
||||||
|
defStyleAttr: Int = 0
|
||||||
|
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
private var mLeftIconRes : Int = 0
|
||||||
|
private var mTitleRes : Int = 0
|
||||||
|
private var mRightIconRes : Int = 0
|
||||||
|
private lateinit var mRightView : View
|
||||||
|
|
||||||
|
private var mBinding = ChatSettingItemBinding.inflate(LayoutInflater.from(context))
|
||||||
|
|
||||||
|
|
||||||
|
fun setItemClickListener (clickHandler: () -> Unit) {
|
||||||
|
setOnClickListener {
|
||||||
|
clickHandler.invoke()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setLeftIconRes (leftIconRes: Int) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -2,11 +2,14 @@ package com.remax.visualnovel.ui.chat.ui
|
||||||
|
|
||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
|
import android.graphics.Color
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
import android.widget.LinearLayout
|
import android.widget.LinearLayout
|
||||||
|
import androidx.core.graphics.toColorInt
|
||||||
import com.remax.visualnovel.R
|
import com.remax.visualnovel.R
|
||||||
import com.remax.visualnovel.databinding.LayoutChatMenuViewBinding
|
import com.remax.visualnovel.databinding.LayoutChatMenuViewBinding
|
||||||
|
import com.remax.visualnovel.ui.chat.ui.expandableSelector.SelectorItem
|
||||||
|
|
||||||
class ChatSettingView @JvmOverloads constructor(
|
class ChatSettingView @JvmOverloads constructor(
|
||||||
context: Context,
|
context: Context,
|
||||||
|
|
@ -18,7 +21,52 @@ class ChatSettingView @JvmOverloads constructor(
|
||||||
|
|
||||||
|
|
||||||
init {
|
init {
|
||||||
|
with(mBinding) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
initAiModelList()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun initAiModelList() {
|
||||||
|
val items = listOf(
|
||||||
|
SelectorItem(
|
||||||
|
name = "Max-0618",
|
||||||
|
description = "Previous-generation large model",
|
||||||
|
pointsInfo = "0.3 points / 1K tokens",
|
||||||
|
color = "#FF6B35".toColorInt(),
|
||||||
|
isRecommended = true
|
||||||
|
),
|
||||||
|
SelectorItem(
|
||||||
|
name = "Turbo-0826-32K",
|
||||||
|
description = "Previous-generation large model",
|
||||||
|
pointsInfo = "0.3 points / 1K tokens",
|
||||||
|
color = Color.parseColor("#4285F4")
|
||||||
|
),
|
||||||
|
SelectorItem(
|
||||||
|
name = "XL-0430",
|
||||||
|
description = "Previous-generation large model",
|
||||||
|
pointsInfo = "0.3 points / 1K tokens",
|
||||||
|
color = Color.parseColor("#34A853")
|
||||||
|
),
|
||||||
|
SelectorItem(
|
||||||
|
name = "XL-0826-32K",
|
||||||
|
description = "Previous-generation large model",
|
||||||
|
pointsInfo = "0.3 points / 1K tokens",
|
||||||
|
color = Color.parseColor("#FBBC05"),
|
||||||
|
isSelected = true // 默认选中
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
//aiModelSelector.setOnItemSelectedListener()
|
||||||
|
mBinding.aiModelSelector.setTitleIcon(R.mipmap.setting_ai_model)
|
||||||
|
mBinding.aiModelSelector.setItems(items)
|
||||||
|
mBinding.aiModelSelector.selectItem(0)
|
||||||
|
//mBinding.aiModelSelector.setTitleText(R.string.xxxx)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,6 @@ import android.animation.AnimatorListenerAdapter
|
||||||
import android.animation.ObjectAnimator
|
import android.animation.ObjectAnimator
|
||||||
import android.animation.ValueAnimator
|
import android.animation.ValueAnimator
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
|
||||||
import android.graphics.drawable.GradientDrawable
|
import android.graphics.drawable.GradientDrawable
|
||||||
import android.util.AttributeSet
|
import android.util.AttributeSet
|
||||||
import android.view.LayoutInflater
|
import android.view.LayoutInflater
|
||||||
|
|
@ -15,6 +14,7 @@ import android.widget.LinearLayout
|
||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import com.remax.visualnovel.R
|
import com.remax.visualnovel.R
|
||||||
import com.remax.visualnovel.databinding.LayoutExpandSelectViewBinding
|
import com.remax.visualnovel.databinding.LayoutExpandSelectViewBinding
|
||||||
|
import com.remax.visualnovel.utils.spannablex.utils.dp
|
||||||
|
|
||||||
|
|
||||||
class ExpandSelectView @JvmOverloads constructor(
|
class ExpandSelectView @JvmOverloads constructor(
|
||||||
|
|
@ -35,7 +35,7 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun initView(context: Context, attrs: AttributeSet?) {
|
private fun initView(context: Context, attrs: AttributeSet?) {
|
||||||
mBinding = LayoutExpandSelectViewBinding.inflate(LayoutInflater.from(context))
|
mBinding = LayoutExpandSelectViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
setupAttributes(attrs)
|
setupAttributes(attrs)
|
||||||
setupClickListeners()
|
setupClickListeners()
|
||||||
}
|
}
|
||||||
|
|
@ -59,16 +59,17 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
mBinding.icon.setImageResource(resId)
|
mBinding.icon.setImageResource(resId)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setTitleText(title: String) {
|
fun setTitleText(titleRes: Int) {
|
||||||
mBinding.titleText.text = title
|
mBinding.titleText.text = context.resources.getString(titleRes)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setPopItems(newItems: List<SelectorItem>) {
|
fun setItems(newItems: List<SelectorItem>) {
|
||||||
items = newItems
|
items = newItems
|
||||||
updateItemsView()
|
updateItemsView()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private fun updateItemsView() {
|
private fun updateItemsView() {
|
||||||
mBinding.itemsContainer.removeAllViews()
|
mBinding.itemsContainer.removeAllViews()
|
||||||
|
|
||||||
|
|
@ -89,24 +90,16 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
val colorIndicator = itemView.findViewById<View>(R.id.colorIndicator)
|
val colorIndicator = itemView.findViewById<View>(R.id.colorIndicator)
|
||||||
val itemName = itemView.findViewById<TextView>(R.id.itemName)
|
val itemName = itemView.findViewById<TextView>(R.id.itemName)
|
||||||
val itemDesc = itemView.findViewById<TextView>(R.id.itemDesc)
|
val itemDesc = itemView.findViewById<TextView>(R.id.itemDesc)
|
||||||
val pointsInfo = itemView.findViewById<TextView>(R.id.pointsInfo)
|
|
||||||
val recommendedTag = itemView.findViewById<TextView>(R.id.recommendedTag)
|
val recommendedTag = itemView.findViewById<TextView>(R.id.recommendedTag)
|
||||||
val selectedDot = itemView.findViewById<View>(R.id.selectedDot)
|
val selectedDot = itemView.findViewById<View>(R.id.selectedDot)
|
||||||
|
|
||||||
// 设置颜色指示器
|
|
||||||
(colorIndicator.background as? GradientDrawable)?.setColor(item.color)
|
(colorIndicator.background as? GradientDrawable)?.setColor(item.color)
|
||||||
|
|
||||||
itemName.text = item.name
|
itemName.text = item.name
|
||||||
itemDesc.text = item.description
|
itemDesc.text = item.description
|
||||||
pointsInfo.text = item.pointsInfo
|
recommendedTag.text = item.pointsInfo
|
||||||
|
|
||||||
// 显示推荐标签
|
|
||||||
recommendedTag.visibility = if (item.isRecommended) View.VISIBLE else View.GONE
|
|
||||||
|
|
||||||
// 显示选中圆点
|
|
||||||
selectedDot.visibility = if (item.isSelected) View.VISIBLE else View.GONE
|
selectedDot.visibility = if (item.isSelected) View.VISIBLE else View.GONE
|
||||||
|
|
||||||
// 设置点击事件
|
|
||||||
itemView.setOnClickListener {
|
itemView.setOnClickListener {
|
||||||
selectItem(position)
|
selectItem(position)
|
||||||
itemSelectedListener?.onItemSelected(position, item)
|
itemSelectedListener?.onItemSelected(position, item)
|
||||||
|
|
@ -117,8 +110,10 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
|
|
||||||
private fun addDivider() {
|
private fun addDivider() {
|
||||||
val divider = View(context).apply {
|
val divider = View(context).apply {
|
||||||
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, 1).apply {
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, 1.dp).apply {
|
||||||
setBackgroundColor(Color.parseColor("#EEEEEE"))
|
setBackgroundColor(context.resources.getColor(R.color.chat_setting_divider_color))
|
||||||
|
marginStart = 10.dp
|
||||||
|
marginEnd = 10.dp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mBinding.itemsContainer.addView(divider)
|
mBinding.itemsContainer.addView(divider)
|
||||||
|
|
@ -148,7 +143,7 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
|
|
||||||
isExpanded = true
|
isExpanded = true
|
||||||
mBinding.itemsContainer.visibility = View.VISIBLE
|
mBinding.itemsContainer.visibility = View.VISIBLE
|
||||||
animateArrow(0f, 180f)
|
animateArrow(0f, 90f)
|
||||||
// param height anim
|
// param height anim
|
||||||
val animator = ValueAnimator.ofInt(0, getItemsHeight())
|
val animator = ValueAnimator.ofInt(0, getItemsHeight())
|
||||||
animator.duration = animationDuration.toLong()
|
animator.duration = animationDuration.toLong()
|
||||||
|
|
@ -167,7 +162,7 @@ class ExpandSelectView @JvmOverloads constructor(
|
||||||
if (!isExpanded) return
|
if (!isExpanded) return
|
||||||
|
|
||||||
isExpanded = false
|
isExpanded = false
|
||||||
animateArrow(180f, 0f)
|
animateArrow(90f, 0f)
|
||||||
// param height anim
|
// param height anim
|
||||||
val animator = ValueAnimator.ofInt(getItemsHeight(), 0)
|
val animator = ValueAnimator.ofInt(getItemsHeight(), 0)
|
||||||
animator.duration = animationDuration.toLong()
|
animator.duration = animationDuration.toLong()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,211 @@
|
||||||
|
package com.remax.visualnovel.ui.chat.ui.expandableSelector
|
||||||
|
|
||||||
|
import android.animation.Animator
|
||||||
|
import android.animation.AnimatorListenerAdapter
|
||||||
|
import android.animation.ObjectAnimator
|
||||||
|
import android.animation.ValueAnimator
|
||||||
|
import android.content.Context
|
||||||
|
import android.graphics.drawable.GradientDrawable
|
||||||
|
import android.util.AttributeSet
|
||||||
|
import android.view.LayoutInflater
|
||||||
|
import android.view.View
|
||||||
|
import android.view.animation.AccelerateDecelerateInterpolator
|
||||||
|
import android.widget.LinearLayout
|
||||||
|
import android.widget.TextView
|
||||||
|
import com.remax.visualnovel.R
|
||||||
|
import com.remax.visualnovel.databinding.LayoutExpandSelectViewBinding
|
||||||
|
import com.remax.visualnovel.utils.spannablex.utils.dp
|
||||||
|
|
||||||
|
|
||||||
|
class MaxNumView @JvmOverloads constructor(
|
||||||
|
context: Context,
|
||||||
|
attrs: AttributeSet? = null,
|
||||||
|
defStyleAttr: Int = 0
|
||||||
|
) : LinearLayout(context, attrs, defStyleAttr) {
|
||||||
|
|
||||||
|
private lateinit var mBinding: LayoutExpandSelectViewBinding
|
||||||
|
|
||||||
|
private var isExpanded = false
|
||||||
|
private var animationDuration = 300
|
||||||
|
private var items: List<SelectorItem> = emptyList()
|
||||||
|
private var itemSelectedListener: OnItemSelectedListener? = null
|
||||||
|
|
||||||
|
init {
|
||||||
|
initView(context, attrs)
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun initView(context: Context, attrs: AttributeSet?) {
|
||||||
|
mBinding = LayoutExpandSelectViewBinding.inflate(LayoutInflater.from(context), this, true)
|
||||||
|
setupAttributes(attrs)
|
||||||
|
setupClickListeners()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupAttributes(attrs: AttributeSet?) {
|
||||||
|
attrs?.let {
|
||||||
|
val typedArray = context.obtainStyledAttributes(it, R.styleable.ExpandableSelector)
|
||||||
|
val title = typedArray.getString(R.styleable.ExpandableSelector_titleText)
|
||||||
|
title?.let { mBinding.titleText.text = it }
|
||||||
|
animationDuration = typedArray.getInt(R.styleable.ExpandableSelector_animationDuration, 300)
|
||||||
|
typedArray.recycle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun setupClickListeners() {
|
||||||
|
mBinding.titleLayout.setOnClickListener { toggle() }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun setTitleIcon(resId: Int) {
|
||||||
|
mBinding.icon.setImageResource(resId)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setTitleText(titleRes: Int) {
|
||||||
|
mBinding.titleText.text = context.resources.getString(titleRes)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setItems(newItems: List<SelectorItem>) {
|
||||||
|
items = newItems
|
||||||
|
updateItemsView()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private fun updateItemsView() {
|
||||||
|
mBinding.itemsContainer.removeAllViews()
|
||||||
|
|
||||||
|
items.forEachIndexed { index, item ->
|
||||||
|
val itemView = createItemView(item, index)
|
||||||
|
mBinding.itemsContainer.addView(itemView)
|
||||||
|
|
||||||
|
if (index < items.size - 1) {
|
||||||
|
addDivider()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun createItemView(item: SelectorItem, position: Int): View {
|
||||||
|
val itemView = LayoutInflater.from(context)
|
||||||
|
.inflate(R.layout.layout_expand_view_item, mBinding.itemsContainer, false)
|
||||||
|
|
||||||
|
val colorIndicator = itemView.findViewById<View>(R.id.colorIndicator)
|
||||||
|
val itemName = itemView.findViewById<TextView>(R.id.itemName)
|
||||||
|
val itemDesc = itemView.findViewById<TextView>(R.id.itemDesc)
|
||||||
|
val recommendedTag = itemView.findViewById<TextView>(R.id.recommendedTag)
|
||||||
|
val selectedDot = itemView.findViewById<View>(R.id.selectedDot)
|
||||||
|
|
||||||
|
(colorIndicator.background as? GradientDrawable)?.setColor(item.color)
|
||||||
|
|
||||||
|
itemName.text = item.name
|
||||||
|
itemDesc.text = item.description
|
||||||
|
recommendedTag.text = item.pointsInfo
|
||||||
|
selectedDot.visibility = if (item.isSelected) VISIBLE else GONE
|
||||||
|
|
||||||
|
itemView.setOnClickListener {
|
||||||
|
selectItem(position)
|
||||||
|
itemSelectedListener?.onItemSelected(position, item)
|
||||||
|
}
|
||||||
|
|
||||||
|
return itemView
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun addDivider() {
|
||||||
|
val divider = View(context).apply {
|
||||||
|
layoutParams = LayoutParams(LayoutParams.MATCH_PARENT, 1.dp).apply {
|
||||||
|
setBackgroundColor(context.resources.getColor(R.color.chat_setting_divider_color))
|
||||||
|
marginStart = 10.dp
|
||||||
|
marginEnd = 10.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
mBinding.itemsContainer.addView(divider)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun selectItem(position: Int) {
|
||||||
|
items.forEachIndexed { index, item ->
|
||||||
|
item.isSelected = index == position
|
||||||
|
}
|
||||||
|
updateItemsView()
|
||||||
|
|
||||||
|
if (position in items.indices) {
|
||||||
|
mBinding.titleText.text = items[position].name
|
||||||
|
}
|
||||||
|
|
||||||
|
collapse()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun toggle() {
|
||||||
|
if (isExpanded) collapse() else expand()
|
||||||
|
}
|
||||||
|
|
||||||
|
fun expand() {
|
||||||
|
if (isExpanded) return
|
||||||
|
|
||||||
|
isExpanded = true
|
||||||
|
mBinding.itemsContainer.visibility = VISIBLE
|
||||||
|
animateArrow(0f, 90f)
|
||||||
|
// param height anim
|
||||||
|
val animator = ValueAnimator.ofInt(0, getItemsHeight())
|
||||||
|
animator.duration = animationDuration.toLong()
|
||||||
|
animator.interpolator = AccelerateDecelerateInterpolator()
|
||||||
|
animator.addUpdateListener { animation ->
|
||||||
|
val value = animation.animatedValue as Int
|
||||||
|
val params = mBinding.itemsContainer.layoutParams
|
||||||
|
params.height = value
|
||||||
|
mBinding.itemsContainer.layoutParams = params
|
||||||
|
}
|
||||||
|
animator.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fun collapse() {
|
||||||
|
if (!isExpanded) return
|
||||||
|
|
||||||
|
isExpanded = false
|
||||||
|
animateArrow(90f, 0f)
|
||||||
|
// param height anim
|
||||||
|
val animator = ValueAnimator.ofInt(getItemsHeight(), 0)
|
||||||
|
animator.duration = animationDuration.toLong()
|
||||||
|
animator.interpolator = AccelerateDecelerateInterpolator()
|
||||||
|
animator.addUpdateListener { animation ->
|
||||||
|
val value = animation.animatedValue as Int
|
||||||
|
val params = mBinding.itemsContainer.layoutParams
|
||||||
|
params.height = value
|
||||||
|
mBinding.itemsContainer.layoutParams = params
|
||||||
|
}
|
||||||
|
animator.addListener(object : AnimatorListenerAdapter() {
|
||||||
|
override fun onAnimationEnd(animation: Animator) {
|
||||||
|
mBinding.itemsContainer.visibility = GONE
|
||||||
|
}
|
||||||
|
})
|
||||||
|
animator.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun animateArrow(from: Float, to: Float) {
|
||||||
|
val rotation = ObjectAnimator.ofFloat(mBinding.arrow, "rotation", from, to)
|
||||||
|
rotation.duration = animationDuration.toLong()
|
||||||
|
rotation.interpolator = AccelerateDecelerateInterpolator()
|
||||||
|
rotation.start()
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getItemsHeight(): Int {
|
||||||
|
var height = 0
|
||||||
|
for (i in 0 until mBinding.itemsContainer.childCount) {
|
||||||
|
val child = mBinding.itemsContainer.getChildAt(i)
|
||||||
|
child.measure(
|
||||||
|
MeasureSpec.makeMeasureSpec(width, MeasureSpec.EXACTLY),
|
||||||
|
MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)
|
||||||
|
)
|
||||||
|
height += child.measuredHeight
|
||||||
|
}
|
||||||
|
return height
|
||||||
|
}
|
||||||
|
|
||||||
|
fun setOnItemSelectedListener(listener: OnItemSelectedListener) {
|
||||||
|
this.itemSelectedListener = listener
|
||||||
|
}
|
||||||
|
|
||||||
|
interface OnItemSelectedListener {
|
||||||
|
fun onItemSelected(position: Int, item: SelectorItem)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -94,8 +94,8 @@ class SwitchView @JvmOverloads constructor(
|
||||||
val normal: Int
|
val normal: Int
|
||||||
val checked: Int
|
val checked: Int
|
||||||
if (style == 0) {
|
if (style == 0) {
|
||||||
normal = R.string.color_surface_white_normal
|
normal = R.string.switch_view_normal
|
||||||
checked = R.string.color_surface_white_normal
|
checked = R.string.switch_view_checked
|
||||||
} else {
|
} else {
|
||||||
normal = R.string.color_txt_secondary_normal
|
normal = R.string.color_txt_secondary_normal
|
||||||
checked = R.string.color_surface_white_normal
|
checked = R.string.color_surface_white_normal
|
||||||
|
|
@ -147,13 +147,13 @@ class SwitchView @JvmOverloads constructor(
|
||||||
val stroke: Int
|
val stroke: Int
|
||||||
if (style == 0) {
|
if (style == 0) {
|
||||||
if (isBg) {
|
if (isBg) {
|
||||||
normal = R.string.color_transparent
|
normal = R.string.switch_view_stroke
|
||||||
checked = R.string.color_primary_normal
|
checked = R.string.switch_view_stroke
|
||||||
stroke = R.string.color_surface_element_normal
|
stroke = R.string.switch_view_stroke
|
||||||
} else {
|
} else {
|
||||||
normal = R.string.color_surface_element_normal
|
normal = R.string.switch_view_stroke
|
||||||
checked = R.string.color_transparent
|
checked = R.string.switch_view_stroke
|
||||||
stroke = R.string.color_transparent
|
stroke = R.string.switch_view_stroke
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isBg) {
|
if (isBg) {
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle"
|
||||||
|
>
|
||||||
|
<size
|
||||||
|
android:width="285dp"
|
||||||
|
android:height="231dp"
|
||||||
|
/>
|
||||||
|
<corners
|
||||||
|
android:topLeftRadius="0dp"
|
||||||
|
android:topRightRadius="0dp"
|
||||||
|
android:bottomLeftRadius="15dp"
|
||||||
|
android:bottomRightRadius="15dp" />
|
||||||
|
|
||||||
|
<solid android:color="#fff5f5ff" />
|
||||||
|
</shape>
|
||||||
|
|
@ -4,7 +4,9 @@
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:id="@+id/drawer_menu"
|
android:id="@+id/drawer_menu"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent" >
|
android:layout_height="match_parent"
|
||||||
|
android:fitsSystemWindows="false"
|
||||||
|
>
|
||||||
|
|
||||||
<!-- 页面内容 -->
|
<!-- 页面内容 -->
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout
|
<com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout
|
||||||
|
|
@ -31,6 +33,7 @@
|
||||||
>
|
>
|
||||||
|
|
||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
|
android:id="@+id/rv_msg"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="0dp"
|
android:layout_height="0dp"
|
||||||
android:layout_marginBottom="-55dp"
|
android:layout_marginBottom="-55dp"
|
||||||
|
|
@ -54,7 +57,7 @@
|
||||||
|
|
||||||
<!-- 右侧抽屉菜单View -->
|
<!-- 右侧抽屉菜单View -->
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
||||||
android:layout_width="240dp"
|
android:layout_width="320dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
|
||||||
|
|
@ -3,11 +3,11 @@
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
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"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="wrap_content"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal"
|
android:orientation="horizontal"
|
||||||
app:backgroundColorToken="@string/color_surface_base_disabled"
|
app:backgroundColorToken="@string/color_chat_setting_item_bg"
|
||||||
app:radiusToken="@string/radius_l"
|
app:radiusToken="@string/radius_m"
|
||||||
android:padding="@dimen/dp_12"
|
android:padding="@dimen/dp_12"
|
||||||
>
|
>
|
||||||
|
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
android:id="@+id/iv_right"
|
android:id="@+id/iv_right"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginStart="@dimen/dp_9"
|
android:layout_marginStart="@dimen/dp_9"
|
||||||
android:src="@mipmap/setting_arrow_right"
|
android:src="@mipmap/setting_arrow_right"
|
||||||
android:textSize="12sp"
|
android:textSize="12sp"
|
||||||
|
|
@ -38,13 +38,72 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="10dp" >
|
android:layout_marginTop="10dp" >
|
||||||
<include
|
|
||||||
android:id="@+id/short_text_model"
|
<com.remax.visualnovel.ui.chat.ui.expandableSelector.ExpandSelectView
|
||||||
layout="@layout/include_setting_item"
|
android:id="@+id/ai_model_selector"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
<!--short text mode-->
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout
|
||||||
|
android:id="@+id/ai_model_short_text_switcher"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp_5"
|
||||||
|
app:backgroundColorToken="@string/color_chat_setting_item_bg"
|
||||||
|
app:radiusToken="@string/radius_m"
|
||||||
|
android:padding="@dimen/dp_12"
|
||||||
|
>
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
|
android:id="@+id/iv_left_short_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:src="@mipmap/setting_short_text"
|
||||||
|
/>
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/tv_title_short_text_mode"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="start"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:text="@string/short_text_mode"
|
||||||
|
android:textColor="@color/gray6"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/switch_short_text"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/iv_left_short_text"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
<com.remax.visualnovel.widget.ui.SwitchView
|
||||||
|
android:id="@+id/switch_short_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_10"
|
||||||
|
app:switchColorStyle="purple"
|
||||||
|
app:switchSize="small"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
</com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout>
|
||||||
|
|
||||||
</com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout>
|
</com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Sound related -->
|
<!-- Sound related -->
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
|
|
@ -60,9 +119,87 @@
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="10dp" >
|
android:layout_marginTop="10dp" >
|
||||||
|
|
||||||
|
<!-- sound selector -->
|
||||||
|
<com.remax.visualnovel.ui.chat.ui.expandableSelector.ExpandSelectView
|
||||||
|
android:id="@+id/sound_actor_selector"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!--play dialogue only-->
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout
|
||||||
|
android:id="@+id/play_dialogue_only_switcher"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp_5"
|
||||||
|
app:backgroundColorToken="@string/color_chat_setting_item_bg"
|
||||||
|
app:radiusToken="@string/radius_m"
|
||||||
|
android:padding="@dimen/dp_12"
|
||||||
|
>
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
|
android:id="@+id/iv_left_play_dialogue_only"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="@dimen/dp_10"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintStart_toStartOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
android:src="@mipmap/setting_short_text"
|
||||||
|
/>
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/tv_title_play_dialogue_only"
|
||||||
|
android:layout_width="0dp"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginHorizontal="8dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:gravity="start"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:text="@string/play_dialogue_only"
|
||||||
|
android:textColor="@color/gray6"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toStartOf="@+id/switch_play_dialogue_only"
|
||||||
|
app:layout_constraintStart_toEndOf="@+id/iv_left_play_dialogue_only"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
<com.remax.visualnovel.widget.ui.SwitchView
|
||||||
|
android:id="@+id/switch_play_dialogue_only"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginStart="@dimen/dp_10"
|
||||||
|
app:switchColorStyle="purple"
|
||||||
|
app:switchSize="small"
|
||||||
|
app:layout_constraintBottom_toBottomOf="parent"
|
||||||
|
app:layout_constraintEnd_toEndOf="parent"
|
||||||
|
app:layout_constraintTop_toTopOf="parent"
|
||||||
|
/>
|
||||||
|
</com.remax.visualnovel.widget.uitoken.view.UITokenConstraintLayout>
|
||||||
|
|
||||||
</com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout>
|
</com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout>
|
||||||
|
|
||||||
<!-- Appearancerelated -->
|
<!--Maximum number of response tokens-->
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="28dp"
|
||||||
|
android:text="@string/setting_max_response_num"
|
||||||
|
android:textColor="@color/gray3"
|
||||||
|
android:textSize="@dimen/sp_16"
|
||||||
|
/>
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="10dp" >
|
||||||
|
|
||||||
|
|
||||||
|
</com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- Appearance related -->
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,17 @@
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
|
|
||||||
<RelativeLayout
|
<com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout
|
||||||
android:id="@+id/titleLayout"
|
android:id="@+id/titleLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="56dp"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="16dp"
|
app:backgroundColorToken="@string/color_chat_setting_item_bg"
|
||||||
android:paddingEnd="16dp"
|
app:radiusToken="@string/radius_m"
|
||||||
android:background="?attr/selectableItemBackground">
|
android:padding="@dimen/dp_12"
|
||||||
|
>
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
android:id="@+id/icon"
|
android:id="@+id/icon"
|
||||||
|
|
@ -37,7 +39,7 @@
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:src="@mipmap/setting_arrow_right"/>
|
android:src="@mipmap/setting_arrow_right"/>
|
||||||
|
|
||||||
</RelativeLayout>
|
</com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout>
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
||||||
android:id="@+id/itemsContainer"
|
android:id="@+id/itemsContainer"
|
||||||
|
|
@ -45,6 +47,7 @@
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:layout_marginTop="@dimen/dp_2"
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
|
android:background="@drawable/bg_expand_view_items"
|
||||||
android:visibility="gone"/>
|
android:visibility="gone"/>
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
@ -1,67 +1,63 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="72dp"
|
android:layout_height="wrap_content"
|
||||||
android:paddingStart="16dp"
|
android:padding="@dimen/dp_12" >
|
||||||
android:paddingEnd="16dp"
|
|
||||||
android:background="?attr/selectableItemBackground"
|
|
||||||
android:paddingTop="12dp"
|
|
||||||
android:paddingBottom="12dp">
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/colorIndicator"
|
android:id="@+id/colorIndicator"
|
||||||
android:layout_width="12dp"
|
android:layout_width="@dimen/dp_25"
|
||||||
android:layout_height="12dp"
|
android:layout_height="@dimen/dp_25"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:background="@drawable/circle_shape"/>
|
android:background="@drawable/circle_shape"/>
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
|
||||||
android:id="@+id/itemName"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toEndOf="@id/colorIndicator"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:textSize="16sp"
|
|
||||||
android:textColor="#333333"/>
|
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
|
||||||
android:id="@+id/itemDesc"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_toEndOf="@id/colorIndicator"
|
|
||||||
android:layout_below="@id/itemName"
|
|
||||||
android:layout_marginStart="12dp"
|
|
||||||
android:layout_marginTop="4dp"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#666666"/>
|
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
|
||||||
android:id="@+id/pointsInfo"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:textSize="12sp"
|
|
||||||
android:textColor="#666666"
|
|
||||||
android:gravity="end"/>
|
|
||||||
|
|
||||||
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
|
||||||
android:id="@+id/recommendedTag"
|
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_above="@id/pointsInfo"
|
|
||||||
android:textSize="@dimen/sp_10"
|
|
||||||
android:textColor="#FF6B35"
|
|
||||||
android:visibility="gone"/>
|
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/selectedDot"
|
android:id="@+id/selectedDot"
|
||||||
android:layout_width="8dp"
|
android:layout_width="@dimen/dp_13"
|
||||||
android:layout_height="8dp"
|
android:layout_height="@dimen/dp_13"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:layout_centerVertical="true"
|
android:layout_centerVertical="true"
|
||||||
android:background="@drawable/circle_selected"
|
android:background="@drawable/circle_selected"
|
||||||
android:visibility="gone"/>
|
android:visibility="visible"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toRightOf="@+id/colorIndicator"
|
||||||
|
android:layout_toLeftOf="@+id/selectedDot"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginHorizontal="@dimen/dp_7"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/itemName"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/sp_14"
|
||||||
|
android:textColor="@color/gray3"/>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/itemDesc"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textStyle="italic"
|
||||||
|
android:textSize="@dimen/sp_10"
|
||||||
|
android:textColor="@color/chat_setting_ai_model_des_color"/>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/recommendedTag"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:textSize="@dimen/sp_11"
|
||||||
|
android:textColor="@color/chat_setting_ai_model_recommend_color"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout>
|
</com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout>
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout
|
||||||
|
android:id="@+id/titleLayout"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
app:backgroundColorToken="@string/color_chat_setting_item_bg"
|
||||||
|
app:radiusToken="@string/radius_m"
|
||||||
|
android:padding="@dimen/dp_12"
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
|
android:id="@+id/icon"
|
||||||
|
android:layout_width="24dp"
|
||||||
|
android:layout_height="24dp"
|
||||||
|
android:layout_centerVertical="true" />
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenTextView
|
||||||
|
android:id="@+id/titleText"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_toEndOf="@id/icon"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="12dp"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:textColor="#333333"
|
||||||
|
android:textStyle="normal"/>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenImageView
|
||||||
|
android:id="@+id/arrow"
|
||||||
|
android:layout_width="16dp"
|
||||||
|
android:layout_height="16dp"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:src="@mipmap/setting_arrow_right"/>
|
||||||
|
|
||||||
|
</com.remax.visualnovel.widget.uitoken.view.UITokenRelativeLayout>
|
||||||
|
|
||||||
|
<com.remax.visualnovel.widget.uitoken.view.UITokenLinearLayout
|
||||||
|
android:id="@+id/itemsContainer"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_marginTop="@dimen/dp_2"
|
||||||
|
android:background="@drawable/bg_expand_view_items"
|
||||||
|
android:visibility="gone"/>
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 1.1 KiB |
|
|
@ -193,7 +193,18 @@
|
||||||
<color name="grayf6">#fff6f6f6</color>
|
<color name="grayf6">#fff6f6f6</color>
|
||||||
|
|
||||||
<!-- chat settings -->
|
<!-- chat settings -->
|
||||||
<color name="glo_color_chat_setting_item_bg">#fff6f6f6</color>
|
<color name="glo_color_chat_setting_item_bg">#F6F6F6</color>
|
||||||
|
<color name="glo_color_switchview_normal">#FFFFFF</color>
|
||||||
|
<color name="glo_color_switchview_checked">#ff00cc88</color>
|
||||||
|
<color name="glo_color_switchview_stroke">#ff020025</color>
|
||||||
|
|
||||||
|
<color name="chat_setting_ai_model_des_color">#ff9494c3</color>
|
||||||
|
<color name="chat_setting_ai_model_recommend_color">#ff0066ff</color>
|
||||||
|
|
||||||
|
<color name="chat_setting_divider_color">#ffececf9</color>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -476,5 +476,8 @@
|
||||||
<string name="setting_background">Background</string>
|
<string name="setting_background">Background</string>
|
||||||
<string name="setting_history">History Archives</string>
|
<string name="setting_history">History Archives</string>
|
||||||
<string name="setting_delete">DELETE</string>
|
<string name="setting_delete">DELETE</string>
|
||||||
|
<string name="short_text_mode">Short Text Mode</string>
|
||||||
|
<string name="play_dialogue_only">Play dialogue only</string>
|
||||||
|
<string name="setting_max_response_num">Maximum number of response tokens</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
@ -205,4 +205,10 @@
|
||||||
|
|
||||||
<!-- new added -->
|
<!-- new added -->
|
||||||
<string name="color_chat_setting_item_bg" translatable="false">color.chat.setting.item.bg</string>
|
<string name="color_chat_setting_item_bg" translatable="false">color.chat.setting.item.bg</string>
|
||||||
|
|
||||||
|
<string name="switch_view_normal" translatable="false">color.switch.view.normal</string>
|
||||||
|
<string name="switch_view_checked" translatable="false">color.switch.view.checked</string>
|
||||||
|
<string name="switch_view_stroke" translatable="false">color.switch.view.stroke</string>
|
||||||
|
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
Loading…
Reference in New Issue