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",
......
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() {
......
<?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"
android:paddingBottom="@dimen/platform_dp_14"> tools:ignore="MissingConstraints"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:layout_width="0dp" <View
android:layout_height="@dimen/platform_dp_7" android:layout_width="0dp"
android:background="@drawable/home_common_title_gradient_back" android:layout_height="@dimen/platform_dp_7"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle" android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle" app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle" app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/> app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle" <TextView
android:layout_width="wrap_content" android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:paddingRight="@dimen/platform_dp_1" android:layout_height="wrap_content"
tools:text="通用.标题" android:paddingRight="@dimen/platform_dp_1"
android:textSize="24dp" tools:text="通用.标题"
android:textStyle="bold" android:textSize="24dp"
android:textColor="@color/platform_color_333333" android:textStyle="bold"
android:layout_marginLeft="@dimen/platform_dp_15" android:textColor="@color/platform_color_333333"
app:layout_constraintLeft_toLeftOf="parent"/> android:layout_marginLeft="@dimen/platform_dp_15"
app:layout_constraintLeft_toLeftOf="parent"
<LinearLayout />
android:layout_width="@dimen/platform_dp_60"
android:layout_height="@dimen/platform_dp_24" <LinearLayout
android:orientation="horizontal" android:layout_width="@dimen/platform_dp_60"
android:gravity="center" android:layout_height="@dimen/platform_dp_24"
android:layout_marginBottom="@dimen/platform_dp_3" android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent" android:gravity="center"
app:layout_constraintRight_toRightOf="parent" android:layout_marginBottom="@dimen/platform_dp_3"
android:layout_marginRight="@dimen/platform_dp_15" app:layout_constraintBottom_toBottomOf="parent"
android:background="@drawable/home_show_more_line"> app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
<TextView android:background="@drawable/home_show_more_line">
android:layout_width="wrap_content"
android:layout_height="wrap_content" <TextView
android:gravity="center" android:layout_width="wrap_content"
android:text="更多" android:layout_height="wrap_content"
android:textStyle="bold" android:gravity="center"
android:layout_marginLeft="@dimen/platform_dp_2" android:text="更多"
android:textColor="@color/platform_color_242424" android:textStyle="bold"
android:textSize="@dimen/platform_dp_13"/> android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_242424"
<ImageView android:textSize="@dimen/platform_dp_13"/>
android:layout_height="@dimen/platform_dp_10"
android:layout_width="@dimen/platform_dp_6" <ImageView
android:src="@drawable/home_common_more_icon" android:layout_height="@dimen/platform_dp_10"
android:layout_marginLeft="3dp"/> android:layout_width="@dimen/platform_dp_6"
android:src="@drawable/home_common_more_icon"
</LinearLayout> android:layout_marginLeft="3dp"/>
</LinearLayout>
</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" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_height="@dimen/platform_dp_99" xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools" android:layout_height="@dimen/platform_dp_99"
android:layout_marginLeft="@dimen/platform_dp_15" android:layout_marginLeft="@dimen/platform_dp_15"
android:layout_marginRight="@dimen/platform_dp_15" android:layout_marginTop="@dimen/platform_dp_3"
android:layout_marginBottom="@dimen/platform_dp_13" android:layout_marginRight="@dimen/platform_dp_15"
android:layout_marginTop="@dimen/platform_dp_3" android:layout_marginBottom="@dimen/platform_dp_13"
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: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
android:id="@+id/homeModuleCourseItemViewImg" <ImageView
android:layout_width="127dp" android:id="@+id/homeModuleCourseItemViewImg"
android:layout_height="69dp" android:layout_width="127dp"
android:scaleType="centerCrop" android:layout_height="69dp"
android:src="@drawable/home_image_default_back"/> android:scaleType="centerCrop"
android:src="@drawable/home_image_default_back" />
</android.support.v7.widget.CardView>
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/homeModuleCourseItemViewTitle" <TextView
android:layout_width="match_parent" android:id="@+id/homeModuleCourseItemViewTitle"
android:layout_height="wrap_content" android:layout_width="match_parent"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView" android:layout_height="wrap_content"
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:textColor="@color/platform_color_242424" android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:textStyle="bold" android:ellipsize="end"
android:maxLines="2" android:maxLines="2"
android:ellipsize="end" android:textColor="@color/platform_color_242424"
android:layout_marginTop="-2dp" android:textSize="@dimen/platform_dp_16"
tools:text="深度睡眠速效药丸丨帮你 android:textStyle="bold"
像婴儿般安稳入睡深度睡眠速效药丸丨帮你 tools:text="深度睡眠速效药丸丨帮你
像婴儿般安稳入睡"/> 像婴儿般安稳入睡深度睡眠速效药丸丨帮你
<TextView 像婴儿般安稳入睡" />
android:id="@+id/homeModuleCourseItemViewFreePrice"
android:visibility="gone" <TextView
android:layout_width="wrap_content" android:id="@+id/homeModuleCourseItemViewFreePrice"
android:layout_height="wrap_content" android:layout_width="wrap_content"
android:text="免费" android:layout_height="wrap_content"
android:textSize="@dimen/platform_dp_15" android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:textStyle="bold" android:layout_marginLeft="@dimen/platform_dp_12"
android:textColor="@color/platform_color_34CD65" android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView" android:text="免费"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView" android:textColor="@color/platform_color_34CD65"
android:layout_marginLeft="@dimen/platform_dp_12"/> android:textSize="@dimen/platform_dp_15"
<RelativeLayout android:textStyle="bold"
android:id="@+id/homeModuleCourseItemViewExpensePriceHideView" android:visibility="gone" />
android:layout_width="wrap_content"
android:layout_height="wrap_content" <RelativeLayout
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView" android:id="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView" android:layout_width="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_12" android:layout_height="wrap_content"
android:layout_marginBottom="-2dp"> android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
<TextView android:layout_marginLeft="@dimen/platform_dp_12"
android:id="@+id/homeModuleCourseItemViewExpensePrice" android:layout_marginBottom="-2dp"
android:layout_width="wrap_content" android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView">
android:layout_height="wrap_content"
tools:text="¥688" <TextView
android:textStyle="bold" android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:textSize="16dp" android:layout_width="wrap_content"
android:textColor="@color/platform_color_FF5A4C"/> android:layout_height="wrap_content"
</RelativeLayout> android:textColor="@color/platform_color_FF5A4C"
<TextView android:textSize="16dp"
android:id="@+id/homeModuleCourseItemViewPersonText" android:textStyle="bold"
android:layout_width="wrap_content" tools:text="¥688" />
android:layout_height="wrap_content" </RelativeLayout>
android:text="人气"
android:textSize="@dimen/platform_dp_11" <TextView
android:gravity="center" android:id="@+id/homeModuleCourseItemViewPersonText"
android:textColor="@color/platform_color_666666" android:layout_width="wrap_content"
android:layout_alignParentRight="true" android:layout_height="wrap_content"
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"
<TextView android:layout_marginBottom="-1dp"
android:id="@+id/homeModuleCourseItemViewPersonNum" android:gravity="center"
android:layout_width="wrap_content" android:text="人气"
android:layout_height="wrap_content" android:textColor="@color/platform_color_666666"
tools:text="3109" android:textSize="@dimen/platform_dp_11" />
android:textSize="@dimen/platform_dp_12"
android:textColor="@color/platform_color_242424" <TextView
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText" android:id="@+id/homeModuleCourseItemViewPersonNum"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView" android:layout_width="wrap_content"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView" android:layout_height="wrap_content"
android:gravity="center" android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_marginBottom="-1dp"/> android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
</RelativeLayout> android:layout_marginBottom="-1dp"
android:layout_toLeftOf="@+id/homeModuleCourseItemViewPersonText"
android:gravity="center"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_12"
tools:text="3109" />
</RelativeLayout>
...@@ -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 <TextView
android:id="@+id/login_password"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
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"
android:text="登录"
android:textColor="@color/white"
android:textSize="17sp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_msm_login" app:layout_constraintTop_toBottomOf="@id/tv_msm_login"
app:layout_constraintStart_toStartOf="@id/tv_msm_login" app:layout_goneMarginTop="@dimen/platform_dp_25" />
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
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:background="@drawable/login_password_unable_bg_24dp"
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"
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"
/>
</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