Commit a1b73895 by YKai

feat:androidx代码提交

parent eb686198
...@@ -6,11 +6,11 @@ ext { ...@@ -6,11 +6,11 @@ ext {
// -------------- 业务模块 -------------- // -------------- 业务模块 --------------
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.03", "m-confide" : "0.0.49.03",
"m-consultant" : "0.0.59.66", "m-consultant" : "0.0.59.67",
"m-fm" : "0.0.30.02", "m-fm" : "0.0.30.02",
"m-user" : "0.0.61.19", "m-user" : "0.0.61.19",
"m-home" : "0.0.22.57", "m-home" : "0.0.22.58",
"m-im" : "0.0.18.42", "m-im" : "0.0.18.43",
"m-dynamic" : "0.0.7.20", "m-dynamic" : "0.0.7.20",
"m-article" : "0.0.0.7", "m-article" : "0.0.0.7",
...@@ -89,11 +89,11 @@ ext { ...@@ -89,11 +89,11 @@ ext {
//第三步 若干 //第三步 若干
"m-confide" : "0.0.49.03", "m-confide" : "0.0.49.03",
"m-consultant" : "0.0.59.66", "m-consultant" : "0.0.59.67",
"m-fm" : "0.0.30.02", "m-fm" : "0.0.30.02",
"m-user" : "0.0.61.19", "m-user" : "0.0.61.19",
"m-home" : "0.0.22.57", "m-home" : "0.0.22.58",
"m-im" : "0.0.18.42", "m-im" : "0.0.18.43",
"m-dynamic" : "0.0.7.20", "m-dynamic" : "0.0.7.20",
"m-article" : "0.0.0.7", "m-article" : "0.0.0.7",
......
...@@ -18,6 +18,7 @@ import android.view.inputmethod.InputMethodManager ...@@ -18,6 +18,7 @@ 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.fragment.app.FragmentActivity
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
...@@ -69,15 +70,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -69,15 +70,17 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
View.OnClickListener, IExpertSearchView, View.OnClickListener, IExpertSearchView,
OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener, OnCategoriesSelectedListener, OnSortItemSelectedListener, OnFilterConfirmListener,
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
private val mContext = context private lateinit var mContext:Context
private val mActivity = activity private lateinit var mActivity:FragmentActivity
override fun layoutResId(): Int { override fun layoutResId(): Int {
return R.layout.consultant_activity_expert_search_list return R.layout.consultant_activity_expert_search_list
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mContext!!) mContext = requireContext()
mActivity = requireActivity()
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mContext)
rootView.setPadding(0, statusBarHeight, 0, 0) rootView.setPadding(0, statusBarHeight, 0, 0)
btn_back.visibility = View.GONE btn_back.visibility = View.GONE
title_layout.setPadding(DisplayUtils.dp2px(context, 15), 0, 0, 0) title_layout.setPadding(DisplayUtils.dp2px(context, 15), 0, 0, 0)
...@@ -178,7 +181,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -178,7 +181,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
btn_call.setOnClickListener(this) btn_call.setOnClickListener(this)
tv_guide.setOnClickListener(this) tv_guide.setOnClickListener(this)
rl_search.setOnClickListener(this) rl_search.setOnClickListener(this)
srlContainer.setColorSchemeColors(ContextCompat.getColor(mActivity!!, R.color.platform_main_theme)) srlContainer.setColorSchemeColors(ContextCompat.getColor(mActivity, R.color.platform_main_theme))
srlContainer.setProgressViewOffset(false, 0, 200) srlContainer.setProgressViewOffset(false, 0, 200)
srlContainer.setOnRefreshListener(this) srlContainer.setOnRefreshListener(this)
initNetLossView() initNetLossView()
...@@ -207,7 +210,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -207,7 +210,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
// btn_back.setOnClickListener { // btn_back.setOnClickListener {
// onBackPressed() // onBackPressed()
// } // }
doctorAdapter = ExpertSearchAdapter(mContext!!, this, doctorList) doctorAdapter = ExpertSearchAdapter(mContext, this, doctorList)
rvExperts.adapter = doctorAdapter rvExperts.adapter = doctorAdapter
val layoutManager = LinearLayoutManager( val layoutManager = LinearLayoutManager(
...@@ -328,7 +331,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -328,7 +331,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
private fun showConsultAssistantDialog() { private fun showConsultAssistantDialog() {
ConsultAssistantDialogUtils.INSTANCE.fitRequest(mActivity!!, "doctor_list") ConsultAssistantDialogUtils.INSTANCE.fitRequest(mActivity, "doctor_list")
} }
private fun hideConsultAssistantDialog() { private fun hideConsultAssistantDialog() {
...@@ -379,8 +382,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -379,8 +382,8 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
*/ */
private fun initStatus() { private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
StatusBarUtils.setTransparentForImageView(mActivity!!, null) StatusBarUtils.setTransparentForImageView(mActivity, null)
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mContext!!) val statusBarHeight = StatusBarUtils.getStatusBarHeight(mContext)
val lp1 = title_layout.layoutParams as LinearLayout.LayoutParams val lp1 = title_layout.layoutParams as LinearLayout.LayoutParams
lp1.height = (RxImageTool.dp2px(48f) + statusBarHeight) lp1.height = (RxImageTool.dp2px(48f) + statusBarHeight)
...@@ -921,7 +924,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -921,7 +924,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
R.id.btn_call -> { R.id.btn_call -> {
ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_ONLINE_CUSTOMER_CLICK) ActionCountUtils.count(ConsultBIConstants.ConsultEvent.APP_CONSULT_LIST_ONLINE_CUSTOMER_CLICK)
ConsultantIn.startP2PXiaoYi(mContext!!) ConsultantIn.startP2PXiaoYi(mContext)
} }
R.id.rl_search -> { R.id.rl_search -> {
ARouter.getInstance() ARouter.getInstance()
...@@ -961,7 +964,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -961,7 +964,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.priceRangesView = allFilter.priceRangesView tempFilter.priceRangesView = allFilter.priceRangesView
if (headData?.filters != null) { if (headData?.filters != null) {
val filterPopupWindow = FilterPopupWindow(mContext!!, headData?.filters!!, tempFilter) val filterPopupWindow = FilterPopupWindow(mContext, headData?.filters!!, tempFilter)
filterPopupWindow.setOnDismissListener { filterPopupWindow.setOnDismissListener {
// viewDim.visibility = View.INVISIBLE // viewDim.visibility = View.INVISIBLE
viewDim_filter.visibility = View.GONE viewDim_filter.visibility = View.GONE
...@@ -1025,7 +1028,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1025,7 +1028,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
for (index in 0.until(headData!!.highlighter.size)) { for (index in 0.until(headData!!.highlighter.size)) {
if (headData!!.highlighter[index].type == "4") { if (headData!!.highlighter[index].type == "4") {
val textview = lin_filter2.getChildAt(index) as TextView val textview = lin_filter2.getChildAt(index) as TextView
mActivity!!.runOnUiThread { mActivity.runOnUiThread {
textview.isSelected = false textview.isSelected = false
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
...@@ -1045,7 +1048,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1045,7 +1048,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
if (headData!!.highlighter[index].type == "5") { if (headData!!.highlighter[index].type == "5") {
val textview = lin_filter2.getChildAt(index) as TextView val textview = lin_filter2.getChildAt(index) as TextView
mActivity!!.runOnUiThread { mActivity.runOnUiThread {
textview.isSelected = false textview.isSelected = false
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
...@@ -1065,7 +1068,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1065,7 +1068,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
if (headData!!.highlighter[index].type == "6") { if (headData!!.highlighter[index].type == "6") {
val textview = lin_filter2.getChildAt(index) as TextView val textview = lin_filter2.getChildAt(index) as TextView
mActivity!!.runOnUiThread { mActivity.runOnUiThread {
textview.isSelected = false textview.isSelected = false
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
...@@ -1086,7 +1089,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1086,7 +1089,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
if (headData!!.highlighter[index].type == "7") { if (headData!!.highlighter[index].type == "7") {
val textview = lin_filter2.getChildAt(index) as TextView val textview = lin_filter2.getChildAt(index) as TextView
mActivity!!.runOnUiThread { mActivity.runOnUiThread {
textview.isSelected = false textview.isSelected = false
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
...@@ -1145,7 +1148,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1145,7 +1148,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
//显示排序弹窗 //显示排序弹窗
private fun showSortPopupWindow() { private fun showSortPopupWindow() {
if (headData?.reorder != null) { if (headData?.reorder != null) {
sortPopup = SortPopupWindow(mActivity!!, headData?.reorder!!, allFilter.reorder, this) sortPopup = SortPopupWindow(mActivity, headData?.reorder!!, allFilter.reorder, this)
sortPopup!!.setOnDismissListener { sortPopup!!.setOnDismissListener {
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
if (allFilter.reorder != headData!!.reorder[0]) { if (allFilter.reorder != headData!!.reorder[0]) {
...@@ -1213,7 +1216,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1213,7 +1216,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
private fun showAreaPopupWindow() { private fun showAreaPopupWindow() {
if (headData?.region != null) { if (headData?.region != null) {
val regionPopupWindow = AreaPopupWindow( val regionPopupWindow = AreaPopupWindow(
mActivity!!, headData?.region mActivity, headData?.region
?: ArrayList(), allFilter.region, allFilter.sub ?: ArrayList(), allFilter.region, allFilter.sub
) )
regionPopupWindow.showAsDropDown(viewSep2) regionPopupWindow.showAsDropDown(viewSep2)
...@@ -1308,7 +1311,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1308,7 +1311,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
tempFilter.categories.addAll(allFilter.categories) tempFilter.categories.addAll(allFilter.categories)
val categories = headData?.cates val categories = headData?.cates
if (categories != null) { if (categories != null) {
categoryPopup = CategoryPopupWindow(mActivity!!, categories, tempFilter.categories) categoryPopup = CategoryPopupWindow(mActivity, categories, tempFilter.categories)
categoryPopup!!.setOnDismissListener { categoryPopup!!.setOnDismissListener {
viewDim.visibility = View.INVISIBLE viewDim.visibility = View.INVISIBLE
if (allFilter.categories.size > 1 || (allFilter.categories.size == 1 && allFilter.categories[0] != headData!!.cates[0])) { if (allFilter.categories.size > 1 || (allFilter.categories.size == 1 && allFilter.categories[0] != headData!!.cates[0])) {
...@@ -1354,7 +1357,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1354,7 +1357,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
for (index in 0.until(headData!!.highlighter.size)) { for (index in 0.until(headData!!.highlighter.size)) {
if (headData!!.highlighter[index].type == "1") { if (headData!!.highlighter[index].type == "1") {
val textview = lin_filter2.getChildAt(index) as TextView val textview = lin_filter2.getChildAt(index) as TextView
mActivity!!.runOnUiThread { mActivity.runOnUiThread {
textview.isSelected = false textview.isSelected = false
textview.paint.isFakeBoldText = false textview.paint.isFakeBoldText = false
} }
...@@ -1459,7 +1462,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1459,7 +1462,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
when (status) { when (status) {
FILTER_STATUS_NORMAL -> { FILTER_STATUS_NORMAL -> {
tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL) tv.typeface = Typeface.defaultFromStyle(Typeface.NORMAL)
tv.setTextColor(ContextCompat.getColor(mContext!!, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds( tv.setCompoundDrawablesWithIntrinsicBounds(
0, 0,
0, 0,
...@@ -1469,7 +1472,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1469,7 +1472,7 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
FILTER_STATUS_FILTERED -> { FILTER_STATUS_FILTERED -> {
tv.typeface = Typeface.DEFAULT_BOLD tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext!!, R.color.platform_main_theme)) tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_main_theme))
tv.setCompoundDrawablesWithIntrinsicBounds( tv.setCompoundDrawablesWithIntrinsicBounds(
0, 0,
0, 0,
...@@ -1479,16 +1482,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres ...@@ -1479,16 +1482,16 @@ class ExpertSearchFragment : BaseMvpFragment<IExpertSearchView, ExpertSearchPres
} }
FILTER_STATUS_OPEN -> { FILTER_STATUS_OPEN -> {
tv.typeface = Typeface.DEFAULT_BOLD tv.typeface = Typeface.DEFAULT_BOLD
tv.setTextColor(ContextCompat.getColor(mContext!!, R.color.platform_colorTextDefault)) tv.setTextColor(ContextCompat.getColor(mContext, R.color.platform_colorTextDefault))
tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_arrow_drop_down_en, 0) tv.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.platform_arrow_drop_down_en, 0)
} }
} }
} }
private fun hideSoftInput() { private fun hideSoftInput() {
val view = mActivity!!.currentFocus val view = mActivity.currentFocus
if (view != null) { if (view != null) {
val imm = mActivity!!.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager val imm = mActivity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(view.windowToken, 0) imm.hideSoftInputFromWindow(view.windowToken, 0)
} }
} }
......
package com.yidianling.home.ui.fragment package com.yidianling.home.ui.fragment
import android.app.Dialog import android.app.Dialog
import android.content.Context
import android.graphics.Typeface import android.graphics.Typeface
import android.os.Build import android.os.Build
import android.text.TextUtils import android.text.TextUtils
...@@ -10,6 +11,7 @@ import android.widget.LinearLayout ...@@ -10,6 +11,7 @@ import android.widget.LinearLayout
import android.widget.RelativeLayout import android.widget.RelativeLayout
import android.widget.TextView import android.widget.TextView
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import androidx.fragment.app.FragmentActivity
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
import com.alibaba.android.arouter.facade.annotation.Route import com.alibaba.android.arouter.facade.annotation.Route
...@@ -54,8 +56,8 @@ import kotlinx.android.synthetic.ydl.home_fragment.* ...@@ -54,8 +56,8 @@ import kotlinx.android.synthetic.ydl.home_fragment.*
open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>(), open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterImpl>(),
IHomeContract.View, IHomeContract.View,
SwipeRefreshLayout.OnRefreshListener { SwipeRefreshLayout.OnRefreshListener {
var mActivity = activity private lateinit var mActivity:FragmentActivity
var mContext = context private lateinit var mContext:Context
open var adapter: YdlHomeAdapter? = null open var adapter: YdlHomeAdapter? = null
open var homeEvent: HomeImpl? = null open var homeEvent: HomeImpl? = null
open var dialog: CouponDialog? = null open var dialog: CouponDialog? = null
...@@ -119,7 +121,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -119,7 +121,8 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
// homeViewOrder.buttonIndex = null // homeViewOrder.buttonIndex = null
// //
// HomeViewConfig.setOrder(homeViewOrder) // HomeViewConfig.setOrder(homeViewOrder)
mActivity = requireActivity()
mContext = requireContext()
initHomeEvent() initHomeEvent()
initView() initView()
initTopButtonBanner() initTopButtonBanner()
...@@ -127,12 +130,12 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -127,12 +130,12 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} }
open fun initHomeEvent() { open fun initHomeEvent() {
homeEvent = HomeImpl(mActivity!!, this) homeEvent = HomeImpl(mActivity, this)
} }
private fun initAdapter() { private fun initAdapter() {
mPresenter?.localHomeData(mContext!!, "home_data.json") mPresenter?.localHomeData(mContext, "home_data.json")
adapter = YdlHomeAdapter(mContext!!, homeEvent!!, ArrayList()) adapter = YdlHomeAdapter(mContext, homeEvent!!, ArrayList())
val layoutManager = LinearLayoutManager(context) val layoutManager = LinearLayoutManager(context)
home_module_fragment_recycler.layoutManager = layoutManager home_module_fragment_recycler.layoutManager = layoutManager
home_module_fragment_recycler.adapter = adapter home_module_fragment_recycler.adapter = adapter
...@@ -158,7 +161,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -158,7 +161,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
if (HomeViewConfig.getOrder().bannerIndex == null || HomeViewConfig.getOrder().bannerIndex == -1) { if (HomeViewConfig.getOrder().bannerIndex == null || HomeViewConfig.getOrder().bannerIndex == -1) {
var marginTop = this.resources.getDimension(R.dimen.home_home_title_bar_height) var marginTop = this.resources.getDimension(R.dimen.home_home_title_bar_height)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity!!) val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
marginTop += statusBarHeight marginTop += statusBarHeight
} }
val lp = home_swipe_refresh_layout.layoutParams as FrameLayout.LayoutParams val lp = home_swipe_refresh_layout.layoutParams as FrameLayout.LayoutParams
...@@ -169,7 +172,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -169,7 +172,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
home_swipe_refresh_layout?.setOnRefreshListener(this) home_swipe_refresh_layout?.setOnRefreshListener(this)
home_swipe_refresh_layout?.setColorSchemeColors( home_swipe_refresh_layout?.setColorSchemeColors(
ContextCompat.getColor( ContextCompat.getColor(
mContext!!, mContext,
R.color.platform_main_theme R.color.platform_main_theme
) )
) )
...@@ -192,7 +195,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -192,7 +195,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
*/ */
private fun initStatus() { private fun initStatus() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {//4.4以下不支持状态栏变色
val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity!!) val statusBarHeight = StatusBarUtils.getStatusBarHeight(mActivity)
var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height) var homeTitleBarHeight = resources.getDimension(R.dimen.home_home_title_bar_height)
val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams val lp1 = view_rl_top_bg.layoutParams as RelativeLayout.LayoutParams
lp1.height = (homeTitleBarHeight + statusBarHeight).toInt() lp1.height = (homeTitleBarHeight + statusBarHeight).toInt()
...@@ -230,7 +233,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -230,7 +233,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} }
override fun startAnim() { override fun startAnim() {
HomeAnimUtils.startAnim(mContext!!, rl_top, rl_search, home_service_call, home_tv) HomeAnimUtils.startAnim(mContext, rl_top, rl_search, home_service_call, home_tv)
HomeAnimUtils.startSearchShow( HomeAnimUtils.startSearchShow(
ll_top_function, ll_top_function,
view_search_input_bg, view_search_input_bg,
...@@ -241,7 +244,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -241,7 +244,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
} }
override fun endAnim() { override fun endAnim() {
HomeAnimUtils.endAnim(mContext!!, rl_top, rl_search, home_tv, home_service_call, this) HomeAnimUtils.endAnim(mContext, rl_top, rl_search, home_tv, home_service_call, this)
HomeAnimUtils.startSearchHide( HomeAnimUtils.startSearchHide(
ll_top_function, ll_top_function,
view_search_input_bg, view_search_input_bg,
...@@ -274,7 +277,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -274,7 +277,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
* 设置悬浮顶部监听数据 * 设置悬浮顶部监听数据
*/ */
private fun setSuspendListener() { private fun setSuspendListener() {
scrollListner?.setContext(mContext!!) scrollListner?.setContext(mContext)
scrollListner?.setHomeView(this) scrollListner?.setHomeView(this)
scrollListner?.setConfideFilterView(ll_layout) scrollListner?.setConfideFilterView(ll_layout)
scrollListner?.setConsultFilterView(ll_consultLayout) scrollListner?.setConsultFilterView(ll_consultLayout)
...@@ -340,12 +343,12 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -340,12 +343,12 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
if (!TextUtils.isEmpty(act.imageBanner)) { if (!TextUtils.isEmpty(act.imageBanner)) {
//展示弹窗 //展示弹窗
if (aa == null) { if (aa == null) {
aa = ActivityDialog(mActivity!!, act.imageBanner, act.linkUrl, act.title) aa = ActivityDialog(mActivity, act.imageBanner, act.linkUrl, act.title)
aa?.show() aa?.show()
aa?.setOnDismissListener { aa?.setOnDismissListener {
//文案不为空才显示引导--李思开 //文案不为空才显示引导--李思开
if (!TextUtils.isEmpty(act.title)) { if (!TextUtils.isEmpty(act.title)) {
ActivityGuideDialog(mActivity!!, act.imageUrl, act.title).show() ActivityGuideDialog(mActivity, act.imageUrl, act.title).show()
} }
} }
} }
...@@ -401,7 +404,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -401,7 +404,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
) )
if (textView != null && textView is TextView) { if (textView != null && textView is TextView) {
textView.textSize = 17f textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mActivity!!, R.color.platform_color_242424)) textView.setTextColor(ContextCompat.getColor(mActivity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD) textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
} }
} }
...@@ -442,7 +445,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -442,7 +445,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
) as LinearLayout).getChildAt(1) ) as LinearLayout).getChildAt(1)
if (textView != null && textView is TextView) { if (textView != null && textView is TextView) {
textView.textSize = 17f textView.textSize = 17f
textView.setTextColor(ContextCompat.getColor(mActivity!!, R.color.platform_color_242424)) textView.setTextColor(ContextCompat.getColor(mActivity, R.color.platform_color_242424))
textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD) textView.typeface = Typeface.defaultFromStyle(Typeface.BOLD)
} }
} }
...@@ -501,7 +504,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm ...@@ -501,7 +504,7 @@ open class YdlHomeFragment : BaseMvpFragment<IHomeContract.View, HomePresenterIm
private fun showConsultAssistantDialog() { private fun showConsultAssistantDialog() {
ModularServiceManager.provide(IConsultantService::class.java) ModularServiceManager.provide(IConsultantService::class.java)
.showConsultAssistantDialog(mActivity!!) .showConsultAssistantDialog(mActivity)
} }
private fun hideConsultAssistantDialog() { private fun hideConsultAssistantDialog() {
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:paddingRight="@dimen/platform_dp_15" android:paddingRight="@dimen/platform_dp_15"
android:paddingTop="@dimen/platform_dp_15"> android:paddingTop="@dimen/platform_dp_15">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/homeModuleArticleItemViewCardImg" android:id="@+id/homeModuleArticleItemViewCardImg"
android:layout_width="@dimen/platform_dp_127" android:layout_width="@dimen/platform_dp_127"
android:layout_height="@dimen/platform_dp_88" android:layout_height="@dimen/platform_dp_88"
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:id="@+id/homeModuleArticleItemViewImg" android:id="@+id/homeModuleArticleItemViewImg"
android:background="@drawable/home_image_default_back"/> android:background="@drawable/home_image_default_back"/>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<TextView <TextView
android:id="@+id/homeModuleArticleItemViewTitle" android:id="@+id/homeModuleArticleItemViewTitle"
......
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
android:layout_height="38dp" android:layout_height="38dp"
android:background="@drawable/home_assuage_grief_stroke_line"> android:background="@drawable/home_assuage_grief_stroke_line">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="@dimen/platform_dp_36" android:layout_width="@dimen/platform_dp_36"
android:layout_height="@dimen/platform_dp_36" android:layout_height="@dimen/platform_dp_36"
android:layout_centerInParent="true" android:layout_centerInParent="true"
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
android:layout_height="@dimen/platform_dp_36" android:layout_height="@dimen/platform_dp_36"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/platform_head_place_hold_pic" /> android:src="@drawable/platform_head_place_hold_pic" />
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
</RelativeLayout> </RelativeLayout>
<TextView <TextView
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
tools:ignore="MissingConstraints"
android:paddingBottom="@dimen/platform_dp_14"> android:paddingBottom="@dimen/platform_dp_14">
<View <View
...@@ -25,7 +26,8 @@ ...@@ -25,7 +26,8 @@
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_333333" android:textColor="@color/platform_color_333333"
android:layout_marginLeft="@dimen/platform_dp_15" android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"/> app:layout_constraintLeft_toLeftOf="parent"
/>
<LinearLayout <LinearLayout
android:layout_width="@dimen/platform_dp_60" android:layout_width="@dimen/platform_dp_60"
...@@ -58,4 +60,4 @@ ...@@ -58,4 +60,4 @@
</android.support.constraint.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_99"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/platform_dp_99"
android:layout_marginLeft="@dimen/platform_dp_15" android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_3"
android:layout_marginRight="@dimen/platform_dp_15" android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginBottom="@dimen/platform_dp_13" android:layout_marginBottom="@dimen/platform_dp_13"
android:layout_marginTop="@dimen/platform_dp_3" android:background="@drawable/home_card_view_stroke"
android:padding="@dimen/platform_dp_15" android:padding="@dimen/platform_dp_15">
android:background="@drawable/home_card_view_stroke">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/homeModuleCourseItemViewImgCardView" android:id="@+id/homeModuleCourseItemViewImgCardView"
android:layout_width="127dp" android:layout_width="127dp"
android:layout_height="69dp" android:layout_height="69dp"
app:cardCornerRadius="6dp" app:cardCornerRadius="6dp"
app:cardElevation="0dp"> app:cardElevation="0dp">
<ImageView <ImageView
android:id="@+id/homeModuleCourseItemViewImg" android:id="@+id/homeModuleCourseItemViewImg"
android:layout_width="127dp" android:layout_width="127dp"
android:layout_height="69dp" android:layout_height="69dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/home_image_default_back"/> android:src="@drawable/home_image_default_back" />
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<TextView <TextView
android:id="@+id/homeModuleCourseItemViewTitle" android:id="@+id/homeModuleCourseItemViewTitle"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_marginLeft="@dimen/platform_dp_12"
android:textSize="@dimen/platform_dp_16" android:layout_marginTop="-2dp"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:ellipsize="end"
android:maxLines="2"
android:textColor="@color/platform_color_242424" android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_16"
android:textStyle="bold" android:textStyle="bold"
android:maxLines="2"
android:ellipsize="end"
android:layout_marginTop="-2dp"
tools:text="深度睡眠速效药丸丨帮你 tools:text="深度睡眠速效药丸丨帮你
像婴儿般安稳入睡深度睡眠速效药丸丨帮你 像婴儿般安稳入睡深度睡眠速效药丸丨帮你
像婴儿般安稳入睡"/> 像婴儿般安稳入睡" />
<TextView <TextView
android:id="@+id/homeModuleCourseItemViewFreePrice" android:id="@+id/homeModuleCourseItemViewFreePrice"
android:visibility="gone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:text="免费" android:text="免费"
android:textColor="@color/platform_color_34CD65"
android:textSize="@dimen/platform_dp_15" android:textSize="@dimen/platform_dp_15"
android:textStyle="bold" android:textStyle="bold"
android:textColor="@color/platform_color_34CD65" android:visibility="gone" />
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"/>
<RelativeLayout <RelativeLayout
android:id="@+id/homeModuleCourseItemViewExpensePriceHideView" android:id="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView" android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginBottom="-2dp"> android:layout_marginBottom="-2dp"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView">
<TextView <TextView
android:id="@+id/homeModuleCourseItemViewExpensePrice" android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="¥688" android:textColor="@color/platform_color_FF5A4C"
android:textStyle="bold"
android:textSize="16dp" android:textSize="16dp"
android:textColor="@color/platform_color_FF5A4C"/> android:textStyle="bold"
tools:text="¥688" />
</RelativeLayout> </RelativeLayout>
<TextView <TextView
android:id="@+id/homeModuleCourseItemViewPersonText" android:id="@+id/homeModuleCourseItemViewPersonText"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="人气"
android:textSize="@dimen/platform_dp_11"
android:gravity="center"
android:textColor="@color/platform_color_666666"
android:layout_alignParentRight="true"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView" android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView" android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_marginBottom="-1dp"/> android:layout_alignParentRight="true"
android:layout_marginBottom="-1dp"
android:gravity="center"
android:text="人气"
android:textColor="@color/platform_color_666666"
android:textSize="@dimen/platform_dp_11" />
<TextView <TextView
android:id="@+id/homeModuleCourseItemViewPersonNum" android:id="@+id/homeModuleCourseItemViewPersonNum"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
tools:text="3109"
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424"
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView" android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_marginBottom="-1dp"
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText"
android:gravity="center" android:gravity="center"
android:layout_marginBottom="-1dp"/> android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
tools:text="3109" />
</RelativeLayout> </RelativeLayout>
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical"> android:orientation="vertical">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="267dp" android:layout_width="267dp"
android:layout_height="292dp" android:layout_height="292dp"
app:cardCornerRadius="10dp"> app:cardCornerRadius="10dp">
...@@ -123,7 +123,7 @@ ...@@ -123,7 +123,7 @@
</LinearLayout> </LinearLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<ImageView <ImageView
android:id="@+id/iv_close" android:id="@+id/iv_close"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
xmlns:tools="http://schemas.android.com/tools"> xmlns:tools="http://schemas.android.com/tools">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView" android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<TextView <TextView
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/muse_first" android:id="@+id/muse_first"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="78dp"
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
android:src="@drawable/home_muse_play" /> android:src="@drawable/home_muse_play" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/muse_second" android:id="@+id/muse_second"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="78dp"
...@@ -116,7 +116,7 @@ ...@@ -116,7 +116,7 @@
android:src="@drawable/home_muse_play" /> android:src="@drawable/home_muse_play" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal"> android:orientation="horizontal">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/muse_third" android:id="@+id/muse_third"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="78dp"
...@@ -171,9 +171,9 @@ ...@@ -171,9 +171,9 @@
android:src="@drawable/home_muse_play" /> android:src="@drawable/home_muse_play" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/muse_forth" android:id="@+id/muse_forth"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="78dp" android:layout_height="78dp"
...@@ -219,7 +219,7 @@ ...@@ -219,7 +219,7 @@
android:src="@drawable/home_muse_play" /> android:src="@drawable/home_muse_play" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
...@@ -243,7 +243,7 @@ ...@@ -243,7 +243,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/home_muse_circle_first" android:src="@drawable/home_muse_circle_first"
android:layout_centerInParent="true" android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView> app:pa_type="pa_circle"/>
<TextView <TextView
android:id="@+id/sleeps_first_text" android:id="@+id/sleeps_first_text"
...@@ -268,7 +268,7 @@ ...@@ -268,7 +268,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/home_muse_circle_second" android:src="@drawable/home_muse_circle_second"
android:layout_centerInParent="true" android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView> app:pa_type="pa_circle"/>
<TextView <TextView
android:id="@+id/sleeps_second_text" android:id="@+id/sleeps_second_text"
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/home_muse_circle_third" android:src="@drawable/home_muse_circle_third"
android:layout_centerInParent="true" android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView> app:pa_type="pa_circle"/>
<TextView <TextView
android:id="@+id/sleeps_third_text" android:id="@+id/sleeps_third_text"
...@@ -318,7 +318,7 @@ ...@@ -318,7 +318,7 @@
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/home_muse_circle_fouth" android:src="@drawable/home_muse_circle_fouth"
android:layout_centerInParent="true" android:layout_centerInParent="true"
app:pa_type="pa_circle"></com.ydl.ydlcommon.view.widgets.RoundImageView> app:pa_type="pa_circle"/>
<TextView <TextView
android:id="@+id/sleeps_forth_text" android:id="@+id/sleeps_forth_text"
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
> >
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:layout_width="70dp" android:layout_width="70dp"
android:layout_height="50dp" android:layout_height="50dp"
app:cardCornerRadius="@dimen/platform_dp_6" app:cardCornerRadius="@dimen/platform_dp_6"
...@@ -30,7 +30,7 @@ ...@@ -30,7 +30,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@drawable/home_image_default_back" android:background="@drawable/home_image_default_back"
android:scaleType="centerCrop"/> android:scaleType="centerCrop"/>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<LinearLayout <LinearLayout
android:layout_width="0dp" android:layout_width="0dp"
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
android:layout_height="match_parent"> android:layout_height="match_parent">
<android.support.v7.widget.CardView <androidx.cardview.widget.CardView
android:id="@+id/homeModuleIntelligentTopViewImageCardView" android:id="@+id/homeModuleIntelligentTopViewImageCardView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</android.support.v7.widget.CardView> </androidx.cardview.widget.CardView>
<TextView <TextView
......
package com.yidianling.im.ui.page.fragment package com.yidianling.im.ui.page.fragment
import android.content.Context
import android.graphics.Color import android.graphics.Color
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View import android.view.View
...@@ -33,7 +34,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -33,7 +34,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
SERVICING, // 服务中 SERVICING, // 服务中
SERVICED // 服务过 SERVICED // 服务过
} }
private val mContext = context private lateinit var mContext:Context
private var chatAdapter: ChatAdapter? = null private var chatAdapter: ChatAdapter? = null
private var allChatData: ChatModelBean = ChatModelBean() //全部数据 private var allChatData: ChatModelBean = ChatModelBean() //全部数据
private var showData: ArrayList<ChatItemBean> = ArrayList() // 最终展示的数据 private var showData: ArrayList<ChatItemBean> = ArrayList() // 最终展示的数据
...@@ -59,6 +60,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -59,6 +60,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
mContext = requireContext()
selectModel(mChatModelType) selectModel(mChatModelType)
chat_all_message.setOnClickListener { chat_all_message.setOnClickListener {
...@@ -203,7 +205,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -203,7 +205,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
private fun initListData() { private fun initListData() {
chatAdapter = ChatAdapter(mContext!!, showData,this) chatAdapter = ChatAdapter(mContext, showData,this)
chatAdapter?.setlistener(object : ChatAdapter.ChatRecyclerViewCallback { chatAdapter?.setlistener(object : ChatAdapter.ChatRecyclerViewCallback {
override fun onRefresh() { override fun onRefresh() {
getChatMessageData() getChatMessageData()
...@@ -281,7 +283,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -281,7 +283,7 @@ class ChatFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_chat_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_chat_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_chat_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
ImIn.loginByOneKeyLogin(mContext!!,true) ImIn.loginByOneKeyLogin(mContext,true)
} }
}) })
} }
......
package com.yidianling.im.ui.page.fragment package com.yidianling.im.ui.page.fragment
import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.util.Log import android.util.Log
import android.view.View import android.view.View
...@@ -27,7 +28,7 @@ import kotlinx.android.synthetic.main.im_interact_fragment.* ...@@ -27,7 +28,7 @@ import kotlinx.android.synthetic.main.im_interact_fragment.*
*/ */
class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener { class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener {
private val mContext = context private lateinit var mContext: Context
private var interactAdapter: InteractAdapter? = null private var interactAdapter: InteractAdapter? = null
private var interactList: ArrayList<InteractItemBean> = ArrayList() private var interactList: ArrayList<InteractItemBean> = ArrayList()
...@@ -40,18 +41,19 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -40,18 +41,19 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener {
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
mContext = requireContext()
initListPageData() initListPageData()
initListData() initListData()
} }
private fun initListData() { private fun initListData() {
interactAdapter = InteractAdapter(mContext!!, interactList) interactAdapter = InteractAdapter(mContext, interactList)
interact_recyclerview.layoutManager = interact_recyclerview.layoutManager =
LinearLayoutManager(context) LinearLayoutManager(context)
interact_recyclerview.adapter = interactAdapter interact_recyclerview.adapter = interactAdapter
interact_recyclerview.setLoadingListener(this) interact_recyclerview.setLoadingListener(this)
var footerView = InteractFooterItemView(mContext) val footerView = InteractFooterItemView(mContext)
interact_recyclerview.setFootView(footerView, object : CustomFooterViewCallBack { interact_recyclerview.setFootView(footerView, object : CustomFooterViewCallBack {
override fun onSetNoMore(p0: View?, p1: Boolean) { override fun onSetNoMore(p0: View?, p1: Boolean) {
footerView.setNoMoreText() footerView.setNoMoreText()
...@@ -198,7 +200,7 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -198,7 +200,7 @@ class InteractFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_interact_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_interact_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_interact_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_interact_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
ImIn.loginByOneKeyLogin(mContext!!,true) ImIn.loginByOneKeyLogin(mContext,true)
} }
}) })
} }
......
package com.yidianling.im.ui.page.fragment package com.yidianling.im.ui.page.fragment
import android.content.Context
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import android.view.View import android.view.View
import com.jcodecraeer.xrecyclerview.XRecyclerView import com.jcodecraeer.xrecyclerview.XRecyclerView
...@@ -23,7 +24,7 @@ import kotlinx.android.synthetic.main.im_notice_fragment.* ...@@ -23,7 +24,7 @@ import kotlinx.android.synthetic.main.im_notice_fragment.*
*/ */
class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener { class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
private val mContext = context private lateinit var mContext: Context
private var noticeAdapter: NoticeAdapter? = null private var noticeAdapter: NoticeAdapter? = null
private var noticeList: ArrayList<NoticeItemBean> = ArrayList() private var noticeList: ArrayList<NoticeItemBean> = ArrayList()
...@@ -32,12 +33,12 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -32,12 +33,12 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
mContext = requireContext()
initListData() initListData()
} }
private fun initListData() { private fun initListData() {
noticeAdapter = NoticeAdapter(mContext!!, noticeList) noticeAdapter = NoticeAdapter(mContext, noticeList)
notice_recyclerview.layoutManager = notice_recyclerview.layoutManager =
LinearLayoutManager(context) LinearLayoutManager(context)
notice_recyclerview.adapter = noticeAdapter notice_recyclerview.adapter = noticeAdapter
...@@ -122,7 +123,7 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener { ...@@ -122,7 +123,7 @@ class NoticeFragment : BaseFragment(), XRecyclerView.LoadingListener {
ll_notice_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN) ll_notice_unusual_view.setUnusualType(ChatUnusualView.TYPE_UNLOGIN)
ll_notice_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener { ll_notice_unusual_view.setListener(object : ChatUnusualView.ChatUnusualListener {
override fun onButtonClick() { override fun onButtonClick() {
ImIn.loginByOneKeyLogin(mContext!!,true) ImIn.loginByOneKeyLogin(mContext,true)
} }
}) })
} }
......
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" android:background="@color/white">
android:background="@color/white"
>
<ImageView <ImageView
android:id="@+id/img_reg_back" android:id="@+id/img_reg_back"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
android:layout_marginTop="54dp" android:layout_marginTop="54dp"
android:src="@drawable/user_ic_back_black" android:src="@drawable/user_ic_back_black"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" app:layout_constraintTop_toTopOf="parent" />
/>
<TextView <TextView
android:id="@+id/tv_password_orSet_title" android:id="@+id/tv_password_orSet_title"
android:layout_width="wrap_content" android:layout_width="wrap_content"
...@@ -31,10 +31,7 @@ ...@@ -31,10 +31,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center_vertical" android:layout_gravity="center_vertical"
app:layout_constraintTop_toBottomOf="@id/tv_password_orSet_title"
android:layout_marginTop="100dp" android:layout_marginTop="100dp"
app:layout_constraintStart_toStartOf="@id/tv_password_orSet_title"
app:layout_constraintEnd_toStartOf="@id/iv_visibility"
android:layout_weight="1" android:layout_weight="1"
android:background="@null" android:background="@null"
android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" android:digits="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
...@@ -42,7 +39,11 @@ ...@@ -42,7 +39,11 @@
android:lines="1" android:lines="1"
android:maxLines="16" android:maxLines="16"
android:textColorHint="@color/platform_color_BFBFBF" android:textColorHint="@color/platform_color_BFBFBF"
android:textSize="20sp" /> android:textSize="20sp"
app:layout_constraintEnd_toStartOf="@id/iv_visibility"
app:layout_constraintStart_toStartOf="@id/tv_password_orSet_title"
app:layout_constraintTop_toBottomOf="@id/tv_password_orSet_title" />
<View <View
android:id="@+id/view_lin" android:id="@+id/view_lin"
android:layout_width="0dp" android:layout_width="0dp"
...@@ -52,94 +53,66 @@ ...@@ -52,94 +53,66 @@
android:background="@color/platform_color_EBEBEB" android:background="@color/platform_color_EBEBEB"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="@id/tv_password_orSet_title" app:layout_constraintStart_toStartOf="@id/tv_password_orSet_title"
app:layout_constraintTop_toBottomOf="@id/et_input_password" app:layout_constraintTop_toBottomOf="@id/et_input_password" />
/>
<ImageView <ImageView
android:id="@+id/iv_visibility"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:src="@drawable/user_ic_invisibility_new" android:src="@drawable/user_ic_invisibility_new"
app:layout_constraintTop_toTopOf="@id/et_input_password"
app:layout_constraintBottom_toBottomOf="@id/et_input_password" app:layout_constraintBottom_toBottomOf="@id/et_input_password"
app:layout_constraintEnd_toEndOf="@id/view_lin" app:layout_constraintEnd_toEndOf="@id/view_lin"
android:id="@+id/iv_visibility" app:layout_constraintTop_toTopOf="@id/et_input_password"/>
>
</ImageView>
<TextView <TextView
android:id="@+id/forget_password_hint"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="@id/view_lin"
app:layout_constraintTop_toBottomOf="@id/view_lin"
android:layout_marginTop="@dimen/platform_dp_10" android:layout_marginTop="@dimen/platform_dp_10"
android:text="密码为6-16个字符,数字和英文字母组合"
app:layout_constraintEnd_toEndOf="@id/view_lin"
android:layout_marginEnd="@dimen/platform_dp_27" android:layout_marginEnd="@dimen/platform_dp_27"
android:id="@+id/forget_password_hint" android:text="密码为6-16个字符,数字和英文字母组合"
android:visibility="gone" android:visibility="gone"
> app:layout_constraintEnd_toEndOf="@id/view_lin"
</TextView> app:layout_constraintStart_toStartOf="@id/view_lin"
app:layout_constraintTop_toBottomOf="@id/view_lin"/>
<TextView <TextView
android:id="@+id/tv_msm_login"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/platform_dp_12"
android:text="验证码登录" android:text="验证码登录"
android:textColor="@color/platform_color_666666" android:textColor="@color/platform_color_666666"
android:textSize="13sp" android:textSize="13sp"
app:layout_constraintTop_toBottomOf="@id/view_lin"
app:layout_constraintStart_toStartOf="@id/view_lin" app:layout_constraintStart_toStartOf="@id/view_lin"
android:layout_marginTop="@dimen/platform_dp_12" app:layout_constraintTop_toBottomOf="@id/view_lin"/>
android:id="@+id/tv_msm_login"
>
</TextView>
<TextView <TextView
android:id="@+id/tv_forget"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="忘记密码?" android:text="忘记密码?"
app:layout_constraintEnd_toEndOf="@id/view_lin"
app:layout_constraintTop_toTopOf="@id/tv_msm_login"
app:layout_constraintBottom_toBottomOf="@id/tv_msm_login" app:layout_constraintBottom_toBottomOf="@id/tv_msm_login"
android:id="@+id/tv_forget" app:layout_constraintEnd_toEndOf="@id/view_lin"
> app:layout_constraintTop_toTopOf="@id/tv_msm_login"/>
</TextView>
<!-- <android.support.v7.widget.CardView
android:layout_width="0dp"
android:layout_height="wrap_content"
app:layout_constraintTop_toBottomOf="@id/tv_msm_login"
app:layout_constraintStart_toStartOf="@id/tv_msm_login"
app:layout_constraintEnd_toEndOf="@id/tv_forget"
app:cardBackgroundColor="#a5dafa"
android:layout_marginTop="@dimen/platform_dp_40"
app:cardCornerRadius="@dimen/platform_dp_24"
app:cardElevation="3dp"
>
<TextView <TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:textColor="@color/white"
android:text="登录"
android:textSize="15sp"
android:id="@+id/login_password" android:id="@+id/login_password"
android:paddingTop="@dimen/platform_dp_14"
android:paddingBottom="@dimen/platform_dp_14"
/>
</android.support.v7.widget.CardView>-->
<TextView
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:gravity="center" android:layout_marginStart="@dimen/platform_dp_28"
android:textColor="@color/white" android:layout_marginTop="@dimen/platform_dp_25"
android:text="登录" android:layout_marginEnd="@dimen/platform_dp_28"
android:enabled="false"
android:textSize="17sp"
android:id="@+id/login_password"
android:background="@drawable/login_password_unable_bg_24dp" android:background="@drawable/login_password_unable_bg_24dp"
android:enabled="false"
android:gravity="center"
android:paddingTop="@dimen/platform_dp_14" android:paddingTop="@dimen/platform_dp_14"
android:paddingBottom="@dimen/platform_dp_14" android:paddingBottom="@dimen/platform_dp_14"
app:layout_constraintTop_toBottomOf="@id/tv_msm_login" android:text="登录"
app:layout_constraintStart_toStartOf="parent" android:textColor="@color/white"
android:textSize="17sp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
android:layout_marginStart="@dimen/platform_dp_28" app:layout_constraintStart_toStartOf="parent"
android:layout_marginEnd="@dimen/platform_dp_28" app:layout_constraintTop_toBottomOf="@id/tv_msm_login"
android:layout_marginTop="@dimen/platform_dp_25" app:layout_goneMarginTop="@dimen/platform_dp_25" />
app:layout_goneMarginTop="@dimen/platform_dp_25"
/>
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
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