Commit cad1c67e by ydl

backup

parent 0fd403d0
...@@ -20,8 +20,8 @@ import java.util.List; ...@@ -20,8 +20,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_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) {
......
ext { ext {
kotlin_version = "1.3.21" kotlin_version = "1.3.21"
dev_mode = false dev_mode = true
ydlPublishVersion = [ ydlPublishVersion = [
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
......
...@@ -43,6 +43,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -43,6 +43,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private var listener: ConsultTabSelectedListener? = null private var listener: ConsultTabSelectedListener? = null
private var dp5: Int = 0 private var dp5: Int = 0
private var dp7: Int = 0
private var dp10: Int = 0 private var dp10: Int = 0
private var dp16: Int = 0 private var dp16: Int = 0
...@@ -52,6 +53,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -52,6 +53,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private fun initView() { private fun initView() {
dp5 = RxImageTool.dp2px(5f) dp5 = RxImageTool.dp2px(5f)
dp7 = RxImageTool.dp2px(7f)
dp10 = RxImageTool.dp2px(10f) dp10 = RxImageTool.dp2px(10f)
dp16 = RxImageTool.dp2px(16f) dp16 = RxImageTool.dp2px(16f)
...@@ -126,7 +128,6 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -126,7 +128,6 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
cacheInfoViewList = ArrayList() cacheInfoViewList = ArrayList()
} }
// TODO xj
//创建HomeConsultItemView:每个tab最多显示四个专家 //创建HomeConsultItemView:每个tab最多显示四个专家
if (cacheInfoViewList!!.size >= list.size) { if (cacheInfoViewList!!.size >= list.size) {
for (index in 0 until list!!.size) { for (index in 0 until list!!.size) {
...@@ -144,7 +145,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -144,7 +145,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
} else { } else {
for (index in 0 until list!!.size) { for (index in 0 until list!!.size) {
if (index > 3) { if (index > 3) {
//只取前条数据 //只取前条数据
break break
} }
//数据大于缓存view数量,创建view //数据大于缓存view数量,创建view
...@@ -223,12 +224,12 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom ...@@ -223,12 +224,12 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
if (!isSelected) { if (!isSelected) {
txtView.textSize = 12f txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#999999")) txtView.setTextColor(Color.parseColor("#999999"))
txtView.setPadding(dp10, dp5, dp10, dp5) txtView.setPadding(dp10, dp5, dp10, dp7)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_unselected_bg) txtView.setBackgroundResource(R.drawable.home_consult_tab_item_unselected_bg)
} else { } else {
txtView.textSize = 12f txtView.textSize = 12f
txtView.setTextColor(Color.parseColor("#FD9B0A")) txtView.setTextColor(Color.parseColor("#FD9B0A"))
txtView.setPadding(dp10, dp5, dp10, dp5) txtView.setPadding(dp10, dp5, dp10, dp7)
txtView.setBackgroundResource(R.drawable.home_consult_tab_item_selected_bg) txtView.setBackgroundResource(R.drawable.home_consult_tab_item_selected_bg)
} }
......
package com.yidianling.home.ui.view package com.yidianling.home.ui.view
import android.annotation.SuppressLint
import android.content.Context import android.content.Context
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -36,6 +37,7 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I ...@@ -36,6 +37,7 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I
/** /**
* 刷新数据 * 刷新数据
*/ */
@SuppressLint("SetTextI18n")
fun updateData(bean: HomeCourseBean.ListBean?) { fun updateData(bean: HomeCourseBean.ListBean?) {
YDLImageCacheManager.showImage(mContext, bean?.pic, homeModuleCourseItemViewImg) YDLImageCacheManager.showImage(mContext, bean?.pic, homeModuleCourseItemViewImg)
...@@ -48,15 +50,29 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I ...@@ -48,15 +50,29 @@ class HomeCourseItemView(private val mContext: Context, private var homeEvent: I
} else { } else {
if (bean?.isPromotion == 1) { if (bean?.isPromotion == 1) {
homeModuleCourseItemViewExpensePrice.text = homeModuleCourseItemViewExpensePrice.text =
"¥" + String.format("%.2f", bean?.promotionApplyFee!!) "¥" + getLastPrice(String.format("%.2f", bean?.promotionApplyFee?:0))
} else { } else {
homeModuleCourseItemViewExpensePrice.text = homeModuleCourseItemViewExpensePrice.text =
"¥" + String.format("%.2f", bean?.applyFee!!) "¥" + getLastPrice(String.format("%.2f", bean?.applyFee?:0))
} }
} }
setOnClickListener { setOnClickListener {
homeEvent?.courseItemClick(bean) bean?.let {
homeEvent?.courseItemClick(bean)
}
}
}
fun getLastPrice(price: String): String {
if (price.length > 3) {
if ("0".equals(price[price.lastIndex]) && "0".equals(price[price.lastIndex - 1]) && ".".equals(
price[price.lastIndex - 2]
)
) {
return price.substring(0, price.length - 3)
}
} }
return price
} }
} }
\ No newline at end of file
...@@ -44,7 +44,13 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo ...@@ -44,7 +44,13 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
*/ */
fun updateData(bean: HomeTestItemBean, isLast: Boolean) { fun updateData(bean: HomeTestItemBean, isLast: Boolean) {
tv_test_item_name.text = bean.name tv_test_item_name.text = bean.name
tv_tested_count.text = bean.testNum.toString() var numStr = ""
if (bean.testNum >= 10000) {
numStr = String.format("%.1f", (bean.testNum / 10000.0)) + "万"
} else {
numStr = bean.testNum.toString()
}
tv_tested_count.text = numStr
YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item) YDLImageCacheManager.showImage(mContext, bean?.shareImage, iv_test_item)
this.setOnClickListener { this.setOnClickListener {
...@@ -57,7 +63,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo ...@@ -57,7 +63,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
* 电台第二个item会有一个marginTop值 * 电台第二个item会有一个marginTop值
*/ */
fun setTopMargin() { fun setTopMargin() {
params?.topMargin = RxImageTool.dp2px(16f) params?.topMargin = RxImageTool.dp2px(15f)
layoutParams = params layoutParams = params
} }
...@@ -65,7 +71,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo ...@@ -65,7 +71,7 @@ class HomeTestItemView(private val mContext: Context, private var homeEvent: IHo
* 电台最后一个item会有一个marginBottom值 * 电台最后一个item会有一个marginBottom值
*/ */
fun setBottomMargin() { fun setBottomMargin() {
params?.bottomMargin = RxImageTool.dp2px(16f) params?.bottomMargin = RxImageTool.dp2px(15f)
layoutParams = params layoutParams = params
} }
} }
\ No newline at end of file
...@@ -55,9 +55,9 @@ class HomeTestView(private val mContext: Context, private var homeEvent: HomeImp ...@@ -55,9 +55,9 @@ class HomeTestView(private val mContext: Context, private var homeEvent: HomeImp
if (index == 1) { if (index == 1) {
itemView.setTopMargin() itemView.setTopMargin()
} }
// else if (index == homeModuleIntelligentViewAddLayout.childCount -1) { if (index == homeModuleIntelligentViewAddLayout.childCount -1) {
// itemView.setBottomMargin() itemView.setBottomMargin()
// } }
itemView.updateData(list[index],index == list.size - 1) itemView.updateData(list[index],index == list.size - 1)
}else if (itemView is HomeTestTopItemView) { }else if (itemView is HomeTestTopItemView) {
itemView.updateData(list[index]) itemView.updateData(list[index])
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="@color/platform_color_F5F5F5"/> <solid android:color="@color/platform_color_F6F6F6"/>
<corners android:radius="@dimen/platform_dp_14" /> <corners android:radius="@dimen/platform_dp_14" />
</shape> </shape>
\ No newline at end of file
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="咨询沟通" android:text="咨询沟通"
android:layout_marginTop="7dp" android:layout_marginTop="3dp"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="13dp"/> android:textSize="13dp"/>
</LinearLayout> </LinearLayout>
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="心理测试" android:text="心理测试"
android:layout_marginTop="7dp" android:layout_marginTop="3dp"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="13dp"/> android:textSize="13dp"/>
</LinearLayout> </LinearLayout>
...@@ -79,7 +79,7 @@ ...@@ -79,7 +79,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="主题阅读" android:text="主题阅读"
android:layout_marginTop="7dp" android:layout_marginTop="3dp"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="13dp"/> android:textSize="13dp"/>
</LinearLayout> </LinearLayout>
...@@ -102,7 +102,7 @@ ...@@ -102,7 +102,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人生答疑" android:text="人生答疑"
android:layout_marginTop="7dp" android:layout_marginTop="3dp"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="13dp"/> android:textSize="13dp"/>
</LinearLayout> </LinearLayout>
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@+id/homeModuleCourseItemViewImgCardView" android:layout_below="@+id/homeModuleCourseItemViewImgCardView"
android:textSize="@dimen/platform_dp_16" android:textSize="@dimen/platform_dp_15"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textStyle="bold" android:textStyle="bold"
android:maxLines="2" android:maxLines="2"
......
...@@ -79,8 +79,8 @@ ...@@ -79,8 +79,8 @@
android:orientation="vertical" android:orientation="vertical"
android:gravity="center"> android:gravity="center">
<ImageView <ImageView
android:layout_width="23.3dp" android:layout_width="24dp"
android:layout_height="21.3dp" android:layout_height="24dp"
android:src="@drawable/home_module_top_xiaoyi_icon"/> android:src="@drawable/home_module_top_xiaoyi_icon"/>
</LinearLayout> </LinearLayout>
......
...@@ -5,12 +5,12 @@ ...@@ -5,12 +5,12 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical">
android:layout_marginBottom="30dp">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="15dp"
android:layout_marginBottom="12dp" android:layout_marginBottom="12dp"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginRight="15dp" android:layout_marginRight="15dp"
...@@ -72,7 +72,6 @@ ...@@ -72,7 +72,6 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:textColor="@color/platform_color_999999" android:textColor="@color/platform_color_999999"
android:textSize="@dimen/platform_dp_12" android:textSize="@dimen/platform_dp_12"
android:textStyle="bold"
tools:text="2486" tools:text="2486"
/> />
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="92dp" android:layout_height="92dp"
android:layout_marginBottom="30dp"
android:background="@drawable/home_test_top_view_layout_back"> android:background="@drawable/home_test_top_view_layout_back">
<TextView <TextView
......
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