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
3a23ad3f
Commit
3a23ad3f
authored
Jul 28, 2022
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:价格筛选回调排序添加
parent
d8a14b9d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
147 deletions
+4
-147
ExpertSearchActivity.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
+2
-2
ExpertSearchFragment.kt
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
+1
-1
FilterPopupWindow.kt
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
+1
-128
consultant_ui_filter_popup.xml
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
+0
-16
No files found.
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchActivity.kt
View file @
3a23ad3f
...
@@ -1163,7 +1163,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1163,7 +1163,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
allFilter
.
title
.
addAll
(
tempFilter
.
title
)
allFilter
.
title
.
addAll
(
tempFilter
.
title
)
allFilter
.
priceRanges
=
tempFilter
.
priceRanges
allFilter
.
priceRanges
=
tempFilter
.
priceRanges
allFilter
.
priceRangesView
=
tempFilter
.
priceRangesView
allFilter
.
priceRangesView
=
tempFilter
.
priceRangesView
allFilter
.
reorder
=
tempFilter
.
reorder
//判断主题选中,判断热门筛选中是否也有该主题
//判断主题选中,判断热门筛选中是否也有该主题
Executors
.
newCachedThreadPool
().
execute
{
Executors
.
newCachedThreadPool
().
execute
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
...
@@ -1618,7 +1618,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
...
@@ -1618,7 +1618,7 @@ class ExpertSearchActivity : BaseMvpActivity<IExpertSearchView, ExpertSearchPres
override
fun
onPriceItemSelected
(
priceRangesItem
:
PriceRangesItem
)
{
override
fun
onPriceItemSelected
(
priceRangesItem
:
PriceRangesItem
)
{
//价格筛选回调
//价格筛选回调
allFilter
.
priceRanges
=
priceRange
allFilter
.
priceRanges
=
priceRange
sItem
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
getPresenter
().
fetchListData
(
allFilter
,
getPresenter
().
mExtras
)
}
}
}
}
m-consultant/src/main/java/com/yidianling/consultant/ExpertSearchFragment.kt
View file @
3a23ad3f
...
@@ -1072,7 +1072,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
...
@@ -1072,7 +1072,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
allFilter
.
title
.
addAll
(
tempFilter
.
title
)
allFilter
.
title
.
addAll
(
tempFilter
.
title
)
allFilter
.
priceRanges
=
tempFilter
.
priceRanges
allFilter
.
priceRanges
=
tempFilter
.
priceRanges
allFilter
.
priceRangesView
=
tempFilter
.
priceRangesView
allFilter
.
priceRangesView
=
tempFilter
.
priceRangesView
allFilter
.
reorder
=
tempFilter
.
reorder
//判断主题选中,判断热门筛选中是否也有该主题
//判断主题选中,判断热门筛选中是否也有该主题
Executors
.
newCachedThreadPool
().
execute
{
Executors
.
newCachedThreadPool
().
execute
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
if
(
headData
!!
.
highlighter
.
size
>
0
)
{
...
...
m-consultant/src/main/java/com/yidianling/consultant/ui/view/FilterPopupWindow.kt
View file @
3a23ad3f
...
@@ -94,8 +94,6 @@ class FilterPopupWindow(
...
@@ -94,8 +94,6 @@ class FilterPopupWindow(
initShowTypeViews
(
view
)
initShowTypeViews
(
view
)
//咨询方式
//咨询方式
initEnquiryViews
(
view
)
initEnquiryViews
(
view
)
//服务均价
initPriceViews
(
view
)
//年龄选择
//年龄选择
initAgeViews
(
view
)
initAgeViews
(
view
)
//其他选择
//其他选择
...
@@ -159,7 +157,7 @@ class FilterPopupWindow(
...
@@ -159,7 +157,7 @@ class FilterPopupWindow(
llTextView
.
isSelected
=
true
llTextView
.
isSelected
=
true
llTextView
.
paint
.
isFakeBoldText
=
true
llTextView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
sortRangesView
=
llTextView
tempFilter
.
sortRangesView
=
llTextView
tempFilter
.
reorder
=
sortItems
[
index
]
}
}
updateCount
(
ConsultBIConstants
.
POSITION_CONSULT_TYPE_CLICK
)
updateCount
(
ConsultBIConstants
.
POSITION_CONSULT_TYPE_CLICK
)
}
}
...
@@ -654,131 +652,6 @@ class FilterPopupWindow(
...
@@ -654,131 +652,6 @@ class FilterPopupWindow(
}
}
}
}
private
fun
initPriceViews
(
view
:
View
)
{
val
priceRange
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_price_range
,
null
)
as
LinearLayout
etMinPrice
=
priceRange
.
findViewById
(
R
.
id
.
etMinPrice
);
etMaxPrice
=
priceRange
.
findViewById
(
R
.
id
.
etMaxPrice
);
// context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
val
listener
:
TextView
.
OnEditorActionListener
=
TextView
.
OnEditorActionListener
{
_
,
actionId
,
event
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_DONE
||
event
!=
null
&&
event
.
keyCode
==
KeyEvent
.
KEYCODE_ENTER
)
{
updatePriceFilter
()
true
}
else
{
false
}
}
if
(
tempFilter
.
priceRanges
!=
null
)
{
etMinPrice
?.
setText
(
tempFilter
.
priceRanges
?.
min_price
)
etMaxPrice
?.
setText
(
tempFilter
.
priceRanges
?.
max_price
)
}
etMaxPrice
?.
setOnEditorActionListener
(
listener
)
etMinPrice
?.
setOnEditorActionListener
(
listener
)
etMaxPrice
?.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
// 以小数点开头,前面自动加上 "0"
if
(
s
.
toString
().
startsWith
(
"."
))
{
etMaxPrice
?.
setText
(
"0$s"
);
etMaxPrice
?.
setSelection
(
etMaxPrice
?.
text
!!
.
length
);
}
}
})
etMinPrice
?.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
// 以小数点开头,前面自动加上 "0"
if
(
s
.
toString
().
startsWith
(
"."
))
{
etMinPrice
?.
setText
(
"0$s"
);
etMinPrice
?.
setSelection
(
etMinPrice
?.
text
!!
.
length
);
}
}
})
val
mWidth
=
(
popWidth
-
RxImageTool
.
dp2px
(
52f
))
/
enquirySize
for
((
index
,
priceRangesItem
)
in
filterData
.
priceRanges
.
withIndex
())
{
val
textView
=
View
.
inflate
(
context
,
R
.
layout
.
consultant_item_filter
,
null
)
as
TextView
val
params
=
FrameLayout
.
LayoutParams
(
mWidth
,
RxImageTool
.
dp2px
(
48f
))
val
marginNum
=
RxImageTool
.
dp2px
(
2f
)
params
.
setMargins
(
marginNum
+
(
RxImageTool
.
dp2px
(
10f
)
+
mWidth
)
*
(
index
%
enquirySize
),
RxImageTool
.
dp2px
(
58f
)
*
(
index
/
3
),
marginNum
,
0
)
textView
.
layoutParams
=
params
val
contentStr
=
String
.
format
(
"%s\n%s"
,
priceRangesItem
.
display_range
,
priceRangesItem
.
recommend_percent
)
val
msp
=
SpannableString
(
contentStr
)
msp
.
setSpan
(
AbsoluteSizeSpan
(
10
,
true
),
contentStr
.
indexOf
(
"\n"
),
contentStr
.
length
,
Spanned
.
SPAN_EXCLUSIVE_EXCLUSIVE
)
textView
.
text
=
msp
textView
.
setSingleLine
(
false
)
textView
.
setLineSpacing
(
1.0f
,
1.2f
)
priceRangeViews
.
add
(
textView
)
if
(
priceRangesItem
==
tempFilter
.
priceRanges
)
{
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
priceRangesView
=
textView
}
textView
.
setOnClickListener
{
if
(
textView
!=
tempFilter
.
priceRangesView
)
{
tempFilter
.
priceRangesView
?.
isSelected
=
false
tempFilter
.
priceRangesView
?.
paint
?.
isFakeBoldText
=
false
}
if
(
textView
.
isSelected
)
{
tempFilter
.
priceRanges
=
null
textView
.
isSelected
=
false
textView
.
paint
.
isFakeBoldText
=
false
tempFilter
.
priceRangesView
=
null
etMaxPrice
?.
setText
(
""
)
etMinPrice
?.
setText
(
""
)
}
else
{
tempFilter
.
priceRanges
=
priceRangesItem
.
copy
(
min_price
=
priceRangesItem
.
min_price
,
max_price
=
priceRangesItem
.
max_price
)
textView
.
isSelected
=
true
textView
.
paint
.
isFakeBoldText
=
true
tempFilter
.
priceRangesView
=
textView
etMinPrice
?.
setText
(
priceRangesItem
.
min_price
)
etMaxPrice
?.
setText
(
priceRangesItem
.
max_price
)
etMinPrice
?.
setSelection
(
etMinPrice
?.
text
!!
.
length
)
etMaxPrice
?.
setSelection
(
etMaxPrice
?.
text
!!
.
length
)
}
updateCount
(
ConsultBIConstants
.
POSITION_AVERAGE_SERVICE_INPUT
)
}
priceRange
.
flPriceRangeContainer
.
addView
(
textView
)
}
view
.
flPriceRange
.
addView
(
priceRange
)
}
private
fun
updatePriceFilter
()
{
private
fun
updatePriceFilter
()
{
RxKeyboardTool
.
hideSoftInput
(
context
,
etMaxPrice
)
RxKeyboardTool
.
hideSoftInput
(
context
,
etMaxPrice
)
...
...
m-consultant/src/main/res/layout/consultant_ui_filter_popup.xml
View file @
3a23ad3f
...
@@ -69,22 +69,6 @@
...
@@ -69,22 +69,6 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"12dp"
/>
android:layout_marginTop=
"12dp"
/>
<TextView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/platform_dp_28"
android:text=
"价格"
android:textColor=
"@color/platform_color_242424"
android:textSize=
"@dimen/platform_dp_16"
android:textStyle=
"bold"
/>
<FrameLayout
android:id=
"@+id/flPriceRange"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"12dp"
/>
<TextView
<TextView
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
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