Commit 6f22f2b4 by ydl

修改私聊消息样式

parent c60419b9
...@@ -3,6 +3,8 @@ ...@@ -3,6 +3,8 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
package="com.ydl.component"> package="com.ydl.component">
<permission android:name="android.permission.WRITE_SETTINGS" />
<uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
......
...@@ -39,7 +39,8 @@ import com.alibaba.fastjson.serializer.AwtCodec.support ...@@ -39,7 +39,8 @@ import com.alibaba.fastjson.serializer.AwtCodec.support
import android.support.v4.app.SupportActivity import android.support.v4.app.SupportActivity
import android.support.v4.app.SupportActivity.ExtraData import android.support.v4.app.SupportActivity.ExtraData
import com.ydl.component.mvp.DemoContract import com.ydl.component.mvp.DemoContract
import com.ydl.component.route.PlatformTempCommonRouteImpl
import com.ydl.ydlcommon.router.YdlCommonRouterManager
/** /**
...@@ -78,6 +79,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>( ...@@ -78,6 +79,8 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
// YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830") // YDLavManager.instances.init(this, "3387e9b251f3491e9221a9877e8f7830")
YdlCommonRouterManager.initYdlCommonRoute(PlatformTempCommonRouteImpl())
bindService() bindService()
reLoadData() reLoadData()
requestPermission() requestPermission()
......
package com.ydl.component.route
import android.app.Activity
import android.content.Context
import com.ydl.ydlcommon.router.IYdlCommonRouter
import com.ydl.ydlcommon.router.YdlUserInfo
import com.yidianling.im.bridge.P2PCustomActionHandlerImpl
import com.yidianling.im.router.ImIn
import com.yidianling.im.session.SessionHelper
import com.yidianling.user.ui.login.RegisterAndLoginActivity
class PlatformTempCommonRouteImpl : IYdlCommonRouter {
override fun startMain(activity: Activity, isSplashActivity: Boolean) {
}
override fun startMain(context: Context, selectTab: Int, trend_tap: String?) {
}
override fun setMoreService(context: Context) {
}
override fun getUserInfo(): YdlUserInfo? {
val userInfo = ImIn.getUserResponse() ?: return null
return YdlUserInfo(userInfo.uid ?: "", userInfo.accessToken ?: "", userInfo.hxpwd
?: "", userInfo.userInfo!!.nick_name ?: "", userInfo.userInfo!!.head ?: "")
}
override fun getUid(): Int {
return ImIn.getUserInfo()?.uid?.toInt() ?: 0
}
}
\ No newline at end of file
...@@ -92,8 +92,8 @@ public class NimApplication { ...@@ -92,8 +92,8 @@ public class NimApplication {
//options.buildNimUserCache = true; //options.buildNimUserCache = true;
options.shouldHandleReceipt = true; options.shouldHandleReceipt = true;
options.toolBarOptions = new YDLToolBarOptions(); options.toolBarOptions = new YDLToolBarOptions();
options.messageLeftBackground = R.drawable.message_receive_content_bg; options.messageLeftBackground = R.drawable.im_message_receive_content_bg;
options.messageRightBackground = R.drawable.message_send_content_bg; options.messageRightBackground = R.drawable.im_message_send_content_bg;
return options; return options;
} }
......
package com.yidianling.im.session.viewholder; package com.yidianling.im.session.viewholder;
import android.graphics.Color;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.View; import android.view.View;
import android.widget.ImageView; import android.widget.ImageView;
...@@ -63,6 +62,8 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase { ...@@ -63,6 +62,8 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase {
//只有倾诉加角标,咨询不加 //只有倾诉加角标,咨询不加
if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) { if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) {
showAudioSmallTip(); showAudioSmallTip();
} else {
hideAudioSmallTip();
} }
} }
...@@ -70,9 +71,9 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase { ...@@ -70,9 +71,9 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase {
protected int leftBackground() { protected int leftBackground() {
CustomAttachConsultCallStatus customAttachTipMsg = (CustomAttachConsultCallStatus) message.getAttachment(); CustomAttachConsultCallStatus customAttachTipMsg = (CustomAttachConsultCallStatus) message.getAttachment();
if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) { if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) {
return R.drawable.message_receive_content_tip_bg; return R.drawable.im_message_receive_content_tip_bg;
} else { } else {
return R.drawable.message_receive_content_bg; return R.drawable.im_message_receive_content_bg;
} }
} }
...@@ -80,9 +81,9 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase { ...@@ -80,9 +81,9 @@ public class MsgViewHolderConsultCallStatus extends MsgViewHolderBase {
protected int rightBackground() { protected int rightBackground() {
CustomAttachConsultCallStatus customAttachTipMsg = (CustomAttachConsultCallStatus) message.getAttachment(); CustomAttachConsultCallStatus customAttachTipMsg = (CustomAttachConsultCallStatus) message.getAttachment();
if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) { if (!"true".equals(customAttachTipMsg.getIsConsultOrder())) {
return R.drawable.message_send_content_tip_bg; return R.drawable.im_message_send_content_tip_bg;
} else { } else {
return R.drawable.message_send_content_bg; return R.drawable.im_message_send_content_bg;
} }
} }
......
...@@ -95,7 +95,7 @@ public class MsgViewHolderAudio extends MsgViewHolderBase { ...@@ -95,7 +95,7 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
setGravity(durationLabel, Gravity.RIGHT | Gravity.CENTER_VERTICAL); setGravity(durationLabel, Gravity.RIGHT | Gravity.CENTER_VERTICAL);
containerView.setBackgroundResource(NimUIKitImpl.getOptions().messageLeftBackground); containerView.setBackgroundResource(NimUIKitImpl.getOptions().messageLeftBackground);
containerView.setPadding(ScreenUtil.dip2px(15), ScreenUtil.dip2px(8), ScreenUtil.dip2px(10), ScreenUtil.dip2px(8)); containerView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(7), ScreenUtil.dip2px(13), ScreenUtil.dip2px(7));
animationView.setBackgroundResource(R.drawable.im_nim_audio_animation_list_left); animationView.setBackgroundResource(R.drawable.im_nim_audio_animation_list_left);
durationLabel.setTextColor(Color.BLACK); durationLabel.setTextColor(Color.BLACK);
...@@ -105,7 +105,7 @@ public class MsgViewHolderAudio extends MsgViewHolderBase { ...@@ -105,7 +105,7 @@ public class MsgViewHolderAudio extends MsgViewHolderBase {
unreadIndicator.setVisibility(View.GONE); unreadIndicator.setVisibility(View.GONE);
containerView.setBackgroundResource(NimUIKitImpl.getOptions().messageRightBackground); containerView.setBackgroundResource(NimUIKitImpl.getOptions().messageRightBackground);
containerView.setPadding(ScreenUtil.dip2px(10), ScreenUtil.dip2px(8), ScreenUtil.dip2px(15), ScreenUtil.dip2px(8)); containerView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(7), ScreenUtil.dip2px(13), ScreenUtil.dip2px(7));
animationView.setBackgroundResource(R.drawable.im_nim_audio_animation_list_right); animationView.setBackgroundResource(R.drawable.im_nim_audio_animation_list_right);
durationLabel.setTextColor(Color.BLACK); durationLabel.setTextColor(Color.BLACK);
} }
......
...@@ -453,4 +453,9 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem ...@@ -453,4 +453,9 @@ public abstract class MsgViewHolderBase extends RecyclerViewHolder<BaseMultiItem
audioLeftSmallTip.setVisibility(View.VISIBLE); audioLeftSmallTip.setVisibility(View.VISIBLE);
} }
} }
protected void hideAudioSmallTip() {
audioRightSmallTip.setVisibility(View.GONE);
audioLeftSmallTip.setVisibility(View.GONE);
}
} }
...@@ -52,10 +52,10 @@ public class MsgViewHolderText extends MsgViewHolderBase { ...@@ -52,10 +52,10 @@ public class MsgViewHolderText extends MsgViewHolderBase {
private void layoutDirection() { private void layoutDirection() {
if (isReceivedMessage()) { if (isReceivedMessage()) {
bodyTextView.setBackgroundResource(NimUIKitImpl.getOptions().messageLeftBackground); bodyTextView.setBackgroundResource(NimUIKitImpl.getOptions().messageLeftBackground);
bodyTextView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(13), ScreenUtil.dip2px(13), ScreenUtil.dip2px(13)); bodyTextView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(7), ScreenUtil.dip2px(13), ScreenUtil.dip2px(7));
} else { } else {
bodyTextView.setBackgroundResource(NimUIKitImpl.getOptions().messageRightBackground); bodyTextView.setBackgroundResource(NimUIKitImpl.getOptions().messageRightBackground);
bodyTextView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(13), ScreenUtil.dip2px(13), ScreenUtil.dip2px(13)); bodyTextView.setPadding(ScreenUtil.dip2px(13), ScreenUtil.dip2px(7), ScreenUtil.dip2px(13), ScreenUtil.dip2px(7));
} }
int textWidth = RxDeviceTool.getScreenWidth(context) - RxImageTool.dp2px(122f); int textWidth = RxDeviceTool.getScreenWidth(context) - RxImageTool.dp2px(122f);
bodyTextView.setMaxWidth(textWidth); bodyTextView.setMaxWidth(textWidth);
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#191DA1F2" />
<corners android:bottomLeftRadius="4dp"
android:topLeftRadius="4dp"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#191DA1F2" />
<corners android:topRightRadius="4dp"
android:bottomRightRadius="4dp"/>
</shape>
\ No newline at end of file
...@@ -5,15 +5,16 @@ ...@@ -5,15 +5,16 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:padding="6dp" android:padding="6dp"
android:minHeight="40dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/type_img" android:id="@+id/type_img"
android:layout_width="wrap_content" android:layout_width="14dp"
android:layout_height="wrap_content" android:layout_height="14dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:layout_marginRight="8dp" android:layout_marginRight="3dp"
android:contentDescription="@string/im_empty" android:contentDescription="@string/im_empty"
android:src="@drawable/im_avchat_left_type_audio"/> android:src="@drawable/im_avchat_left_type_audio"/>
...@@ -22,6 +23,7 @@ ...@@ -22,6 +23,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
android:text="无人接听" android:text="无人接听"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:padding="6dp" android:padding="6dp"
android:minHeight="40dp"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:id="@+id/message_item_avchat_type_img" android:id="@+id/message_item_avchat_type_img"
android:layout_width="wrap_content" android:layout_width="14dp"
android:layout_height="wrap_content" android:layout_height="14dp"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:layout_marginRight="8dp" android:layout_marginRight="8dp"
......
...@@ -171,7 +171,7 @@ ...@@ -171,7 +171,7 @@
android:textColor="#1DA1F2" android:textColor="#1DA1F2"
android:textSize="10dp" android:textSize="10dp"
android:visibility="gone" android:visibility="gone"
android:background="#191DA1F2"/> android:background="@drawable/im_nim_confide_left_tip_bg"/>
<FrameLayout <FrameLayout
android:id="@+id/message_item_content" android:id="@+id/message_item_content"
...@@ -189,7 +189,7 @@ ...@@ -189,7 +189,7 @@
android:textColor="#1DA1F2" android:textColor="#1DA1F2"
android:textSize="10dp" android:textSize="10dp"
android:visibility="gone" android:visibility="gone"
android:background="#191DA1F2"/> android:background="@drawable/im_nim_confide_right_tip_bg"/>
</LinearLayout> </LinearLayout>
</FrameLayout> </FrameLayout>
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
android:minHeight="40dp"
> >
<ImageView <ImageView
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
android:gravity="center_vertical|left" android:gravity="center_vertical|left"
android:includeFontPadding="false" android:includeFontPadding="false"
android:lineSpacingExtra="3dip" android:lineSpacingExtra="3dip"
android:minHeight="40dp"
android:textColor="@color/im_color_242424" android:textColor="@color/im_color_242424"
android:textSize="17dp"/> android:textSize="17dp"/>
</LinearLayout> </LinearLayout>
...@@ -7,6 +7,8 @@ ...@@ -7,6 +7,8 @@
android:layout_gravity="bottom" android:layout_gravity="bottom"
android:layout_marginBottom="3dip" android:layout_marginBottom="3dip"
android:background="@color/im_transparent" android:background="@color/im_transparent"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:text="@string/im_readed" android:text="@string/im_readed"
android:textColor="#666666" android:textColor="#666666"
android:textSize="12sp" android:textSize="12sp"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment