Commit 4c425445 by YKai

feat: 主马甲包同步专家档案功能

parent 759bef26
...@@ -21,8 +21,8 @@ import java.util.List; ...@@ -21,8 +21,8 @@ import java.util.List;
public final class DemoGlobalConfig implements IConfigModule { public final class DemoGlobalConfig implements IConfigModule {
String APP_DOMAIN = "https://api.github.com/"; String APP_DOMAIN = "https://api.github.com/";
// public static String appEnv = YDLConstants.ENV_AUTO_TEST; // public static String appEnv = YDLConstants.ENV_AUTO_TEST;
// public static String appEnv = YDLConstants.ENV_TEST; public static String appEnv = YDLConstants.ENV_TEST;
public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库 // public static String appEnv = YDLConstants.ENV_NEW_TEST;//配置未上传到maven库
// public static String appEnv = YDLConstants.ENV_PROD; // public static String appEnv = YDLConstants.ENV_PROD;
@Override @Override
public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) { public void injectAppLifecycle(@NotNull Context context, @NotNull List<IAppLifecycles> lifecycles) {
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -99,8 +99,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -99,8 +99,8 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
} }
private fun initAdapter() { private fun initAdapter() {
mPresenter?.localHomeData(mContext!!, "home_data_xlzx.json") mPresenter?.localHomeData(mContext, "home_data_xlzx.json")
adapter = YdlHomeAdapter(mContext!!, homeEvent!!, ArrayList()) adapter = YdlHomeAdapter(mContext, homeEvent!!, ArrayList())
val layoutManager = val layoutManager =
LinearLayoutManager(context) LinearLayoutManager(context)
home_module_fragment_recycler.layoutManager = layoutManager home_module_fragment_recycler.layoutManager = layoutManager
...@@ -116,7 +116,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>() ...@@ -116,7 +116,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
home_swipe_refresh_layout.setOnRefreshListener(this) home_swipe_refresh_layout.setOnRefreshListener(this)
home_swipe_refresh_layout.setColorSchemeColors( home_swipe_refresh_layout.setColorSchemeColors(
ContextCompat.getColor( ContextCompat.getColor(
mContext!!, mContext,
R.color.platform_main_theme R.color.platform_main_theme
) )
) )
......
...@@ -101,10 +101,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -101,10 +101,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
tab_layout.addOnTabSelectedListener(listener!!) tab_layout.addOnTabSelectedListener(listener!!)
try { try {
var textView = tab_layout.getTabAt(0) as TextView var textView = tab_layout.getTabAt(0) as TextView
if (textView != null && textView is TextView) {
updateText(textView, true) updateText(textView, true)
}
} catch (e: Exception) {} } catch (e: Exception) {}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
tab_layout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY -> tab_layout.setOnScrollChangeListener { v, scrollX, scrollY, oldScrollX, oldScrollY ->
...@@ -133,12 +130,12 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -133,12 +130,12 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
//创建HomeConsultItemView:每个tab最多显示四个专家 //创建HomeConsultItemView:每个tab最多显示四个专家
if (cacheInfoViewList!!.size >= list.size) { if (cacheInfoViewList!!.size >= list.size) {
for (index in 0 until list!!.size) { for (index in list.indices) {
//设置数据 //设置数据
cacheInfoViewList!![index].setData( cacheInfoViewList!![index].setData(
list[index]!!, list[index],
index, index,
index == list!!.size - 1, index == list.size - 1,
"${category?.id}" "${category?.id}"
) )
cacheInfoViewList!![index].layoutParams = getViewLayoutParams(index) cacheInfoViewList!![index].layoutParams = getViewLayoutParams(index)
...@@ -146,7 +143,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -146,7 +143,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
ll_content.addView(cacheInfoViewList!![index]) ll_content.addView(cacheInfoViewList!![index])
} }
} else { } else {
for (index in 0 until list!!.size) { for (index in list.indices) {
if (index > 3) { if (index > 3) {
//只取前四条数据 //只取前四条数据
break break
...@@ -158,9 +155,9 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -158,9 +155,9 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
} }
//设置数据 //设置数据
cacheInfoViewList!![index].setData( cacheInfoViewList!![index].setData(
list[index]!!, list[index],
index, index,
index == list!!.size - 1, index == list.size - 1,
"${category?.id}" "${category?.id}"
) )
cacheInfoViewList!![index].layoutParams = getViewLayoutParams(index) cacheInfoViewList!![index].layoutParams = getViewLayoutParams(index)
...@@ -205,21 +202,17 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -205,21 +202,17 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
override fun onTabUnselected(tab: TabLayout.Tab?) { override fun onTabUnselected(tab: TabLayout.Tab?) {
var textView = tabLayout?.getTabAt(tab?.position!!)?.customView as TextView var textView = tabLayout?.getTabAt(tab?.position!!)?.customView as TextView
if (textView != null && textView is TextView) {
updateText(textView, false) updateText(textView, false)
} }
}
override fun onTabSelected(tab: TabLayout.Tab?) { override fun onTabSelected(tab: TabLayout.Tab?) {
if (mLastPosition == tab!!.position) { if (mLastPosition == tab!!.position) {
return return
} }
var textView = tabLayout?.getTabAt(tab?.position!!)?.customView as TextView var textView = tabLayout?.getTabAt(tab.position)?.customView as TextView
if (textView != null && textView is TextView) {
updateText(textView, true) updateText(textView, true)
} homeEvent!!.getConsultData(list!![tab.position], tab.position)
homeEvent!!.getConsultData(list!![tab!!.position], tab!!.position)
} }
} }
......
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