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",
......
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() {
......
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.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"
android:paddingBottom="@dimen/platform_dp_14">
<View
android:layout_width="0dp"
android:layout_height="@dimen/platform_dp_7"
android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
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"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_show_more_line">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:textStyle="bold"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_13"/>
<ImageView
android:layout_height="@dimen/platform_dp_10"
android:layout_width="@dimen/platform_dp_6"
android:src="@drawable/home_common_more_icon"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</android.support.constraint.ConstraintLayout>
<?xml version="1.0" encoding="utf-8"?>
<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
android:layout_width="0dp"
android:layout_height="@dimen/platform_dp_7"
android:background="@drawable/home_common_title_gradient_back"
app:layout_constraintLeft_toLeftOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintRight_toRightOf="@+id/homeModuleCommonTitleViewTitle"
app:layout_constraintBottom_toBottomOf="@+id/homeModuleCommonTitleViewTitle"
android:layout_marginBottom="2dp"/>
<TextView
android:id="@+id/homeModuleCommonTitleViewTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingRight="@dimen/platform_dp_1"
tools:text="通用.标题"
android:textSize="24dp"
android:textStyle="bold"
android:textColor="@color/platform_color_333333"
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"
android:orientation="horizontal"
android:gravity="center"
android:layout_marginBottom="@dimen/platform_dp_3"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:layout_marginRight="@dimen/platform_dp_15"
android:background="@drawable/home_show_more_line">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="更多"
android:textStyle="bold"
android:layout_marginLeft="@dimen/platform_dp_2"
android:textColor="@color/platform_color_242424"
android:textSize="@dimen/platform_dp_13"/>
<ImageView
android:layout_height="@dimen/platform_dp_10"
android:layout_width="@dimen/platform_dp_6"
android:src="@drawable/home_common_more_icon"
android:layout_marginLeft="3dp"/>
</LinearLayout>
</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_marginLeft="@dimen/platform_dp_15"
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.support.v7.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.support.v7.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:textColor="@color/platform_color_242424"
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:text="免费"
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"/>
<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">
<TextView
android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
tools:text="¥688"
android:textStyle="bold"
android:textSize="16dp"
android:textColor="@color/platform_color_FF5A4C"/>
</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"/>
<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:gravity="center"
android:layout_marginBottom="-1dp"/>
</RelativeLayout>
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:background="@drawable/home_card_view_stroke"
android:padding="@dimen/platform_dp_15">
<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" />
</androidx.cardview.widget.CardView>
<TextView
android:id="@+id/homeModuleCourseItemViewTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/platform_dp_12"
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"
tools:text="深度睡眠速效药丸丨帮你
像婴儿般安稳入睡深度睡眠速效药丸丨帮你
像婴儿般安稳入睡" />
<TextView
android:id="@+id/homeModuleCourseItemViewFreePrice"
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:visibility="gone" />
<RelativeLayout
android:id="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/homeModuleCourseItemViewImgCardView"
android:layout_marginLeft="@dimen/platform_dp_12"
android:layout_marginBottom="-2dp"
android:layout_toRightOf="@+id/homeModuleCourseItemViewImgCardView">
<TextView
android:id="@+id/homeModuleCourseItemViewExpensePrice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/platform_color_FF5A4C"
android:textSize="16dp"
android:textStyle="bold"
tools:text="¥688" />
</RelativeLayout>
<TextView
android:id="@+id/homeModuleCourseItemViewPersonText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
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"
android:layout_alignTop="@+id/homeModuleCourseItemViewExpensePriceHideView"
android:layout_alignBottom="@+id/homeModuleCourseItemViewExpensePriceHideView"
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 @@
>
<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
app:layout_constraintEnd_toEndOf="@id/view_lin"
app:layout_constraintTop_toTopOf="@id/tv_msm_login"/>
<TextView
android:id="@+id/login_password"
android:layout_width="0dp"
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_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
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"
/>
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