Commit 9038e39e by 严久程

我的动态点击闪退修复

parent 5b4c5e73
...@@ -53,7 +53,7 @@ ext { ...@@ -53,7 +53,7 @@ ext {
"m-tests" : "0.0.15.3", "m-tests" : "0.0.15.3",
"m-course" : "0.0.34.4", "m-course" : "0.0.34.4",
"m-im" : "0.0.3.7", "m-im" : "0.0.3.7",
"m-dynamic" : "0.0.1.5", "m-dynamic" : "0.0.1.6",
//-------------- 业务模块 API 层 -------------- //-------------- 业务模块 API 层 --------------
......
...@@ -54,17 +54,6 @@ import java.util.* ...@@ -54,17 +54,6 @@ import java.util.*
class TrendsListFragment : BaseLazyFragment(), ITrendsListView, class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
internal var trends_rcv: RecyclerView? = null
internal var trends_lastr_swl: MultiSwipeRefreshLayout? = null
internal var trend_list_no_datas_rel: RelativeLayout? = null
// @BindView(R2.id.trend_last_more_pro_lin)
// LinearLayout loadingDataLin;
internal var cdl: CoordinatorLayout? = null
private val REQUEST_CODE = 1001 private val REQUEST_CODE = 1001
private val eachPageDataNum = 20 private val eachPageDataNum = 20
...@@ -117,7 +106,8 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -117,7 +106,8 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
//置顶帖Header View //置顶帖Header View
private val recommendTopHeaderView: View private val recommendTopHeaderView: View
get() { get() {
val view = LayoutInflater.from(activity).inflate(R.layout.dynamic_item_recommend_top, null) val view =
LayoutInflater.from(activity).inflate(R.layout.dynamic_item_recommend_top, null)
val linearLayoutManager = LinearLayoutManager(activity) val linearLayoutManager = LinearLayoutManager(activity)
mRecommendTopAdapter = RecommendTopAdapter<TrendsListBean.ExtData>(activity) mRecommendTopAdapter = RecommendTopAdapter<TrendsListBean.ExtData>(activity)
mRecommendTopRcv = view.findViewById<View>(R.id.recy_top) as RecyclerView mRecommendTopRcv = view.findViewById<View>(R.id.recy_top) as RecyclerView
...@@ -141,7 +131,8 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -141,7 +131,8 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
val view: View val view: View
if (trends_rcv != null) { if (trends_rcv != null) {
view = view =
LayoutInflater.from(activity).inflate(R.layout.dynamic_progress_item, trends_rcv, false) LayoutInflater.from(activity)
.inflate(R.layout.dynamic_progress_item, trends_rcv, false)
} else { } else {
view = LayoutInflater.from(activity).inflate(R.layout.dynamic_progress_item, null) view = LayoutInflater.from(activity).inflate(R.layout.dynamic_progress_item, null)
} }
...@@ -152,9 +143,7 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -152,9 +143,7 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
val isNeedLogin: Boolean val isNeedLogin: Boolean
get() { get() {
tab = arguments.getInt("tab") tab = arguments.getInt("tab")
return if (tab == 3) { return tab == 3
true
} else false
} }
private val lastId: Int private val lastId: Int
...@@ -481,18 +470,18 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView, ...@@ -481,18 +470,18 @@ class TrendsListFragment : BaseLazyFragment(), ITrendsListView,
} }
fun initClick() { fun initClick() {
recommend_trend_add_iv.setOnClickListener { recommend_trend_add_iv.setOnClickListener {
if (!DynamicIn.isLogin()) { if (!DynamicIn.isLogin()) {
startActivity(DynamicIn.loginWayIntent(activity)) startActivity(DynamicIn.loginWayIntent(activity))
LogUtil.d("start ChooseLoginWayActivity") LogUtil.d("start ChooseLoginWayActivity")
} else { } else {
val intent = Intent(activity.applicationContext, PublishTrendActivity::class.java) val intent = Intent(activity.applicationContext, PublishTrendActivity::class.java)
val bundle = Bundle() val bundle = Bundle()
bundle.putString(DynamicConstants.PUBLISH_TYPE, "default_publish") bundle.putString(DynamicConstants.PUBLISH_TYPE, "default_publish")
intent.putExtra("bundle", bundle) intent.putExtra("bundle", bundle)
startActivity(intent) startActivity(intent)
}
} }
}
image_scroll_top.setOnClickListener { image_scroll_top.setOnClickListener {
scrollToTop() scrollToTop()
......
...@@ -178,7 +178,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -178,7 +178,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
//和助理私聊时的常用语逻辑 //和助理私聊时的常用语逻辑
rl_common_question_enter = rootView.findViewById(R.id.rl_common_question); rl_common_question_enter = rootView.findViewById(R.id.rl_common_question);
fl_question_content = rootView.findViewById(R.id.fl_question_content); fl_question_content = rootView.findViewById(R.id.fl_question_content);
rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE); rl_common_question_enter.setVisibility(ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3 ? View.VISIBLE : View.GONE);
if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 3) {
rl_common_question_enter.setOnClickListener(v -> { rl_common_question_enter.setOnClickListener(v -> {
...@@ -221,7 +221,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -221,7 +221,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
} }
// 初始化顶部专家信息栏 // 初始化顶部专家信息栏
if (ActionHandlerStorage.getL(sessionId).getUserType() == 2) { if (ActionHandlerStorage.getL(sessionId) != null && ActionHandlerStorage.getL(sessionId).getUserType() == 2) {
top_expert_info_cl.setVisibility(View.VISIBLE); top_expert_info_cl.setVisibility(View.VISIBLE);
initTopCustomBar(); initTopCustomBar();
} }
...@@ -506,7 +506,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -506,7 +506,7 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
if (TextUtils.equals(userChatStatus, "true")) { if (TextUtils.equals(userChatStatus, "true")) {
messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, true); messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, true);
SharedPreferencesEditor.putString(chatStatusKey, "true"); SharedPreferencesEditor.putString(chatStatusKey, "true");
}else { } else {
messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, false); messageListPanel = new MessageListPanelEx(container, rootView, anchor, false, false);
} }
} else { } else {
...@@ -849,4 +849,5 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy { ...@@ -849,4 +849,5 @@ public class YDLMessageFragment extends TFragment implements ModuleProxy {
.subscribe(resp -> { .subscribe(resp -> {
}, throwable -> { }, throwable -> {
}); });
}} }
}
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