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
3b09394d
Commit
3b09394d
authored
Apr 28, 2022
by
upwork.021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 代码优化
parent
324e576c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
41 deletions
+36
-41
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+17
-26
ExpertSearchAdapter.kt
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
+19
-15
No files found.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
3b09394d
...
@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
...
@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
import
android.content.Context
import
android.content.Context
import
android.graphics.Typeface
import
android.graphics.Typeface
import
android.os.Build
import
android.os.Build
import
androidx.core.content.ContextCompat
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
android.text.TextUtils
import
android.text.TextUtils
import
android.view.Gravity
import
android.view.View
import
android.view.View
import
android.view.inputmethod.InputMethodManager
import
android.view.inputmethod.InputMethodManager
import
android.widget.ImageView
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.LinearLayout
import
android.widget.TextView
import
android.widget.TextView
import
androidx.core.content.ContextCompat
import
androidx.fragment.app.FragmentActivity
import
androidx.fragment.app.FragmentActivity
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.facade.annotation.Route
import
com.alibaba.android.arouter.launcher.ARouter
import
com.alibaba.android.arouter.launcher.ARouter
import
com.google.android.material.appbar.AppBarLayout
import
com.google.android.material.appbar.AppBarLayout
...
@@ -59,12 +58,7 @@ import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
...
@@ -59,12 +58,7 @@ import kotlinx.android.synthetic.main.consultant_item_filter_online.view.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
import
kotlinx.android.synthetic.main.consultant_layout_search_content.*
import
kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import
kotlinx.android.synthetic.main.consultant_layout_search_toolbar.*
import
org.json.JSONObject
import
org.json.JSONObject
import
java.util.*
import
java.util.concurrent.Executors
import
java.util.concurrent.Executors
import
kotlin.collections.ArrayList
import
kotlin.collections.LinkedHashSet
import
kotlin.properties.Delegates
import
kotlin.reflect.jvm.internal.impl.load.kotlin.JvmType
@Route
(
path
=
"/consultant/consultant"
)
@Route
(
path
=
"/consultant/consultant"
)
class
ExpertSearchFragment
:
BaseMvpFragment
<
IExpertSearchView
,
ExpertSearchPresenter
>(),
class
ExpertSearchFragment
:
BaseMvpFragment
<
IExpertSearchView
,
ExpertSearchPresenter
>(),
...
@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
else
if
(
newState
==
RecyclerView
.
SCROLL_STATE_IDLE
)
{
}
else
if
(
newState
==
RecyclerView
.
SCROLL_STATE_IDLE
)
{
//没有滚动
//没有滚动
showConsultAssistantDialog
()
showConsultAssistantDialog
()
if
(
sIsScrolling
)
{
sIsScrolling
=
false
}
sIsScrolling
=
false
;
}
}
}
}
override
fun
onScrollTop
()
{
override
fun
onScrollTop
()
{
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if
(
isBtnShow
)
{
if
(
isBtnShow
)
{
return
return
}
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if
(!
isBtnShow
)
{
if
(!
isBtnShow
)
{
return
return
}
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
View file @
3b09394d
...
@@ -285,22 +285,26 @@ class ExpertSearchAdapter(
...
@@ -285,22 +285,26 @@ class ExpertSearchAdapter(
holder
.
ll_tags
,
holder
.
ll_tags
,
false
false
)
)
if
(
1
==
item
.
isPackage
)
{
when
(
item
.
isPackage
)
{
view
.
tvTitle
.
text
=
"单次"
1
->
{
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
platform_color_1DA1F2
))
view
.
tvTitle
.
text
=
"单次"
view
.
tvTitle
.
background
=
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
platform_color_1DA1F2
))
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_single
)
view
.
tvTitle
.
background
=
view
.
tvContent
.
text
=
item
.
name
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_single
)
holder
.
ll_products
.
addView
(
view
)
view
.
tvContent
.
text
=
item
.
name
}
else
if
(
2
==
item
.
isPackage
)
{
holder
.
ll_products
.
addView
(
view
)
view
.
tvTitle
.
text
=
"套餐"
}
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
consultant_color_FF9500
))
2
->
{
view
.
tvTitle
.
background
=
view
.
tvTitle
.
text
=
"套餐"
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_menu
)
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
consultant_color_FF9500
))
view
.
tvContent
.
text
=
item
.
name
view
.
tvTitle
.
background
=
holder
.
ll_products
.
addView
(
view
)
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_menu
)
}
else
{
view
.
tvContent
.
text
=
item
.
name
holder
.
ll_products
.
addView
(
view
)
}
else
->
{
}
}
}
}
}
}
}
...
...
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