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
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
29 deletions
+24
-29
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
+7
-3
No files found.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
3b09394d
...
...
@@ -7,18 +7,17 @@ import android.animation.PropertyValuesHolder
import
android.content.Context
import
android.graphics.Typeface
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.view.Gravity
import
android.view.View
import
android.view.inputmethod.InputMethodManager
import
android.widget.ImageView
import
android.widget.LinearLayout
import
android.widget.TextView
import
androidx.core.content.ContextCompat
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.launcher.ARouter
import
com.google.android.material.appbar.AppBarLayout
...
...
@@ -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_toolbar.*
import
org.json.JSONObject
import
java.util.*
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"
)
class
ExpertSearchFragment
:
BaseMvpFragment
<
IExpertSearchView
,
ExpertSearchPresenter
>(),
...
...
@@ -241,18 +235,15 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
}
else
if
(
newState
==
RecyclerView
.
SCROLL_STATE_IDLE
)
{
//没有滚动
showConsultAssistantDialog
()
if
(
sIsScrolling
)
{
}
sIsScrolling
=
false
;
sIsScrolling
=
false
}
}
override
fun
onScrollTop
()
{
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
...
@@ -268,10 +259,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if
(
isBtnShow
)
{
return
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
r
animator
=
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
0f
,
1f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
0f
,
1f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
0f
,
1f
)
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
...
@@ -287,10 +278,10 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if
(!
isBtnShow
)
{
return
}
va
r
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
r
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
r
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
r
animator
=
va
l
alpha
=
PropertyValuesHolder
.
ofFloat
(
"alpha"
,
1f
,
0f
)
va
l
scaleX
=
PropertyValuesHolder
.
ofFloat
(
"scaleX"
,
1f
,
0f
)
va
l
scaleY
=
PropertyValuesHolder
.
ofFloat
(
"scaleY"
,
1f
,
0f
)
va
l
animator
=
ObjectAnimator
.
ofPropertyValuesHolder
(
image_scroll_top
,
alpha
,
scaleX
,
scaleY
)
.
setDuration
(
200
)
animator
.
addListener
(
object
:
AnimatorListenerAdapter
()
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/adapter/ExpertSearchAdapter.kt
View file @
3b09394d
...
...
@@ -285,25 +285,29 @@ class ExpertSearchAdapter(
holder
.
ll_tags
,
false
)
if
(
1
==
item
.
isPackage
)
{
when
(
item
.
isPackage
)
{
1
->
{
view
.
tvTitle
.
text
=
"单次"
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
platform_color_1DA1F2
))
view
.
tvTitle
.
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_single
)
view
.
tvContent
.
text
=
item
.
name
holder
.
ll_products
.
addView
(
view
)
}
else
if
(
2
==
item
.
isPackage
)
{
}
2
->
{
view
.
tvTitle
.
text
=
"套餐"
view
.
tvTitle
.
setTextColor
(
context
.
resources
.
getColor
(
R
.
color
.
consultant_color_FF9500
))
view
.
tvTitle
.
background
=
context
.
resources
.
getDrawable
(
R
.
drawable
.
consultant_expert_search_menu
)
view
.
tvContent
.
text
=
item
.
name
holder
.
ll_products
.
addView
(
view
)
}
else
{
}
else
->
{
}
}
}
}
}
else
if
(
holder
is
FooterViewHolder
)
{
...
...
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