Commit f4080b07 by 严久程

导医的入口和跳转

parent 92efbc41
......@@ -6,17 +6,17 @@ ext {
// -------------- 业务模块 --------------
//第三步 若干
"m-confide" : "0.0.48.74",
"m-consultant" : "0.0.59.23",
"m-consultant" : "0.0.59.27",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.21",
"m-home" : "0.0.22.20",
"m-im" : "0.0.18.14",
"m-dynamic" : "0.0.7.70",
"m-im" : "0.0.18.15",
"m-dynamic" : "0.0.7.9",
"m-article" : "0.0.0.6",
"m-muse" : "0.0.28.20",
"m-tests" : "0.0.24.10",
"m-course" : "0.0.42.6",
"m-course" : "0.0.42.8",
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
......@@ -40,7 +40,7 @@ ext {
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.29.7",
"ydl-flutter-base": "0.0.14.16",
"ydl-flutter-base": "0.0.14.18",
//以下 几乎不会动
"router" : "0.0.1",
......@@ -102,7 +102,7 @@ ext {
//-------------- 业务模块 API 层 --------------
"m-audioim-api" : "0.0.6",
"m-confide-api" : "0.0.2.1",
"m-consultant-api": "0.0.5.2",
"m-consultant-api": "0.0.5.3",
"m-course-api" : "0.0.3.6",
"m-fm-api" : "0.0.3",
"m-muse-api" : "0.0.1",
......@@ -121,7 +121,7 @@ ext {
"ydl-media" : "0.0.21.6",
"ydl-pay" : "0.0.18.9",
"m-audioim" : "0.0.49.29.7",
"ydl-flutter-base": "0.0.14.14",
"ydl-flutter-base": "0.0.14.18",
//以下 几乎不会动
"router" : "0.0.1",
......
......@@ -17,6 +17,7 @@ import com.google.gson.reflect.TypeToken
import com.ydl.ydl_image.config.ISimpleImageOpConfig
import com.ydl.ydl_image.config.SimpleImageOpConfiger
import com.ydl.ydl_image.manager.YDLImageCacheManager
import com.ydl.ydl_image.module.GlideApp
import com.ydl.ydl_router.manager.YDLRouterParams
import com.ydl.ydlcommon.base.BaseMvpActivity
import com.ydl.ydlcommon.bean.StatusBarOptions
......@@ -29,7 +30,6 @@ import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.view.banner.GlideImageLoader
import com.yidianling.common.tools.RxDeviceTool
import com.yidianling.common.tools.RxImageTool
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.api.IConsultantService
import com.yidianling.consultant.bean.HotSearchBean
import com.yidianling.consultant.bean.HotSearchFocusItemBean
......@@ -117,15 +117,14 @@ class HotSearchActivity : BaseMvpActivity<IHotSearchContract.View, IHotSearchCon
if (data?.size ?: 0 > 0) {
val imageUrl= data?.get(0)?.pic
iv_daoyi_image.visibility=View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext,imageUrl, iv_daoyi_image, sp)
GlideApp.with(mContext)
.load(imageUrl)
.into(iv_daoyi_image)
iv_daoyi_image.setOnClickListener {
LogUtil.e("跳转导医:location=${data?.get(0)!!.location},title=${data[0].title}")
ConsultAssistantEntryUtils.jumpConsultAssistant(this,data?.get(0)!!.location.toInt())
}
}
......
......@@ -65,7 +65,7 @@ interface SearchApi {
//获取咨询助理uid
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
@GET("consult/assistant/chat-distribute")
fun getConsultAssistantUidRequest(location: Int): Observable<BaseAPIResponse<Long>>
fun getConsultAssistantUidRequest(@Query("location")location: Int): Observable<BaseAPIResponse<Long>>
//获取咨询助理uid
@Headers(YDL_DOMAIN + YDL_DOMAIN_JAVA, "Content-Type:application/json")
......
......@@ -7,7 +7,6 @@ import com.ydl.ydlcommon.data.http.ThrowableConsumer
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.ToastUtil
import com.yidianling.consultant.ConsultAssistantCenterActivity
import com.yidianling.consultant.HotSearchActivity
import com.yidianling.consultant.constants.ConsultBIConstants
import com.yidianling.consultant.model.SearchApi
import com.yidianling.consultant.router.ConsultantIn
......@@ -16,26 +15,38 @@ import io.reactivex.functions.Consumer
import io.reactivex.schedulers.Schedulers
class ConsultAssistantEntryUtils {
companion object{
companion object {
@SuppressLint("CheckResult")
fun jumpConsultAssistant(activity: Activity, location:Int){
ActionCountUtils.count(ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,"$location")
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe( Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(activity as AppCompatActivity, it.data.toString())
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, object: ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
fun jumpConsultAssistant(activity: Activity, location: Int) {
ActionCountUtils.count(
ConsultBIConstants.POSITION_DAOYI_ADVERTISEMENT_CLICK,
"$location"
)
if (!ConsultantIn.isLogin()) {
ConsultantIn.toLogin(activity)
} else {
// 请求接口获取咨询助理的uid
SearchApi.getSearchApi().getConsultAssistantUidRequest(location)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (it.code == "200" && it.data != 0.toLong() && null != activity) {
ConsultantIn.startP2PSession(
activity as AppCompatActivity,
it.data.toString()
)
} else {
ToastUtil.toastShort("咨询助理忙碌中,请稍后再试")
}
}, object : ThrowableConsumer() {
override fun accept(msg: String) {
if (null != activity && activity is ConsultAssistantCenterActivity && !activity.isFinishing) activity.finish()
}
}
}
)
)
}
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_white">
<LinearLayout
android:id="@+id/clContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/consultant_title_bar_height"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingLeft="15dp"
android:tag="tag_search_input">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="60dp"
android:background="@drawable/consultant_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/consultant_icon_input_search"
android:tag="tag_search_input_img" />
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="搜索心理问题或专家姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@color/platform_main_theme"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
<TextView
android:id="@+id/tv_search_cancle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:padding="5dp"
android:text="取消"
android:textColor="#242424"
android:textSize="15dp" />
</RelativeLayout>
<View
android:id="@+id/v_topLine"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/rl_search"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_marginBottom="13dp"
android:background="@color/platform_color_E0E0E0" />
<ImageView
android:id="@+id/iv_daoyi_image"
android:layout_width="match_parent"
android:layout_marginLeft="15dp"
android:visibility="gone"
android:layout_marginRight="15dp"
android:layout_marginBottom="13dp"
android:layout_height="90dp"/>
<LinearLayout
android:id="@+id/ll_search_history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/v_topLine"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="历史搜索"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_delete_history"
android:layout_width="28dp"
android:layout_height="28dp"
android:padding="5dp"
android:src="@drawable/consultant_hot_search_delete_icon" />
</LinearLayout>
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/fl_search_history"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/llHotSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_search_history"
android:layout_marginTop="28dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="热门搜索"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/flHotSearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/llHotExpert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/llHotSearch"
android:layout_marginTop="28dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="本周热门专家"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/flHotExpert"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_below="@+id/llHotExpert"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_28"
app:cardCornerRadius="@dimen/platform_dp_4"
app:cardElevation="0px">
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="80dp"
android:scaleType="centerCrop"
android:tag="overScroll"
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/consultant_banner_indicator_select"
app:pa_indicator_drawable_unselected="@drawable/consultant_banner_indicator_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false" />
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/platform_white">
<LinearLayout
android:id="@+id/clContainer"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rl_search"
android:layout_width="match_parent"
android:layout_height="@dimen/consultant_title_bar_height"
android:focusable="true"
android:focusableInTouchMode="true"
android:paddingLeft="15dp"
android:tag="tag_search_input">
<View
android:id="@+id/view_search_input_bg"
android:layout_width="match_parent"
android:layout_height="32dp"
android:layout_centerVertical="true"
android:layout_marginRight="60dp"
android:background="@drawable/consultant_bg_hot_search_input"
android:tag="tag_search_input_bg" />
<ImageView
android:id="@+id/iv_search_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_centerVertical="true"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:scaleType="centerCrop"
android:src="@drawable/consultant_icon_input_search"
android:tag="tag_search_input_img" />
<EditText
android:id="@+id/etSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginRight="20dp"
android:layout_toLeftOf="@+id/iv_delete_icon"
android:layout_toRightOf="@id/iv_search_icon"
android:background="@null"
android:cursorVisible="true"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="搜索心理问题或专家姓名"
android:imeOptions="actionSearch"
android:maxLength="100"
android:singleLine="true"
android:tag="tag_search_input_edit"
android:textColor="#242424"
android:textColorHint="#b3b3b3"
android:textCursorDrawable="@color/platform_main_theme"
android:textSize="13sp" />
<ImageView
android:id="@+id/iv_delete_icon"
android:layout_width="14dp"
android:layout_height="14dp"
android:layout_alignRight="@+id/view_search_input_bg"
android:layout_centerVertical="true"
android:layout_marginRight="12dp"
android:scaleType="centerCrop"
android:src="@drawable/platform_delete"
android:visibility="invisible" />
<TextView
android:id="@+id/tv_search_cancle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginRight="10dp"
android:padding="5dp"
android:text="取消"
android:textColor="#242424"
android:textSize="15dp" />
</RelativeLayout>
<View
android:id="@+id/v_topLine"
android:layout_width="match_parent"
android:layout_height="1px"
android:layout_below="@+id/rl_search"
android:layout_marginTop="@dimen/platform_dp_6"
android:layout_marginBottom="13dp"
android:background="@color/platform_color_E0E0E0" />
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:id="@+id/iv_daoyi_image"
android:layout_width="match_parent"
android:layout_height="90dp"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:scaleType="centerCrop"
app:pa_borderRadius="8dp"
app:pa_type="pa_round"
android:visibility="gone"
tools:visibility="visible" />
<LinearLayout
android:id="@+id/ll_search_history"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/v_topLine"
android:clickable="true"
android:focusable="true"
android:layout_marginTop="13dp"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="历史搜索"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<ImageView
android:id="@+id/iv_delete_history"
android:layout_width="28dp"
android:layout_height="28dp"
android:padding="5dp"
android:src="@drawable/consultant_hot_search_delete_icon" />
</LinearLayout>
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/fl_search_history"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/llHotSearch"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/ll_search_history"
android:layout_marginTop="13dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="热门搜索"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/flHotSearch"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<LinearLayout
android:id="@+id/llHotExpert"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/llHotSearch"
android:layout_marginTop="13dp"
android:clickable="true"
android:focusable="true"
android:orientation="vertical"
android:paddingLeft="15dp"
android:paddingRight="15dp"
android:visibility="gone"
tools:visibility="visible">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="本周热门专家"
android:textColor="#242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" />
<cn.lankton.flowlayout.FlowLayout
android:id="@+id/flHotExpert"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginTop="12dp" />
</LinearLayout>
<android.support.v7.widget.CardView
android:id="@+id/card_view"
android:layout_width="match_parent"
android:layout_height="80dp"
android:layout_below="@+id/llHotExpert"
android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_28"
android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_28"
app:cardCornerRadius="@dimen/platform_dp_4"
app:cardElevation="0px">
<com.ydl.ydlcommon.view.banner.Banner
android:id="@+id/banner"
android:layout_width="match_parent"
android:layout_height="80dp"
android:scaleType="centerCrop"
android:tag="overScroll"
app:pa_indicator_different_width="14dp"
app:pa_indicator_drawable_selected="@drawable/consultant_banner_indicator_select"
app:pa_indicator_drawable_unselected="@drawable/consultant_banner_indicator_unselect"
app:pa_indicator_height="5dp"
app:pa_indicator_margin="1.25dp"
app:pa_is_selected_same_unselected="false" />
</android.support.v7.widget.CardView>
</LinearLayout>
</ScrollView>
......@@ -81,6 +81,8 @@ dependencies {
//发布时使用
compileOnly rootProject.ext.dependencies["ydl-m-user-api"]
compileOnly rootProject.ext.dependencies["ydl-m-dynamic-api"]
compileOnly rootProject.ext.dependencies['ydl-m-consultant-api']
// compileOnlyrootProject.ext.dependencies['com.ydl:m-consultant-api']
api rootProject.ext.dependencies["ydl-webview"]
api (rootProject.ext.dependencies["ydl-media"]){
transitive = true
......
......@@ -253,10 +253,11 @@ class CourseItemNewView : ConstraintLayout {
fun setGuideData(bean: GuideBean) {
view_bottom_line.visibility = View.INVISIBLE
iv_guide_image.visibility = View.VISIBLE
val sp = SimpleImageOpConfiger()
sp.transform = ISimpleImageOpConfig.TRANSFORM_ROUND
sp.radius = 8
YDLImageCacheManager.showImage(mContext, bean.pic, iv_guide_image, sp)
GlideApp.with(mContext)
.load(bean.pic)
.into(iv_guide_image)
iv_guide_image.setOnClickListener {
provide(IConsultantService::class.java).jumpConsultAssistant(mContext as Activity, bean.location.toInt())
}
......
......@@ -235,13 +235,15 @@
android:background="@color/course_color_EBEBEB"
app:layout_constraintTop_toBottomOf="@+id/iv_head"/>
<ImageView
<com.ydl.ydlcommon.view.widgets.RoundImageView
android:id="@+id/iv_guide_image"
android:layout_width="match_parent"
android:layout_height="90dp"
android:visibility="gone"
android:layout_marginTop="20dp"
tools:visibility="visible"
app:pa_borderRadius="8dp"
app:pa_type="pa_round"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/iv_head"
/>
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_trend_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:background="@color/dynamic_white"
android:elevation="1dp"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:id="@+id/item_trend_user_rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp">
<ImageView
android:id="@+id/item_trend_user_head_iv"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="@drawable/dynamic_head_place_hold_pic" />
<TextView
android:id="@+id/item_trend_user_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingTop="3dp"
android:text="小明"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_head_iv" />
<ImageView
android:id="@+id/item_trend_user_gender_iv"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="@dimen/platform_dp_2"
android:paddingTop="6dp"
android:src="@drawable/dynamic_new_male"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_name_tv" />
<TextView
android:id="@+id/item_trend_time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/item_trend_user_name_rel"
android:layout_toRightOf="@+id/item_trend_user_head_iv"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:text=""
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="10sp"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_head_iv"
app:layout_constraintTop_toBottomOf="@+id/item_trend_user_name_tv"
android:visibility="invisible"/>
<TextView
android:id="@+id/item_trend_souce_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="7dp"
android:text="来自安卓终端"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="10sp"
app:layout_constraintBaseline_toBaselineOf="@+id/item_trend_time_tv"
app:layout_constraintLeft_toRightOf="@+id/item_trend_time_tv" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/item_trend_title_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:text="标题"
android:textColor="@color/dynamic_text_3d3d3d"
android:textSize="15sp" />
<TextView
android:id="@+id/item_trend_content_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:lineSpacingExtra="3dp"
android:text="外交部回应“朝鲜正准备第六次核试验”】有报道称,朝鲜正在准备进行第六次核试验,预计此次核试规模将比上一次增加十几倍。对此,外交部回应表示:中方反对朝鲜核试的立场是明确和一贯的。当前半岛形势高度复杂敏感,任何可能加剧半岛局势紧张的举动都是不可取的。希望相关各方都保持冷静克制,负起自己的责任,不要采取进一步相互刺激和加剧局势紧张的行动。"
android:textColor="@color/dynamic_text_666666"
android:textSize="12sp"
android:visibility="gone"
tools:visibility="visible" />
<!-- 图片布局 -->
<com.yidianling.dynamic.common.view.NineGridView
android:id="@+id/nine_grid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp" />
<ImageView
android:id="@+id/iv_assistant_guide_image"
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:visibility="gone"
android:layout_marginBottom="15dp"
android:layout_height="90dp"/>
<!-- Url布局-->
<RelativeLayout
android:id="@+id/item_trend_ad_rel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="@drawable/dynamic_trend_ad_bg"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/item_trend_ad_iv"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/dynamic_default_img" />
<ImageView
android:id="@+id/iv_fm"
android:layout_width="@dimen/platform_dp_22"
android:layout_height="@dimen/platform_dp_22"
android:layout_centerVertical="true"
android:layout_marginLeft="9dp"
android:src="@drawable/dynamic_img_trend_fm_play"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/item_trend_ad_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="14dp"
android:layout_marginRight="15dp"
android:layout_toRightOf="@+id/item_trend_ad_iv"
android:ellipsize="end"
android:maxLines="2"
android:text="外交部回应“朝鲜正准备第六次核试验”】有报道称,朝鲜正在准备进行第六次核试验,预计"
android:textColor="@color/dynamic_text_666666"
android:textSize="12sp" />
</RelativeLayout>
<!--点赞评论-->
<RelativeLayout
android:id="@+id/item_trend_zan_rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center">
<TextView
android:id="@+id/text_trend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#FAA05A"
android:textSize="12sp"
tools:text="#表白话题#" />
<ImageView
android:id="@+id/item_trend_discuss_iv"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/text_talk_num"
android:padding="3dp"
android:src="@drawable/dynamic_comment" />
<TextView
android:id="@+id/text_talk_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="@dimen/dynamic_text_size_12"
tools:text="评论" />
<ImageView
android:id="@+id/item_trend_zan_iv"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/text_zan_num"
android:padding="3dp"
android:src="@drawable/dynamic_icon_warm_nor" />
<TextView
android:id="@+id/text_zan_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/item_trend_discuss_iv"
android:gravity="center_vertical"
android:minWidth="25dp"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="@dimen/dynamic_text_size_12"
tools:text="温暖" />
</RelativeLayout>
</LinearLayout>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/ll_trend_content"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginRight="15dp"
android:layout_marginTop="20dp"
android:background="@color/dynamic_white"
android:elevation="1dp"
android:orientation="vertical">
<android.support.constraint.ConstraintLayout
android:id="@+id/item_trend_user_rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="15dp"
android:layout_marginTop="15dp">
<ImageView
android:id="@+id/item_trend_user_head_iv"
android:layout_width="45dp"
android:layout_height="45dp"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentTop="true"
android:src="@drawable/dynamic_head_place_hold_pic" />
<TextView
android:id="@+id/item_trend_user_name_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:paddingLeft="10dp"
android:paddingTop="3dp"
android:text="小明"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="12sp"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_head_iv" />
<ImageView
android:id="@+id/item_trend_user_gender_iv"
android:layout_width="16dp"
android:layout_height="16dp"
android:layout_marginLeft="@dimen/platform_dp_2"
android:paddingTop="6dp"
android:src="@drawable/dynamic_new_male"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_name_tv" />
<TextView
android:id="@+id/item_trend_time_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/item_trend_user_name_rel"
android:layout_toRightOf="@+id/item_trend_user_head_iv"
android:paddingLeft="10dp"
android:paddingTop="10dp"
android:text=""
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="10sp"
app:layout_constraintLeft_toRightOf="@+id/item_trend_user_head_iv"
app:layout_constraintTop_toBottomOf="@+id/item_trend_user_name_tv"
android:visibility="invisible"/>
<TextView
android:id="@+id/item_trend_souce_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="7dp"
android:text="来自安卓终端"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="10sp"
app:layout_constraintBaseline_toBaselineOf="@+id/item_trend_time_tv"
app:layout_constraintLeft_toRightOf="@+id/item_trend_time_tv" />
</android.support.constraint.ConstraintLayout>
<TextView
android:id="@+id/item_trend_title_tv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:text="标题"
android:textColor="@color/dynamic_text_3d3d3d"
android:textSize="15sp" />
<TextView
android:id="@+id/item_trend_content_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:lineSpacingExtra="3dp"
android:text="外交部回应“朝鲜正准备第六次核试验”】有报道称,朝鲜正在准备进行第六次核试验,预计此次核试规模将比上一次增加十几倍。对此,外交部回应表示:中方反对朝鲜核试的立场是明确和一贯的。当前半岛形势高度复杂敏感,任何可能加剧半岛局势紧张的举动都是不可取的。希望相关各方都保持冷静克制,负起自己的责任,不要采取进一步相互刺激和加剧局势紧张的行动。"
android:textColor="@color/dynamic_text_666666"
android:textSize="12sp"
android:visibility="gone"
tools:visibility="visible" />
<!-- 图片布局 -->
<com.yidianling.dynamic.common.view.NineGridView
android:id="@+id/nine_grid"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp" />
<ImageView
android:id="@+id/iv_assistant_guide_image"
android:layout_width="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:visibility="gone"
tools:visibility="visible"
android:layout_marginBottom="15dp"
android:layout_height="90dp"/>
<!-- Url布局-->
<RelativeLayout
android:id="@+id/item_trend_ad_rel"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="@drawable/dynamic_trend_ad_bg"
android:visibility="gone"
tools:visibility="visible">
<ImageView
android:id="@+id/item_trend_ad_iv"
android:layout_width="40dp"
android:layout_height="40dp"
android:layout_centerVertical="true"
android:scaleType="centerCrop"
android:src="@drawable/dynamic_default_img" />
<ImageView
android:id="@+id/iv_fm"
android:layout_width="@dimen/platform_dp_22"
android:layout_height="@dimen/platform_dp_22"
android:layout_centerVertical="true"
android:layout_marginLeft="9dp"
android:src="@drawable/dynamic_img_trend_fm_play"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/item_trend_ad_tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="14dp"
android:layout_marginRight="15dp"
android:layout_toRightOf="@+id/item_trend_ad_iv"
android:ellipsize="end"
android:maxLines="2"
android:text="外交部回应“朝鲜正准备第六次核试验”】有报道称,朝鲜正在准备进行第六次核试验,预计"
android:textColor="@color/dynamic_text_666666"
android:textSize="12sp" />
</RelativeLayout>
<!--点赞评论-->
<RelativeLayout
android:id="@+id/item_trend_zan_rel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="15dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:gravity="center">
<TextView
android:id="@+id/text_trend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:ellipsize="end"
android:maxLines="1"
android:textColor="#FAA05A"
android:textSize="12sp"
tools:text="#表白话题#" />
<ImageView
android:id="@+id/item_trend_discuss_iv"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/text_talk_num"
android:padding="3dp"
android:src="@drawable/dynamic_comment" />
<TextView
android:id="@+id/text_talk_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:drawablePadding="5dp"
android:gravity="center_vertical"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="@dimen/dynamic_text_size_12"
tools:text="评论" />
<ImageView
android:id="@+id/item_trend_zan_iv"
android:layout_width="20dp"
android:layout_height="20dp"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/text_zan_num"
android:padding="3dp"
android:src="@drawable/dynamic_icon_warm_nor" />
<TextView
android:id="@+id/text_zan_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="5dp"
android:layout_marginRight="5dp"
android:layout_toLeftOf="@+id/item_trend_discuss_iv"
android:gravity="center_vertical"
android:minWidth="25dp"
android:textColor="@color/dynamic_text_trend_defult"
android:textSize="@dimen/dynamic_text_size_12"
tools:text="温暖" />
</RelativeLayout>
</LinearLayout>
......@@ -34,6 +34,7 @@ import com.yidianling.im.session.action.OrderAction;
import com.yidianling.im.session.action.RedPacketAction;
import com.yidianling.im.session.action.SendCardAction;
import com.yidianling.im.session.action.TeamAVChatAction;
import com.yidianling.im.session.extension.CustomAttachAssistantReceivedMoney;
import com.yidianling.im.session.extension.CustomAttachChatTipMsg;
import com.yidianling.im.session.extension.CustomAttachConsult;
import com.yidianling.im.session.extension.CustomAttachConsultCallStatus;
......@@ -63,6 +64,7 @@ import com.yidianling.im.session.extension.CustomSystemTips;
import com.yidianling.im.session.extension.DefaultCustomAttachment;
import com.yidianling.im.session.extension.StickerAttachment;
import com.yidianling.im.session.viewholder.MsgViewHolderAVChat;
import com.yidianling.im.session.viewholder.MsgViewHolderAssistantReceivedMoney;
import com.yidianling.im.session.viewholder.MsgViewHolderChatTip;
import com.yidianling.im.session.viewholder.MsgViewHolderConsult;
import com.yidianling.im.session.viewholder.MsgViewHolderConsultCallStatus;
......@@ -415,6 +417,7 @@ public class SessionHelper {
NimUIKit.registerMsgItemViewHolder(CustomCustomerServiceCardAttachment.class, MsgViewHolderCustomerServiceCard.class);//客服小壹名片
NimUIKit.registerMsgItemViewHolder(CustomAttachmentShareMsg.class, MsgViewHolderShareMsg.class);//分享推送
NimUIKit.registerMsgItemViewHolder(CustomAttachConsultCallStatus.class, MsgViewHolderConsultCallStatus.class);//咨询声网的拨打状态
NimUIKit.registerMsgItemViewHolder(CustomAttachAssistantReceivedMoney.class, MsgViewHolderAssistantReceivedMoney.class);
}
private static void setSessionListener() {
......
package com.yidianling.im.session.extension;
import com.alibaba.fastjson.JSONObject;
/**
* 收款消息拓展
* Created by harvie on 2017/1/10.
*/
public class CustomAttachAssistantReceivedMoney extends CustomAttachment {
private static final String KEY_TITLE = "title";
private static final String KEY_NUM = "num";
private static final String KEY_ORPAY = "orPay";
private static final String KEY_URL = "url";
private String num = "";//订单金额
private String title = "";//订单标题题
private int orPay;//支付状态 0未支付1已支付
private String url = "";//订单id
public CustomAttachAssistantReceivedMoney() {
super(CustomAttachmentType.ASSISTANT_RECEIVEDMONEY);
}
public CustomAttachAssistantReceivedMoney(String num, String title, int orPay, String url) {
super(CustomAttachmentType.ASSISTANT_RECEIVEDMONEY);
this.num = num;
this.title = title;
this.orPay = orPay;
this.url = url;
}
@Override
protected void parseData(JSONObject data) {
this.url = data.getString(KEY_URL);
this.title = data.getString(KEY_TITLE);
this.num = data.getString(KEY_NUM);
this.orPay = data.getInteger(KEY_ORPAY);
}
@Override
protected JSONObject packData() {
JSONObject data = new JSONObject();
data.put(KEY_URL, url);
data.put(KEY_TITLE, title);
data.put(KEY_NUM, num);
data.put(KEY_ORPAY, orPay);
return data;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public int getOrPay() {
return orPay;
}
public String getTitle() {
return title;
}
public String getNum() {
return num;
}
public void setNum(String num) {
this.num = num;
}
public void setTitle(String title) {
this.title = title;
}
public void setOrPay(int orPay) {
this.orPay = orPay;
}
}
......@@ -115,6 +115,9 @@ public class CustomAttachParser implements MsgAttachmentParser {
//咨询的声网拨打状态的自定义消息
attachment = new CustomAttachConsultCallStatus();
break;
case CustomAttachmentType.ASSISTANT_RECEIVEDMONEY:
attachment = new CustomAttachAssistantReceivedMoney();
break;
default:
attachment = new DefaultCustomAttachment();
break;
......
......@@ -34,4 +34,5 @@ public interface CustomAttachmentType {
int TYPE_PUSH_SHARE = 30;// 分享,倾诉推荐,课程,测评,文章
int TYPE_CUSTOMER_SERVICE = 31; //客服名片
int TYPE_CUSTOMER_CONSULT_CALL_STATUS = 32; //咨询的声网拨打状态的自定义消息
int ASSISTANT_RECEIVEDMONEY = 33;//发起收款
}
package com.yidianling.im.session.viewholder;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import com.ydl.webview.H5Params;
import com.ydl.webview.NewH5Activity;
import com.ydl.ydlcommon.base.config.HttpConfig;
import com.yidianling.im.R;
import com.yidianling.im.session.extension.CustomAttachAssistantReceivedMoney;
import com.yidianling.im.session.extension.CustomAttachReceivedMoney;
import com.yidianling.nimbase.common.ui.recyclerview.adapter.BaseMultiItemFetchLoadAdapter;
import com.yidianling.uikit.business.session.viewholder.MsgViewHolderBase;
/**
* 收款消息拓展
* Created by wi1ls on 2017/1/10.
*/
public class MsgViewHolderAssistantReceivedMoney extends MsgViewHolderBase {
private String num;//订单金额
private String title;//订单标题题
private int orPay;//支付状态 0未支付1已支付
private String url;//订单url
private View message_received;
private TextView tit,content;
private ImageView img;
public MsgViewHolderAssistantReceivedMoney(BaseMultiItemFetchLoadAdapter adapter) {
super(adapter);
}
@Override
protected int getContentResId() {
return R.layout.im_ui_message_received_money;
}
@Override
protected void inflateContentView() {
message_received=findViewById(R.id.message_received);
tit = findViewById(R.id.packet_title);
content = findViewById(R.id.text_content);
img = findViewById(R.id.packte_im);
}
@Override
protected void bindContentView() {
CustomAttachAssistantReceivedMoney customAttachReceivedMoney= (CustomAttachAssistantReceivedMoney) message.getAttachment();
url=customAttachReceivedMoney.getUrl();
num = customAttachReceivedMoney.getNum();
title = customAttachReceivedMoney.getTitle();
orPay = customAttachReceivedMoney.getOrPay();
num = customAttachReceivedMoney.getNum();
if (title!=null)tit.setText(title);
if (orPay == 1) {
//支付成功
if (num!=null)content.setText("您支付了"+num+"元");
img.setImageDrawable(view.getResources().getDrawable(R.mipmap.im_zhifu));
}else{
if (num!=null)content.setText("您需要支付"+num+"元");
img.setImageDrawable(view.getResources().getDrawable(R.mipmap.im_weifu));
}
hideItemBg();
}
@Override
protected void onItemClick() {
if (isReceivedMessage()) {
NewH5Activity.start(view.getContext(), new H5Params(url, null));
}
}
}
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