Commit 2aafb11b by 严久程

Merge branch 'feature/v3' of…

Merge branch 'feature/v3' of ssh://gitlab.yidianling.com:2224/app_android_lib/YDL-Component into feature/v3
parents 286a715f 84569c33
......@@ -202,7 +202,7 @@ dependencies {
// implementation project(':m-muse')
implementation project(':m-muse')
implementation project(':m-im')
implementation project(':m-dynamic')
......
......@@ -48,7 +48,7 @@ class BigShotOneView : LinearLayout {
}
fun setUrl(bean: ExpertSearchBigShotBean) {
GlideApp.with(mContext).load(bean.topicImages[0]).into(consultant_one_img_1)
GlideApp.with(mContext).load(bean.topicImages[0].imageUrl).into(consultant_one_img_1)
consultant_one_img_1.setOnClickListener {
val h5Params = H5Params(bean.specialTopicUrl, null)
NewH5Activity.start(context, h5Params)
......
......@@ -66,6 +66,12 @@ class RecommendListView : LinearLayout {
orientation = VERTICAL
View.inflate(mContext, R.layout.consultant_expert_search_top_all_view, this)
//无数据则隐藏所有布局
recommendViewPager.visibility = View.GONE
recommendViewPagerIndicator.visibility = View.GONE
itemListView.visibility = View.GONE
requestData()
}
......@@ -79,8 +85,20 @@ class RecommendListView : LinearLayout {
.observeOn(AndroidSchedulers.mainThread())
.subscribe(Consumer {
if (null != mContext) {
mSceneSpecialTopicList.addAll(it.sceneSpecialTopics)
mDoctorSpecialTopicsList.addAll(it.doctorSpecialTopics)
if (it.sceneSpecialTopics == null || it.sceneSpecialTopics.size == 0) {
recommendViewPager.visibility = View.GONE
recommendViewPagerIndicator.visibility = View.GONE
}else {
mSceneSpecialTopicList.addAll(it.sceneSpecialTopics)
recommendViewPager.visibility = View.VISIBLE
recommendViewPagerIndicator.visibility = View.VISIBLE
}
if (it.doctorSpecialTopics == null || it.doctorSpecialTopics.size == 0) {
itemListView.visibility = View.GONE
}else {
mDoctorSpecialTopicsList.addAll(it.doctorSpecialTopics)
itemListView.visibility = View.VISIBLE
}
setData()
}
......@@ -318,7 +336,7 @@ class RecommendListView : LinearLayout {
val mView1 = BigShotTwoView(mContext!!)
mView.setUrl(mDoctorSpecialTopicsList[0], mDoctorSpecialTopicsList[1], mDoctorSpecialTopicsList[2])
mView1.setUrl(mDoctorSpecialTopicsList[3], mDoctorSpecialTopicsList[3])
mView1.setUrl(mDoctorSpecialTopicsList[3], mDoctorSpecialTopicsList[4])
itemListView.addView(mView)
itemListView.addView(mView1)
}
......
......@@ -12,6 +12,7 @@
android:background="#FAFAFA" />
<LinearLayout
android:id="@+id/recommendViewPagerIndicator"
android:layout_width="match_parent"
android:layout_height="15dp"
android:orientation="horizontal"
......
......@@ -24,7 +24,7 @@ modular {
groupId = "com.ydl"
artifactId = "m-im-api"
//开发时注释掉版本号,发布api时打开
version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// version = rootProject.ext.ydlPublishVersion[childProject.getName()+"-api"]
// API 层打包时需要引入的依赖
apiDependencies {
implementation "com.google.code.gson:gson:2.8.2"
......
package com.yidianling.im.helper;
import android.os.Build;
import android.support.annotation.RequiresApi;
import com.netease.nimlib.sdk.NIMClient;
import com.netease.nimlib.sdk.NIMSDK;
import com.netease.nimlib.sdk.RequestCallbackWrapper;
......@@ -11,10 +14,13 @@ import com.netease.nimlib.sdk.team.model.MemberChangeAttachment;
import com.yidianling.common.tools.LogUtil;
import com.yidianling.im.event.UpdateTabUnreadNumEvent;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import de.greenrobot.event.EventBus;
import io.reactivex.Observable;
......@@ -41,6 +47,26 @@ public class MsgReceiveHelper {
}
}
/**
* 获取所有未读数
* @return
*/
public static int getAllUnNum() {
Object[] list = unreadNumMap.values().toArray();
int sum = 0;
for (int i=0;i<list.length;i++) {
try {
sum += Integer.parseInt(list[0].toString());
}catch (Exception e) {
sum += 0;
}
}
return sum;
}
public static void onMessageReceived() {
reQueryUnreadNum();
......
......@@ -201,4 +201,8 @@ class IMServiceImpl : IImService {
override fun getUnReadByUid(uid: String): Int {
return MsgReceiveHelper.getUnNum(uid)
}
override fun getAllUnReadNum(): Int {
return MsgReceiveHelper.getAllUnNum()
}
}
\ No newline at end of file
......@@ -53,7 +53,13 @@ interface IImService : IProvider {
fun startChat(context : Activity ,toUid : String ,flag : Int , canTalk : Int)
/**
* 根据uid获取未读数
* 根据对方uid获取未读数
*/
fun getUnReadByUid(uid: String): Int
/**
* 获取自己的所有未读数
*/
fun getAllUnReadNum(): Int
}
\ No newline at end of file
package com.ydl.utils;
import android.content.Context;
import android.graphics.drawable.BitmapDrawable;
import android.view.Gravity;
import android.view.View;
import android.view.WindowManager;
import android.widget.PopupWindow;
import com.ydl.view.MoreClickView;
/**
* Created by Wi1ls on 2016/10/17;
*/
public class PopUtils {
public static PopupWindow showMoreItem(Context context, View view, int offX, int offY){
MoreClickView v= new MoreClickView(context);
WindowManager windowManager= (WindowManager) context.getSystemService(Context.WINDOW_SERVICE);
final PopupWindow popupWindow=new PopupWindow(v, windowManager.getDefaultDisplay().getWidth(),
windowManager.getDefaultDisplay().getHeight());
v.setPopupWindow(popupWindow);
popupWindow.setFocusable(false);
popupWindow.setOutsideTouchable(true);
popupWindow.setBackgroundDrawable(new BitmapDrawable());
popupWindow.showAtLocation(view, Gravity.CENTER,0,0);
return popupWindow;
}
}
package com.ydl.view
import android.content.Context
import android.content.Intent
import android.net.Uri
import android.text.TextUtils
import android.util.AttributeSet
import android.view.View
import android.widget.PopupWindow
import android.widget.RelativeLayout
import com.ydl.webview.R
import com.ydl.ydlcommon.data.PlatformDataManager
import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.router.YdlCommonRouterManager
import com.ydl.ydlcommon.view.dialog.CommonDialog
import com.yidianling.im.api.service.IImService
import kotlinx.android.synthetic.main.web_ui_new_more.view.*
/**
* Created by Wi1ls on 2016/10/17;
*/
class MoreClickView @JvmOverloads constructor(private val mContext: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0) : RelativeLayout(mContext, attrs, defStyleAttr), View.OnClickListener {
private var mPopupWindow: PopupWindow? = null
private val work_time = if (PlatformDataManager.getRam().getGlobalInfo() == null) "早8:30-凌晨2:00" else PlatformDataManager.getRam().getGlobalInfo()?.info?.work_time
private val tel = if (PlatformDataManager.getRam().getGlobalInfo() == null) "400-114-1010'" else PlatformDataManager.getRam().getGlobalInfo()?.info?.tel
init {
View.inflate(mContext, R.layout.web_ui_new_more, this)
init()
}
internal fun init() {
fl_main.setOnClickListener(this)
more_msg.setOnClickListener(this)
more_homepage.setOnClickListener(this)
more_service.setOnClickListener(this)
more_ray.setOnClickListener(this)
/* if (YdlCommonRouterManager.getYdlCommonRoute().isHasUnread()) {
msg_new.setVisibility(View.VISIBLE)
} else {
msg_new.setVisibility(View.INVISIBLE)
}*/
un_read_num.text = ModularServiceManager.provide(IImService::class.java).getAllUnReadNum().toString()
}
override fun onClick(view: View) {
if (mPopupWindow != null && mPopupWindow!!.isShowing) {
mPopupWindow!!.dismiss()
}
when (view.id) {
R.id.fl_main -> {
}
R.id.more_msg -> setMoreMsg()
R.id.more_homepage -> setMoreHomePage()
R.id.more_service -> setMoreService()
R.id.more_ray -> setMoreRay()
}
}
private fun setMoreMsg() {
if (PlatformDataManager.getRam().getChannelName().startsWith("ATK_3")) {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 2, null)
} else {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 3, null)
}
}
private fun setMoreHomePage() {
YdlCommonRouterManager.getYdlCommonRoute().startMain(context, 0, null)
}
private fun setMoreService() {
YdlCommonRouterManager.getYdlCommonRoute().setMoreService(context)
}
private fun setMoreRay() {
CommonDialog(context)
.setMessage("欢迎致电壹点灵客服热线\n" + PlatformDataManager.getRam().getGlobalInfo()?.info?.tel + "\n服务时间:" + work_time)
.setLeftOnclick("取消", null)
.setRightClick("拨打") {
if (null != tel && !TextUtils.isEmpty(tel)) {
val phoneIntent = Intent(Intent.ACTION_DIAL, Uri.parse("tel:$tel"))
context.startActivity(phoneIntent)
}
}.show()
}
private var callBack: CallPhoneCallBack? = null
fun setCallPhoneCallBack(callBack: CallPhoneCallBack) {
this.callBack = callBack
}
interface CallPhoneCallBack {
fun call(tel: String, action: String)
}
fun setPopupWindow(popupWindow: PopupWindow) {
mPopupWindow = popupWindow
}
}
......@@ -35,6 +35,7 @@ import com.tencent.smtt.sdk.WebView;
import com.tencent.smtt.sdk.WebViewClient;
import com.umeng.socialize.UMShareAPI;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.ydl.utils.PopUtils;
import com.ydl.ydl_router.manager.YDLRouterManager;
import com.ydl.ydlcommon.base.BaseActivity;
import com.ydl.ydlcommon.base.BaseApp;
......@@ -44,7 +45,6 @@ import com.ydl.ydlcommon.ui.LogoLoadingView;
import com.ydl.ydlcommon.utils.BuryPointUtils;
import com.ydl.ydlcommon.utils.LogUtil;
import com.ydl.ydlcommon.utils.NetWorkSpeedUtils;
import com.ydl.ydlcommon.utils.PopUtils;
import com.ydl.ydlcommon.utils.StatusBarUtils;
import com.ydl.ydlcommon.utils.TemporaryUtils;
import com.ydl.ydlcommon.utils.URLUtils;
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:radius="7dp"/>
<solid android:color="#FF5040"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/fl_main"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="150dp"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_gravity="right"
android:elevation="4dp"
android:background="@color/platform_white"
android:layout_marginTop="55dp"
android:layout_marginRight="5dp">
<LinearLayout
android:id="@+id/more_msg"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_news"/>
<TextView
android:id="@+id/tv_msg"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="消息"
android:textColor="#333333"/>
<TextView
android:id="@+id/un_read_num"
android:layout_width="wrap_content"
android:layout_height="14dp"
android:textSize="10dp"
tools:text="10"
android:textColor="#ffffff"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:gravity="center"
android:background="@drawable/web_message_num_bg"
android:layout_marginLeft="5dp"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
<LinearLayout
android:id="@+id/more_homepage"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_home"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="首页"
android:textColor="#333333"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
<LinearLayout
android:id="@+id/more_service"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_kefu"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="在线客服"
android:textColor="#333333"/>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#e5e5e5"
android:layout_marginRight="2dp"/>
<LinearLayout
android:id="@+id/more_ray"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:gravity="center_vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="19dp"
android:layout_marginRight="15dp"
android:src="@drawable/platform_ic_pop_phone"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="17sp"
android:text="免费热线"
android:textColor="#333333"/>
</LinearLayout>
</LinearLayout>
</FrameLayout>
\ 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