Commit 3839b0c4 by 徐健

网络库空指针,首页和消息模块的部分bug

parent c0d6d99e
......@@ -20,7 +20,7 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST;
public static String appEnv = YDLConstants.ENV_PROD;
public static String appEnv = YDLConstants.ENV_TEST;
// public static String appEnv = YDLConstants.ENV_TEST;
@Override
......
......@@ -3,6 +3,7 @@ package com.ydl.component.service.web;
import android.app.Activity;
import com.ydl.webview.H5JsBean;
import com.ydl.webview.NewH5Activity;
/**
* webview 点击事件监听 抽象类
......@@ -395,4 +396,19 @@ public class WVClickAbstractListener implements WebViewClientClickListener {
public void goHome(H5JsBean.H5JsCmd.Params params) {
}
@Override
public void sendUnReadNum(String callbackFuncName, String uid) {
final StringBuffer sb = new StringBuffer();
sb.append(callbackFuncName);
sb.append("('");
sb.append("333");
sb.append("')");
if (mContext instanceof NewH5Activity) {
((NewH5Activity) mContext).callJSFunc(sb.toString());
}
}
}
......@@ -364,6 +364,9 @@ class WebJavascriptHandler : IJavascriptHandler{
"goHome" -> {
wvEnventPro?.goHome(jsData.cmd?.params)
}
"chatUnread" -> {
wvEnventPro?.sendUnReadNum(jsData.cmd!!.callBack, jsData.cmd!!.params?.uid.toString())
}
}
}
}
......@@ -173,4 +173,6 @@ public interface WebViewClientClickListener {
void goHome(H5JsBean.H5JsCmd.Params params);
//保存图片
// void storePic();
void sendUnReadNum(String callbackFuncName, String uid);
}
......@@ -5,8 +5,8 @@ ext {
ydl_app = [
appName : "心理咨询壹点灵",
applicationId: "com.cxzapp.yidianling",
versionName : "4.0.00",
versionCode : 4000,
versionName : "4.0.31",
versionCode : 4031,
]
xlzx_app = [
......@@ -47,7 +47,7 @@ ext {
"m-consultant" : "0.0.51.3",
"m-fm" : "0.0.23.3",
"m-user" : "0.0.40.3",
"m-home" : "0.0.6.18",
"m-home" : "0.0.6.19",
"m-muse" : "0.0.20.3",
"m-tests" : "0.0.15.2",
......@@ -66,7 +66,7 @@ ext {
"m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9",
"m-home-api" : "0.0.3",
"m-im-api" : "0.0.3",
"m-im-api" : "0.0.4",
"m-dynamic-api" : "0.0.1",
//-------------- 功能组件 --------------
......@@ -74,7 +74,7 @@ ext {
"ydl-platform" : "0.0.29.1",
//第二步 若干
"ydl-webview" : "0.0.28.4",
"ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
......@@ -111,7 +111,7 @@ ext {
"m-tests-api" : "0.0.1",
"m-user-api" : "0.0.9",
"m-home-api" : "0.0.3",
"m-im-api" : "0.0.3",
"m-im-api" : "0.0.4",
"m-dynamic-api" : "0.0.1",
//-------------- 功能组件 --------------
......@@ -119,7 +119,7 @@ ext {
"ydl-platform" : "0.0.29.1",
//第二步 若干
"ydl-webview" : "0.0.28.3",
"ydl-webview" : "0.0.28.5",
"ydl-media" : "0.0.14.3",
"ydl-pay" : "0.0.11.4",
"m-audioim" : "0.0.40.3",
......
......@@ -104,73 +104,71 @@ class HomeConfideRecyleSuspendListener : RecyclerView.OnScrollListener() {
if (mCurrentPosition != manager.findFirstVisibleItemPosition() && manager.findFirstVisibleItemPosition() != -1) {
mCurrentPosition = manager.findFirstVisibleItemPosition()
}
if (adapter!!.itemCount > mCurrentPosition && mCurrentPosition != 0) {
if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONFIDE_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.childCount > 1 && view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
confideFilterView!!.visibility = View.VISIBLE
} else {
confideFilterView!!.visibility = View.INVISIBLE
}
if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONFIDE_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.childCount > 1 && view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
confideFilterView!!.visibility = View.VISIBLE
} else {
confideFilterView!!.visibility = View.INVISIBLE
}
}
}
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
confideFilterView!!.visibility = View.INVISIBLE
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
confideFilterView!!.visibility = View.INVISIBLE
}
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONSULT_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
consultFilterView?.visibility = View.VISIBLE
} else {
consultFilterView?.visibility = View.INVISIBLE
}
}
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.CONSULT_VIEW) {
val view = manager.findViewByPosition(mCurrentPosition)
if (view != null) {
if (view is ViewGroup) {
if (view.getChildAt(1) is TabLayout) {
val tabLayout = view.getChildAt(1)
val location = IntArray(2)
tabLayout.getLocationOnScreen(location)
if (location[1] - RxImageTool.dip2px(40f) <= mSuspensionHeight) {
consultFilterView?.visibility = View.VISIBLE
} else {
consultFilterView?.visibility = View.INVISIBLE
}
}
}
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
consultFilterView!!.visibility = View.INVISIBLE
}
val nextView = manager.findViewByPosition(mCurrentPosition + 1)
if (nextView != null) {
if (nextView.top <= (mSuspensionHeight + RxImageTool.dip2px(41f))) {
consultFilterView!!.visibility = View.INVISIBLE
}
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW) {
if (excuteStartAnim) {
mHomeView?.startAnim()
excuteStartAnim = false
excuteEndAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
if (excuteEndAnim) {
mHomeView?.endAnim()
excuteEndAnim = false
excuteStartAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else {
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
}
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.BUTTON_BANNER_VIEW) {
if (excuteStartAnim) {
mHomeView?.startAnim()
excuteStartAnim = false
excuteEndAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else if (adapter!!.getItemViewType(mCurrentPosition) == YdlHomeViewHolderConstract.PAGER_BANNER_VIEW) {
if (excuteEndAnim) {
mHomeView?.endAnim()
excuteEndAnim = false
excuteStartAnim = true
}
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
} else {
confideFilterView?.visibility = View.INVISIBLE
consultFilterView?.visibility = View.INVISIBLE
}
}
......
......@@ -197,4 +197,8 @@ class IMServiceImpl : IImService {
//这里虽然是倾述流程进入私聊,但不需要发送自定义消息
IMUtil.startChat(context as AppCompatActivity, toUid, 0x001, canTalk, null, 0, false)
}
override fun getUnReadByUid(uid: String): Int {
return MsgReceiveHelper.getUnNum(uid)
}
}
\ No newline at end of file
......@@ -51,4 +51,9 @@ interface IImService : IProvider {
fun sendTestResultMessage(uid: String, content: String, title: String?, head: String?, url: String?, id: Int, share_url: String?, callback: IMRequestCallback<Void>)
fun startChat(context : Activity ,toUid : String ,flag : Int , canTalk : Int)
/**
* 根据uid获取未读数
*/
fun getUnReadByUid(uid: String): Int
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ class H5JsBean {
var params: Params? = null
var action_name: String? = null
var callBack: String = ""
class Params {
......
......@@ -247,6 +247,7 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 15秒后发送一条消息通知展示无网络页面
*/
private void sendNetLossMessage() {
if (null != mTimeOutHandler)
mTimeOutHandler.sendEmptyMessageDelayed(TIME_OUT_TYPE, timeOutLong);
}
......@@ -254,7 +255,9 @@ public class NewH5Activity extends BaseActivity implements PtrHandler {
* 取消预定15秒后发送的消息
*/
private void cancelSendNetLossMessage() {
mTimeOutHandler.removeMessages(TIME_OUT_TYPE);
if (null != mTimeOutHandler) {
mTimeOutHandler.removeMessages(TIME_OUT_TYPE);
}
}
private void initLoadingView() {
......
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