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
5126c0ac
Commit
5126c0ac
authored
Dec 24, 2019
by
徐健
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
咨询列表UI校对
parent
71175894
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
145 additions
and
38 deletions
+145
-38
config.gradle
config.gradle
+2
-2
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+8
-0
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+8
-0
ExpertSearchSwipeRefreshLayout.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/ExpertSearchSwipeRefreshLayout.kt
+35
-0
RecommendListView.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
+64
-13
consultant_indicator_selected.xml
m-consultant/src/main/res/drawable/consultant_indicator_selected.xml
+3
-3
consultant_indicator_unselected.xml
m-consultant/src/main/res/drawable/consultant_indicator_unselected.xml
+3
-3
consultant_activity_expert_search_list.xml
m-consultant/src/main/res/layout/consultant_activity_expert_search_list.xml
+2
-2
consultant_expert_search_big_shot_one.xml
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_one.xml
+1
-1
consultant_expert_search_big_shot_three.xml
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_three.xml
+3
-3
consultant_expert_search_big_shot_two.xml
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_two.xml
+2
-2
consultant_expert_search_top_all_view.xml
m-consultant/src/main/res/layout/consultant_expert_search_top_all_view.xml
+6
-5
consultant_expert_search_top_item_view.xml
m-consultant/src/main/res/layout/consultant_expert_search_top_item_view.xml
+8
-4
No files found.
config.gradle
View file @
5126c0ac
ext
{
kotlin_version
=
"1.3.21"
dev_mode
=
tru
e
dev_mode
=
fals
e
ydl_app
=
[
appName
:
"心理咨询壹点灵"
,
...
...
@@ -44,7 +44,7 @@ ext {
//第三步 若干
"m-confide"
:
"0.0.41.3"
,
"m-consultant"
:
"0.0.51.1
4
"
,
"m-consultant"
:
"0.0.51.1
7
"
,
"m-fm"
:
"0.0.23.5"
,
"m-user"
:
"0.0.41.3"
,
"m-home"
:
"0.0.6.26"
,
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
5126c0ac
...
...
@@ -53,6 +53,7 @@ import com.yidianling.consultant.ui.view.AreaPopupWindow
import
com.yidianling.consultant.ui.view.CategoryPopupWindow
import
com.yidianling.consultant.ui.view.FilterPopupWindow
import
com.yidianling.consultant.ui.view.SortPopupWindow
import
com.yidianling.consultant.ui.view.topView.RecommendListView
import
kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import
kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
...
...
@@ -196,6 +197,13 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
srlContainer
.
setProgressViewOffset
(
false
,
0
,
200
)
srlContainer
.
setOnRefreshListener
(
this
)
recommendListView
.
addViewPagerScrollStateListener
(
object
:
RecommendListView
.
ViewPagerScrollStateCallback
{
override
fun
viewPagerScroll
(
isScrolling
:
Boolean
)
{
//如果viewpager正在滚动,则禁止下拉刷新
srlContainer
.
isEnabled
=
!
isScrolling
}
})
appbar_layout
.
addOnOffsetChangedListener
{
appbarLayout
,
i
->
srlContainer
.
isEnabled
=
i
>=
0
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
5126c0ac
...
...
@@ -49,6 +49,7 @@ import com.yidianling.consultant.ui.view.AreaPopupWindow
import
com.yidianling.consultant.ui.view.CategoryPopupWindow
import
com.yidianling.consultant.ui.view.FilterPopupWindow
import
com.yidianling.consultant.ui.view.SortPopupWindow
import
com.yidianling.consultant.ui.view.topView.RecommendListView
import
kotlinx.android.synthetic.main.consultant_activity_expert_search_list.*
import
kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
...
...
@@ -156,6 +157,13 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
srlContainer
.
setOnRefreshListener
(
this
)
initNetLossView
()
recommendListView
.
addViewPagerScrollStateListener
(
object
:
RecommendListView
.
ViewPagerScrollStateCallback
{
override
fun
viewPagerScroll
(
isScrolling
:
Boolean
)
{
//如果viewpager正在滚动,则禁止下拉刷新
srlContainer
.
isEnabled
=
!
isScrolling
}
})
appbar_layout
.
addOnOffsetChangedListener
{
appbarLayout
,
i
->
srlContainer
.
isEnabled
=
i
>=
0
}
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/ExpertSearchSwipeRefreshLayout.kt
0 → 100644
View file @
5126c0ac
package
com.yidianling.consultant.ui.view
import
android.content.Context
import
android.support.v4.widget.SwipeRefreshLayout
import
android.util.AttributeSet
import
android.view.MotionEvent
// 判断 X 轴的 Y 轴的 移动的距离差 来判断是否 需要拦截事件
class
ExpertSearchSwipeRefreshLayout
(
context
:
Context
,
attrs
:
AttributeSet
)
:
SwipeRefreshLayout
(
context
,
attrs
)
{
// 上一次触摸时的X坐标
private
var
mPreDownX
:
Float
=
0
.
toFloat
()
private
var
mPreDownY
:
Float
=
0
.
toFloat
()
override
fun
onInterceptTouchEvent
(
ev
:
MotionEvent
):
Boolean
{
when
(
ev
.
action
)
{
MotionEvent
.
ACTION_DOWN
->
{
mPreDownX
=
ev
.
x
mPreDownY
=
ev
.
y
}
MotionEvent
.
ACTION_MOVE
->
{
val
eventX
=
ev
.
x
val
eventY
=
ev
.
y
val
xAbs
=
Math
.
abs
(
eventX
-
mPreDownX
)
val
yAbs
=
Math
.
abs
(
eventY
-
mPreDownY
)
// 如果 X 轴移动的 距离大于 Y 轴移动的距离
// 那么 不拦截 触摸事件 交给 下面的处理
if
(
xAbs
>
yAbs
)
{
return
false
}
}
}
return
super
.
onInterceptTouchEvent
(
ev
)
}
}
m-consultant/src/main/java/com/yidianling/consultant/ui/view/topView/RecommendListView.kt
View file @
5126c0ac
...
...
@@ -5,20 +5,18 @@ import android.content.Context
import
android.support.v4.view.PagerAdapter
import
android.support.v4.view.ViewPager
import
android.util.AttributeSet
import
android.
util.Log
import
android.
view.MotionEvent
import
android.view.View
import
android.view.ViewGroup
import
android.widget.LinearLayout
import
com.ydl.ydlcommon.data.http.RxUtils
import
com.ydl.ydlcommon.data.http.ThrowableConsumer
import
com.ydl.ydlcommon.utils.RxLifecycleUtils
import
com.yidianling.common.tools.RxImageTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.consultant.R
import
com.yidianling.consultant.bean.ExpertSearchBigShotBean
import
com.yidianling.consultant.bean.ExpertSearchRecommandBean
import
com.yidianling.consultant.http.ExpertSearchHttpImpl
import
io.reactivex.Scheduler
import
io.reactivex.android.schedulers.AndroidSchedulers
import
io.reactivex.functions.Consumer
import
io.reactivex.schedulers.Schedulers
...
...
@@ -54,8 +52,8 @@ class RecommendListView : LinearLayout {
private
var
minHeight
:
Int
=
0
// viewPager最小高度
private
var
maxHeight
:
Int
=
0
// viewPager最大高度
private
var
dp_1
5
:
Int
=
RxImageTool
.
dp2px
(
15
f
)
private
var
dp_
5
:
Int
=
RxImageTool
.
dp2px
(
5
f
)
private
var
dp_1
0
:
Int
=
RxImageTool
.
dp2px
(
10
f
)
private
var
dp_
4
:
Int
=
RxImageTool
.
dp2px
(
4
f
)
private
fun
initView
()
{
...
...
@@ -148,14 +146,24 @@ class RecommendListView : LinearLayout {
val
item
=
RecommendItemView
(
mContext
!!
)
item
.
setPadding
(
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
))
item
.
setPadding
(
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
)
)
item
.
setData
(
mSceneSpecialTopicList
[
index
])
ll
.
addView
(
item
)
if
(
index
+
1
<
mSceneSpecialTopicList
.
size
)
{
val
item1
=
RecommendItemView
(
mContext
!!
)
item1
.
setPadding
(
0
,
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
))
item1
.
setPadding
(
0
,
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
)
)
item1
.
setData
(
mSceneSpecialTopicList
[
index
+
1
])
ll
.
addView
(
item1
)
...
...
@@ -180,14 +188,24 @@ class RecommendListView : LinearLayout {
val
item
=
RecommendItemView
(
mContext
!!
)
item
.
setPadding
(
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
))
item
.
setPadding
(
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
)
)
item
.
setData
(
mSceneSpecialTopicList
[
index
])
ll
.
addView
(
item
)
if
(
index
+
1
<
mSceneSpecialTopicList
.
size
)
{
val
item1
=
RecommendItemView
(
mContext
!!
)
item1
.
setPadding
(
0
,
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
))
item1
.
setPadding
(
0
,
RxImageTool
.
dp2px
(
9f
),
RxImageTool
.
dp2px
(
15f
),
RxImageTool
.
dp2px
(
11f
)
)
item1
.
setData
(
mSceneSpecialTopicList
[
index
+
1
])
ll
.
addView
(
item1
)
...
...
@@ -212,6 +230,25 @@ class RecommendListView : LinearLayout {
}
private
fun
addListener
()
{
recommendViewPager
.
setOnTouchListener
(
object
:
View
.
OnTouchListener
{
override
fun
onTouch
(
v
:
View
?,
event
:
MotionEvent
?):
Boolean
{
when
(
event
?.
action
)
{
MotionEvent
.
ACTION_MOVE
->
{
mListener
?.
viewPagerScroll
(
true
)
}
MotionEvent
.
ACTION_UP
->
{
mListener
?.
viewPagerScroll
(
false
)
}
MotionEvent
.
ACTION_CANCEL
->
{
mListener
?.
viewPagerScroll
(
false
)
}
}
return
false
}
})
recommendViewPager
.
addOnPageChangeListener
(
object
:
ViewPager
.
OnPageChangeListener
{
override
fun
onPageScrollStateChanged
(
state
:
Int
)
{
}
...
...
@@ -236,20 +273,20 @@ class RecommendListView : LinearLayout {
private
fun
setSelectedIndex
(
position
:
Int
)
{
if
(
position
==
0
)
{
leftIndicator
.
layoutParams
=
LayoutParams
(
dp_1
5
,
dp_5
)
leftIndicator
.
layoutParams
=
LayoutParams
(
dp_1
0
,
dp_4
)
val
marginParams
=
leftIndicator
.
layoutParams
as
MarginLayoutParams
marginParams
.
rightMargin
=
RxImageTool
.
dp2px
(
6f
)
leftIndicator
.
layoutParams
=
marginParams
leftIndicator
.
setBackgroundResource
(
R
.
drawable
.
consultant_indicator_selected
)
rightIndicator
.
layoutParams
=
LayoutParams
(
dp_
5
,
dp_5
)
rightIndicator
.
layoutParams
=
LayoutParams
(
dp_
4
,
dp_4
)
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
consultant_indicator_unselected
)
}
else
{
leftIndicator
.
layoutParams
=
LayoutParams
(
dp_
5
,
dp_5
)
leftIndicator
.
layoutParams
=
LayoutParams
(
dp_
4
,
dp_4
)
val
marginParams
=
leftIndicator
.
layoutParams
as
MarginLayoutParams
marginParams
.
rightMargin
=
RxImageTool
.
dp2px
(
6f
)
leftIndicator
.
layoutParams
=
marginParams
leftIndicator
.
setBackgroundResource
(
R
.
drawable
.
consultant_indicator_unselected
)
rightIndicator
.
layoutParams
=
LayoutParams
(
dp_1
5
,
dp_5
)
rightIndicator
.
layoutParams
=
LayoutParams
(
dp_1
0
,
dp_4
)
rightIndicator
.
setBackgroundResource
(
R
.
drawable
.
consultant_indicator_selected
)
}
}
...
...
@@ -398,5 +435,18 @@ class RecommendListView : LinearLayout {
}
}
private
var
mListener
:
ViewPagerScrollStateCallback
?
=
null
fun
addViewPagerScrollStateListener
(
listener
:
ViewPagerScrollStateCallback
?)
{
listener
?.
let
{
mListener
=
listener
}
}
interface
ViewPagerScrollStateCallback
{
fun
viewPagerScroll
(
isScrolling
:
Boolean
)
//isScrolling
}
}
\ No newline at end of file
m-consultant/src/main/res/drawable/consultant_indicator_selected.xml
View file @
5126c0ac
...
...
@@ -2,10 +2,10 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:height=
"
5
dp"
android:width=
"1
5
dp"
/>
<size
android:height=
"
4
dp"
android:width=
"1
0
dp"
/>
<corners
android:radius=
"2
.5
dp"
/>
<corners
android:radius=
"2dp"
/>
<solid
android:color=
"#000000"
/>
...
...
m-consultant/src/main/res/drawable/consultant_indicator_unselected.xml
View file @
5126c0ac
...
...
@@ -2,10 +2,10 @@
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:shape=
"rectangle"
>
<size
android:height=
"
5
dp"
android:width=
"
5
dp"
/>
<size
android:height=
"
4
dp"
android:width=
"
4
dp"
/>
<corners
android:radius=
"2
.5
dp"
/>
<corners
android:radius=
"2dp"
/>
<solid
android:color=
"#dddddd"
/>
...
...
m-consultant/src/main/res/layout/consultant_activity_expert_search_list.xml
View file @
5126c0ac
...
...
@@ -11,7 +11,7 @@
layout=
"@layout/consultant_layout_search_toolbar"
android:layout_width=
"match_parent"
android:layout_height=
"48dp"
/>
<
android.support.v4.widget.
SwipeRefreshLayout
<
com.yidianling.consultant.ui.view.ExpertSearch
SwipeRefreshLayout
android:id=
"@+id/srlContainer"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
...
...
@@ -63,6 +63,6 @@
</android.support.design.widget.CoordinatorLayout>
</
android.support.v4.widget.
SwipeRefreshLayout>
</
com.yidianling.consultant.ui.view.ExpertSearch
SwipeRefreshLayout>
</LinearLayout>
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_one.xml
View file @
5126c0ac
...
...
@@ -9,7 +9,7 @@
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
>
app:cardCornerRadius=
"
4
dp"
>
<ImageView
android:id=
"@+id/consultant_one_img_1"
android:layout_width=
"match_parent"
...
...
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_three.xml
View file @
5126c0ac
...
...
@@ -10,7 +10,7 @@
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
app:cardCornerRadius=
"
4
dp"
android:layout_marginRight=
"5dp"
>
<ImageView
android:id=
"@+id/consultant_three_img_1"
...
...
@@ -25,7 +25,7 @@
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
app:cardCornerRadius=
"
4
dp"
android:layout_marginLeft=
"5dp"
android:layout_marginRight=
"5dp"
>
<ImageView
...
...
@@ -41,7 +41,7 @@
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
app:cardCornerRadius=
"
4
dp"
android:layout_marginLeft=
"5dp"
>
<ImageView
android:id=
"@+id/consultant_three_img_3"
...
...
m-consultant/src/main/res/layout/consultant_expert_search_big_shot_two.xml
View file @
5126c0ac
...
...
@@ -10,7 +10,7 @@
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
app:cardCornerRadius=
"
4
dp"
android:layout_marginRight=
"5dp"
>
<ImageView
android:id=
"@+id/consultant_two_img_1"
...
...
@@ -25,7 +25,7 @@
android:layout_weight=
"1"
android:layout_height=
"match_parent"
app:cardElevation=
"0dp"
app:cardCornerRadius=
"
6
dp"
app:cardCornerRadius=
"
4
dp"
android:layout_marginLeft=
"5dp"
>
<ImageView
android:id=
"@+id/consultant_two_img_2"
...
...
m-consultant/src/main/res/layout/consultant_expert_search_top_all_view.xml
View file @
5126c0ac
...
...
@@ -14,20 +14,21 @@
<LinearLayout
android:id=
"@+id/recommendViewPagerIndicator"
android:layout_width=
"match_parent"
android:layout_height=
"15dp"
android:layout_height=
"14dp"
android:paddingBottom=
"10dp"
android:orientation=
"horizontal"
android:background=
"#FAFAFA"
android:gravity=
"center"
>
<View
android:id=
"@+id/leftIndicator"
android:layout_width=
"1
5
dp"
android:layout_height=
"
5
dp"
android:layout_width=
"1
0
dp"
android:layout_height=
"
4
dp"
android:layout_marginRight=
"3dp"
/>
<View
android:id=
"@+id/rightIndicator"
android:layout_width=
"1
5
dp"
android:layout_height=
"
5
dp"
android:layout_width=
"1
0
dp"
android:layout_height=
"
4
dp"
android:layout_marginLeft=
"3dp"
/>
</LinearLayout>
...
...
m-consultant/src/main/res/layout/consultant_expert_search_top_item_view.xml
View file @
5126c0ac
<?xml version="1.0" encoding="utf-8"?>
<merge
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:orientation=
"horizontal"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
...
...
@@ -11,6 +12,8 @@
android:layout_height=
"40dp"
android:background=
"#eeeeee"
android:layout_marginRight=
"10dp"
app:cardCornerRadius=
"2dp"
app:cardElevation=
"0dp"
>
<ImageView
android:id=
"@+id/top_item_img"
...
...
@@ -31,16 +34,17 @@
android:layout_weight=
"1"
android:gravity=
"left|top"
android:text=
"标题"
android:textSize=
"14dp"
android:textSize=
"13dp"
android:textStyle=
"bold"
android:maxLines=
"1"
android:
textColor=
"#242424
"
android:text
Style=
"bold
"
/>
android:
layout_marginTop=
"1dp
"
android:text
Color=
"#242424
"
/>
<TextView
android:id=
"@+id/top_item_desc"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"left
|top
"
android:gravity=
"left"
android:text=
"我是描述"
android:maxLines=
"1"
android:textSize=
"11dp"
...
...
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