消息页UI修改

This commit is contained in:
huangjian
2021-12-16 11:31:53 +08:00
parent bbc5a21f4a
commit d79d273db6
32 changed files with 78 additions and 100 deletions

View File

@@ -377,8 +377,7 @@ class GameRoomFragment() : BaseMvpFragment<IGameRoomView?, GameRoomPresenter?>()
RoomEvent.DOWN_MIC -> {
if (AvRoomDataManager.get().isOwner(roomEvent.account)) {
//自己的消息
gameDelegate.notifySelfPlayingState(false)
gameDelegate.notifySelfInState(false)
gameDelegate.exitGame()
}
onDownMicro(roomEvent.micPosition)
}

View File

@@ -91,6 +91,30 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
login(loginCallback)
}
fun updateGame(mgId: Long?) {
if (mgId == null || mgId == 0L || mgId == mMGID || iSudFSTAPP == null) return
mMGID = mgId
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
loadMG(activity, mUid, mRoomID, APP_CODE, mMGID, mLanguage)
}
fun exitGame() {
notifySelfPlayingState(false)
notifySelfInState(false)
}
/**
* 例如"你画我猜"游戏的文字命中
*/
fun hitTheMark(msg: String) {
mKeyWord?.let {
if (msg.contains(it)) {
notifySelfTextHit(it, msg)
}
}
}
/**
* "接入方客户端"登陆接口, 从"接入方服务端"获得Code
* "接入方服务端"是通过"服务端接入SDK"获得Code来返回给"接入方客户端"的
@@ -108,13 +132,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
fun updateGame(mgId: Long?) {
if (mgId == null || mgId == 0L || mgId == mMGID || iSudFSTAPP == null) return
mMGID = mgId
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
loadMG(activity, mUid, mRoomID, APP_CODE, mMGID, mLanguage)
}
/**
* 1初始化游戏SDK
*
@@ -173,16 +190,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
SingleToastUtil.showToast(content)
}
/**
* 例如"你画我猜"游戏的文字命中
*/
fun hitTheMark(msg: String) {
mKeyWord?.let {
if (msg.contains(it)) {
notifySelfTextHit(it, msg)
}
}
}
/**
* 通知"文字命中状态"到游戏端
@@ -515,7 +522,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
}
fun notifySelfInState(isIn: Boolean, seatIndex: Int = -1) {
private fun notifySelfInState(isIn: Boolean, seatIndex: Int = -1) {
try {
if (!isIn) {
notifySelfReadyState(false)
@@ -555,7 +562,7 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
}
fun notifySelfPlayingState(isPlaying: Boolean) {
private fun notifySelfPlayingState(isPlaying: Boolean) {
try {
//状态名称
val state = SudMGPAPPState.APP_COMMON_SELF_PLAYING
@@ -639,8 +646,6 @@ class GameDelegate(val activity: Activity, val container: FrameLayout, var mgId:
}
fun onDestroy() {
notifySelfPlayingState(false)
notifySelfInState(false)
updateMyMicQueue(GameStatus.STATUS_NOT_JOIN)
iSudFSTAPP?.destroyMG()
}

View File

@@ -10,6 +10,7 @@ import androidx.fragment.app.Fragment
import androidx.fragment.app.activityViewModels
import com.scwang.smartrefresh.layout.internal.ProgressDrawable
import com.yizhuan.erban.R
import com.yizhuan.erban.avroom.activity.AVRoomActivity
import com.yizhuan.erban.avroom.adapter.RoomVPAdapter
import com.yizhuan.erban.base.BaseActivity
import com.yizhuan.erban.base.BaseFragment
@@ -107,23 +108,9 @@ class RecommendFragment : BaseFragment(),
dialogManager.dismissDialog()
it?.let {
if (it.isPick) {
RecommendRoomDialog.newInstance(it).show(context)
AVRoomActivity.start(context, it.uid)
} else {
dialogManager.showOkCancelDialog(
it.failContext,
"新建游戏房间",
"交友畅聊",
true,
object : DialogManager.OkCancelDialogListener {
override fun onOk() {
OpenRoomHelper.openHomePartyRoom(requireActivity() as BaseActivity)
}
override fun onCancel() {
OpenRoomHelper.openRoom(requireActivity() as BaseActivity)
}
})
RecommendRoomDialog.newInstance(it).show(context)
}
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/item_hover_nim" android:state_pressed="true" />
<item android:drawable="@color/item_hover_nim" android:state_focused="true" />
<item android:drawable="@color/white" android:state_pressed="true" />
<item android:drawable="@color/white" android:state_focused="true" />
<item android:drawable="@color/bg_normal_1c1b22" />
</selector>

View File

@@ -2,6 +2,6 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:color="#7154EE"
android:color="#FFBC52"
android:width="1dp" />
</shape>

View File

@@ -35,7 +35,7 @@
android:layout_marginEnd="2dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="15sp"
tools:text="我的我的我的我的我的我的"
app:layout_flexShrink="1"

View File

@@ -4,7 +4,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/tv_msg"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="14sp"
android:maxWidth="215dp"
tools:text="恭喜您,获得抽奖机会,点我抽奖>>" />

View File

@@ -16,7 +16,7 @@
android:gravity="center"
android:layout_gravity="center"
tools:text="你领取了一个红包"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="@dimen/dp_13"
tools:ignore="SpUsage" />

View File

@@ -6,6 +6,6 @@
android:layout_height="wrap_content"
android:maxWidth="215dp"
android:padding="@dimen/dp_5"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="14sp"
tools:text="恭喜您,获得抽奖机会,点我抽奖>>" />

View File

@@ -25,7 +25,7 @@
android:id="@+id/tip_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:layout_gravity="center_vertical"
android:layout_marginLeft="12dp"
android:layout_marginRight="12dp"

View File

@@ -11,7 +11,7 @@
<TextView
android:id="@+id/tv_title"
tools:text="点我!点我!点我!"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="@dimen/sp_16"
android:paddingStart="@dimen/dp_9"
android:paddingEnd="@dimen/dp_9"
@@ -27,7 +27,7 @@
android:paddingStart="@dimen/dp_9"
android:paddingEnd="@dimen/dp_9"
android:gravity="center"
android:textColor="@color/white"
android:textColor="@color/text_secondary_4f516a"
android:textSize="@dimen/sp_14"
tools:text="提醒签到消息" />

View File

@@ -35,7 +35,7 @@
android:layout_marginEnd="2dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="15sp"
app:layout_flexShrink="1"
tools:text="我的我的我的我的我的我的" />

View File

@@ -41,7 +41,7 @@
android:layout_marginEnd="2dp"
android:ellipsize="end"
android:lines="1"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="15sp"
tools:text="我的我的我的我的我的我的"
app:layout_flexShrink="1"

View File

@@ -146,7 +146,7 @@ public class HallMsgViewHolder extends MsgViewHolderBase{
return;
}
// title
setupView(tvTitle, hallMsgLayout.getTitle());
tvTitle.setText(hallMsgLayout.getTitle().getContent());
// content
List<HallMsgComponent> erbanSysMsgLayoutContent = hallMsgLayout.getContents();
if (erbanSysMsgLayoutContent != null) {
@@ -208,20 +208,6 @@ public class HallMsgViewHolder extends MsgViewHolderBase{
}
private void setupView(TextView view, HallMsgComponent component) {
if (component != null) {
setupComponent(view, component.getContent(),
component.getFontColor(), component.getFontSize(),
component.getRouterType(), component.getRouterValue());
}
}
private void setupComponent(TextView view, String text, String textColor, float fontSize,
int routerType, int routerValue) {
view.setText(text);
view.setTextColor(Color.parseColor(textColor));
view.setTextSize(fontSize);
}
private void handleClick(HallImMsgInfo info, int second) {
stvAgree.setOnClickListener(v -> handleApply(info, second, 1));

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#7154EE" />
<solid android:color="#FFBC52" />
<size
android:width="120dp"
android:height="43dp" />

View File

@@ -12,6 +12,6 @@
android:includeFontPadding="false"
android:lineSpacingExtra="3dip"
android:maxWidth="222dp"
android:textColor="@color/white"
android:textColor="@color/text_title_white"
android:textSize="@dimen/dp_13"/>
</LinearLayout>

View File

@@ -56,7 +56,7 @@ public class RoomInviteFansActivity extends BaseActivity {
getInviteError(throwable.getMessage())
)
.subscribe(info -> {
tvInviteFansCount.setText(Html.fromHtml("确认邀请后会给收藏该房间的共"+"<font color=#7154EE font-size=12dp>"+info.getFansNum()+"</font>"+"位用户发送提醒"));
tvInviteFansCount.setText(Html.fromHtml("确认邀请后会给收藏该房间的共"+"<font color=#FFBC52 font-size=12dp>"+info.getFansNum()+"</font>"+"位用户发送提醒"));
tvInviteFansTimes.setText(Html.fromHtml("今日剩余"+"<font color=#7662FE font-size=18dp>"+info.getInviteTimes()+"</font>"+""));
tvInviteFansConfirm.setBackground(getResources().getDrawable(R.drawable.bg_common_confirm_normal));
if (info.getInviteInterval() > 0){
@@ -92,7 +92,7 @@ public class RoomInviteFansActivity extends BaseActivity {
RoomInviteFansModel.INSTANCE.setRoomInviteFans(AvRoomDataManager.get().mCurrentRoomInfo.getUid())
.doOnError(throwable -> SingleToastUtil.showToastShort(throwable.getMessage()))
.subscribe(info -> {
tvInviteFansCount.setText(Html.fromHtml("确认邀请后会给收藏该房间的"+"<font color=#7154EE font-size=12dp>"+info.getFansNum()+"</font>"+"位用户发送提醒"));
tvInviteFansCount.setText(Html.fromHtml("确认邀请后会给收藏该房间的"+"<font color=#FFBC52 font-size=12dp>"+info.getFansNum()+"</font>"+"位用户发送提醒"));
tvInviteFansTimes.setText(Html.fromHtml("今日剩余"+"<font color=#7662FE font-size=18dp>"+info.getInviteTimes()+"</font>"+""));
tvInviteFansConfirm.setBackground(getResources().getDrawable(R.drawable.bg_common_confirm_normal));
if (info.getInviteInterval() > 0){

View File

@@ -33,14 +33,14 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/find_new"
android:textColor="@color/white"
android:textColor="@color/text_normal_c6c6e9"
android:textSize="@dimen/dp_18" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="每日更新推荐"
android:textColor="@color/text_normal_c6c6e9"
android:textColor="@color/text_secondary_4f516a"
android:textSize="@dimen/dp_13" />
</LinearLayout>
@@ -51,7 +51,7 @@
android:layout_gravity="center_vertical"
android:layout_marginStart="@dimen/dp_15"
android:padding="@dimen/dp_8"
android:src="@drawable/arrow_left_white" />
android:src="@drawable/arrow_left" />
</FrameLayout>

View File

@@ -49,7 +49,7 @@
android:id="@+id/iv_back"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/arrow_left_white"
android:src="@drawable/arrow_left"
android:layout_marginStart="@dimen/dp_15"
android:layout_gravity="center_vertical"
/>

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#35354B" />
<solid android:color="#F4F4FA" />
<corners android:radius="15dp" />
</shape>

View File

@@ -13,6 +13,6 @@
android:topLeftRadius="4dp"
android:topRightRadius="20dp"/>
<solid android:color="@color/color_2a2a39"/>
<solid android:color="@color/white"/>
</shape>

View File

@@ -13,6 +13,6 @@
android:bottomRightRadius="20dp"
android:bottomLeftRadius="20dp"/>
<solid android:color="@color/color_2a2a39"/>
<solid android:color="@color/white"/>
</shape>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#35354B" />
<solid android:color="@color/white" />
<corners android:topLeftRadius="15dp"
android:topRightRadius="15dp"
android:bottomRightRadius="15dp"

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/color_1c1b22" android:state_pressed="true" />
<item android:drawable="@color/color_2a2a39" android:state_pressed="false" />
<item android:drawable="@color/color_2a2a39" />
<item android:drawable="@color/color_f4f4fa" android:state_pressed="true" />
<item android:drawable="@color/white" android:state_pressed="false" />
<item android:drawable="@color/white" />
</selector>

View File

@@ -4,7 +4,7 @@
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/color_2a2a39"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/nim_message_activity_text_layout"/>

View File

@@ -56,24 +56,24 @@
<EditText
android:id="@+id/editTextMessage"
android:textCursorDrawable="@null"
android:textColor="@color/color_C6C6E9"
android:layout_width="match_parent"
android:layout_height="30dp"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/bottom_component_margin_horizontal"
android:layout_toStartOf="@+id/emoji_button"
android:layout_toEndOf="@+id/switchLayout"
android:autoLink="web|email|phone"
android:maxLength="40"
android:layout_centerVertical="true"
android:background="@drawable/bg_message_input"
android:hint="@string/message_hint"
android:imeOptions="actionSend"
android:inputType="text"
android:hint="@string/message_hint"
android:textColorHint="@color/text_hint_555574"
android:maxLength="40"
android:maxLines="4"
android:paddingStart="@dimen/dp_10"
android:paddingEnd="10dp"
android:background="@drawable/bg_message_input"
android:maxLines="4"
android:textColor="@color/color_C6C6E9"
android:textColorHint="@color/text_hint_555574"
android:textCursorDrawable="@null"
android:textSize="13sp" />
<ImageView

View File

@@ -18,7 +18,7 @@
android:background="@drawable/nim_bg_message_tip"
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:textColor="@color/text_hint_555574"
android:textColor="@color/color_grey_999999"
android:textSize="10sp"
android:visibility="gone" />

View File

@@ -11,7 +11,7 @@
android:gravity="center"
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:textColor="#ffffff"
android:textColor="@color/color_black_333333"
android:textSize="12sp"/>
</merge>

View File

@@ -16,6 +16,6 @@
android:maxWidth="238dp"
android:minWidth="40dp"
android:minHeight="40dp"
android:textColor="@color/white"
android:textColor="@color/color_black_333333"
android:textSize="13sp" />
</LinearLayout>

View File

@@ -13,7 +13,7 @@
android:background="@drawable/nim_bg_message_tip"
android:paddingLeft="7dip"
android:paddingRight="7dip"
android:textColor="#ffffff"
android:textColor="@color/color_black_333333"
android:textSize="12sp"
tools:text="12312313" />
</LinearLayout>

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<color name="nim_app_color">#7154EE</color>
<color name="nim_app_color_press">#7154EE</color>
<color name="nim_app_color">#FFBC52</color>
<color name="nim_app_color_press">#FFBC52</color>
<color name="transparent">#00000000</color>
<color name="white">#FFFFFF</color>
@@ -69,11 +69,12 @@
<color name="robot_link_element_text_blue">#248DFA</color>
<color name="color_FAFAFA">#FAFAFA</color>
<color name="color_B3B3B3">#B3B3B3</color>
<color name="color_7154EE">#7154EE</color>
<color name="color_7154EE">#FFBC52</color>
<color name="color_BAB0FF">#BAB0FF</color>
<color name="color_2a2a39">#2A2A39</color>
<color name="color_1c1b22">#1C1B22</color>
<color name="color_C6C6E9">#C6C6E9</color>
<color name="text_hint_555574">#555574</color>
<color name="color_C6C6E9">#ff333333</color>
<color name="text_hint_555574">#B3333333</color>
<color name="color_f4f4fa">#FFF4F4FA</color>
</resources>

View File

@@ -38,7 +38,7 @@ public class MsgViewHolderText extends MsgViewHolderBase {
@Override
protected void bindContentView() {
bodyTextView.setTextColor(ContextCompat.getColor(context, isReceivedMessage() ? R.color.white : R.color.color_C6C6E9));
bodyTextView.setTextColor(ContextCompat.getColor(context,R.color.color_C6C6E9));
bodyTextView.setOnClickListener(v -> onItemClick());
MoonUtil.identifyFaceExpression(NimUIKit.getContext(), bodyTextView, getDisplayText(), ImageSpan.ALIGN_BOTTOM);
bodyTextView.setMovementMethod(LinkMovementMethod.getInstance());