Commit a1b73895 by YKai

feat:androidx代码提交

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