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
8c41ac44
Commit
8c41ac44
authored
Jun 14, 2022
by
fengquan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 倾诉列表添加搜索框 & 接口调试
parent
09db41a9
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
261 additions
and
93 deletions
+261
-93
AndroidManifest.xml
m-confide/src/main/AndroidManifest.xml
+2
-0
ConfideHomeActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
+30
-1
ConfideSearchActivity.kt
m-confide/src/main/java/com/ydl/confide/home/ConfideSearchActivity.kt
+83
-0
ConfideHomeAdapter.kt
m-confide/src/main/java/com/ydl/confide/home/adapter/ConfideHomeAdapter.kt
+14
-34
ConfideHomeAllFiltersBean.kt
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeAllFiltersBean.kt
+5
-0
ConfideHomeDataBean.kt
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeDataBean.kt
+4
-2
FinalString.java
m-confide/src/main/java/com/ydl/confide/home/constants/FinalString.java
+5
-0
ConfideHomeHttpImpl.kt
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeHttpImpl.kt
+1
-0
ConfideRecommendParam.kt
m-confide/src/main/java/com/ydl/confide/home/http/ConfideRecommendParam.kt
+16
-0
ConfideHomeRecycleViewListener.kt
m-confide/src/main/java/com/ydl/confide/home/listener/ConfideHomeRecycleViewListener.kt
+1
-1
ConfideHomeRecyleSuspendListener.kt
m-confide/src/main/java/com/ydl/confide/home/listener/ConfideHomeRecyleSuspendListener.kt
+0
-50
ConfideHomeSexAgePopupWindow.kt
m-confide/src/main/java/com/ydl/confide/home/popwindow/ConfideHomeSexAgePopupWindow.kt
+1
-1
ConfideHomeUtils.kt
m-confide/src/main/java/com/ydl/confide/home/util/ConfideHomeUtils.kt
+4
-0
confide_home_activity.xml
m-confide/src/main/res/layout/confide_home_activity.xml
+1
-1
confide_home_search_header.xml
m-confide/src/main/res/layout/confide_home_search_header.xml
+2
-3
confide_search_activity.xml
m-confide/src/main/res/layout/confide_search_activity.xml
+92
-0
No files found.
m-confide/src/main/AndroidManifest.xml
View file @
8c41ac44
...
@@ -9,5 +9,7 @@
...
@@ -9,5 +9,7 @@
<activity
<activity
android:name=
".intro.ExpertIntroActivity"
android:name=
".intro.ExpertIntroActivity"
android:screenOrientation=
"portrait"
/>
android:screenOrientation=
"portrait"
/>
<activity
android:name=
".home.ConfideSearchActivity"
android:screenOrientation=
"portrait"
/>
</application>
</application>
</manifest>
</manifest>
m-confide/src/main/java/com/ydl/confide/home/ConfideHomeActivity.kt
View file @
8c41ac44
...
@@ -2,12 +2,15 @@ package com.ydl.confide.home
...
@@ -2,12 +2,15 @@ package com.ydl.confide.home
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.graphics.Color
import
android.graphics.Color
import
android.net.Uri
import
android.net.Uri
import
android.os.Build
import
android.os.Build
import
android.text.TextUtils
import
android.view.View
import
android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
android.view.WindowManager
import
android.view.WindowManager
import
android.widget.TextView
import
androidx.fragment.app.FragmentActivity
import
androidx.fragment.app.FragmentActivity
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.SimpleItemAnimator
import
androidx.recyclerview.widget.SimpleItemAnimator
...
@@ -24,6 +27,8 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
...
@@ -24,6 +27,8 @@ import com.ydl.confide.home.bean.ConfideHomeBodyBean
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import
com.ydl.confide.home.bean.ConfideHomeFiterItemBean
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.constants.FinalString
import
com.ydl.confide.home.constants.FinalString.SEARCH_REQUEST_CODE
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.event.ConfideHomeEventImpl
import
com.ydl.confide.home.event.ConfideHomeEventImpl
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.confide.home.event.IConfideHomeEvent
...
@@ -120,6 +125,9 @@ class ConfideHomeActivity :
...
@@ -120,6 +125,9 @@ class ConfideHomeActivity :
private
var
dp48
=
0
private
var
dp48
=
0
private
var
bottomSheetDialogFragment
:
ConfideBottomSheetDialogFragment
?
=
null
private
var
bottomSheetDialogFragment
:
ConfideBottomSheetDialogFragment
?
=
null
private
var
keyword
:
String
=
""
;
init
{
init
{
//初始化参数
//初始化参数
initParam
()
initParam
()
...
@@ -129,6 +137,7 @@ class ConfideHomeActivity :
...
@@ -129,6 +137,7 @@ class ConfideHomeActivity :
private
fun
initParam
()
{
private
fun
initParam
()
{
allFiltersBean
=
ConfideHomeAllFiltersBean
(
allFiltersBean
=
ConfideHomeAllFiltersBean
(
page
,
page
,
""
,
ConfideHomeFiterItemBean
().
apply
{
ConfideHomeFiterItemBean
().
apply
{
id
=
"-1"
id
=
"-1"
name
=
""
name
=
""
...
@@ -177,6 +186,7 @@ class ConfideHomeActivity :
...
@@ -177,6 +186,7 @@ class ConfideHomeActivity :
//需要将当前列表已存在的老师uid数组发送到后端去重,因为排序实时变化
//需要将当前列表已存在的老师uid数组发送到后端去重,因为排序实时变化
this
.
page
=
page
this
.
page
=
page
allFiltersBean
!!
.
page
=
page
allFiltersBean
!!
.
page
=
page
allFiltersBean
!!
.
keywords
=
keyword
if
(
1
==
page
)
{
if
(
1
==
page
)
{
//显示加载中
//显示加载中
showProgressDialog
()
showProgressDialog
()
...
@@ -337,8 +347,15 @@ class ConfideHomeActivity :
...
@@ -337,8 +347,15 @@ class ConfideHomeActivity :
"0"
,
"0"
,
true
true
)
)
}
rl_search_head
.
setOnClickListener
{
var
intent
=
Intent
(
this
,
ConfideSearchActivity
::
class
.
java
)
if
(!
TextUtils
.
isEmpty
(
keyword
)){
intent
.
putExtra
(
FinalString
.
CONFIDE_SEARCH_KEY_WORD
,
keyword
)
}
startActivityForResult
(
intent
,
SEARCH_REQUEST_CODE
)
}
}
}
}
...
@@ -410,7 +427,7 @@ class ConfideHomeActivity :
...
@@ -410,7 +427,7 @@ class ConfideHomeActivity :
initParam
()
initParam
()
hideError
()
hideError
()
cacheList
?.
addAll
(
0
,
list
)
cacheList
?.
addAll
(
0
,
list
)
cacheList
?.
add
(
0
,
ConfideHomeDataBean
(
IConfideHomeConfig
.
TYPE_SEARCH
,
null
,
null
,
null
,
-
1
))
cacheList
?.
add
(
0
,
ConfideHomeDataBean
(
IConfideHomeConfig
.
TYPE_SEARCH
,
null
,
null
,
null
,
-
1
,
keyword
))
updateAdapter
()
updateAdapter
()
setSuspendListener
()
setSuspendListener
()
v_filterView
.
refreshView
()
v_filterView
.
refreshView
()
...
@@ -429,6 +446,18 @@ class ConfideHomeActivity :
...
@@ -429,6 +446,18 @@ class ConfideHomeActivity :
v_filterView
.
setHomeView
(
this
)
v_filterView
.
setHomeView
(
this
)
}
}
override
fun
onActivityResult
(
requestCode
:
Int
,
resultCode
:
Int
,
data
:
Intent
?)
{
super
.
onActivityResult
(
requestCode
,
resultCode
,
data
)
if
(
requestCode
==
SEARCH_REQUEST_CODE
&&
resultCode
==
RESULT_OK
)
{
val
keyWord
=
data
?.
getStringExtra
(
FinalString
.
CONFIDE_SEARCH_KEY_WORD
)
if
(
keyWord
!=
null
){
keyword
=
keyWord
rl_search_head
.
findViewById
<
TextView
>(
R
.
id
.
etSearch
).
setText
(
keyword
)
onRefresh
()
}
}
}
/**
/**
* 更新适配器数据
* 更新适配器数据
*/
*/
...
...
m-confide/src/main/java/com/ydl/confide/home/ConfideSearchActivity.kt
0 → 100644
View file @
8c41ac44
package
com.ydl.confide.home
import
android.content.Context
import
android.content.Intent
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextWatcher
import
android.view.View
import
android.view.WindowManager
import
android.view.inputmethod.EditorInfo
import
android.view.inputmethod.InputMethodManager
import
android.widget.TextView
import
com.ydl.confide.R
import
com.ydl.confide.home.constants.FinalString
import
com.ydl.ydlcommon.base.BaseActivity
import
kotlinx.android.synthetic.main.confide_search_activity.*
class
ConfideSearchActivity
:
BaseActivity
()
{
override
fun
initDataAndEvent
()
{
val
keyWord
=
intent
.
getStringExtra
(
FinalString
.
CONFIDE_SEARCH_KEY_WORD
)
if
(!
TextUtils
.
isEmpty
(
keyWord
)){
etSearch
?.
setText
(
keyWord
)
iv_delete_icon
.
visibility
=
View
.
VISIBLE
}
etSearch
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
val
keyword
=
etSearch
!!
.
text
.
trim
().
toString
()
val
intent
=
Intent
()
intent
.
putExtra
(
FinalString
.
CONFIDE_SEARCH_KEY_WORD
,
keyword
)
setResult
(
RESULT_OK
,
intent
)
finish
()
}
true
}
findViewById
<
TextView
>(
R
.
id
.
tv_search_cancle
).
setOnClickListener
{
setResult
(
RESULT_OK
)
finish
()
}
if
(
etSearch
.
requestFocus
())
{
val
imm
=
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
)
as
InputMethodManager
val
isShowing
=
imm
.
showSoftInput
(
etSearch
,
InputMethodManager
.
SHOW_IMPLICIT
)
if
(!
isShowing
)
{
window
.
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_STATE_VISIBLE
)
}
}
etSearch
.
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
s
:
Editable
?)
{
if
(
TextUtils
.
isEmpty
(
s
))
{
iv_delete_icon
.
visibility
=
View
.
INVISIBLE
}
else
{
iv_delete_icon
.
visibility
=
View
.
VISIBLE
}
}
override
fun
beforeTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
count
:
Int
,
after
:
Int
)
{}
override
fun
onTextChanged
(
s
:
CharSequence
?,
start
:
Int
,
before
:
Int
,
count
:
Int
)
{
}
})
iv_delete_icon
.
setOnClickListener
{
etSearch
.
setText
(
""
)
}
}
override
fun
layoutResId
():
Int
{
return
R
.
layout
.
confide_search_activity
}
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/adapter/ConfideHomeAdapter.kt
View file @
8c41ac44
...
@@ -2,6 +2,7 @@ package com.ydl.confide.home.adapter
...
@@ -2,6 +2,7 @@ package com.ydl.confide.home.adapter
import
android.app.Activity
import
android.app.Activity
import
android.content.Context
import
android.content.Context
import
android.content.Intent
import
android.text.Editable
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextUtils
import
android.text.TextWatcher
import
android.text.TextWatcher
...
@@ -15,14 +16,19 @@ import android.widget.ImageView
...
@@ -15,14 +16,19 @@ import android.widget.ImageView
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.RecyclerView
import
androidx.recyclerview.widget.RecyclerView
import
com.ydl.confide.R
import
com.ydl.confide.R
import
com.ydl.confide.home.ConfideHomeActivity
import
com.ydl.confide.home.ConfideSearchActivity
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.bean.ConfideHomeDataBean
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.config.IConfideHomeConfig
import
com.ydl.confide.home.constants.FinalString
import
com.ydl.confide.home.constants.FinalString.SEARCH_REQUEST_CODE
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.contract.IConfideHomeContract
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.confide.home.event.IConfideHomeEvent
import
com.ydl.confide.home.widget.*
import
com.ydl.confide.home.widget.*
import
com.ydl.ydlcommon.utils.DisplayUtils
import
com.ydl.ydlcommon.utils.DisplayUtils
import
com.ydl.ydlcommon.utils.KeyboardChangeListener
import
com.ydl.ydlcommon.utils.KeyboardChangeListener
import
com.yidianling.common.tools.RxKeyboardTool
import
com.yidianling.common.tools.RxKeyboardTool
import
kotlinx.android.synthetic.main.confide_home_activity.view.*
/**
/**
* @author yuanwai
* @author yuanwai
...
@@ -187,43 +193,17 @@ class ConfideHomeAdapter(
...
@@ -187,43 +193,17 @@ class ConfideHomeAdapter(
val
recentBody
=
mListData
!!
[
position
].
body
val
recentBody
=
mListData
!!
[
position
].
body
holder
.
rv
.
adapter
=
VideoShowAdapter
(
recentBody
,
confideHomeEvent
)
holder
.
rv
.
adapter
=
VideoShowAdapter
(
recentBody
,
confideHomeEvent
)
}
else
if
(
holder
is
SearchViewHolder
)
{
}
else
if
(
holder
is
SearchViewHolder
)
{
holder
.
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
)
holder
.
searchView
.
etSearch
.
setText
(
mListData
!!
[
position
].
keyword
)
.
setOnEditorActionListener
{
_
,
actionId
,
_
->
holder
.
searchView
.
setOnClickListener
{
if
(
actionId
==
EditorInfo
.
IME_ACTION_SEARCH
)
{
var
intent
=
Intent
(
mContext
,
ConfideSearchActivity
::
class
.
java
)
Log
.
e
(
"fqLog"
,
"点击了"
);
if
(!
TextUtils
.
isEmpty
(
mListData
!!
[
position
].
keyword
)){
RxKeyboardTool
.
hideSoftInput
(
mContext
as
Activity
?)
intent
.
putExtra
(
FinalString
.
CONFIDE_SEARCH_KEY_WORD
,
mListData
!!
[
position
].
keyword
)
}
true
}
}
val
keyboardChangeListener
=
KeyboardChangeListener
(
mContext
as
Activity
?)
if
(
mContext
is
ConfideHomeActivity
){
keyboardChangeListener
.
setKeyBoardListener
{
isShow
,
i
->
val
confideHomeActivity
=
mContext
as
ConfideHomeActivity
if
(!
isShow
){
confideHomeActivity
.
startActivityForResult
(
intent
,
SEARCH_REQUEST_CODE
)
holder
.
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
clearFocus
()
}
}
}
}
holder
.
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
p0
:
Editable
?)
{
if
(
TextUtils
.
isEmpty
(
p0
))
{
holder
.
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
visibility
=
View
.
INVISIBLE
}
else
{
holder
.
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
visibility
=
View
.
VISIBLE
}
}
override
fun
beforeTextChanged
(
p0
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
}
override
fun
onTextChanged
(
char
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
}
})
holder
.
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
setOnClickListener
{
holder
.
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
setText
(
""
)
}
}
else
if
(
holder
is
EmptyViewHolder
)
{
}
else
if
(
holder
is
EmptyViewHolder
)
{
}
else
{
}
else
{
...
...
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeAllFiltersBean.kt
View file @
8c41ac44
...
@@ -9,6 +9,8 @@ package com.ydl.confide.home.bean
...
@@ -9,6 +9,8 @@ package com.ydl.confide.home.bean
*/
*/
data class
ConfideHomeAllFiltersBean
(
data class
ConfideHomeAllFiltersBean
(
var
page
:
Int
,
var
page
:
Int
,
//通过倾诉师的名字搜索
var
keywords
:
String
,
//选择的综合排序Id
//选择的综合排序Id
var
selectSort
:
ConfideHomeFiterItemBean
?,
var
selectSort
:
ConfideHomeFiterItemBean
?,
//选择的性别id
//选择的性别id
...
@@ -19,4 +21,6 @@ data class ConfideHomeAllFiltersBean(
...
@@ -19,4 +21,6 @@ data class ConfideHomeAllFiltersBean(
val
selectGoodData
:
ArrayList
<
ConfideHomeFiterItemBean
>?,
val
selectGoodData
:
ArrayList
<
ConfideHomeFiterItemBean
>?,
//当前列表已存在专家uid列表
//当前列表已存在专家uid列表
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
)
)
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/bean/ConfideHomeDataBean.kt
View file @
8c41ac44
...
@@ -30,4 +30,6 @@ data class ConfideHomeDataBean(
...
@@ -30,4 +30,6 @@ data class ConfideHomeDataBean(
/**
/**
* 为你推荐Id 本地使用 用于区分音频播放区域
* 为你推荐Id 本地使用 用于区分音频播放区域
*/
*/
var
recommendId
:
Int
)
var
recommendId
:
Int
,
\ No newline at end of file
var
keyword
:
String
=
""
)
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/constants/FinalString.java
View file @
8c41ac44
...
@@ -19,4 +19,9 @@ public class FinalString {
...
@@ -19,4 +19,9 @@ public class FinalString {
//连接倾听未绑定手机提示
//连接倾听未绑定手机提示
public
static
final
String
TEL_BINDPHONE
=
"电话连接需要绑定手机哦~"
;
public
static
final
String
TEL_BINDPHONE
=
"电话连接需要绑定手机哦~"
;
public
static
final
String
CONFIDE_SEARCH_KEY_WORD
=
"confide_key_word"
;
public
static
final
int
SEARCH_REQUEST_CODE
=
1
;
}
}
m-confide/src/main/java/com/ydl/confide/home/http/ConfideHomeHttpImpl.kt
View file @
8c41ac44
...
@@ -51,6 +51,7 @@ class ConfideHomeHttpImpl private constructor() : IConfideHomeHttp {
...
@@ -51,6 +51,7 @@ class ConfideHomeHttpImpl private constructor() : IConfideHomeHttp {
val
sb
=
StringBuffer
()
val
sb
=
StringBuffer
()
sb
.
append
(
"page"
).
append
(
"="
).
append
(
param
.
page
).
append
(
"&"
)
sb
.
append
(
"page"
).
append
(
"="
).
append
(
param
.
page
).
append
(
"&"
)
.
append
(
"keywords"
).
append
(
"="
).
append
(
param
.
getKeywords
()).
append
(
"&"
)
.
append
(
"sortType"
).
append
(
"="
).
append
(
param
.
getSortType
()).
append
(
"&"
)
.
append
(
"sortType"
).
append
(
"="
).
append
(
param
.
getSortType
()).
append
(
"&"
)
.
append
(
"sexType"
).
append
(
"="
).
append
(
param
.
getSexType
()).
append
(
"&"
)
.
append
(
"sexType"
).
append
(
"="
).
append
(
param
.
getSexType
()).
append
(
"&"
)
.
append
(
"ageType"
).
append
(
"="
).
append
(
param
.
getAgeType
()).
append
(
"&"
)
.
append
(
"ageType"
).
append
(
"="
).
append
(
param
.
getAgeType
()).
append
(
"&"
)
...
...
m-confide/src/main/java/com/ydl/confide/home/http/ConfideRecommendParam.kt
View file @
8c41ac44
...
@@ -30,6 +30,8 @@ class ConfideRecommendParam private constructor(builder: Builder){
...
@@ -30,6 +30,8 @@ class ConfideRecommendParam private constructor(builder: Builder){
*/
*/
private
var
goodType
:
String
=
""
private
var
goodType
:
String
=
""
private
var
keyWords
:
String
=
""
//当前列表已存在专家uid列表
//当前列表已存在专家uid列表
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
...
@@ -49,6 +51,10 @@ class ConfideRecommendParam private constructor(builder: Builder){
...
@@ -49,6 +51,10 @@ class ConfideRecommendParam private constructor(builder: Builder){
return
goodType
return
goodType
}
}
fun
getKeywords
()
:
String
{
return
keyWords
}
init
{
init
{
this
.
page
=
builder
.
page
this
.
page
=
builder
.
page
this
.
sortType
=
builder
.
sortType
this
.
sortType
=
builder
.
sortType
...
@@ -56,6 +62,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
...
@@ -56,6 +62,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
this
.
ageType
=
builder
.
ageType
this
.
ageType
=
builder
.
ageType
this
.
goodType
=
builder
.
goodType
this
.
goodType
=
builder
.
goodType
this
.
notInUid
=
builder
.
notInUid
this
.
notInUid
=
builder
.
notInUid
this
.
keyWords
=
builder
.
keyWords
}
}
class
Builder
{
class
Builder
{
...
@@ -65,6 +72,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
...
@@ -65,6 +72,7 @@ class ConfideRecommendParam private constructor(builder: Builder){
internal
var
ageType
:
String
=
""
internal
var
ageType
:
String
=
""
internal
var
goodType
:
String
=
""
internal
var
goodType
:
String
=
""
internal
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
internal
var
notInUid
:
ArrayList
<
Int
>
=
ArrayList
()
internal
var
keyWords
:
String
=
""
fun
page
(
page
:
Int
):
Builder
{
fun
page
(
page
:
Int
):
Builder
{
this
.
page
=
page
this
.
page
=
page
...
@@ -91,9 +99,17 @@ class ConfideRecommendParam private constructor(builder: Builder){
...
@@ -91,9 +99,17 @@ class ConfideRecommendParam private constructor(builder: Builder){
return
this
return
this
}
}
fun
keyWords
(
keyWords
:
String
):
Builder
{
this
.
keyWords
=
keyWords
return
this
}
fun
build
()
:
ConfideRecommendParam
{
fun
build
()
:
ConfideRecommendParam
{
return
ConfideRecommendParam
(
this
)
return
ConfideRecommendParam
(
this
)
}
}
}
}
}
}
...
...
m-confide/src/main/java/com/ydl/confide/home/listener/ConfideHomeRecycleViewListener.kt
View file @
8c41ac44
...
@@ -54,7 +54,7 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
...
@@ -54,7 +54,7 @@ class ConfideHomeRecycleViewListener : RecyclerView.OnScrollListener() {
mRecyclerView
.
scrollBy
(
0
,
1
)
mRecyclerView
.
scrollBy
(
0
,
1
)
val
childAt
=
mRecyclerView
.
getChildAt
(
mIndex
)
val
childAt
=
mRecyclerView
.
getChildAt
(
mIndex
)
if
(
childAt
!
is
ConfideHomeFilterView
)
return
if
(
childAt
!
is
ConfideHomeFilterView
)
return
val
top
=
childAt
.
top
val
top
=
childAt
.
top
-
childAt
.
height
if
(
top
==
0
||
top
==
1
){
if
(
top
==
0
||
top
==
1
){
//已滚动到顶部
//已滚动到顶部
...
...
m-confide/src/main/java/com/ydl/confide/home/listener/ConfideHomeRecyleSuspendListener.kt
View file @
8c41ac44
...
@@ -56,38 +56,6 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
...
@@ -56,38 +56,6 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
this
.
divView
=
divView
this
.
divView
=
divView
this
.
searchView
=
searchView
this
.
searchView
=
searchView
val
keyboardChangeListener
=
KeyboardChangeListener
(
BaseActivityMgr
.
INST
.
topActivity
)
keyboardChangeListener
.
setKeyBoardListener
{
isShow
,
i
->
if
(!
isShow
)
{
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
clearFocus
()
}
}
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
addTextChangedListener
(
object
:
TextWatcher
{
override
fun
afterTextChanged
(
p0
:
Editable
?)
{
if
(
TextUtils
.
isEmpty
(
p0
))
{
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
visibility
=
View
.
INVISIBLE
}
else
{
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
visibility
=
View
.
VISIBLE
}
}
override
fun
beforeTextChanged
(
p0
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
}
override
fun
onTextChanged
(
char
:
CharSequence
,
p1
:
Int
,
p2
:
Int
,
p3
:
Int
)
{
if
(
char
!=
null
){
searchText
=
char
.
toString
()
}
}
})
searchView
.
findViewById
<
ImageView
>(
R
.
id
.
iv_delete_icon
).
setOnClickListener
{
searchView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
setText
(
""
)
}
}
}
fun
setSectionAdapter
(
adapter
:
ConfideHomeAdapter
)
{
fun
setSectionAdapter
(
adapter
:
ConfideHomeAdapter
)
{
...
@@ -104,15 +72,6 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
...
@@ -104,15 +72,6 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
mSearchViewHeight
=
searchView
!!
.
height
mSearchViewHeight
=
searchView
!!
.
height
}
}
searchView
!!
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
clearFocus
()
val
viewHolder
=
recyclerView
.
findViewHolderForAdapterPosition
(
1
)
if
(
viewHolder
!=
null
&&
viewHolder
is
ConfideHomeAdapter
.
SearchViewHolder
)
{
viewHolder
.
itemView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
clearFocus
()
if
(
newState
==
1
){
searchView
!!
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
setText
(
viewHolder
.
itemView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
text
)
}
}
}
}
override
fun
onScrolled
(
recyclerView
:
RecyclerView
,
dx
:
Int
,
dy
:
Int
)
{
override
fun
onScrolled
(
recyclerView
:
RecyclerView
,
dx
:
Int
,
dy
:
Int
)
{
...
@@ -160,13 +119,5 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
...
@@ -160,13 +119,5 @@ class ConfideHomeRecyleSuspendListener : RecyclerView.OnScrollListener() {
filterView
!!
.
visibility
=
View
.
INVISIBLE
filterView
!!
.
visibility
=
View
.
INVISIBLE
divView
?.
visibility
=
View
.
INVISIBLE
divView
?.
visibility
=
View
.
INVISIBLE
}
}
if
(
searchView
?.
visibility
!=
View
.
VISIBLE
){
val
viewHolder
=
recyclerView
.
findViewHolderForAdapterPosition
(
1
)
if
(
viewHolder
!=
null
&&
viewHolder
is
ConfideHomeAdapter
.
SearchViewHolder
)
{
viewHolder
.
itemView
.
findViewById
<
EditText
>(
R
.
id
.
etSearch
).
setText
(
searchText
)
}
}
}
}
}
}
\ No newline at end of file
m-confide/src/main/java/com/ydl/confide/home/popwindow/ConfideHomeSexAgePopupWindow.kt
View file @
8c41ac44
...
@@ -54,7 +54,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
...
@@ -54,7 +54,7 @@ class ConfideHomeSexAgePopupWindow(context: Context, sexData: ArrayList<ConfideH
tvSexTitle
.
text
=
"性别筛选"
tvSexTitle
.
text
=
"性别筛选"
tvAgeTitle
.
text
=
"年龄筛选"
tvAgeTitle
.
text
=
"年龄筛选"
if
(
null
==
mAllFiltersBean
){
if
(
null
==
mAllFiltersBean
){
mAllFiltersBean
=
ConfideHomeAllFiltersBean
(
allFiltersBean
.
page
,
allFiltersBean
.
selectSort
,
allFiltersBean
.
selectSex
,
allFiltersBean
.
selectAgeData
,
allFiltersBean
.
selectGoodData
)
mAllFiltersBean
=
ConfideHomeAllFiltersBean
(
allFiltersBean
.
page
,
""
,
allFiltersBean
.
selectSort
,
allFiltersBean
.
selectSex
,
allFiltersBean
.
selectAgeData
,
allFiltersBean
.
selectGoodData
)
}
}
initData
(
sexData
,
ageData
,
mAllFiltersBean
!!
)
initData
(
sexData
,
ageData
,
mAllFiltersBean
!!
)
initSexData
(
view
,
mAllFiltersBean
!!
)
initSexData
(
view
,
mAllFiltersBean
!!
)
...
...
m-confide/src/main/java/com/ydl/confide/home/util/ConfideHomeUtils.kt
View file @
8c41ac44
...
@@ -490,6 +490,10 @@ class ConfideHomeUtils {
...
@@ -490,6 +490,10 @@ class ConfideHomeUtils {
if
(-
1
!=
allFiltersBean
.
page
)
{
if
(-
1
!=
allFiltersBean
.
page
)
{
param
.
page
(
allFiltersBean
.
page
)
param
.
page
(
allFiltersBean
.
page
)
}
}
if
(
null
!=
allFiltersBean
.
keywords
){
param
.
keyWords
(
allFiltersBean
.
keywords
)
}
//综合排序
//综合排序
if
(
null
!=
allFiltersBean
.
selectSort
&&
!
TextUtils
.
isEmpty
(
allFiltersBean
.
selectSort
!!
.
id
)
&&
"-1"
!=
allFiltersBean
.
selectSort
!!
.
id
)
{
if
(
null
!=
allFiltersBean
.
selectSort
&&
!
TextUtils
.
isEmpty
(
allFiltersBean
.
selectSort
!!
.
id
)
&&
"-1"
!=
allFiltersBean
.
selectSort
!!
.
id
)
{
param
.
sortType
(
allFiltersBean
.
selectSort
!!
.
id
!!
)
param
.
sortType
(
allFiltersBean
.
selectSort
!!
.
id
!!
)
...
...
m-confide/src/main/res/layout/confide_home_activity.xml
View file @
8c41ac44
...
@@ -167,7 +167,7 @@
...
@@ -167,7 +167,7 @@
android:src=
"@drawable/confide_icon_input_search"
android:src=
"@drawable/confide_icon_input_search"
android:tag=
"tag_search_input_img"
/>
android:tag=
"tag_search_input_img"
/>
<
EditText
<
TextView
android:id=
"@+id/etSearch"
android:id=
"@+id/etSearch"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
m-confide/src/main/res/layout/confide_home_search_header.xml
View file @
8c41ac44
...
@@ -4,8 +4,7 @@
...
@@ -4,8 +4,7 @@
android:id=
"@+id/rl_search"
android:id=
"@+id/rl_search"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/platform_dp_48"
android:layout_height=
"@dimen/platform_dp_48"
android:focusable=
"true"
android:descendantFocusability=
"blocksDescendants"
android:focusableInTouchMode=
"true"
>
>
<View
<View
...
@@ -29,7 +28,7 @@
...
@@ -29,7 +28,7 @@
android:src=
"@drawable/confide_icon_input_search"
android:src=
"@drawable/confide_icon_input_search"
android:tag=
"tag_search_input_img"
/>
android:tag=
"tag_search_input_img"
/>
<
EditText
<
TextView
android:id=
"@+id/etSearch"
android:id=
"@+id/etSearch"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
m-confide/src/main/res/layout/confide_search_activity.xml
0 → 100644
View file @
8c41ac44
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/rl_search"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/platform_dp_48"
android:paddingStart=
"15dp"
android:tag=
"tag_search_input"
>
<View
android:id=
"@+id/view_search_input_bg"
android:layout_width=
"match_parent"
android:layout_height=
"32dp"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"60dp"
android:background=
"@drawable/confide_bg_hot_search_input"
android:tag=
"tag_search_input_bg"
/>
<ImageView
android:id=
"@+id/iv_search_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"15dp"
android:layout_marginRight=
"10dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/confide_icon_input_search"
android:tag=
"tag_search_input_img"
/>
<EditText
android:id=
"@+id/etSearch"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"20dp"
android:layout_toLeftOf=
"@+id/iv_delete_icon"
android:layout_toRightOf=
"@id/iv_search_icon"
android:background=
"@null"
android:cursorVisible=
"true"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:hint=
"请输入倾诉师姓名"
android:imeOptions=
"actionSearch"
android:maxLength=
"100"
android:singleLine=
"true"
android:tag=
"tag_search_input_edit"
android:textColor=
"#242424"
android:textColorHint=
"#b3b3b3"
android:textCursorDrawable=
"@drawable/confide_edit_cursor_drawable"
android:textSize=
"13sp"
/>
<ImageView
android:id=
"@+id/iv_delete_icon"
android:layout_width=
"14dp"
android:layout_height=
"14dp"
android:layout_alignRight=
"@+id/view_search_input_bg"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"12dp"
android:scaleType=
"centerCrop"
android:src=
"@drawable/platform_delete"
android:visibility=
"invisible"
/>
<TextView
android:id=
"@+id/tv_search_cancle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:layout_marginRight=
"10dp"
android:padding=
"5dp"
android:text=
"取消"
android:textColor=
"#242424"
android:textSize=
"15dp"
/>
</RelativeLayout>
<View
android:id=
"@+id/v_topLine"
android:layout_width=
"match_parent"
android:layout_height=
"0.5dp"
android:layout_below=
"@+id/rl_search"
android:layout_marginTop=
"@dimen/platform_dp_6"
android:background=
"@color/platform_color_E0E0E0"
/>
</LinearLayout>
\ No newline at end of file
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