Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
0504b3e1
Commit
0504b3e1
authored
May 16, 2020
by
ydl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页改版基本完成,等待接口
parent
a6cf9f10
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
252 additions
and
228 deletions
+252
-228
DemoGlobalConfig.java
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
+2
-2
config.gradle
config.gradle
+1
-1
YdlHomeFragment.kt
m-home/src/xlzx/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
+15
-1
HomeConsultItemView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
+10
-8
HomeConsultView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
+22
-2
HomeImageBannerView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeImageBannerView.kt
+13
-4
HomePagerBannerView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomePagerBannerView.kt
+0
-104
HomeModuleCategoryView.kt
m-home/src/xlzx/java/com/yidianling/home/ui/widget/HomeModuleCategoryView.kt
+119
-12
home_consult_chat_rest_bg.xml
m-home/src/xlzx/res/drawable/home_consult_chat_rest_bg.xml
+3
-5
home_button_banner_view.xml
m-home/src/xlzx/res/layout/home_button_banner_view.xml
+0
-1
home_common_title_view.xml
m-home/src/xlzx/res/layout/home_common_title_view.xml
+1
-1
home_confide_view.xml
m-home/src/xlzx/res/layout/home_confide_view.xml
+19
-24
home_consult_item_view.xml
m-home/src/xlzx/res/layout/home_consult_item_view.xml
+22
-31
home_image_banner_view.xml
m-home/src/xlzx/res/layout/home_image_banner_view.xml
+5
-6
home_layout_home_module_input.xml
m-home/src/xlzx/res/layout/home_layout_home_module_input.xml
+15
-8
home_pager_banner_view.xml
m-home/src/xlzx/res/layout/home_pager_banner_view.xml
+5
-18
No files found.
app/src/main/java/com/ydl/component/base/DemoGlobalConfig.java
View file @
0504b3e1
...
...
@@ -20,8 +20,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_PROD
;
public
static
String
appEnv
=
YDLConstants
.
ENV_TEST
;
//
public static String appEnv = YDLConstants.ENV_PROD;
@Override
public
void
injectAppLifecycle
(
@NotNull
Context
context
,
@NotNull
List
<
IAppLifecycles
>
lifecycles
)
{
...
...
config.gradle
View file @
0504b3e1
...
...
@@ -46,7 +46,7 @@ ext {
"m-consultant"
:
"0.0.59.7"
,
"m-fm"
:
"0.0.29.3"
,
"m-user"
:
"0.0.60.3"
,
"m-home"
:
"0.0.2
1.9
"
,
"m-home"
:
"0.0.2
2.6
"
,
"m-im"
:
"0.0.18.0"
,
"m-dynamic"
:
"0.0.7.5"
,
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/fragment/YdlHomeFragment.kt
View file @
0504b3e1
...
...
@@ -15,6 +15,7 @@ import com.ydl.webview.NewH5Activity
import
com.ydl.ydl_image.module.GlideApp
import
com.ydl.ydl_router.manager.YDLRouterManager
import
com.ydl.ydlcommon.base.BaseMvpFragment
import
com.ydl.ydlcommon.bean.StatusBarOptions
import
com.ydl.ydlcommon.data.http.BaseResponse
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.utils.*
...
...
@@ -33,6 +34,7 @@ import com.yidianling.home.model.bean.*
import
com.yidianling.home.presenter.HomePresenterImpl
import
com.yidianling.home.ui.utils.Double11ActivityManagerUtils
import
com.yidianling.home.ui.view.CouponDialog
import
com.yidianling.im.api.service.IImService
import
com.yidianling.user.api.service.IUserService
import
kotlinx.android.synthetic.xlzx.home_fragment_home_module.*
import
kotlinx.android.synthetic.xlzx.home_layout_home_module_content.*
...
...
@@ -83,6 +85,10 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
return
R
.
layout
.
home_fragment_home_module
}
override
fun
getStatusViewOptions
():
StatusBarOptions
{
return
StatusBarOptions
(
isAddStatusView
=
true
,
statusBarDarkMode
=
true
)
}
override
fun
initDataAndEvent
()
{
homeEvent
=
HomeImpl
(
activity
,
this
)
initView
()
...
...
@@ -109,9 +115,15 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
)
)
home_swipe_refresh_layout
.
setProgressViewOffset
(
false
,
0
,
200
)
home_swipe_refresh_layout
.
isEnabled
=
fals
e
home_swipe_refresh_layout
.
isEnabled
=
tru
e
etSearch
.
setOnClickListener
{
homeEvent
?.
searchTvClick
(
""
)
}
home_page_xiaoyi
.
setOnClickListener
{
activity
?.
let
{
ModularServiceManager
.
provide
(
IImService
::
class
.
java
).
startP2PXiaoYi
(
activity
)
}
}
// val inputLayoutParams = ll_search.layoutParams as CoordinatorLayout.LayoutParams
// val inputOriginMargin = inputLayoutParams.leftMargin
// var inputOffset = DisplayUtils.dp2px(context, 20).toFloat()
...
...
@@ -201,6 +213,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
if
(
act
!=
null
)
{
if
(!
TextUtils
.
isEmpty
(
act
.
imageUrl
))
{
img_ad
.
visibility
=
View
.
VISIBLE
img_ad_card
.
visibility
=
View
.
VISIBLE
GlideApp
.
with
(
this
).
load
(
act
.
imageUrl
).
into
(
img_ad
)
img_ad
.
setOnClickListener
{
if
(
Utils
.
isFastClick
())
{
...
...
@@ -215,6 +228,7 @@ class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>()
}
}
else
{
img_ad
.
visibility
=
View
.
GONE
img_ad_card
.
visibility
=
View
.
GONE
}
if
(!
TextUtils
.
isEmpty
(
act
.
imageBanner
))
{
val
va
=
SharedPreferencesEditor
.
getString
(
act
.
imageBanner
)
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultItemView.kt
View file @
0504b3e1
package
com.yidianling.home.ui.view
import
android.content.Context
import
android.graphics.Color
import
android.support.v4.content.ContextCompat
import
android.text.TextUtils
import
android.view.View
...
...
@@ -50,8 +51,6 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
setHead
(
bean
)
//设置名称
tv_consult_name
.
text
=
bean
.
name
//设置咨询师级别
tv_consult_jibie
.
text
=
bean
.
profesBack
//设置接通率文案
setConnection
(
bean
)
//设置向TA咨询人数
...
...
@@ -80,7 +79,7 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
tv_consult_num
.
visibility
=
View
.
GONE
}
else
{
tv_consult_num
.
visibility
=
View
.
VISIBLE
tv_consult_num
.
text
=
bodyBean
.
zixunOrderNum
.
toString
()
tv_consult_num
.
text
=
"${bodyBean.zixunOrderNum}次咨询"
}
}
...
...
@@ -93,7 +92,8 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
}
else
{
tv_feedback_rate
.
visibility
=
View
.
VISIBLE
try
{
val
str
=
String
.
format
(
"%.1f"
,
bodyBean
.
feedbackRate
/
10f
)
val
dd
=
bodyBean
.
feedbackRate
/
5.00f
val
str
=
String
.
format
(
"%.1f"
,
dd
*
10f
)
tv_feedback_rate
.
text
=
str
}
catch
(
e
:
Exception
)
{
e
.
printStackTrace
()
...
...
@@ -106,8 +106,10 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
*/
private
fun
setConfideButton
(
bodyBean
:
HomeConsultBean
.
ListBean
)
{
//私聊文案
if
(!
TextUtils
.
isEmpty
(
bodyBean
.
chatBtnText
))
{
tv_consult_chat
.
visibility
=
View
.
VISIBLE
if
(
TextUtils
.
isEmpty
(
bodyBean
.
chatBtnText
))
{
tv_consult_chat
.
text
=
"私聊"
tv_consult_chat
.
setTextColor
(
Color
.
parseColor
(
"#FD9B0A"
))
}
else
{
tv_consult_chat
.
text
=
bodyBean
.
chatBtnText
tv_consult_chat
.
setTextColor
(
ContextCompat
.
getColor
(
...
...
@@ -115,9 +117,9 @@ class HomeConsultItemView(private var mContext: Context, private var homeEvent:
R
.
color
.
platform_color_999999
)
)
tv_consult_chat
.
background
=
ContextCompat
.
getDrawable
(
context
,
R
.
drawable
.
home_consult_chat_rest_bg
)
}
tv_consult_chat
.
setOnClickListener
{
homeEvent
!!
.
consultChatClick
(
bodyBean
.
uid
.
toString
())
}
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeConsultView.kt
View file @
0504b3e1
...
...
@@ -7,11 +7,13 @@ import android.os.Build
import
android.support.design.widget.TabLayout
import
android.support.v4.content.ContextCompat
import
android.support.v7.widget.RecyclerView
import
android.text.Layout
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
android.widget.TextView
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.home.R
import
com.yidianling.home.event.IHomeBaseEvent
...
...
@@ -19,6 +21,7 @@ import com.yidianling.home.model.bean.HomeConsultBean
import
com.yidianling.home.model.bean.HomeHeaderBean
import
kotlinx.android.synthetic.xlzx.home_confide_view.view.*
import
java.lang.Exception
import
kotlin.math.ceil
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
...
...
@@ -41,6 +44,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private
var
dp5
:
Int
=
0
private
var
dp10
:
Int
=
0
private
var
dp16
:
Int
=
0
init
{
initView
()
...
...
@@ -49,6 +53,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
private
fun
initView
()
{
dp5
=
RxImageTool
.
dp2px
(
5f
)
dp10
=
RxImageTool
.
dp2px
(
10f
)
dp16
=
RxImageTool
.
dp2px
(
16f
)
val
params
=
RecyclerView
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
...
...
@@ -121,6 +126,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
cacheInfoViewList
=
ArrayList
()
}
// TODO xj
//创建HomeConsultItemView:每个tab最多显示四个专家
if
(
cacheInfoViewList
!!
.
size
>=
list
.
size
)
{
for
(
index
in
0
until
list
!!
.
size
)
{
...
...
@@ -131,6 +137,7 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
index
==
list
!!
.
size
-
1
,
"${category?.id}"
)
cacheInfoViewList
!!
[
index
].
layoutParams
=
getViewLayoutParams
(
index
)
//添加到布局
ll_content
.
addView
(
cacheInfoViewList
!!
[
index
])
}
...
...
@@ -142,8 +149,8 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
}
//数据大于缓存view数量,创建view
if
(
index
>
cacheInfoViewList
!!
.
size
-
1
)
{
var
HomeConsultItemView
=
createConsultInfoView
()
cacheInfoViewList
!!
.
add
(
HomeConsultItemView
)
var
m
HomeConsultItemView
=
createConsultInfoView
()
cacheInfoViewList
!!
.
add
(
m
HomeConsultItemView
)
}
//设置数据
cacheInfoViewList
!!
[
index
].
setData
(
...
...
@@ -152,12 +159,25 @@ class HomeConsultView(private val mContext: Context, private var homeEvent: IHom
index
==
list
!!
.
size
-
1
,
"${category?.id}"
)
cacheInfoViewList
!!
[
index
].
layoutParams
=
getViewLayoutParams
(
index
)
//添加到布局
ll_content
.
addView
(
cacheInfoViewList
!!
[
index
])
}
}
}
fun
getViewLayoutParams
(
index
:
Int
):
MarginLayoutParams
{
var
itemWidth
:
Int
=
(
RxDeviceTool
.
getScreenWidth
(
mContext
)
-
dp16
-
dp16
-
dp10
)
/
2
var
itemHeight
:
Int
=
(
itemWidth
*
187
)
/
166
var
topMargin
=
if
(
index
==
2
||
index
==
3
)
itemHeight
+
dp10
else
0
val
params
=
LayoutParams
(
itemWidth
,
itemHeight
)
as
MarginLayoutParams
params
.
setMargins
(
dp16
+
(
itemWidth
+
dp10
)
*
((
index
)
%
2
),
topMargin
,
0
,
0
)
return
params
}
/**
* 创建专家信息view
*/
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomeImageBannerView.kt
View file @
0504b3e1
...
...
@@ -4,6 +4,7 @@ import android.content.Context
import
android.support.v7.widget.RecyclerView
import
android.view.View
import
android.view.ViewGroup
import
android.widget.FrameLayout
import
android.widget.LinearLayout
import
com.ydl.ydlcommon.utils.YdlBuryPointUtil
import
com.ydl.ydlcommon.view.banner.GlideImageLoader
...
...
@@ -24,18 +25,27 @@ class HomeImageBannerView(val mContext: Context, val homeEvent: IHomeBaseEvent)
fun
initView
()
{
val
params
=
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
((
RxDeviceTool
.
getScreenWidth
(
mContext
)
-
RxImageTool
.
dp2px
(
16f
+
16f
))
*
139f
/
345f
).
toInt
()
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
as
MarginLayoutParams
params
.
topMargin
=
RxImageTool
.
dp2px
(
12f
)
params
.
leftMargin
=
RxImageTool
.
dp2px
(
16f
)
params
.
rightMargin
=
RxImageTool
.
dp2px
(
16f
)
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
home_image_banner_view
,
this
)
initBannerLayout
()
}
private
fun
initBannerLayout
()
{
val
bannerWidth
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
-
RxImageTool
.
dp2px
(
16f
)
*
2
val
bannerLayoutParams
=
FrameLayout
.
LayoutParams
(
bannerWidth
,
(
bannerWidth
*
131
/
343
)
)
banner_search
.
layoutParams
=
bannerLayoutParams
banner_search
.
setIndicatorBottomPadding
(
10
)
}
fun
initData
(
bean
:
HomePagerDataBean
)
{
...
...
@@ -63,7 +73,6 @@ class HomeImageBannerView(val mContext: Context, val homeEvent: IHomeBaseEvent)
"${cacheList[it].imageUrl}"
)
}
banner_search
.
setIndicatorBottomPadding
(
20
)
}
}
...
...
m-home/src/xlzx/java/com/yidianling/home/ui/view/HomePagerBannerView.kt
deleted
100644 → 0
View file @
a6cf9f10
package
com.yidianling.home.ui.view
import
android.content.Context
import
android.view.View
import
android.view.ViewGroup
import
android.widget.RelativeLayout
import
com.ydl.ydlcommon.view.banner.GlideImageLoader
import
com.yidianling.common.tools.RxDeviceTool
import
com.yidianling.home.R
import
com.yidianling.home.event.IHomeBaseEvent
import
com.yidianling.home.model.bean.HomeHeaderBean
import
kotlinx.android.synthetic.xlzx.home_pager_banner_view.view.*
/**
* @author <a href="https://www.jianshu.com/u/c1e5310dd724">xujian</a>
* @描述:顶部ViewPager与分类模块
* @Copyright Copyright (c) 2019
* @Company 壹点灵
* @date 2019/02/13
*/
class
HomePagerBannerView
(
private
val
mContext
:
Context
,
private
var
homeEvent
:
IHomeBaseEvent
?)
:
RelativeLayout
(
mContext
)
{
private
val
mImageViews
=
ArrayList
<
String
>()
private
var
homePagerBannerCategoryView
:
HomePagerBannerCategoryView
?
=
null
init
{
initView
()
}
private
fun
initView
()
{
var
screenWidth
=
RxDeviceTool
.
getScreenWidth
(
mContext
)
val
params
=
RelativeLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
layoutParams
=
params
View
.
inflate
(
mContext
,
R
.
layout
.
home_pager_banner_view
,
this
)
initBannerLayout
()
}
private
fun
initBannerLayout
()
{
homeModulePagerBannerViewBanner
.
setIndicatorBottomPadding
(
50
)
}
/**
* 填充数据
*/
fun
initData
(
bean
:
HomeHeaderBean
?)
{
initCategory
(
bean
?.
askCategoryData
,
bean
?.
homeSaleData
)
initBanner
(
bean
?.
focusList
)
}
/**
* 更新分类细目
*/
private
fun
initCategory
(
categoryBean
:
List
<
HomeHeaderBean
.
AskCategoryDataBean
>?,
homeSaleData
:
List
<
HomeHeaderBean
.
HomeSaleDataBean
>?
)
{
homePagerBannerCategoryView
!!
.
initData
(
categoryBean
,
homeSaleData
)
}
/**
* 更新banner
*/
private
fun
initBanner
(
focusListBean
:
List
<
HomeHeaderBean
.
FocusListBean
>?)
{
//临时缓存集合
val
cacheList
=
ArrayList
<
HomeHeaderBean
.
FocusListBean
>()
if
(
null
!=
focusListBean
&&
focusListBean
.
isNotEmpty
())
{
mImageViews
.
clear
()
//产品说取前8个
if
(
focusListBean
.
size
>
8
)
{
cacheList
.
addAll
(
focusListBean
.
subList
(
0
,
8
))
}
else
{
cacheList
.
addAll
(
focusListBean
)
}
for
(
item
in
cacheList
)
{
mImageViews
.
add
(
item
.
imageUrl
!!
)
}
}
homeModulePagerBannerViewBanner
.
setImageLoader
(
GlideImageLoader
(
R
.
drawable
.
home_image_default_back
))
.
setImages
(
mImageViews
).
start
()
homeModulePagerBannerViewBanner
.
setOnBannerListener
{
homeEvent
?.
bannerClick
(
cacheList
!!
[
it
])
}
}
fun
startBanner
()
{
if
(
homeModulePagerBannerViewBanner
!=
null
)
{
homeModulePagerBannerViewBanner
.
startAutoPlay
()
}
}
fun
stopBanner
()
{
if
(
homeModulePagerBannerViewBanner
!=
null
)
{
homeModulePagerBannerViewBanner
.
stopAutoPlay
()
}
}
}
\ No newline at end of file
m-home/src/xlzx/java/com/yidianling/home/ui/widget/HomeModuleCategoryView.kt
View file @
0504b3e1
...
...
@@ -43,10 +43,32 @@ class HomeModuleCategoryView : FrameLayout {
* 文本宽度
*/
var
imageViewHeight
:
Int
=
0
/**
* 间隔
*/
var
margin
:
Int
=
0
/**
* 八个的时候文本宽度
*/
var
textViewWidth
:
Int
=
0
/**
* 八个的时候文本高度
*/
var
textViewHeight
:
Int
=
0
/**
* 八个时候分类宽度
*/
var
categoryEightWidth
:
Int
=
0
/**
* 八个时候分类宽度
*/
var
imageEightViewWidth
:
Int
=
0
var
dp1
:
Int
=
0
var
dp3
:
Int
=
0
var
dp8
:
Int
=
0
var
dp12
:
Int
=
0
var
dp15
:
Int
=
0
/**
* 倍数
*/
...
...
@@ -91,6 +113,14 @@ class HomeModuleCategoryView : FrameLayout {
dp1
=
RxImageTool
.
dip2px
(
1f
)
dp3
=
RxImageTool
.
dip2px
(
3f
)
dp12
=
RxImageTool
.
dip2px
(
12f
)
categoryEightWidth
=
ScreenUtil
.
screenWidth
-
RxImageTool
.
dp2px
(
30f
)
textViewWidth
=
categoryEightWidth
/
4
imageEightViewWidth
=
RxImageTool
.
dip2px
(
38f
)
textViewHeight
=
RxImageTool
.
dip2px
(
28f
)
margin
=
(
categoryEightWidth
-
4
*
imageEightViewWidth
)
/
8
dp8
=
RxImageTool
.
dip2px
(
8f
)
dp15
=
RxImageTool
.
dip2px
(
15f
)
}
fun
initData
(
askCategoryDataBean
:
List
<
HomeHeaderBean
.
AskCategoryDataBean
>?)
{
...
...
@@ -137,27 +167,53 @@ class HomeModuleCategoryView : FrameLayout {
private
fun
refreshView
()
{
homeModulePagerBannerFlRoot
.
removeAllViews
()
var
i
=
0
for
(
item
in
mDataList
!!
)
{
if
(
i
>
5
)
{
break
}
val
imageView
=
createIcon
(
i
)
// 后端没资源,Android自己做兼容,复原原来的代码
mDataList
?.
let
{
if
(
mDataList
?.
size
!!
>=
8
)
{
for
(
item
in
mDataList
!!
)
{
if
(
i
>
7
)
{
break
}
val
imageView
=
createEightIcon
(
i
)
val
textView
=
createText
(
i
)
homeModulePagerBannerFlRoot
.
addView
(
imageView
)
homeModulePagerBannerFlRoot
.
addView
(
imageView
)
homeModulePagerBannerFlRoot
.
addView
(
textView
)
imageView
.
setOnClickListener
{
homeEvent
!!
.
categoryClick
(
item
)
}
imageView
.
setOnClickListener
{
homeEvent
!!
.
categoryClick
(
item
)
}
textView
.
setOnClickListener
{
homeEvent
!!
.
categoryClick
(
item
)
}
bindIconData
(
imageView
,
item
)
bindTextData
(
textView
,
item
)
i
++
}
}
else
if
(
mDataList
?.
size
!!
==
6
)
{
for
(
item
in
mDataList
!!
)
{
if
(
i
>
5
)
{
break
}
val
imageView
=
createSixIcon
(
i
)
homeModulePagerBannerFlRoot
.
addView
(
imageView
)
bindIconData
(
imageView
,
item
)
i
++
imageView
.
setOnClickListener
{
homeEvent
!!
.
categoryClick
(
item
)
}
bindIconData
(
imageView
,
item
)
i
++
}
}
}
}
/**
* 创建图标
*/
private
fun
createIcon
(
i
:
Int
):
ImageView
{
private
fun
create
Six
Icon
(
i
:
Int
):
ImageView
{
val
imageParams
=
LayoutParams
(
imageViewWidth
,
imageViewHeight
)
val
imageView
=
ImageView
(
context
)
imageView
.
scaleType
=
ImageView
.
ScaleType
.
CENTER_CROP
...
...
@@ -176,6 +232,57 @@ class HomeModuleCategoryView : FrameLayout {
}
/**
* 创建图标
*/
private
fun
createEightIcon
(
i
:
Int
):
ImageView
{
val
imageParams
=
FrameLayout
.
LayoutParams
(
imageEightViewWidth
,
imageEightViewWidth
)
val
imageView
=
ImageView
(
context
)
imageView
.
scaleType
=
ImageView
.
ScaleType
.
CENTER_CROP
if
(
i
>
3
)
{
multiple
=
2
imageParams
.
topMargin
=
imageEightViewWidth
+
dp8
+
textViewHeight
+
dp8
+
RxImageTool
.
dip2px
(
1f
)
imageParams
.
leftMargin
=
dp15
+
margin
*
(
i
-
3
)
+
(
i
-
4
)
*
(
imageEightViewWidth
+
margin
)
}
else
{
multiple
=
1
imageParams
.
leftMargin
=
dp15
+
margin
*
(
i
+
1
)
+
i
*
(
imageEightViewWidth
+
margin
)
}
imageView
.
layoutParams
=
imageParams
return
imageView
}
/**
* 创建文本
*/
private
fun
createText
(
index
:
Int
):
TextView
{
val
textParams
=
FrameLayout
.
LayoutParams
(
textViewWidth
,
textViewHeight
)
val
textView
=
TextView
(
context
)
textView
.
setTextColor
(
Color
.
parseColor
(
"#444444"
))
textView
.
setTextSize
(
TypedValue
.
COMPLEX_UNIT_SP
,
12f
)
textView
.
gravity
=
Gravity
.
CENTER_HORIZONTAL
if
(
index
>
3
)
{
textParams
.
topMargin
=
2
*
(
imageEightViewWidth
+
dp8
)
+
textViewHeight
+
dp8
textParams
.
leftMargin
=
dp15
+
textViewWidth
*
(
index
-
4
)
}
else
{
textParams
.
topMargin
=
imageEightViewWidth
+
dp8
textParams
.
leftMargin
=
dp15
+
textViewWidth
*
(
index
)
}
textView
.
layoutParams
=
textParams
return
textView
}
/**
* 设置文本
*/
private
fun
bindTextData
(
textView
:
TextView
,
categoryBean
:
HomeHeaderBean
.
AskCategoryDataBean
)
{
textView
.
text
=
categoryBean
.
cateTitle
}
/**
* 加载图片
*/
private
fun
bindIconData
(
...
...
m-home/src/xlzx/res/drawable/home_consult_chat_rest_bg.xml
View file @
0504b3e1
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<gradient
android:angle=
"180"
android:startColor=
"#F0F0F0"
android:endColor=
"#F0F0F0"
/>
<solid
android:color=
"@color/platform_color_F5F5F5"
/>
<corners
android:radius=
"@dimen/platform_dp_
3
"
/>
<corners
android:radius=
"@dimen/platform_dp_
14
"
/>
</shape>
\ No newline at end of file
m-home/src/xlzx/res/layout/home_button_banner_view.xml
View file @
0504b3e1
...
...
@@ -4,7 +4,6 @@
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:layout_marginBottom=
"17dp"
android:layout_marginTop=
"17dp"
>
<LinearLayout
...
...
m-home/src/xlzx/res/layout/home_common_title_view.xml
View file @
0504b3e1
...
...
@@ -4,7 +4,7 @@
android:layout_height=
"wrap_content"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:paddingTop=
"@dimen/platform_dp_
2
0"
android:paddingTop=
"@dimen/platform_dp_
3
0"
android:paddingBottom=
"@dimen/platform_dp_6"
>
<TextView
...
...
m-home/src/xlzx/res/layout/home_confide_view.xml
View file @
0504b3e1
...
...
@@ -3,7 +3,8 @@
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
android:clipChildren=
"false"
>
<com.yidianling.home.ui.view.HomeCommonTitleView
android:id=
"@+id/homeModuleConfideViewHomeCommonTitleView"
...
...
@@ -15,36 +16,30 @@
android:layout_height=
"40dp"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:clipChildren=
"false"
>
<RelativeLayout
android:layout_width=
"
0dp
"
<android.support.design.widget.TabLayout
android:id=
"@+id/tab_layout"
android:layout_width=
"
match_parent
"
android:layout_height=
"40dp"
android:layout_weight=
"1"
>
<android.support.design.widget.TabLayout
android:id=
"@+id/tab_layout"
android:layout_width=
"match_parent"
android:layout_height=
"40dp"
app:tabGravity=
"fill"
app:tabIndicatorHeight=
"0dp"
android:layout_marginLeft=
"12dp"
app:tabMode=
"scrollable"
app:tabPaddingStart=
"4dp"
app:tabPaddingEnd=
"4dp"
app:tabSelectedTextColor=
"@color/platform_color_242424"
app:tabTextAppearance=
"@style/TabLayoutTextSize"
app:tabTextColor=
"#333"
/>
</RelativeLayout>
app:tabGravity=
"fill"
app:tabIndicatorHeight=
"0dp"
android:layout_marginLeft=
"12dp"
android:layout_marginRight=
"12dp"
app:tabMode=
"scrollable"
app:tabPaddingStart=
"4dp"
app:tabPaddingEnd=
"4dp"
app:tabSelectedTextColor=
"@color/platform_color_242424"
app:tabTextAppearance=
"@style/TabLayoutTextSize"
app:tabTextColor=
"#333"
/>
</LinearLayout>
<
Linear
Layout
<
Frame
Layout
android:id=
"@+id/ll_content"
android:layout_marginTop=
"10dp"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
/>
android:layout_height=
"wrap_content"
/>
</merge>
m-home/src/xlzx/res/layout/home_consult_item_view.xml
View file @
0504b3e1
...
...
@@ -3,10 +3,10 @@
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"
wrap_cont
ent"
android:layout_width=
"
match_par
ent"
android:layout_height=
"
match_par
ent"
android:orientation=
"vertical"
android:gravity=
"center
_horizontal
"
android:gravity=
"center"
android:background=
"@drawable/home_view_shadow_bg"
>
<RelativeLayout
android:layout_width=
"wrap_content"
...
...
@@ -26,20 +26,6 @@
android:scaleType=
"centerCrop"
android:src=
"@drawable/platform_head_place_hold_pic"
/>
</android.support.v7.widget.CardView>
<TextView
android:id=
"@+id/tv_consult_chat"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/platform_dp_15"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/home_consult_chat_rest_bg"
android:gravity=
"center"
android:paddingLeft=
"9dp"
android:paddingRight=
"9dp"
tools:text=
"休息中"
android:textColor=
"@color/platform_color_666666"
android:textSize=
"10dp"
android:visibility=
"gone"
/>
</RelativeLayout>
<LinearLayout
...
...
@@ -70,21 +56,10 @@
</LinearLayout>
<TextView
android:id=
"@+id/tv_consult_jibie"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"2dp"
android:layout_marginBottom=
"9dp"
android:textColor=
"@color/platform_color_666666"
android:textSize=
"@dimen/platform_dp_13"
tools:text=
"二级心理咨询师"
/>
<LinearLayout
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
android:layout_marginBottom=
"20dp"
>
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_feedback_rate"
android:layout_width=
"wrap_content"
...
...
@@ -98,18 +73,34 @@
android:layout_height=
"wrap_content"
android:textColor=
"#FF5B46"
android:textSize=
"14dp"
tools
:text=
"分"
/>
android
:text=
"分"
/>
<TextView
android:id=
"@+id/tv_consult_num"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textColor=
"@color/platform_color_
242424
"
android:textColor=
"@color/platform_color_
666666
"
android:textSize=
"@dimen/platform_dp_13"
tools:text=
"8000次咨询"
android:layout_marginLeft=
"4dp"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_consult_chat"
android:layout_width=
"80dp"
android:layout_height=
"28dp"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:background=
"@drawable/home_consult_chat_rest_bg"
android:gravity=
"center"
android:paddingLeft=
"9dp"
android:paddingRight=
"9dp"
tools:text=
"休息中"
android:layout_marginTop=
"10dp"
android:layout_marginBottom=
"15dp"
android:textColor=
"@color/platform_color_999999"
android:textSize=
"12dp"
/>
</LinearLayout>
m-home/src/xlzx/res/layout/home_image_banner_view.xml
View file @
0504b3e1
...
...
@@ -7,23 +7,22 @@
android:gravity=
"center"
>
<android.support.v7.widget.CardView
android:layout_width=
"
match_par
ent"
android:layout_height=
"
match_par
ent"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"
wrap_cont
ent"
app:cardCornerRadius=
"8dp"
app:cardElevation=
"0dp"
>
<com.ydl.ydlcommon.view.banner.Banner
android:id=
"@+id/banner_search"
android:layout_width=
"
match_par
ent"
android:layout_height=
"
@dimen/home_head_bg_heigh
t"
android:layout_width=
"
wrap_cont
ent"
android:layout_height=
"
wrap_conten
t"
app:pa_indicator_different_width=
"14dp"
app:pa_indicator_drawable_selected=
"@drawable/home_banner_tip_select"
app:pa_indicator_drawable_unselected=
"@drawable/home_banner_tip_unselect"
app:pa_indicator_height=
"5dp"
app:pa_indicator_margin=
"1.
25
dp"
app:pa_indicator_margin=
"1.
8
dp"
app:pa_is_selected_same_unselected=
"false"
android:scaleType=
"centerCrop"
android:tag=
"overScroll"
/>
</android.support.v7.widget.CardView>
...
...
m-home/src/xlzx/res/layout/home_layout_home_module_input.xml
View file @
0504b3e1
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:a
ndroid=
"http://schemas.android.com/apk/res/android
"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:a
pp=
"http://schemas.android.com/apk/res-auto
"
android:id=
"@+id/ll_search"
android:layout_width=
"match_parent"
android:layout_height=
"44dp"
...
...
@@ -10,15 +10,22 @@
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:background=
"@color/white"
android:focusableInTouchMode=
"true"
>
android:focusableInTouchMode=
"true"
>
<android.support.v7.widget.CardView
android:id=
"@+id/img_ad_card"
android:layout_width=
"64dp"
android:layout_height=
"34dp"
app:cardCornerRadius=
"8dp"
app:cardElevation=
"0dp"
android:layout_marginEnd=
"10dp"
android:visibility=
"gone"
>
<ImageView
android:id=
"@+id/img_ad"
android:layout_width=
"64dp"
android:layout_height=
"34dp"
android:
layout_marginEnd=
"10dp"
android:visibility=
"gone"
/
>
android:
visibility=
"gone"
/>
</android.support.v7.widget.CardView
>
<RelativeLayout
android:layout_width=
"0dp"
...
...
@@ -66,11 +73,11 @@
</RelativeLayout>
<LinearLayout
android:id=
"@+id/home_page_xiaoyi"
android:layout_width=
"44dp"
android:layout_height=
"44dp"
android:orientation=
"vertical"
android:gravity=
"center"
android:background=
"#14FF0000"
>
android:gravity=
"center"
>
<ImageView
android:layout_width=
"23.3dp"
android:layout_height=
"21.3dp"
...
...
m-home/src/xlzx/res/layout/home_pager_banner_view.xml
View file @
0504b3e1
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"180dp"
>
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<com.ydl.ydlcommon.view.banner.Banner
android:id=
"@+id/homeModulePagerBannerViewBanner"
...
...
@@ -17,18 +12,10 @@
app:pa_indicator_drawable_selected=
"@drawable/home_banner_tip_select"
app:pa_indicator_drawable_unselected=
"@drawable/home_banner_tip_unselect"
app:pa_indicator_height=
"5dp"
app:pa_indicator_margin=
"1.
25
dp"
app:pa_indicator_margin=
"1.
8
dp"
app:pa_is_selected_same_unselected=
"false"
app:pa_is_show_indicator=
"false"
android:background=
"@color/platform_color_444444"
/>
<ImageView
android:layout_alignBottom=
"@+id/homeModulePagerBannerViewBanner"
android:layout_width=
"match_parent"
android:layout_height=
"15dp"
android:background=
"@drawable/home_arc_bg"
/>
</RelativeLayout>
</merge>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment