Commit 4c425445 by YKai

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

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