Commit 3dd1ce7c by fengquan

fix: code review

parent a231a39b
......@@ -37,7 +37,11 @@ import kotlin.math.roundToInt
* 筛选弹窗
* Created by zqk on 17-9-15.
*/
class FilterPopupWindow(private val context: Context, private val filterData: Filters, private val tempFilter: AllFilter) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
class FilterPopupWindow(
private val context: Context,
private val filterData: Filters,
private val tempFilter: AllFilter
) : PopupWindow(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) {
private val mDisposableList = CompositeDisposable()
......@@ -157,12 +161,12 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
showTypeViews[1].isSelected = true
for (v in enquiryViews) {
v.isSelected = false
val textView:TextView = v.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = v.findViewById(R.id.iv_consultant_method)
val textView: TextView = v.findViewById(R.id.tvFilterName)
val ivIcon: ImageView = v.findViewById(R.id.iv_consultant_method)
textView.paint.isFakeBoldText = false
tempFilter.enquiries.forEach {
if (textView.text.toString() == it.value){
if (textView.text.toString() == it.value) {
Glide.with(context)
.load(it.unCheckUrl)
.into(ivIcon)
......@@ -176,7 +180,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
v.paint.isFakeBoldText = false
}
}
for (v in goodAtViews){
for (v in goodAtViews) {
v.isSelected = false
v.paint.isFakeBoldText = false
}
......@@ -333,6 +337,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
fun addSubscription(disposable: Disposable) {
mDisposableList.add(disposable)
}
/**
* 其他选择
* */
......@@ -421,13 +426,13 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
if (text == "展开") {
view.tv_crowd_open.text = "收起"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_close)
for (i in 20 until goodAtViews.size){
for (i in 20 until goodAtViews.size) {
goodAtViews[i].visibility = View.VISIBLE
}
} else {
view.tv_crowd_open.text = "展开"
view.iv_crowd_open.setImageResource(R.drawable.ic_crowd_open)
for (i in 20 until goodAtViews.size){
for (i in 20 until goodAtViews.size) {
goodAtViews[i].visibility = View.GONE
}
}
......@@ -460,7 +465,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
if (index>19){
if (index > 19) {
textView.visibility = View.GONE
}
goodAtViews.add(textView)
......@@ -468,6 +473,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
}
}
/**
* 年龄
* */
......@@ -508,6 +514,7 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
view.flAge.addView(textView)
}
}
/**
* 学历
* */
......@@ -553,8 +560,8 @@ class FilterPopupWindow(private val context: Context, private val filterData: Fi
val mWidth = (popWidth - RxImageTool.dp2px(52f)) / enquirySize
for ((index, enquiry) in filterData.enquiry.withIndex()) {
val llLayout = View.inflate(context, R.layout.consultant_method_item_filter, null)
val textView:TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon:ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val textView: TextView = llLayout.findViewById(R.id.tvFilterName)
val ivIcon: ImageView = llLayout.findViewById(R.id.iv_consultant_method)
val params = FrameLayout.LayoutParams(mWidth, RxImageTool.dp2px(36f))
val marginNum = RxImageTool.dp2px(5f)
params.setMargins(
......
......@@ -137,7 +137,7 @@ public class MembersActivity extends BaseActivity implements View.OnClickListene
initListeners();
// initDatas();
setTabSelection(0);
StatusBarUtils.Companion.setCustomStatusView(this,members_title_rel,true);
StatusBarUtils.Companion.setCustomStatusViewForMembers(this,members_title_rel,true);
}
private void initEvent() {
......
......@@ -1092,6 +1092,20 @@ class StatusBarUtils {
setTransparentForImageView(context, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(context)
params.height = RxImageTool.dp2px(48f) + statusBarHeight
statusView.setPadding(0, statusBarHeight, 0, 0)
if (isDarkMode) {
statusBarLightMode(context)
}
}
/**
* 适配 One Plus手机顶部返回按钮被截取问题
*/
fun setCustomStatusViewForMembers(context: Activity,statusView:View,isDarkMode:Boolean = false) {
val params = statusView.layoutParams
setTransparentForImageView(context, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(context)
params.height = RxImageTool.dp2px(48f) + statusBarHeight
statusView.setPadding(0, statusBarHeight - 25, 0, 0)
if (isDarkMode) {
statusBarLightMode(context)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment