Commit aaf081b2 by 徐健

修复最后一条消息被隐藏的问题

parent 21900601
......@@ -180,7 +180,7 @@ dependencies {
implementation fileTree(dir: 'aars', include: ['*.aar'])
implementation project(':m-user')
implementation modularPublication('com.ydl:m-user-api')
implementation project(':m-tests')
// implementation project(':m-tests')
implementation project(':m-consultant')
implementation modularPublication('com.ydl:m-consultant-api')
// implementation project(':m-confide')
......@@ -202,9 +202,9 @@ dependencies {
implementation project(':m-muse')
// implementation project(':m-muse')
implementation project(':m-im')
implementation project(':m-dynamic')
// implementation project(':m-dynamic')
// api rootProject.ext.dependencies["ydl-m-fm-module-ydl"]
......
......@@ -25,10 +25,10 @@ import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.ydl.ydlcommon.router.IYDLRouterConstant
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
//import com.yidianling.consultant.ExpertSearchActivity.Companion.HOT_SEARCH_DOCTOR_NAME
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.fm.api.service.IFMService
import com.yidianling.tests.home.NewTestHomeActivity
//import com.yidianling.tests.home.NewTestHomeActivity
import kotlinx.android.synthetic.main.activity_main.*
/**
......@@ -84,13 +84,13 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
.navigation()
}
bt_to_consultant.setOnClickListener {
ARouter.getInstance()
.build("/consult/hot_search")
.withString(
HOT_SEARCH_DOCTOR_NAME,
this.resources?.getString(R.string.platform_search_hint)
)
.navigation()
// ARouter.getInstance()
// .build("/consult/hot_search")
// .withString(
// HOT_SEARCH_DOCTOR_NAME,
// this.resources?.getString(R.string.platform_search_hint)
// )
// .navigation()
}
bt_to_music.setOnClickListener {
FragmentContainerActivity.start(this)
......@@ -102,7 +102,7 @@ class MainActivity : BaseLceActivity<DemoContract.View, DemoContract.Presenter>(
FragmentContainerActivity.start(this,"TrendsHomeFragment")
}
bt_to_tests.setOnClickListener {
startActivity(Intent(this, NewTestHomeActivity::class.java))
// startActivity(Intent(this, NewTestHomeActivity::class.java))
}
// bt_to_confide.setOnClickListener {
// YDLavManager.instances.login("1193016")
......
......@@ -7,8 +7,8 @@ import com.ydl.component.mvp.DemoContract
import com.ydl.component.mvp.DemoPresenter
import com.ydl.ydlcommon.bean.StatusBarOptions
import com.ydl.ydlcommon.mvp.lce.BaseLceActivity
import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
import com.yidianling.home.ui.fragment.YdlHomeFragment
//import com.yidianling.dynamic.trendsHome.TrendsHomeFragment
//import com.yidianling.home.ui.fragment.YdlHomeFragment
import com.yidianling.im.ui.page.NewMultiMessageFragment
......@@ -61,12 +61,12 @@ class FragmentContainerActivity : BaseLceActivity<DemoContract.View, DemoContra
if ("NewMultiMessageFragment" == fragmentName) {
return NewMultiMessageFragment()
}
if ("TrendsHomeFragment" == fragmentName) {
return TrendsHomeFragment()
}
if ("YdlHomeFragment" == fragmentName) {
return YdlHomeFragment()
}
// if ("TrendsHomeFragment" == fragmentName) {
// return TrendsHomeFragment()
// }
// if ("YdlHomeFragment" == fragmentName) {
// return YdlHomeFragment()
// }
return PlayFragment()
}
}
ext {
kotlin_version = "1.3.21"
dev_mode = false
dev_mode = true
ydl_app = [
appName : "心理咨询壹点灵",
......
......@@ -130,6 +130,15 @@ public class P2PCustomActionHandlerImpl implements IP2PCustomActionHandler {
docInfo.doctorBriefInfoHelpLong = expert.doctorBriefInfo.helpLong;
docInfo.doctorBriefInfoOrderNum = expert.doctorBriefInfo.orderNum;
docInfo.doctorBriefInfoSmallImage = expert.doctorBriefInfo.smallImage;
docInfo.commentCounter = expert.commentCounter;
docInfo.commentCounterUrl = expert.commentCounterUrl;
if (docInfo.commentList == null) {
docInfo.commentList = new ArrayList();
}
docInfo.commentList.clear();
docInfo.commentList.addAll(expert.commentList);
}
public P2PCustomActionHandlerImpl(String toChatUsername,
......
package com.yidianling.uikit.business.session.view
import android.content.Context
import android.os.Handler
import android.os.Looper
import android.os.Message
import android.util.AttributeSet
import android.view.View
import android.view.ViewGroup
import android.view.animation.Animation
import android.view.animation.DecelerateInterpolator
import android.view.animation.TranslateAnimation
import android.widget.LinearLayout
import com.ydl.webview.H5Params
import com.ydl.webview.NewH5Activity
import com.yidianling.im.R
import com.yidianling.im.api.bean.ImCommendDetailBean
import kotlinx.android.synthetic.main.im_real_view_in.view.*
import kotlinx.android.synthetic.main.im_real_view_left.view.*
import kotlinx.android.synthetic.main.im_real_view_out.view.*
class ImCommentBannerView : LinearLayout {
constructor(context: Context) : super(context) {
mContext = context
initViews()
}
constructor(context: Context, attrs: AttributeSet) : super(context, attrs) {
mContext = context
initViews()
}
constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(
context,
attrs,
defStyle
) {
mContext = context
initViews()
}
private var mContext: Context? = null
private val STATUS_IN = 0
private val STATUS_OUT = 1
private var curTipIndex = 0
private var lastTimeMillis: Long = 0
private val ANIM_DELAYED_MILLIONS = 2 * 1000
/**
* 动画持续时长
*/
private val ANIM_DURATION = 500
/**
* 进、出 两个view (主要用于做动画,其实是两个相同的布局文件)
*/
private var view_out: View? = null
private var view_in: View? = null
/**
* 进、出 两个View 的动画
*/
private var anim_out: Animation? = null
private var anim_in: Animation? = null
/**
* 数据缓存
*/
private var mDataList: ArrayList<ImCommendDetailBean>? = null
private val mHandler: Handler = object : Handler(Looper.getMainLooper()) {
override fun handleMessage(msg: Message?) {
super.handleMessage(msg)
updateTipAndPlayAnimation()
sendMessageDelayed(Message(), ANIM_DELAYED_MILLIONS.toLong())
}
}
private fun initViews() {
initView()
initAnimation()
}
/**
* 界面初始化
*/
private fun initView() {
orientation = HORIZONTAL
var params = ViewGroup.LayoutParams(
ViewGroup.LayoutParams.MATCH_PARENT,
ViewGroup.LayoutParams.WRAP_CONTENT
)
View.inflate(mContext, R.layout.im_real_view_left, this)
view_out = View.inflate(mContext, R.layout.im_real_view_out, null)
view_in = View.inflate(mContext, R.layout.im_real_view_in, null)
imRealViewLeftFrameLayout.addView(view_out)
imRealViewLeftFrameLayout.addView(view_in)
layoutParams = params
}
private fun initAnimation() {
anim_out = newAnimation(0f, -1f)
anim_in = newAnimation(1f, 0f)
anim_in?.setAnimationListener(object : Animation.AnimationListener {
override fun onAnimationStart(animation: Animation) {
}
override fun onAnimationRepeat(animation: Animation) {
}
override fun onAnimationEnd(animation: Animation) {
updateViewVisibility()
}
})
}
/**
* 设置数据
*/
fun initData(list: ArrayList<ImCommendDetailBean>?) {
mHandler.removeCallbacksAndMessages(null)
if (null == list || list.isEmpty()) {
visibility = View.GONE
return
}
visibility = View.VISIBLE
if (null == mDataList) {
mDataList = ArrayList()
} else {
(mDataList as ArrayList).clear()
}
(mDataList as ArrayList).addAll(list)
curTipIndex = 0
updateTip(STATUS_OUT)
updateTipAndPlayAnimation()
mHandler.sendMessageDelayed(Message(), ANIM_DELAYED_MILLIONS.toLong())
}
private fun updateViewVisibility() {
if (curTipIndex % 2 == 0) {
view_out?.visibility = View.INVISIBLE
} else {
view_in?.visibility = View.INVISIBLE
}
}
private fun newAnimation(fromYValue: Float, toYValue: Float): Animation {
val anim = TranslateAnimation(
Animation.RELATIVE_TO_SELF, 0f, Animation.RELATIVE_TO_SELF, 0f,
Animation.RELATIVE_TO_SELF, fromYValue, Animation.RELATIVE_TO_SELF, toYValue
)
anim.duration = ANIM_DURATION.toLong()
anim.interpolator = DecelerateInterpolator()
return anim
}
private fun updateTipAndPlayAnimation() {
view_in?.visibility = View.VISIBLE
view_out?.visibility = View.VISIBLE
if (curTipIndex % 2 == 0) {
updateTip(STATUS_OUT)
view_in?.startAnimation(anim_out)
view_out?.startAnimation(anim_in)
this.bringChildToFront(view_in)
} else {
updateTip(STATUS_IN)
view_out?.startAnimation(anim_out)
view_in?.startAnimation(anim_in)
this.bringChildToFront(view_out)
}
}
private fun updateTip(status: Int) {
val bodyBean = getNextTip() ?: return
mContext?.let {
when (status) {
STATUS_IN -> {
tv_in_comment_desc.text = bodyBean.commentContent
tv_in_content_before.text = getName(bodyBean.nickName)
view_in?.setOnClickListener {
val params: H5Params = H5Params(bodyBean.commentUrl, "")
mContext?.let {
NewH5Activity.start(mContext, params)
}
}
}
STATUS_OUT -> {
tv_out_comment_desc.text = bodyBean.commentContent
tv_out_content_before.text = getName(bodyBean.nickName)
view_out?.setOnClickListener {
val params: H5Params = H5Params(bodyBean.commentUrl, "")
mContext?.let {
NewH5Activity.start(mContext, params)
}
}
}
else -> {}
}
}
}
//获取经过加密的名字 : 徐**
private fun getName(name: String?): String {
var nameBuffer = StringBuffer()
name?.let {
nameBuffer.append(name[0])
nameBuffer.append("**:")
}
return nameBuffer.toString()
}
private fun getNextTip(): ImCommendDetailBean? {
if (null == mDataList || mDataList?.isEmpty()!!) {
return null
}
return mDataList!![curTipIndex++ % mDataList!!.size!!]
}
fun onDestory() {
mHandler.removeCallbacksAndMessages(null)
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ import android.app.Activity;
import android.content.Context;
import com.netease.nimlib.sdk.msg.model.IMMessage;
import com.yidianling.im.api.bean.ImCommendDetailBean;
import com.yidianling.uikit.custom.http.response.RecommendExpertBean;
import org.json.JSONObject;
......@@ -148,6 +149,10 @@ public interface IP2PCustomActionHandler {
public int doctorBriefInfoOrderNum = 0; //帮助人数
public int doctorBriefInfoHelpLong = 0; //服务时长
public String doctorBriefInfoSmallImage = ""; //小头像
public int commentCounter = 0;
public String commentCounterUrl = "";
public ArrayList<ImCommendDetailBean> commentList;
}
//消息中有11位数字,提示是否要隐藏中间5位 相关
......
package com.yidianling.im.api.bean;
import java.util.ArrayList;
import java.util.List;
/**
* Created by hgw on 2018/3/13.
*/
......@@ -10,5 +13,8 @@ public class IMExpertBuild {
public String tips; //禁言提示内容
public String url;//禁言帮助URL
public IMDoctorBriefInfo doctorBriefInfo = new IMDoctorBriefInfo();
public List<ImCommendDetailBean> commentList = new ArrayList(); //评论列表
public int commentCounter = 0; //评论总数
public String commentCounterUrl = ""; //评论总数url
}
\ No newline at end of file
package com.yidianling.im.api.bean
/**
* 评论细节bean
*/
class ImCommendDetailBean {
var nickName: String = ""
var commentContent: String = ""
var commentUrl: String = ""
}
\ 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="#E5F5FF"/>
<corners android:radius="10dp"/>
</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="#E5F5FF"/>
<corners android:radius="10dp"/>
</shape>
\ No newline at end of file
<?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"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:layout_gravity="center_vertical"
tools:text="姚**:"
android:layout_marginLeft="18dp"
android:id="@+id/tv_in_content_before"
android:textColor="#242424"
android:textStyle="bold"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginRight="6dp"
tools:text="谢谢老师的疏导,相信以后的自相信以后的自相信以后的自…"
android:id="@+id/tv_in_comment_desc"
android:textSize="12dp"
android:textColor="#666666"
android:lines="1"
android:ellipsize="end"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
<?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"
android:orientation="horizontal"
android:paddingTop="10dp"
android:paddingBottom="10dp"
>
<FrameLayout
android:id="@+id/imRealViewLeftFrameLayout"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"/>
</LinearLayout>
<?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"
android:orientation="horizontal"
android:background="?android:attr/selectableItemBackground"
xmlns:tools="http://schemas.android.com/tools">
<TextView
android:layout_gravity="center_vertical"
tools:text="姚**:"
android:layout_marginLeft="18dp"
android:id="@+id/tv_out_content_before"
android:textColor="#242424"
android:textStyle="bold"
android:textSize="12dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<TextView
android:layout_marginRight="6dp"
tools:text="谢谢老师的疏导,相信以后的自相信以后的自相信以后的自…"
android:id="@+id/tv_out_comment_desc"
android:textSize="12dp"
android:textColor="#666666"
android:lines="1"
android:ellipsize="end"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content" />
</LinearLayout>
\ No newline at end of file
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