Commit 07b31ccc by Dell

1、修改直播间状态

2、修改直播间样式和布局
3、修改赛事样式和布局
4、修改主页样式和布局
parent 814b47f7
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
//apply plugin: 'com.github.dcendents.android-maven' //apply plugin: 'com.github.dcendents.android-maven'
//apply plugin: 'com.jfrog.bintray' //apply plugin: 'com.jfrog.bintray'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
def config = rootProject.ext.ver def config = rootProject.ext.ver
def library = rootProject.ext.library def library = rootProject.ext.library
...@@ -25,4 +27,5 @@ android { ...@@ -25,4 +27,5 @@ android {
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:support-v4:25.1.0' compile 'com.android.support:support-v4:25.1.0'
implementation 'androidx.viewpager2:viewpager2:1.1.0-beta01'
} }
package com.flyco.tablayout.utils
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.FragmentManager
import androidx.lifecycle.Lifecycle
import androidx.viewpager2.adapter.FragmentStateAdapter
import java.util.ArrayList
/**
* @author by Dell
* @date on 2021/8/18
* @describe
*/
public class FragmentBasePager2Adapter(fm: FragmentManager?, fragments: ArrayList<Fragment>?, titles: Array<String?>,lifecycle: Lifecycle) : FragmentStateAdapter(fm!!, lifecycle) {
private var mFragments: ArrayList<Fragment>? = arrayListOf()
private var mTitles: Array<String?>? = null
override fun getItemCount(): Int {
return mFragments?.size ?: 0
}
override fun createFragment(position: Int): Fragment {
return mFragments!![position]
}
fun getPageTitle(position: Int): CharSequence? {
return mTitles!![position]
}
fun getItem(position: Int): Fragment {
return mFragments!![position]
}
init {
titles.isNotEmpty().let {
if (it) {
mTitles = titles
}
}
fragments?.isNotEmpty()?.let {
if (it) {
mFragments = fragments
}
}
}
}
\ No newline at end of file
...@@ -71,6 +71,9 @@ ...@@ -71,6 +71,9 @@
<attr name="tl_textSelectColor" format="color"/> <attr name="tl_textSelectColor" format="color"/>
<!-- 设置字体未选中颜色 --> <!-- 设置字体未选中颜色 -->
<attr name="tl_textUnselectColor" format="color"/> <attr name="tl_textUnselectColor" format="color"/>
<!-- 自定义图片 配合Style = Custom使用-->
<attr name="tl_tab_drawable" format="reference"/>
<!-- 设置字体加粗 --> <!-- 设置字体加粗 -->
<attr name="tl_textBold" format="enum"> <attr name="tl_textBold" format="enum">
<enum name="NONE" value="0"/> <enum name="NONE" value="0"/>
...@@ -109,6 +112,7 @@ ...@@ -109,6 +112,7 @@
<attr name="tl_tab_padding_none_first"/> <attr name="tl_tab_padding_none_first"/>
<attr name="tl_tab_space_equal"/> <attr name="tl_tab_space_equal"/>
<attr name="tl_tab_width"/> <attr name="tl_tab_width"/>
<attr name="tl_tab_drawable"/>
<!-- title --> <!-- title -->
<attr name="tl_textsize"/> <attr name="tl_textsize"/>
......
...@@ -178,6 +178,8 @@ dependencies { ...@@ -178,6 +178,8 @@ dependencies {
implementation 'com.github.zhpanvip:bannerviewpager:3.5.4' implementation 'com.github.zhpanvip:bannerviewpager:3.5.4'
// implementation 'com.github.xiaweizi:MarqueeTextView:1.0'
} }
repositories { repositories {
mavenCentral() mavenCentral()
......
...@@ -432,6 +432,7 @@ object Constants { ...@@ -432,6 +432,7 @@ object Constants {
const val USER_NICK = "user_nick" const val USER_NICK = "user_nick"
const val LIVE_ROOM_USER_NAME = "live_room_user_name" const val LIVE_ROOM_USER_NAME = "live_room_user_name"
const val LIVE_ROOM_NAME = "live_room_name"
const val USER_LEVEL = "user_level" const val USER_LEVEL = "user_level"
const val MESSAGE_USER_ID = "user_id" const val MESSAGE_USER_ID = "user_id"
const val MESSAGE_USER_RID = "user_rid" const val MESSAGE_USER_RID = "user_rid"
...@@ -474,6 +475,7 @@ object Constants { ...@@ -474,6 +475,7 @@ object Constants {
const val ROOM_COVER = "room_cover" const val ROOM_COVER = "room_cover"
const val INDEX_DATA = "index_data" const val INDEX_DATA = "index_data"
const val POSITION = "POSITION"
const val INDEX_TYPE = "index_type" const val INDEX_TYPE = "index_type"
const val INDEX_MATCH_TYPE = "index_match_type" const val INDEX_MATCH_TYPE = "index_match_type"
...@@ -481,6 +483,9 @@ object Constants { ...@@ -481,6 +483,9 @@ object Constants {
const val IS_AGREE = "IS_AGREE" const val IS_AGREE = "IS_AGREE"
const val SUBSCRIBE_MATCH = "SUBSCRIBE_MATCH"
const val SUBSCRIBE_FOLLOW = "SUBSCRIBE_FOLLOW"
const val SWITCH_MESSAGE= "SWITCH_MESSAGE" const val SWITCH_MESSAGE= "SWITCH_MESSAGE"
const val SWITCH_START_BACK= "SWITCH_START_BACK" const val SWITCH_START_BACK= "SWITCH_START_BACK"
const val SWITCH_START_MATCH= "SWITCH_START_MATCH" const val SWITCH_START_MATCH= "SWITCH_START_MATCH"
......
...@@ -72,6 +72,15 @@ public class LiveBean { ...@@ -72,6 +72,15 @@ public class LiveBean {
private String matchCutImg; private String matchCutImg;
private int roomStatus; private int roomStatus;
private int recommend; private int recommend;
private int sportsId;
public int getSportsId() {
return sportsId;
}
public void setSportsId(int sportsId) {
this.sportsId = sportsId;
}
public String getAnchorName() { public String getAnchorName() {
return anchorName; return anchorName;
......
...@@ -63,6 +63,7 @@ public class MatchContentBean implements Serializable { ...@@ -63,6 +63,7 @@ public class MatchContentBean implements Serializable {
private int status; private int status;
private String matchTime; private String matchTime;
private String matchName; private String matchName;
private String matchDate;
private String matchShortName; private String matchShortName;
private int sportsType; private int sportsType;
private boolean subscribe; private boolean subscribe;
...@@ -73,6 +74,14 @@ public class MatchContentBean implements Serializable { ...@@ -73,6 +74,14 @@ public class MatchContentBean implements Serializable {
return matchDays; return matchDays;
} }
public String getMatchDate() {
return matchDate;
}
public void setMatchDate(String matchDate) {
this.matchDate = matchDate;
}
public int getHomeScore() { public int getHomeScore() {
return homeScore; return homeScore;
} }
......
...@@ -34,6 +34,8 @@ public class RoomInfoBean { ...@@ -34,6 +34,8 @@ public class RoomInfoBean {
private String roomAnnouncement; private String roomAnnouncement;
private boolean follow; private boolean follow;
private int userGold; private int userGold;
private int userLevel;
private String follows;
private String userId; private String userId;
private String wxNum; private String wxNum;
private String qqNum; private String qqNum;
...@@ -41,6 +43,22 @@ public class RoomInfoBean { ...@@ -41,6 +43,22 @@ public class RoomInfoBean {
private String huanXinUserId; private String huanXinUserId;
private int roomStatus; private int roomStatus;
public int getUserLevel() {
return userLevel;
}
public void setUserLevel(int userLevel) {
this.userLevel = userLevel;
}
public String getFollows() {
return follows;
}
public void setFollows(String follows) {
this.follows = follows;
}
public String getMatchId() { public String getMatchId() {
return matchId; return matchId;
} }
......
package com.hupu.tv.player.app.event
/**
* @author by Dell
* @date on 2022/2/18
* @describe
*/
class SubscribeMatchEvent(val id: String, val subsribe: Boolean, val fragmentPosition:Int,val parentPostion: Int, val position: Int, val tag: String) {
}
\ No newline at end of file
...@@ -66,7 +66,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta ...@@ -66,7 +66,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
override fun initialize() { override fun initialize() {
setStatus() setStatus()
setStatusColor(R.color.white) setStatusColor(R.color.color_F8F8F7)
StatusBarUtil.setStatusBarLightMode(this, 3) StatusBarUtil.setStatusBarLightMode(this, 3)
// isMineFragment(false) // isMineFragment(false)
showAdDialog() showAdDialog()
...@@ -85,12 +85,17 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta ...@@ -85,12 +85,17 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
} }
} }
private fun isMineFragment(isMineFragment: Boolean) { private fun isMineFragment(position: Int) {
val top = if (isMineFragment) { val top = if (position == 4) {
setStatusColor(R.color.transparent) setStatusColor(R.color.transparent)
-DisplayUtil.px2dip(this, StatusBarUtil.getStatusBarHeight().toFloat()).toFloat() - 0.3f -DisplayUtil.px2dip(this, StatusBarUtil.getStatusBarHeight().toFloat()).toFloat() - 0.3f
} else { } else {
setStatusColor(R.color.white) if (position == 0) {
setStatusColor(R.color.color_F8F8F7)
} else {
setStatusColor(R.color.white)
}
0f 0f
} }
...@@ -146,7 +151,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta ...@@ -146,7 +151,7 @@ class MainActivity : RefreshActivity<MainActivityPresenter>(), MainActivityConta
mTabLayout.setOnTabSelectListener(object : OnTabSelectListener { mTabLayout.setOnTabSelectListener(object : OnTabSelectListener {
override fun onTabSelect(position: Int) { override fun onTabSelect(position: Int) {
mViewPager.currentItem = position mViewPager.currentItem = position
isMineFragment(position == 4) isMineFragment(position)
} }
override fun onTabReselect(position: Int) {} override fun onTabReselect(position: Int) {}
......
package com.hupu.tv.player.app.ui.adapter
import android.content.Intent
import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseQuickAdapter.OnItemClickListener
import com.chad.library.adapter.base.BaseViewHolder
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.LiveBean
import com.hupu.tv.player.app.bean.MatchContentBean
import com.hupu.tv.player.app.bean.MatchContentBean.MatchListsBean.MatchInfosBean.GuidesBean
import com.hupu.tv.player.app.event.SubscribeEvent
import com.hupu.tv.player.app.event.SubscribeMatchEvent
import com.hupu.tv.player.app.ui.activity.LiveActivity
import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.GlideUtils
import com.softgarden.baselibrary.base.BaseFragment
import com.softgarden.baselibrary.utils.RecyclerViewUtil.nestedScrollNoFluent
import com.softgarden.baselibrary.utils.SPUtil
import org.greenrobot.eventbus.EventBus
/**
* @author by Dell
* @date on 2020/6/15
* @describe
*/
class FollowContentIncludeAdapter(
layoutResId: Int,
private val baseFragment: BaseFragment<*>,
val fragmentPosition: Int,
val parentPosition: Int
) :
BaseQuickAdapter<MatchContentBean.MatchListsBean.MatchInfosBean, BaseViewHolder>(layoutResId) {
override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean.MatchInfosBean) {
val homeTeam = item.homeTeam
val awayTeam = item.awayTeam
GlideUtils.loadImage(baseFragment, homeTeam.teamIcon, helper.getView(R.id.iv_home), 0)
GlideUtils.loadImage(baseFragment, awayTeam.teamIcon, helper.getView(R.id.iv_away), 0)
helper.apply {
setVisible(R.id.iv_win_home, homeTeam.score > awayTeam.score && item.status != Constants.MATCH_STATUS_UNSTART)
setVisible(R.id.iv_win_away, awayTeam.score > homeTeam.score && item.status != Constants.MATCH_STATUS_UNSTART)
setGone(R.id.ll_time, item.status != Constants.MATCH_STATUS_END)
setGone(R.id.tv_status, item.status == Constants.MATCH_STATUS_END)
setText(R.id.tv_time, item.matchTime)
setText(R.id.tv_name, item.matchShortName)
setText(R.id.tv_status, "已结束")
setText(R.id.tv_home, homeTeam.teamName)
setText(R.id.tv_away, awayTeam.teamName)
getView<ImageView>(R.id.iv_subscribe).isSelected = item.isSubscribe
getView<TextView>(R.id.tv_score_home).apply {
setTextColor(
if (homeTeam.score > awayTeam.score) {
mContext.getColor(R.color.black)
} else {
mContext.getColor(R.color.color_999999)
}
)
visibility = if (item.status != Constants.MATCH_STATUS_UNSTART) {
View.VISIBLE
} else {
View.GONE
}
text = when (item.status) {
Constants.MATCH_STATUS_UNSTART -> "-"
Constants.MATCH_STATUS_END -> if (homeTeam.score == 0) {
"-"
} else {
homeTeam.score.toString()
}
else -> homeTeam.score.toString()
}
}
getView<TextView>(R.id.tv_score_away).apply {
setTextColor(
if (awayTeam.score > homeTeam.score) {
mContext.getColor(R.color.black)
} else {
mContext.getColor(R.color.color_999999)
}
)
visibility = if (item.status != Constants.MATCH_STATUS_UNSTART) {
View.VISIBLE
} else {
View.GONE
}
text = when (item.status) {
Constants.MATCH_STATUS_UNSTART -> "-"
Constants.MATCH_STATUS_END -> if (awayTeam.score == 0) {
"-"
} else {
awayTeam.score.toString()
}
else -> awayTeam.score.toString()
}
}
getView<ImageView>(R.id.iv_subscribe).apply {
visibility = if (item.status == Constants.MATCH_STATUS_UNSTART) {
View.VISIBLE
} else {
View.GONE
}
setOnClickListener {
if (SPUtil[Constants.USER_LOGIN, false] == true) {
EventBus.getDefault().post(
SubscribeMatchEvent(
item.id,
item.isSubscribe,
fragmentPosition,
parentPosition,
helper.layoutPosition,
Constants.SUBSCRIBE_FOLLOW
)
)
} else {
CommonUtils.toLogin(mContext)
}
}
}
getView<TextView>(R.id.tv_status_play).apply {
setTextColor(
when (item.status) {
Constants.MATCH_STATUS_LIVE -> mContext.getColor(R.color.color_FF5655)
else -> mContext.getColor(R.color.color_6D6D6D)
}
)
}
getView<RecyclerView>(R.id.recycler_content).apply {
layoutManager = nestedScrollNoFluent(
this,
LinearLayoutManager(baseFragment.activity, RecyclerView.HORIZONTAL, false)
)
adapter = GuidesAdapter(R.layout.item_guides_image, baseFragment).apply {
setNewData(item.guides)
setOnItemClickListener { adapter, view, position ->
baseFragment.startActivity(Intent(baseFragment.activity, LiveActivity::class.java).apply {
putExtra(Constants.ROOM_ID, (adapter.getItem(position) as GuidesBean).roomId)
putExtra(Constants.ROOM_COVER, (adapter.getItem(position) as GuidesBean).matchCutImg)
})
}
}
}
}
// ivSubscribe.setOnClickListener(v -> {
//
//
// });
}
}
\ No newline at end of file
package com.hupu.tv.player.app.ui.adapter
import android.content.Intent
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.OrientationHelper
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseQuickAdapter.OnItemClickListener
import com.chad.library.adapter.base.BaseViewHolder
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.MatchContentBean
import com.hupu.tv.player.app.ui.activity.NewMatchDetailActivity
import com.hupu.tv.player.app.ui.activity.UserInfoActivity
import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.DialogUtils
import com.softgarden.baselibrary.base.BaseFragment
import com.softgarden.baselibrary.utils.RecyclerViewUtil.addItemDecoration
import com.softgarden.baselibrary.utils.RecyclerViewUtil.nestedScrollNoFluent
import com.softgarden.baselibrary.utils.SPUtil
/**
* @author by Dell
* @date on 2020/6/15
* @describe
*/
class FollowMatchContentAdapter(layoutResId: Int, private val baseFragment: BaseFragment<*>, val fragmentPosition:Int) : BaseQuickAdapter<MatchContentBean.MatchListsBean, BaseViewHolder>(layoutResId) {
override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean) {
val time = when (CommonUtils.getWithCurrentDayDifferent(item.matchTime)) {
0 -> {
"今天 ${item.matchTime}"
}
else -> {
item.matchTime
}
}
helper.setText(R.id.tv_title, time)
val recyclerView = helper.getView<RecyclerView>(R.id.recycler_content)
val matchContentIncludeAdapter = FollowContentIncludeAdapter(R.layout.item_match_include_content_new, baseFragment,fragmentPosition,helper.layoutPosition)
val linearLayoutManager = nestedScrollNoFluent(recyclerView, LinearLayoutManager(baseFragment.activity))
if (recyclerView.itemDecorationCount == 0) {
addItemDecoration(baseFragment.activity!!, recyclerView, R.color.view_color, 0.5f, OrientationHelper.VERTICAL)
}
recyclerView.layoutManager = linearLayoutManager
recyclerView.adapter = matchContentIncludeAdapter
matchContentIncludeAdapter.setNewData(item.matchInfos)
matchContentIncludeAdapter.onItemClickListener = OnItemClickListener { adapter: BaseQuickAdapter<*, *>, view: View?, position: Int ->
if (SPUtil[Constants.USER_LOGIN, false] as Boolean) {
val adapterItem = adapter.getItem(position) as MatchContentBean.MatchListsBean.MatchInfosBean?
// Intent intent = new Intent(baseFragment.getActivity(), MatchDetailActivity.class);
val intent = Intent(baseFragment.activity, NewMatchDetailActivity::class.java)
intent.putExtra(Constants.MATCH_BEAN_ID, adapterItem!!.id)
intent.putExtra(Constants.SPORT_TYPE, adapterItem.sportsType)
baseFragment.startActivity(intent)
} else {
DialogUtils.showLogin(mContext as AppCompatActivity)
// startActivity(LoginActivity::class.java)
}
}
}
}
\ No newline at end of file
...@@ -23,7 +23,7 @@ public class GuidesAdapter extends BaseQuickAdapter<MatchContentBean.MatchListsB ...@@ -23,7 +23,7 @@ public class GuidesAdapter extends BaseQuickAdapter<MatchContentBean.MatchListsB
protected void convert(BaseViewHolder helper, MatchContentBean.MatchListsBean.MatchInfosBean.GuidesBean item) { protected void convert(BaseViewHolder helper, MatchContentBean.MatchListsBean.MatchInfosBean.GuidesBean item) {
// GlideUtils.loadAvatar(basefragment, SPUtil.Companion.get(Constants.AVATAR_URL,"")+item.getAvatar(), helper.getView(R.id.iv_actor)); // GlideUtils.loadAvatar(basefragment, SPUtil.Companion.get(Constants.AVATAR_URL,"")+item.getAvatar(), helper.getView(R.id.iv_actor));
GlideUtils.loadAvatar(basefragment, item.getAvatar(), helper.getView(R.id.iv_actor)); GlideUtils.loadAvatar(basefragment, item.getAvatar(), helper.getView(R.id.iv_actor));
GlideUtils.loadImage(basefragment, R.mipmap.icon_live_living_guest, helper.getView(R.id.iv_live)); // GlideUtils.loadImage(basefragment, R.mipmap.icon_live_living_guest, helper.getView(R.id.iv_live));
helper.setText(R.id.tv_name, item.getName()); // helper.setText(R.id.tv_name, item.getName());
} }
} }
...@@ -14,24 +14,24 @@ import com.softgarden.baselibrary.base.BaseFragment ...@@ -14,24 +14,24 @@ import com.softgarden.baselibrary.base.BaseFragment
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class LiveItemAdapter(layoutResId: Int, private val fragment: BaseFragment<*>) : BaseQuickAdapter<LiveBean.DataListBean, BaseViewHolder>(layoutResId) { class LiveItemAdapter(layoutResId: Int, private val fragment: BaseFragment<*>) :
BaseQuickAdapter<LiveBean.DataListBean, BaseViewHolder>(layoutResId) {
override fun convert(helper: BaseViewHolder, item: LiveBean.DataListBean) { override fun convert(helper: BaseViewHolder, item: LiveBean.DataListBean) {
val ivLive = helper.getView<ImageView>(R.id.iv_live) GlideUtils.loadImageNoCenter(
val ivRecommend = helper.getView<View>(R.id.iv_recommend) fragment,
GlideUtils.loadImageGif(fragment, R.mipmap.icon_live_living_gif, ivLive) item.matchCutImg,
if (item.recommend == 1) { helper.getView(R.id.iv_cover),
ivRecommend.visibility = View.VISIBLE R.mipmap.bg_live_place_holder
} else { )
ivRecommend.visibility = View.GONE
}
if (item.roomStatus == 1) {
ivLive.visibility = View.VISIBLE
} else {
ivLive.visibility = View.GONE
}
GlideUtils.loadRoundCircleImageCenterCrop(fragment, item.matchCutImg, helper.getView(R.id.iv_cover), 4, R.mipmap.bg_live_place_holder)
helper.setText(R.id.tv_title, item.roomName) helper.setText(R.id.tv_title, item.roomName)
.setText(R.id.tv_name, item.anchorName) .setText(R.id.tv_name, item.anchorName)
.setText(R.id.tv_hot_num, item.hotNum.toString()) .setText(R.id.tv_hot_num, item.hotNum.toString())
.setText(
R.id.tv_type, when (item.sportsId) {
0 -> "足球"
1 -> "篮球"
else -> "其他"
}
)
} }
} }
\ No newline at end of file
package com.hupu.tv.player.app.ui.adapter
import android.view.View
import android.widget.ImageView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.bean.LiveBean
import com.hupu.tv.player.app.utils.GlideUtils
import com.softgarden.baselibrary.base.BaseFragment
/**
* @author by Dell
* @date on 2020/6/15
* @describe
*/
class LiveRecommendAdapter :
BaseQuickAdapter<LiveBean.DataListBean, BaseViewHolder>(R.layout.item_live_recommend) {
override fun convert(helper: BaseViewHolder, item: LiveBean.DataListBean) {
GlideUtils.loadImage(
helper.itemView,
item.matchCutImg,
helper.getView(R.id.iv_cover),
R.mipmap.bg_live_place_holder
)
helper
.setText(R.id.tv_name, item.anchorName)
.setText(R.id.tv_hot_num, item.hotNum.toString())
}
}
\ No newline at end of file
...@@ -2,35 +2,25 @@ package com.hupu.tv.player.app.ui.adapter ...@@ -2,35 +2,25 @@ package com.hupu.tv.player.app.ui.adapter
import android.annotation.SuppressLint import android.annotation.SuppressLint
import android.view.View import android.view.View
import android.widget.ImageView
import android.widget.LinearLayout
import android.widget.TextView import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import com.chad.library.adapter.base.BaseQuickAdapter import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder import com.chad.library.adapter.base.BaseViewHolder
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.MatchContentBean import com.hupu.tv.player.app.bean.MatchContentBean
import com.hupu.tv.player.app.event.SubscribeEvent
import com.hupu.tv.player.app.ui.activity.UserInfoActivity
import com.hupu.tv.player.app.utils.CommonUtils import com.hupu.tv.player.app.utils.CommonUtils
import com.hupu.tv.player.app.utils.DialogUtils
import com.hupu.tv.player.app.utils.GlideUtils import com.hupu.tv.player.app.utils.GlideUtils
import com.softgarden.baselibrary.base.BaseFragment import com.softgarden.baselibrary.base.BaseFragment
import com.softgarden.baselibrary.utils.SPUtil
import org.greenrobot.eventbus.EventBus
/** /**
* @author by Dell * @author by Dell
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class LiveTopAdapter(layoutResId: Int, private val basefragment: BaseFragment<*>) : BaseQuickAdapter<MatchContentBean.MatchListsBean.MatchInfosBean, BaseViewHolder>(layoutResId) { class LiveTopAdapter(layoutResId: Int, private val basefragment: BaseFragment<*>) :
BaseQuickAdapter<MatchContentBean.MatchListsBean.MatchInfosBean, BaseViewHolder>(layoutResId) {
@SuppressLint("UseCompatLoadingForDrawables") @SuppressLint("UseCompatLoadingForDrawables")
override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean.MatchInfosBean) { override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean.MatchInfosBean) {
var maxLength = 4 val date = if (CommonUtils.time == item.matchDate) {
val time = if (CommonUtils.time == item.matchTime) {
"今天" "今天"
} else { } else {
"明天" "明天"
...@@ -38,119 +28,31 @@ class LiveTopAdapter(layoutResId: Int, private val basefragment: BaseFragment<*> ...@@ -38,119 +28,31 @@ class LiveTopAdapter(layoutResId: Int, private val basefragment: BaseFragment<*>
val awayTeam = item.awayTeam val awayTeam = item.awayTeam
val homeTeam = item.homeTeam val homeTeam = item.homeTeam
GlideUtils.loadCirclePic(basefragment, homeTeam.teamIcon, helper.getView(R.id.iv_team_icon)) GlideUtils.loadCirclePic(basefragment, homeTeam.teamIcon, helper.getView(R.id.iv_team_icon))
GlideUtils.loadCirclePic(basefragment, awayTeam.teamIcon, helper.getView(R.id.iv_team_icon_away)) GlideUtils.loadCirclePic(basefragment, awayTeam.teamIcon, helper.getView(R.id.iv_team_icon_away))
//tvSubscribe 未开始时显示 status 2 //2 未开始 1直播中
// val tvSubscribe = helper.getView<TextView>(R.id.tv_subscribe)
val ivSubscribe = helper.getView<ImageView>(R.id.iv_subscribe) helper
//ll_subscribe 未开始 status 2 .setGone(R.id.ll_time, item.status == 2)
val llSubscribe = helper.getView<LinearLayout>(R.id.ll_subscribe) .setGone(R.id.tv_live, item.status == 1)
.setText(R.id.tv_date, date)
.setText(R.id.tv_time, item.matchTime)
//llLive 直播中 status 1 .setText(R.id.tv_name, item.matchShortName)
val llLive = helper.getView<LinearLayout>(R.id.ll_live) .setText(R.id.tv_team_name, homeTeam.teamName)
//2个分数 status = 1 .setText(R.id.tv_team_name_away, awayTeam.teamName)
val tvAwayScore = helper.getView<TextView>(R.id.tv_away_score) .setText(
val tvHomeScore = helper.getView<TextView>(R.id.tv_home_score) R.id.tv_home_score, when (item.status) {
1 -> homeTeam.score.toString()
llLive.visibility = View.GONE else -> "-"
tvAwayScore.visibility = View.GONE
tvHomeScore.visibility = View.GONE
llSubscribe.visibility = View.VISIBLE
// tvSubscribe.visibility = View.VISIBLE
ivSubscribe.visibility = View.VISIBLE
when (item.status) {
//未开始
2 -> {
maxLength = 4
llSubscribe.visibility = View.VISIBLE
// tvSubscribe.visibility = View.VISIBLE
ivSubscribe.visibility = View.VISIBLE
ivSubscribe.apply {
setImageResource(if (item.isSubscribe) {
R.mipmap.icon_subscribe_selected
} else {
R.mipmap.icon_subscribe_normal
})
setOnClickListener {
if (SPUtil[Constants.USER_LOGIN, false] as Boolean) {
setImageResource(if (item.isSubscribe) {
R.mipmap.icon_subscribe_normal
} else {
R.mipmap.icon_subscribe_selected
})
item.isSubscribe = !item.isSubscribe
EventBus.getDefault().post(SubscribeEvent(item.id, item.isSubscribe,
"liveTop"))
} else {
DialogUtils.showLogin(mContext as AppCompatActivity)
}
}
} }
)
} .setText(
//直播中 R.id.tv_away_score, when (item.status) {
1 -> { 1 -> homeTeam.score.toString()
maxLength = 6 else -> "-"
ivSubscribe.visibility = View.GONE
llSubscribe.visibility = View.GONE
llLive.visibility = View.VISIBLE
tvAwayScore.visibility = View.VISIBLE
tvHomeScore.visibility = View.VISIBLE
tvHomeScore.text = item.homeScore.toString()
tvAwayScore.text = item.awayScore.toString()
val iv1 = helper.getView<ImageView>(R.id.iv_1)
val iv2 = helper.getView<ImageView>(R.id.iv_2)
val iv3 = helper.getView<ImageView>(R.id.iv_3)
iv1.visibility = View.VISIBLE
iv2.visibility = View.VISIBLE
iv3.visibility = View.VISIBLE
if (!item.guides.isNullOrEmpty()) {
when (item.guides.size) {
1 -> {
GlideUtils.loadAvatar(basefragment, item.guides[0].avatar, iv1)
iv2.visibility = View.INVISIBLE
iv3.visibility = View.INVISIBLE
}
2 -> {
GlideUtils.loadAvatar(basefragment, item.guides[0].avatar, iv1)
GlideUtils.loadAvatar(basefragment, item.guides[0].avatar, iv2)
iv3.visibility = View.INVISIBLE
}
3 -> {
GlideUtils.loadAvatar(basefragment, item.guides[0].avatar, iv1)
GlideUtils.loadAvatar(basefragment, item.guides[1].avatar, iv2)
GlideUtils.loadAvatar(basefragment, item.guides[2].avatar, iv3)
}
}
} else {
iv1.visibility = View.INVISIBLE
iv2.visibility = View.INVISIBLE
iv3.visibility = View.INVISIBLE
} }
} )
//已结束
}
val homeTeamName = if (homeTeam.teamName.length > maxLength) {
val subSequence = homeTeam.teamName.subSequence(0, maxLength)
"$subSequence..."
} else {
homeTeam.teamName
}
val awayTeamName = if (awayTeam.teamName.length > maxLength) {
val subSequence = awayTeam.teamName.subSequence(0, maxLength)
"$subSequence..."
} else {
awayTeam.teamName
}
helper.setText(R.id.tv_day, time)
.setText(R.id.tv_time, item.matchTime)
.setText(R.id.tv_name, item.matchShortName)
.setText(R.id.tv_team_name, homeTeamName)
.setText(R.id.tv_team_name_away, awayTeamName)
} }
} }
\ No newline at end of file
...@@ -26,36 +26,24 @@ import com.softgarden.baselibrary.utils.SPUtil ...@@ -26,36 +26,24 @@ import com.softgarden.baselibrary.utils.SPUtil
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class MatchContentAdapter(layoutResId: Int, private val baseFragment: BaseFragment<*>) : BaseQuickAdapter<MatchContentBean.MatchListsBean, BaseViewHolder>(layoutResId) { class MatchContentAdapter(layoutResId: Int, private val baseFragment: BaseFragment<*>,val fragmentPosition:Int) : BaseQuickAdapter<MatchContentBean.MatchListsBean, BaseViewHolder>(layoutResId) {
override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean) { override fun convert(helper: BaseViewHolder, item: MatchContentBean.MatchListsBean) {
val time = when (CommonUtils.getWithCurrentDayDifferent(item.matchTime)) { val time = when (CommonUtils.getWithCurrentDayDifferent(item.matchTime)) {
-1 -> {
"昨天"
}
0 -> { 0 -> {
"今天" "今天 ${item.matchTime}"
}
1 -> {
"明天"
}
2 -> {
"后天"
}
3 -> {
"大后天"
} }
else -> { else -> {
"前天" item.matchTime
} }
} }
helper.setText(R.id.tv_title, time) helper.setText(R.id.tv_title, time)
val recyclerView = helper.getView<RecyclerView>(R.id.recycler_content) val recyclerView = helper.getView<RecyclerView>(R.id.recycler_content)
val matchContentIncludeAdapter = MatchContentIncludeAdapter(R.layout.item_match_include_content_new, baseFragment) val matchContentIncludeAdapter = MatchContentIncludeAdapter(R.layout.item_match_include_content_new, baseFragment,fragmentPosition,helper.layoutPosition)
val linearLayoutManager = nestedScrollNoFluent(recyclerView, LinearLayoutManager(baseFragment.activity)) val linearLayoutManager = nestedScrollNoFluent(recyclerView, LinearLayoutManager(baseFragment.activity))
if (recyclerView.itemDecorationCount == 0) { if (recyclerView.itemDecorationCount == 0) {
addItemDecoration(baseFragment.activity!!, recyclerView, R.color.view_color, 1, OrientationHelper.VERTICAL) addItemDecoration(baseFragment.activity!!, recyclerView, R.color.view_color, 0.5f, OrientationHelper.VERTICAL)
} }
recyclerView.layoutManager = linearLayoutManager recyclerView.layoutManager = linearLayoutManager
recyclerView.adapter = matchContentIncludeAdapter recyclerView.adapter = matchContentIncludeAdapter
......
...@@ -10,15 +10,15 @@ import com.hupu.tv.player.app.bean.MatchContentBean ...@@ -10,15 +10,15 @@ import com.hupu.tv.player.app.bean.MatchContentBean
*/ */
interface FollowMatchContract { interface FollowMatchContract {
interface Display : IBaseDisplay { interface Display : IBaseDisplay {
fun onMatchList(list: List<MatchContentBean.MatchListsBean>) fun onMatchList(list: List<MatchContentBean.MatchListsBean>)
fun onSubscribeMatch(message:String) fun onSubscribeMatch(message: String, parentPosition: Int, position: Int)
} }
interface Presenter { interface Presenter {
fun getMatchOrder() fun getMatchOrder()
fun reserveMatch(id: String) fun reserveMatch(id: String, parentPosition: Int, position: Int)
fun cancelReserveMatch(id: String) fun cancelReserveMatch(id: String, parentPosition: Int, position: Int)
fun reserveMatch(id:String,status:Boolean) fun reserveMatch(id: String, status: Boolean, parentPosition: Int, position: Int)
} }
......
package com.hupu.tv.player.app.ui.contact package com.hupu.tv.player.app.ui.contact
import com.hupu.tv.player.app.bean.FakeMessageEntity import com.hupu.tv.player.app.bean.LiveBean
import com.softgarden.baselibrary.base.IBaseDisplay import com.softgarden.baselibrary.base.IBaseDisplay
import com.hupu.tv.player.app.bean.RoomInfoBean import com.hupu.tv.player.app.bean.RoomInfoBean
...@@ -14,6 +14,7 @@ interface LiveActivityContact { ...@@ -14,6 +14,7 @@ interface LiveActivityContact {
fun onRequestRoomInfo(bean: RoomInfoBean?) fun onRequestRoomInfo(bean: RoomInfoBean?)
fun onFollowAnchor(msg:String,status:Boolean) fun onFollowAnchor(msg:String,status:Boolean)
fun onSendGift(id:Int,position:Int) fun onSendGift(id:Int,position:Int)
fun onRecommend(data: LiveBean?)
} }
...@@ -22,6 +23,7 @@ interface LiveActivityContact { ...@@ -22,6 +23,7 @@ interface LiveActivityContact {
fun getRoomInfo(id: String) fun getRoomInfo(id: String)
fun followAnchor(id:String) fun followAnchor(id:String)
fun unFollowAnchor(id:String) fun unFollowAnchor(id:String)
fun getRecommend(id:String,pageNum:Int)
fun sendGift (giftId:Int,roomId:String,giftPosition:Int) fun sendGift (giftId:Int,roomId:String,giftPosition:Int)
} }
} }
\ No newline at end of file
...@@ -11,14 +11,14 @@ import com.hupu.tv.player.app.bean.MatchContentBean ...@@ -11,14 +11,14 @@ import com.hupu.tv.player.app.bean.MatchContentBean
interface MatchContentFragmentContract { interface MatchContentFragmentContract {
interface Display : IBaseDisplay { interface Display : IBaseDisplay {
fun onMatchList(list: List<MatchContentBean.MatchListsBean>) fun onMatchList(list: List<MatchContentBean.MatchListsBean>)
fun onSubscribeMatch(message:String) fun onSubscribeMatch(message:String,parentPosition:Int,position:Int)
} }
interface Presenter { interface Presenter {
fun getMatchList(id: String, pageNo: Int) fun getMatchList(id: String, pageNo: Int)
fun reserveMatch(id: String) fun reserveMatch(id: String,parentPosition:Int,position:Int)
fun cancelReserveMatch(id: String) fun cancelReserveMatch(id: String,parentPosition:Int,position:Int)
fun reserveMatch(id:String,status:Boolean) fun reserveMatch(id:String,status:Boolean,parentPosition:Int,position:Int)
} }
......
...@@ -44,6 +44,7 @@ import java.util.Random; ...@@ -44,6 +44,7 @@ import java.util.Random;
public class ChatFragment extends CustomEaseChatFragment implements OnRecallMessageResultListener { public class ChatFragment extends CustomEaseChatFragment implements OnRecallMessageResultListener {
private static final String TAG = ChatFragment.class.getSimpleName(); private static final String TAG = ChatFragment.class.getSimpleName();
private String liveUserName = ""; private String liveUserName = "";
private String liveRoomName = "";
protected ClipboardManager clipboard; protected ClipboardManager clipboard;
private boolean isSend = false; private boolean isSend = false;
private static final int REQUEST_CODE_SELECT_AT_USER = 15; private static final int REQUEST_CODE_SELECT_AT_USER = 15;
...@@ -60,7 +61,10 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -60,7 +61,10 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
super.initView(); super.initView();
userHxId = getArguments().getString(Constants.USER_HX_ID,""); userHxId = getArguments().getString(Constants.USER_HX_ID,"");
liveUserName = getArguments().getString(Constants.LIVE_ROOM_USER_NAME); liveUserName = getArguments().getString(Constants.LIVE_ROOM_USER_NAME);
liveRoomName = getArguments().getString(Constants.LIVE_ROOM_NAME);
chatLayout.getChatMessageListLayout().setItemShowType(EaseChatMessageListLayout.ShowType.LEFT); chatLayout.getChatMessageListLayout().setItemShowType(EaseChatMessageListLayout.ShowType.LEFT);
chatLayout.getChatMessageListLayout().setBackgroundColor(getContext().getColor(R.color.background_f5));
chatLayout.getChatMessageListLayout().setLiveName("欢迎来到"+liveRoomName+"直播间");
customChatPrimaryMenu = new CustomChatPrimaryMenu(getContext()); customChatPrimaryMenu = new CustomChatPrimaryMenu(getContext());
chatLayout.getChatInputMenu().setCustomPrimaryMenu(customChatPrimaryMenu); chatLayout.getChatInputMenu().setCustomPrimaryMenu(customChatPrimaryMenu);
clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE); clipboard = (ClipboardManager) getActivity().getSystemService(Context.CLIPBOARD_SERVICE);
...@@ -130,6 +134,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess ...@@ -130,6 +134,7 @@ public class ChatFragment extends CustomEaseChatFragment implements OnRecallMess
} }
public void sendJoinRoomData() { public void sendJoinRoomData() {
if (!isSend) { if (!isSend) {
boolean isLogin = (boolean) SPUtil.Companion.get(Constants.USER_LOGIN, false); boolean isLogin = (boolean) SPUtil.Companion.get(Constants.USER_LOGIN, false);
if (isLogin) { if (isLogin) {
......
...@@ -86,8 +86,19 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc ...@@ -86,8 +86,19 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc
private fun initDownRecyclerView() { private fun initDownRecyclerView() {
liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this) liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this)
mRecyclerView_down?.layoutManager = RecyclerViewUtil.nestedScrollNoFluent(mRecyclerView_down, GridLayoutManager(activity, 2)) mRecyclerView_down?.layoutManager =
activity?.let { RecyclerViewUtil.addGridItemDecoration(it, mRecyclerView_down!!, R.color.transparent, 2 * Constants.item_divider) } RecyclerViewUtil.nestedScrollNoFluent(mRecyclerView_down, GridLayoutManager(activity, 2))
if (mRecyclerView_down.itemDecorationCount == 0) {
activity?.let {
RecyclerViewUtil.addGridItemDecoration(
it,
mRecyclerView_down!!,
R.color.transparent,
2 * Constants.item_divider
)
}
}
mRecyclerView_down?.adapter = liveItemAdapter mRecyclerView_down?.adapter = liveItemAdapter
liveItemAdapter?.setOnItemClickListener { adapter, view, position -> liveItemAdapter?.setOnItemClickListener { adapter, view, position ->
// if (!(SPUtil[Constants.USER_LOGIN, false] as Boolean)) { // if (!(SPUtil[Constants.USER_LOGIN, false] as Boolean)) {
...@@ -98,7 +109,7 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc ...@@ -98,7 +109,7 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc
val item: LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean val item: LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean
val intent = Intent(activity, LiveActivity::class.java) val intent = Intent(activity, LiveActivity::class.java)
intent.putExtra(Constants.ROOM_ID, item.roomId) intent.putExtra(Constants.ROOM_ID, item.roomId)
intent.putExtra(Constants.ROOM_COVER,item.matchCutImg) intent.putExtra(Constants.ROOM_COVER, item.matchCutImg)
startActivity(intent) startActivity(intent)
} }
} }
...@@ -106,20 +117,23 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc ...@@ -106,20 +117,23 @@ class FollowAnchorFragment : ToolbarFragment<FollowAnchorPresenter>(), FollowAnc
private fun initTopRecyclerView() { private fun initTopRecyclerView() {
anchorAdapter = AnchorAdapter(R.layout.item_anchor, this) anchorAdapter = AnchorAdapter(R.layout.item_anchor, this)
mRecyclerView?.adapter = anchorAdapter mRecyclerView?.adapter = anchorAdapter
mRecyclerView?.layoutManager = RecyclerViewUtil.nestedScrollNoFluent(mRecyclerView!!, LinearLayoutManager(activity, RecyclerView.VERTICAL, false)) mRecyclerView?.layoutManager = RecyclerViewUtil.nestedScrollNoFluent(
mRecyclerView!!,
LinearLayoutManager(activity, RecyclerView.VERTICAL, false)
)
if (mRecyclerView?.itemDecorationCount == 0) { if (mRecyclerView?.itemDecorationCount == 0) {
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) } activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) }
} }
anchorAdapter?.setOnItemClickListener { adapter, view, position -> anchorAdapter?.setOnItemClickListener { adapter, view, position ->
val anchorEntity = adapter.getItem(position) as AnchorEntity val anchorEntity = adapter.getItem(position) as AnchorEntity
if (anchorEntity.liveStatus == 0){ if (anchorEntity.liveStatus == 0) {
ToastUtil.s("您关注的主播未开播") ToastUtil.s("您关注的主播未开播")
return@setOnItemClickListener return@setOnItemClickListener
} }
val intent = Intent(activity, LiveActivity::class.java) val intent = Intent(activity, LiveActivity::class.java)
intent.putExtra(Constants.ROOM_ID, anchorEntity.roomId) intent.putExtra(Constants.ROOM_ID, anchorEntity.roomId)
intent.putExtra(Constants.ROOM_COVER,anchorEntity.matchCutImg) intent.putExtra(Constants.ROOM_COVER, anchorEntity.matchCutImg)
startActivity(intent) startActivity(intent)
} }
} }
......
...@@ -4,6 +4,7 @@ import android.os.Bundle ...@@ -4,6 +4,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mirkowu.basetoolbar.BaseToolbar import com.mirkowu.basetoolbar.BaseToolbar
import com.softgarden.baselibrary.utils.RecyclerViewUtil import com.softgarden.baselibrary.utils.RecyclerViewUtil
...@@ -17,7 +18,11 @@ import com.hupu.tv.player.app.bean.MatchContentBean ...@@ -17,7 +18,11 @@ import com.hupu.tv.player.app.bean.MatchContentBean
import com.hupu.tv.player.app.event.FollowMatchEvent import com.hupu.tv.player.app.event.FollowMatchEvent
import com.hupu.tv.player.app.event.RefreshUserEvent import com.hupu.tv.player.app.event.RefreshUserEvent
import com.hupu.tv.player.app.event.SubscribeEvent import com.hupu.tv.player.app.event.SubscribeEvent
import com.hupu.tv.player.app.event.SubscribeMatchEvent
import com.hupu.tv.player.app.ui.adapter.FollowContentIncludeAdapter
import com.hupu.tv.player.app.ui.adapter.FollowMatchContentAdapter
import com.hupu.tv.player.app.ui.adapter.MatchContentAdapter import com.hupu.tv.player.app.ui.adapter.MatchContentAdapter
import com.hupu.tv.player.app.ui.adapter.MatchContentIncludeAdapter
import com.hupu.tv.player.app.ui.contact.FollowMatchContract import com.hupu.tv.player.app.ui.contact.FollowMatchContract
import com.hupu.tv.player.app.ui.presenter.FollowMatchPresenter import com.hupu.tv.player.app.ui.presenter.FollowMatchPresenter
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
...@@ -36,7 +41,7 @@ import org.greenrobot.eventbus.ThreadMode ...@@ -36,7 +41,7 @@ import org.greenrobot.eventbus.ThreadMode
* @describe * @describe
*/ */
class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatchContract.Display { class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatchContract.Display {
private var matchContentAdapter: MatchContentAdapter? = null private var matchContentAdapter: FollowMatchContentAdapter? = null
private var sportId: String = "" private var sportId: String = ""
override val layoutId: Int override val layoutId: Int
get() = R.layout.fragment_follow_order_content get() = R.layout.fragment_follow_order_content
...@@ -69,7 +74,6 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch ...@@ -69,7 +74,6 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch
} }
private fun initView() { private fun initView() {
initRecyclerView() initRecyclerView()
initRefreshLayout() initRefreshLayout()
...@@ -80,12 +84,9 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch ...@@ -80,12 +84,9 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch
} }
private fun initAdapter() { private fun initAdapter() {
matchContentAdapter = MatchContentAdapter(R.layout.item_match_content, this) matchContentAdapter = FollowMatchContentAdapter(R.layout.item_match_content, this, 0)
mRecyclerView?.adapter = matchContentAdapter mRecyclerView?.adapter = matchContentAdapter
mRecyclerView?.layoutManager = LinearLayoutManager(activity) mRecyclerView?.layoutManager = LinearLayoutManager(activity)
if (mRecyclerView?.itemDecorationCount == 0) {
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 2 * Constants.item_divider_4) }
}
} }
...@@ -110,18 +111,15 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch ...@@ -110,18 +111,15 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
fun onEventFollow(event: SubscribeEvent) { fun onSubcribe(event: SubscribeMatchEvent) {
if (event.className != "order"){ if (event.tag != Constants.SUBSCRIBE_FOLLOW) {
return return
} }
LogUtils.e("event") if (SPUtil[Constants.USER_LOGIN, false] == true) {
if (SPUtil[Constants.USER_LOGIN,false] == true){ presenter?.reserveMatch(event.id, event.subsribe, event.parentPostion, event.position)
presenter?.reserveMatch(event.id, event.isStatus)
} }
} }
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
fun onEventRefreshUser(event: RefreshUserEvent) { fun onEventRefreshUser(event: RefreshUserEvent) {
isLogin() isLogin()
...@@ -135,7 +133,6 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch ...@@ -135,7 +133,6 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch
} }
override fun onDestroy() { override fun onDestroy() {
super.onDestroy() super.onDestroy()
EventBus.getDefault().unregister(this) EventBus.getDefault().unregister(this)
...@@ -144,11 +141,19 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch ...@@ -144,11 +141,19 @@ class FollowMatchFragment : ToolbarFragment<FollowMatchPresenter>(), FollowMatch
override fun onMatchList(list: List<MatchContentBean.MatchListsBean>) { override fun onMatchList(list: List<MatchContentBean.MatchListsBean>) {
matchContentAdapter?.let { matchContentAdapter?.let {
setLoadData(it, list,EmptyConfig.NO_FOLLOW_MATCH) setLoadData(it, list, EmptyConfig.NO_FOLLOW_MATCH)
} }
} }
override fun onSubscribeMatch(message: String) {
override fun onSubscribeMatch(message: String, parentPosition: Int, position: Int) {
ToastUtil.s(message) ToastUtil.s(message)
val recyclerView = matchContentAdapter?.getViewByPosition(parentPosition, R.id.recycler_content) as RecyclerView
val matchContentIncludeAdapter = recyclerView.adapter as? FollowContentIncludeAdapter
val item = matchContentIncludeAdapter?.getItem(position)
item?.let {
it.isSubscribe = !it.isSubscribe
}
matchContentIncludeAdapter?.notifyItemChanged(position)
lazyLoad() lazyLoad()
} }
......
...@@ -6,6 +6,7 @@ import com.softgarden.baselibrary.base.BaseActivity ...@@ -6,6 +6,7 @@ import com.softgarden.baselibrary.base.BaseActivity
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshFragment import com.hupu.tv.player.app.base.RefreshFragment
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.bean.RoomInfoBean import com.hupu.tv.player.app.bean.RoomInfoBean
import com.hupu.tv.player.app.ui.contact.LiveAnchorFragmentContact import com.hupu.tv.player.app.ui.contact.LiveAnchorFragmentContact
import com.hupu.tv.player.app.ui.presenter.LiveAnchorFragmentPresenter import com.hupu.tv.player.app.ui.presenter.LiveAnchorFragmentPresenter
...@@ -18,7 +19,7 @@ import kotlinx.android.synthetic.main.fragment_anchor.* ...@@ -18,7 +19,7 @@ import kotlinx.android.synthetic.main.fragment_anchor.*
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class LiveAnchorFragment : RefreshFragment<LiveAnchorFragmentPresenter>(), LiveAnchorFragmentContact.Display { class LiveAnchorFragment : RefreshVP2Fragment<LiveAnchorFragmentPresenter>(), LiveAnchorFragmentContact.Display {
private var roomid = "" private var roomid = ""
override val layoutId: Int override val layoutId: Int
get() = R.layout.fragment_anchor get() = R.layout.fragment_anchor
......
...@@ -2,6 +2,7 @@ package com.hupu.tv.player.app.ui.fragment ...@@ -2,6 +2,7 @@ package com.hupu.tv.player.app.ui.fragment
import android.content.Intent import android.content.Intent
import android.os.Bundle import android.os.Bundle
import android.text.TextUtils
import android.util.Log import android.util.Log
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
...@@ -10,6 +11,7 @@ import com.softgarden.baselibrary.utils.SPUtil ...@@ -10,6 +11,7 @@ import com.softgarden.baselibrary.utils.SPUtil
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshFragment import com.hupu.tv.player.app.base.RefreshFragment
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.bean.GiftBean import com.hupu.tv.player.app.bean.GiftBean
import com.hupu.tv.player.app.bean.LiveUserBean import com.hupu.tv.player.app.bean.LiveUserBean
import com.hupu.tv.player.app.event.RefreshUserEvent import com.hupu.tv.player.app.event.RefreshUserEvent
...@@ -21,6 +23,7 @@ import com.hupu.tv.player.app.ui.contact.LiveConversationFragmentContact ...@@ -21,6 +23,7 @@ import com.hupu.tv.player.app.ui.contact.LiveConversationFragmentContact
import com.hupu.tv.player.app.ui.presenter.LiveConversationFragmentPresenter import com.hupu.tv.player.app.ui.presenter.LiveConversationFragmentPresenter
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
import kotlinx.android.synthetic.main.fragment_live_conversation.* import kotlinx.android.synthetic.main.fragment_live_conversation.*
import kotlinx.android.synthetic.main.layout_marquee.*
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe import org.greenrobot.eventbus.Subscribe
import org.greenrobot.eventbus.ThreadMode import org.greenrobot.eventbus.ThreadMode
...@@ -31,20 +34,21 @@ import org.greenrobot.eventbus.ThreadMode ...@@ -31,20 +34,21 @@ import org.greenrobot.eventbus.ThreadMode
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresenter>(), LiveConversationFragmentContact.IDisplay { class LiveConversationFragment : RefreshVP2Fragment<LiveConversationFragmentPresenter>(), LiveConversationFragmentContact.IDisplay {
var chatFragment: ChatFragment? = null var chatFragment: ChatFragment? = null
var liveUserName = "" var liveUserName = ""
companion object { companion object {
@JvmStatic @JvmStatic
fun newInstance(conversationId: String, notice: String,userName:String,userHxId:String): LiveConversationFragment { fun newInstance(conversationId: String, notice: String,userName:String,userHxId:String,roomName:String): LiveConversationFragment {
val args = Bundle() val args = Bundle()
args.putString(EaseConstant.EXTRA_CONVERSATION_ID, conversationId) args.putString(EaseConstant.EXTRA_CONVERSATION_ID, conversationId)
args.putString(Constants.USER_HX_ID, userHxId) args.putString(Constants.USER_HX_ID, userHxId)
args.putInt(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_CHATROOM) args.putInt(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_CHATROOM)
args.putBoolean(EaseConstant.EXTRA_IS_ROAM, false) args.putBoolean(EaseConstant.EXTRA_IS_ROAM, true)
args.putString(Constants.LIVE_NOTICE, notice) args.putString(Constants.LIVE_NOTICE, notice)
args.putString(Constants.LIVE_ROOM_USER_NAME, userName) args.putString(Constants.LIVE_ROOM_USER_NAME, userName)
args.putString(Constants.LIVE_ROOM_NAME, roomName)
val fragment = LiveConversationFragment() val fragment = LiveConversationFragment()
fragment.arguments = args fragment.arguments = args
return fragment return fragment
...@@ -55,7 +59,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent ...@@ -55,7 +59,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
liveUserName = arguments?.getString(Constants.LIVE_ROOM_USER_NAME,"游客50234")?:"游客50234" liveUserName = arguments?.getString(Constants.LIVE_ROOM_USER_NAME,"游客50234")?:"游客50234"
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
initChatFragment() initChatFragment()
tv_notice.text = getString(R.string.string_live_notice, arguments?.getString(Constants.LIVE_NOTICE)) tv_notice.text = "公告:${getString(R.string.string_live_notice, arguments?.getString(Constants.LIVE_NOTICE))}"
needLogin() needLogin()
tv_report.setOnClickListener { tv_report.setOnClickListener {
startActivity(Intent(requireContext(), ReportActivity::class.java)) startActivity(Intent(requireContext(), ReportActivity::class.java))
...@@ -98,9 +102,10 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent ...@@ -98,9 +102,10 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
val bundle = Bundle() val bundle = Bundle()
bundle.putString(EaseConstant.EXTRA_CONVERSATION_ID, arguments?.getString(EaseConstant.EXTRA_CONVERSATION_ID)) bundle.putString(EaseConstant.EXTRA_CONVERSATION_ID, arguments?.getString(EaseConstant.EXTRA_CONVERSATION_ID))
bundle.putInt(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_CHATROOM) bundle.putInt(EaseConstant.EXTRA_CHAT_TYPE, EaseConstant.CHATTYPE_CHATROOM)
bundle.putBoolean(EaseConstant.EXTRA_IS_ROAM, false) bundle.putBoolean(EaseConstant.EXTRA_IS_ROAM, true)
bundle.putString(Constants.LIVE_ROOM_USER_NAME, liveUserName) bundle.putString(Constants.LIVE_ROOM_USER_NAME, liveUserName)
bundle.putString(Constants.USER_HX_ID, arguments?.getString(Constants.USER_HX_ID)) bundle.putString(Constants.USER_HX_ID, arguments?.getString(Constants.USER_HX_ID))
bundle.putString(Constants.LIVE_ROOM_NAME, arguments?.getString(Constants.LIVE_ROOM_NAME))
chatFragment = ChatFragment() chatFragment = ChatFragment()
chatFragment?.arguments = bundle chatFragment?.arguments = bundle
childFragmentManager.beginTransaction().replace(R.id.fl_fragment, chatFragment!!, "chat").commit() childFragmentManager.beginTransaction().replace(R.id.fl_fragment, chatFragment!!, "chat").commit()
...@@ -108,6 +113,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent ...@@ -108,6 +113,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
} }
override fun lazyLoad() { override fun lazyLoad() {
presenter?.getGiftList() presenter?.getGiftList()
} }
...@@ -119,6 +125,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent ...@@ -119,6 +125,7 @@ class LiveConversationFragment : RefreshFragment<LiveConversationFragmentPresent
SPUtil.putSerializableObject(Constants.GIFT_BEAN,list) SPUtil.putSerializableObject(Constants.GIFT_BEAN,list)
} }
override fun onMemberJoinRoom(list: ArrayList<LiveUserBean>?) { override fun onMemberJoinRoom(list: ArrayList<LiveUserBean>?) {
} }
......
...@@ -8,6 +8,7 @@ import com.softgarden.baselibrary.base.BaseActivity ...@@ -8,6 +8,7 @@ import com.softgarden.baselibrary.base.BaseActivity
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshFragment import com.hupu.tv.player.app.base.RefreshFragment
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.bean.RedListData import com.hupu.tv.player.app.bean.RedListData
import com.hupu.tv.player.app.ui.activity.RedDetailActivity import com.hupu.tv.player.app.ui.activity.RedDetailActivity
import com.hupu.tv.player.app.ui.adapter.RedListAdapter import com.hupu.tv.player.app.ui.adapter.RedListAdapter
...@@ -22,7 +23,7 @@ import com.softgarden.baselibrary.utils.RecyclerViewUtil ...@@ -22,7 +23,7 @@ import com.softgarden.baselibrary.utils.RecyclerViewUtil
* @date on 2020/6/15 * @date on 2020/6/15
* @describe * @describe
*/ */
class LiveRedListFragment : RefreshFragment<LiveRedListPresenter>(), LiveRedListContact.Display { class LiveRedListFragment : RefreshVP2Fragment<LiveRedListPresenter>(), LiveRedListContact.Display {
private var sportId = "" private var sportId = ""
private lateinit var adapter: RedListAdapter private lateinit var adapter: RedListAdapter
......
...@@ -15,6 +15,7 @@ import com.softgarden.baselibrary.utils.RecyclerViewUtil ...@@ -15,6 +15,7 @@ import com.softgarden.baselibrary.utils.RecyclerViewUtil
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.base.ToolbarFragment import com.hupu.tv.player.app.base.ToolbarFragment
import com.hupu.tv.player.app.bean.* import com.hupu.tv.player.app.bean.*
import com.hupu.tv.player.app.bean.MatchContentBean.MatchListsBean.MatchInfosBean import com.hupu.tv.player.app.bean.MatchContentBean.MatchListsBean.MatchInfosBean
...@@ -47,16 +48,13 @@ import org.greenrobot.eventbus.ThreadMode ...@@ -47,16 +48,13 @@ import org.greenrobot.eventbus.ThreadMode
* @date on 2020/6/14 * @date on 2020/6/14
* @describe * @describe
*/ */
class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainContentAllContract.Display { class MainContentAllFragment : RefreshVP2Fragment<MainContentAllPresenter>(), MainContentAllContract.Display {
private var sportId: String = "" private var sportId: String = ""
private var liveItemAdapter: LiveItemAdapter? = null private var liveItemAdapter: LiveItemAdapter? = null
private var liveTopAdapter: LiveTopAdapter? = null private var liveTopAdapter: LiveTopAdapter? = null
override val layoutId: Int override val layoutId: Int
get() = R.layout.fragment_match_all get() = R.layout.fragment_match_all
override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? {
return null
}
override fun initEventAndData() { override fun initEventAndData() {
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
...@@ -69,7 +67,17 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC ...@@ -69,7 +67,17 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC
initBanner() initBanner()
liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this) liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this)
mRecyclerView?.layoutManager = GridLayoutManager(activity, 2) mRecyclerView?.layoutManager = GridLayoutManager(activity, 2)
activity?.let { RecyclerViewUtil.addGridItemDecoration(it, mRecyclerView!!, R.color.transparent, 2 * Constants.item_divider_4) } if (mRecyclerView?.itemDecorationCount == 0) {
activity?.let {
RecyclerViewUtil.addGridItemDecoration(
it,
mRecyclerView!!,
R.color.transparent,
Constants.item_divider_4 * 2
)
}
}
mRecyclerView?.adapter = liveItemAdapter mRecyclerView?.adapter = liveItemAdapter
liveItemAdapter?.setOnItemClickListener { adapter, view, position -> liveItemAdapter?.setOnItemClickListener { adapter, view, position ->
val item: LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean val item: LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean
...@@ -79,26 +87,30 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC ...@@ -79,26 +87,30 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC
startActivity(intent) startActivity(intent)
} }
liveTopAdapter = LiveTopAdapter(R.layout.item_match_topl_live_new, this) liveTopAdapter = LiveTopAdapter(R.layout.item_match_topl_live_new, this)
mRecyclerView_top.layoutManager = RecyclerViewUtil.nestedScrollNoFluent(mRecyclerView_top, LinearLayoutManager(activity, RecyclerView.HORIZONTAL, false)) mRecyclerView_top.layoutManager = RecyclerViewUtil.nestedScrollNoFluent(
mRecyclerView_top,
LinearLayoutManager(activity, RecyclerView.HORIZONTAL, false)
)
mRecyclerView_top.adapter = liveTopAdapter mRecyclerView_top.adapter = liveTopAdapter
RecyclerViewUtil.addItemDecoration(requireActivity(), mRecyclerView_top, R.color.transparent, Constants.item_divider_4 * 2, RecyclerView.HORIZONTAL) if (mRecyclerView_top.itemDecorationCount == 0) {
liveTopAdapter?.setOnItemClickListener { adapter, view, position -> RecyclerViewUtil.addItemDecoration(
requireActivity(),
mRecyclerView_top,
R.color.transparent,
Constants.item_divider,
RecyclerView.HORIZONTAL
)
}
if (SPUtil[Constants.USER_LOGIN, false] as Boolean) { liveTopAdapter?.setOnItemClickListener { adapter, view, position ->
val adapterItem = adapter.getItem(position) as MatchInfosBean? val adapterItem = adapter.getItem(position) as MatchInfosBean?
// val intent = Intent(activity, MatchDetailActivity::class.java) val intent = Intent(activity, NewMatchDetailActivity::class.java)
val intent = Intent(activity, NewMatchDetailActivity::class.java) intent.putExtra(Constants.MATCH_BEAN_ID, adapterItem?.id)
intent.putExtra(Constants.MATCH_BEAN_ID, adapterItem?.id) intent.putExtra(Constants.SPORT_TYPE, adapterItem?.sportsType)
intent.putExtra(Constants.SPORT_TYPE, adapterItem?.sportsType) startActivity(intent)
startActivity(intent)
} else {
DialogUtils.showLogin(requireActivity() as AppCompatActivity)
// startActivity(LoginActivity::class.java)
}
} }
...@@ -125,8 +137,6 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC ...@@ -125,8 +137,6 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC
} }
override fun lazyLoad() { override fun lazyLoad() {
presenter?.getMatchData(mPage) presenter?.getMatchData(mPage)
presenter?.getTopLive(mPage) presenter?.getTopLive(mPage)
...@@ -155,7 +165,6 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC ...@@ -155,7 +165,6 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC
} }
override fun onRequestLiveData(data: List<LiveBean.DataListBean>?) { override fun onRequestLiveData(data: List<LiveBean.DataListBean>?) {
liveItemAdapter?.let { liveItemAdapter?.let {
setLoadMore(it, data) setLoadMore(it, data)
...@@ -174,12 +183,12 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC ...@@ -174,12 +183,12 @@ class MainContentAllFragment : ToolbarFragment<MainContentAllPresenter>(), MainC
} }
override fun onMessage(data: List<MessageBean.DataListBean>?) { override fun onMessage(data: List<MessageBean.DataListBean>?) {
data?.let {list-> data?.let { list ->
if (list.isNotEmpty()){ if (list.isNotEmpty()) {
ll_message.visibility = View.GONE ll_message.visibility = View.GONE
tv_message.text =list[0].title tv_message.text = list[0].title
ll_message.setOnClickListener { ll_message.setOnClickListener {
DialogUtils.showMessage(requireActivity() as AppCompatActivity,list[0].content) DialogUtils.showMessage(requireActivity() as AppCompatActivity, list[0].content)
} }
} }
} }
......
...@@ -10,6 +10,7 @@ import com.softgarden.baselibrary.utils.L ...@@ -10,6 +10,7 @@ import com.softgarden.baselibrary.utils.L
import com.softgarden.baselibrary.utils.RecyclerViewUtil import com.softgarden.baselibrary.utils.RecyclerViewUtil
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.base.ToolbarFragment import com.hupu.tv.player.app.base.ToolbarFragment
import com.hupu.tv.player.app.bean.CategoryBean import com.hupu.tv.player.app.bean.CategoryBean
import com.hupu.tv.player.app.bean.LiveBean import com.hupu.tv.player.app.bean.LiveBean
...@@ -35,16 +36,13 @@ import org.greenrobot.eventbus.ThreadMode ...@@ -35,16 +36,13 @@ import org.greenrobot.eventbus.ThreadMode
* @date on 2020/6/14 * @date on 2020/6/14
* @describe * @describe
*/ */
class MainContentNormalFragment : ToolbarFragment<MainContentNormalPresenter>(), MainContentNormalContract.Display { class MainContentNormalFragment : RefreshVP2Fragment<MainContentNormalPresenter>(), MainContentNormalContract.Display {
private var imageCarousel: ImageCarousel? = null private var imageCarousel: ImageCarousel? = null
private var liveItemAdapter: LiveItemAdapter? = null private var liveItemAdapter: LiveItemAdapter? = null
private var sportId: String = "" private var sportId: String = ""
override val layoutId: Int override val layoutId: Int
get() = R.layout.fragment_match_content_normal get() = R.layout.fragment_match_content_normal
override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? {
return null
}
override fun initEventAndData() { override fun initEventAndData() {
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
...@@ -58,7 +56,16 @@ class MainContentNormalFragment : ToolbarFragment<MainContentNormalPresenter>(), ...@@ -58,7 +56,16 @@ class MainContentNormalFragment : ToolbarFragment<MainContentNormalPresenter>(),
liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this) liveItemAdapter = LiveItemAdapter(R.layout.item_match_normal_live, this)
mRecyclerView?.adapter = liveItemAdapter mRecyclerView?.adapter = liveItemAdapter
mRecyclerView?.layoutManager = GridLayoutManager(activity, 2) mRecyclerView?.layoutManager = GridLayoutManager(activity, 2)
activity?.let { RecyclerViewUtil.addGridItemDecoration(it, mRecyclerView!!, R.color.transparent, 2 * Constants.item_divider) } if (mRecyclerView?.itemDecorationCount == 0){
activity?.let {
RecyclerViewUtil.addGridItemDecoration(
it,
mRecyclerView!!,
R.color.transparent,
Constants.item_divider_4 * 2
)
}
}
liveItemAdapter?.setOnItemClickListener { adapter, view, position -> liveItemAdapter?.setOnItemClickListener { adapter, view, position ->
val item:LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean val item:LiveBean.DataListBean = adapter.getItem(position) as LiveBean.DataListBean
val intent = Intent(activity, LiveActivity::class.java) val intent = Intent(activity, LiveActivity::class.java)
......
...@@ -5,6 +5,7 @@ import android.os.Bundle ...@@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.View import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import com.flyco.tablayout.utils.FragmentBasePager2Adapter
import com.kongzue.dialog.v3.WaitDialog import com.kongzue.dialog.v3.WaitDialog
import com.softgarden.baselibrary.base.FragmentBaseStatePagerAdapter import com.softgarden.baselibrary.base.FragmentBaseStatePagerAdapter
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
...@@ -13,8 +14,8 @@ import com.hupu.tv.player.app.base.RefreshFragment ...@@ -13,8 +14,8 @@ import com.hupu.tv.player.app.base.RefreshFragment
import com.hupu.tv.player.app.bean.TitleSortBean import com.hupu.tv.player.app.bean.TitleSortBean
import com.hupu.tv.player.app.ui.contact.MainFragmentContact import com.hupu.tv.player.app.ui.contact.MainFragmentContact
import com.hupu.tv.player.app.ui.presenter.MainFragmentPresenter import com.hupu.tv.player.app.ui.presenter.MainFragmentPresenter
import kotlinx.android.synthetic.main.fragment_main.tabLayout_main import com.softgarden.baselibrary.utils.ToastUtil
import kotlinx.android.synthetic.main.fragment_main.vp_main import kotlinx.android.synthetic.main.fragment_main.*
import kotlinx.android.synthetic.main.layout_empty_no_data.* import kotlinx.android.synthetic.main.layout_empty_no_data.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
...@@ -33,9 +34,14 @@ class MainFragment : RefreshFragment<MainFragmentPresenter>(), MainFragmentConta ...@@ -33,9 +34,14 @@ class MainFragment : RefreshFragment<MainFragmentPresenter>(), MainFragmentConta
presenter?.getCategory() presenter?.getCategory()
} }
private fun initView() { private fun initView() {
ll_empty.visibility = View.GONE ll_empty.visibility = View.GONE
iv_message.setOnClickListener {
ToastUtil.s("敬请期待")
}
iv_category.setOnClickListener {
ToastUtil.s("敬请期待")
}
} }
private fun initViewPager() { private fun initViewPager() {
val list = addDefaultData() val list = addDefaultData()
...@@ -49,10 +55,10 @@ class MainFragment : RefreshFragment<MainFragmentPresenter>(), MainFragmentConta ...@@ -49,10 +55,10 @@ class MainFragment : RefreshFragment<MainFragmentPresenter>(), MainFragmentConta
} }
} }
val mAdapter = FragmentBaseStatePagerAdapter(childFragmentManager, mFragments, mTitles) val mAdapter = FragmentBasePager2Adapter(childFragmentManager, mFragments, mTitles,lifecycle)
vp_main.offscreenPageLimit = list.size vp_main.offscreenPageLimit = list.size
vp_main.adapter = mAdapter vp_main.adapter = mAdapter
tabLayout_main.setViewPager(vp_main) tabLayout_main.setViewPager2(vp_main)
} }
......
...@@ -57,7 +57,9 @@ class MainNewsContentAllFragment : ToolbarFragment<MainNewsContentAllPresenter>( ...@@ -57,7 +57,9 @@ class MainNewsContentAllFragment : ToolbarFragment<MainNewsContentAllPresenter>(
newsAdapter = NewsListAdapter(R.layout.item_news, this) newsAdapter = NewsListAdapter(R.layout.item_news, this)
mRecyclerView?.layoutManager = LinearLayoutManager(requireContext()) mRecyclerView?.layoutManager = LinearLayoutManager(requireContext())
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) } if (mRecyclerView?.itemDecorationCount == 0){
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) }
}
mRecyclerView?.adapter = newsAdapter mRecyclerView?.adapter = newsAdapter
newsAdapter.setOnItemClickListener { adapter, view, position -> newsAdapter.setOnItemClickListener { adapter, view, position ->
val intent = Intent(requireActivity(), NewsDetailActivity::class.java) val intent = Intent(requireActivity(), NewsDetailActivity::class.java)
......
...@@ -40,7 +40,10 @@ class MainNewsContentNormalFragment : ToolbarFragment<MainNewsContentNormalPrese ...@@ -40,7 +40,10 @@ class MainNewsContentNormalFragment : ToolbarFragment<MainNewsContentNormalPrese
private fun initView() { private fun initView() {
newsAdapter = NewsListAdapter(R.layout.item_news, this) newsAdapter = NewsListAdapter(R.layout.item_news, this)
mRecyclerView?.layoutManager = LinearLayoutManager(requireContext()) mRecyclerView?.layoutManager = LinearLayoutManager(requireContext())
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) } if (mRecyclerView?.itemDecorationCount == 0){
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) }
}
mRecyclerView?.adapter = newsAdapter mRecyclerView?.adapter = newsAdapter
newsAdapter.setOnItemClickListener { adapter, view, position -> newsAdapter.setOnItemClickListener { adapter, view, position ->
val intent = Intent(requireActivity(), NewsDetailActivity::class.java) val intent = Intent(requireActivity(), NewsDetailActivity::class.java)
......
...@@ -12,8 +12,7 @@ import com.hupu.tv.player.app.base.RefreshFragment ...@@ -12,8 +12,7 @@ import com.hupu.tv.player.app.base.RefreshFragment
import com.hupu.tv.player.app.bean.NewsTagItemEntity import com.hupu.tv.player.app.bean.NewsTagItemEntity
import com.hupu.tv.player.app.ui.contact.MainNewsFragmentContact import com.hupu.tv.player.app.ui.contact.MainNewsFragmentContact
import com.hupu.tv.player.app.ui.presenter.MainNewsFragmentPresenter import com.hupu.tv.player.app.ui.presenter.MainNewsFragmentPresenter
import kotlinx.android.synthetic.main.fragment_main.tabLayout_main import kotlinx.android.synthetic.main.fragment_main_news.*
import kotlinx.android.synthetic.main.fragment_main.vp_main
import kotlinx.android.synthetic.main.layout_empty_no_data.* import kotlinx.android.synthetic.main.layout_empty_no_data.*
import kotlin.collections.ArrayList import kotlin.collections.ArrayList
......
...@@ -2,16 +2,20 @@ package com.hupu.tv.player.app.ui.fragment ...@@ -2,16 +2,20 @@ package com.hupu.tv.player.app.ui.fragment
import android.os.Bundle import android.os.Bundle
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.mirkowu.basetoolbar.BaseToolbar import com.mirkowu.basetoolbar.BaseToolbar
import com.softgarden.baselibrary.utils.RecyclerViewUtil import com.softgarden.baselibrary.utils.RecyclerViewUtil
import com.softgarden.baselibrary.utils.ToastUtil import com.softgarden.baselibrary.utils.ToastUtil
import com.hupu.tv.player.app.R import com.hupu.tv.player.app.R
import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.RefreshVP2Fragment
import com.hupu.tv.player.app.base.ToolbarFragment import com.hupu.tv.player.app.base.ToolbarFragment
import com.hupu.tv.player.app.bean.CategoryBean import com.hupu.tv.player.app.bean.CategoryBean
import com.hupu.tv.player.app.bean.MatchContentBean import com.hupu.tv.player.app.bean.MatchContentBean
import com.hupu.tv.player.app.event.FollowMatchEvent import com.hupu.tv.player.app.event.FollowMatchEvent
import com.hupu.tv.player.app.ui.adapter.MatchContentAdapter import com.hupu.tv.player.app.ui.adapter.MatchContentAdapter
import com.hupu.tv.player.app.ui.adapter.MatchContentIncludeAdapter
import com.hupu.tv.player.app.ui.contact.MatchContentFragmentContract import com.hupu.tv.player.app.ui.contact.MatchContentFragmentContract
import com.hupu.tv.player.app.ui.presenter.MatchContentPresenter import com.hupu.tv.player.app.ui.presenter.MatchContentPresenter
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
...@@ -22,16 +26,13 @@ import org.greenrobot.eventbus.EventBus ...@@ -22,16 +26,13 @@ import org.greenrobot.eventbus.EventBus
* @date on 2020/6/14 * @date on 2020/6/14
* @describe * @describe
*/ */
class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchContentFragmentContract.Display { class MatchContentFragment : RefreshVP2Fragment<MatchContentPresenter>(), MatchContentFragmentContract.Display {
private var matchContentAdapter: MatchContentAdapter? = null private var matchContentAdapter: MatchContentAdapter? = null
private var sportId: String = "" private var sportId: String = ""
override val layoutId: Int override val layoutId: Int
get() = R.layout.fragment_match_content get() = R.layout.fragment_match_content
override fun setToolbar(builder: BaseToolbar.Builder): BaseToolbar.Builder? {
return null
}
override fun initEventAndData() { override fun initEventAndData() {
initRecyclerView() initRecyclerView()
...@@ -39,19 +40,21 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont ...@@ -39,19 +40,21 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont
initView() initView()
} }
public fun requestFollow(id: String, status: Boolean) { fun requestFollow(id: String, status: Boolean, parentPosition: Int, position: Int) {
presenter?.reserveMatch(id, status) presenter?.reserveMatch(id, status, parentPosition, position)
} }
private fun initView() { private fun initView() {
matchContentAdapter = MatchContentAdapter(R.layout.item_match_content, this) matchContentAdapter =
MatchContentAdapter(R.layout.item_match_content, this, arguments?.getInt(Constants.POSITION) ?: 0)
mRecyclerView?.adapter = matchContentAdapter mRecyclerView?.adapter = matchContentAdapter
mRecyclerView?.layoutManager = LinearLayoutManager(activity) mRecyclerView?.layoutManager = LinearLayoutManager(activity)
if (mRecyclerView?.itemDecorationCount == 0) { if (mRecyclerView?.itemDecorationCount == 0) {
activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) } activity?.let { RecyclerViewUtil.addItemDecoration(it, mRecyclerView!!, R.color.view_color, 1) }
} }
matchContentAdapter?.bindToRecyclerView(mRecyclerView!!)
arguments?.getString(CategoryBean.ID)?.let { arguments?.getString(CategoryBean.ID)?.let {
sportId = it sportId = it
} }
...@@ -63,11 +66,12 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont ...@@ -63,11 +66,12 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont
} }
companion object { companion object {
fun newInstance(id: String, title: String): MatchContentFragment { fun newInstance(id: String, title: String, index: Int): MatchContentFragment {
val args = Bundle() val args = Bundle()
val fragment = MatchContentFragment() val fragment = MatchContentFragment()
args.putString(CategoryBean.ID, id) args.putString(CategoryBean.ID, id)
args.putString(CategoryBean.TITLE, title) args.putString(CategoryBean.TITLE, title)
args.putInt(Constants.POSITION, index)
fragment.arguments = args fragment.arguments = args
return fragment return fragment
} }
...@@ -80,8 +84,15 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont ...@@ -80,8 +84,15 @@ class MatchContentFragment : ToolbarFragment<MatchContentPresenter>(), MatchCont
} }
} }
override fun onSubscribeMatch(message: String) { override fun onSubscribeMatch(message: String, parentPosition: Int, position: Int) {
ToastUtil.s(message) ToastUtil.s(message)
val recyclerView = matchContentAdapter?.getViewByPosition(parentPosition, R.id.recycler_content) as RecyclerView
val matchContentIncludeAdapter = recyclerView.adapter as? MatchContentIncludeAdapter
val item = matchContentIncludeAdapter?.getItem(position)
item?.let {
it.isSubscribe = !it.isSubscribe
}
matchContentIncludeAdapter?.notifyItemChanged(position)
EventBus.getDefault().post(FollowMatchEvent()) EventBus.getDefault().post(FollowMatchEvent())
} }
......
...@@ -6,6 +6,8 @@ import android.view.View ...@@ -6,6 +6,8 @@ import android.view.View
import androidx.appcompat.app.AppCompatActivity import androidx.appcompat.app.AppCompatActivity
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager.widget.ViewPager import androidx.viewpager.widget.ViewPager
import androidx.viewpager2.widget.ViewPager2
import com.flyco.tablayout.utils.FragmentBasePager2Adapter
import com.kongzue.dialog.v3.WaitDialog import com.kongzue.dialog.v3.WaitDialog
import com.mirkowu.basetoolbar.BaseToolbar import com.mirkowu.basetoolbar.BaseToolbar
import com.softgarden.baselibrary.base.FragmentBaseStatePagerAdapter import com.softgarden.baselibrary.base.FragmentBaseStatePagerAdapter
...@@ -15,12 +17,13 @@ import com.hupu.tv.player.app.app.Constants ...@@ -15,12 +17,13 @@ import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.base.ToolbarFragment import com.hupu.tv.player.app.base.ToolbarFragment
import com.hupu.tv.player.app.bean.TitleSortBean import com.hupu.tv.player.app.bean.TitleSortBean
import com.hupu.tv.player.app.event.SubscribeEvent import com.hupu.tv.player.app.event.SubscribeEvent
import com.hupu.tv.player.app.event.SubscribeMatchEvent
import com.hupu.tv.player.app.event.VisibleEvent import com.hupu.tv.player.app.event.VisibleEvent
import com.hupu.tv.player.app.ui.contact.MatchFragmentContact import com.hupu.tv.player.app.ui.contact.MatchFragmentContact
import com.hupu.tv.player.app.ui.presenter.MatchFragmentPresenter import com.hupu.tv.player.app.ui.presenter.MatchFragmentPresenter
import com.hupu.tv.player.app.utils.DialogUtils import com.hupu.tv.player.app.utils.DialogUtils
import kotlinx.android.synthetic.main.fragment_match_main.tabLayout_main import com.softgarden.baselibrary.utils.ToastUtil
import kotlinx.android.synthetic.main.fragment_match_main.vp_main import kotlinx.android.synthetic.main.fragment_match_main.*
import kotlinx.android.synthetic.main.layout_empty_no_data.* import kotlinx.android.synthetic.main.layout_empty_no_data.*
import me.jessyan.autosize.utils.LogUtils import me.jessyan.autosize.utils.LogUtils
import org.greenrobot.eventbus.EventBus import org.greenrobot.eventbus.EventBus
...@@ -58,22 +61,14 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo ...@@ -58,22 +61,14 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo
val mTitles = arrayOfNulls<String>(list.size) val mTitles = arrayOfNulls<String>(list.size)
list.forEachIndexed { index, titleSortBean -> list.forEachIndexed { index, titleSortBean ->
mTitles[index] = titleSortBean.sportsName mTitles[index] = titleSortBean.sportsName
mFragments.add(MatchContentFragment.newInstance(titleSortBean.sportsId, titleSortBean.sportsName)) mFragments.add(MatchContentFragment.newInstance(titleSortBean.sportsId, titleSortBean.sportsName,index))
} }
val mAdapter = FragmentBaseStatePagerAdapter(childFragmentManager, mFragments, mTitles) val mAdapter = FragmentBasePager2Adapter(childFragmentManager, mFragments, mTitles,lifecycle)
vp_main.offscreenPageLimit = list.size vp_main.offscreenPageLimit = list.size
vp_main.adapter = mAdapter vp_main.adapter = mAdapter
tabLayout_main.setViewPager(vp_main) tabLayout_main.setViewPager2(vp_main)
vp_main.addOnPageChangeListener(object : ViewPager.OnPageChangeListener { vp_main.registerOnPageChangeCallback(object :ViewPager2.OnPageChangeCallback(){
override fun onPageScrollStateChanged(state: Int) {
}
override fun onPageScrolled(position: Int, positionOffset: Float, positionOffsetPixels: Int) {
}
override fun onPageSelected(position: Int) { override fun onPageSelected(position: Int) {
currentFragment = position currentFragment = position
} }
...@@ -89,17 +84,12 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo ...@@ -89,17 +84,12 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo
} }
@Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1) @Subscribe(threadMode = ThreadMode.MAIN, sticky = true, priority = 1)
fun onEventContent(event: SubscribeEvent) { fun onSubcribe(event: SubscribeMatchEvent) {
if (event.className != "match") { if (event.tag != Constants.SUBSCRIBE_MATCH) {
return return
} }
LogUtils.e("event") val matchContentFragment = mFragments[event.fragmentPosition] as MatchContentFragment
if (SPUtil[Constants.USER_LOGIN, false] == true) { matchContentFragment.requestFollow(event.id, event.subsribe,event.parentPostion,event.position)
val matchContentFragment = mFragments[currentFragment] as MatchContentFragment
matchContentFragment.requestFollow(event.id, event.isStatus)
} else {
DialogUtils.showLogin(activity as AppCompatActivity)
}
} }
...@@ -129,6 +119,9 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo ...@@ -129,6 +119,9 @@ class MatchFragment : ToolbarFragment<MatchFragmentPresenter>(), MatchFragmentCo
override fun initEventAndData() { override fun initEventAndData() {
hideToolbar() hideToolbar()
iv_message.setOnClickListener {
ToastUtil.s("敬请期待")
}
EventBus.getDefault().register(this) EventBus.getDefault().register(this)
} }
......
...@@ -2,6 +2,7 @@ package com.hupu.tv.player.app.ui.im; ...@@ -2,6 +2,7 @@ package com.hupu.tv.player.app.ui.im;
import android.content.Context; import android.content.Context;
import android.view.View; import android.view.View;
import android.widget.ImageView;
import android.widget.TextView; import android.widget.TextView;
import com.hyphenate.chat.EMClient; import com.hyphenate.chat.EMClient;
...@@ -22,6 +23,7 @@ import com.hupu.tv.player.app.app.Constants; ...@@ -22,6 +23,7 @@ import com.hupu.tv.player.app.app.Constants;
*/ */
public class CustomTextRow extends EaseChatRowText { public class CustomTextRow extends EaseChatRowText {
private TextView tvLevel; private TextView tvLevel;
private ImageView ivLevel;
public CustomTextRow(Context context, boolean isSender) { public CustomTextRow(Context context, boolean isSender) {
super(context, isSender); super(context, isSender);
...@@ -35,6 +37,7 @@ public class CustomTextRow extends EaseChatRowText { ...@@ -35,6 +37,7 @@ public class CustomTextRow extends EaseChatRowText {
protected void onFindViewById() { protected void onFindViewById() {
super.onFindViewById(); super.onFindViewById();
tvLevel = findViewById(R.id.tv_level); tvLevel = findViewById(R.id.tv_level);
ivLevel = findViewById(R.id.iv_level);
} }
@Override @Override
...@@ -60,24 +63,110 @@ public class CustomTextRow extends EaseChatRowText { ...@@ -60,24 +63,110 @@ public class CustomTextRow extends EaseChatRowText {
protected void setAvatarAndNick() { protected void setAvatarAndNick() {
String userNick = message.getStringAttribute(Constants.USER_NICK, message.getFrom()); String userNick = message.getStringAttribute(Constants.USER_NICK, message.getFrom());
int level = message.getIntAttribute(Constants.USER_LEVEL, 1); int level = message.getIntAttribute(Constants.USER_LEVEL, 1);
userNick = userNick.replace("\n", ""); userNick = userNick.replace("\n", "");
if (isSender()) { if (isSender()) {
EaseUserUtils.setUserAvatar(context, EMClient.getInstance().getCurrentUser(), userAvatarView); EaseUserUtils.setUserAvatar(context, EMClient.getInstance().getCurrentUser(), userAvatarView);
//只要不是常规布局形式,就展示昵称 //只要不是常规布局形式,就展示昵称
if (EaseChatItemStyleHelper.getInstance().getStyle().getItemShowType() != EaseChatMessageListLayout.ShowType.NORMAL.ordinal()) { if (EaseChatItemStyleHelper.getInstance().getStyle().getItemShowType() != EaseChatMessageListLayout.ShowType.NORMAL.ordinal()) {
EaseUserUtils.setUserNick(userNick+":", usernickView); EaseUserUtils.setUserNick(userNick + ":", usernickView);
tvLevel.setText("LV." +level); setLevel(level);
tvLevel.setText("LV." + level);
} }
} else { } else {
//todo 接受来的昵称 //todo 接受来的昵称
EaseUserUtils.setUserAvatar(context, message.getFrom(), userAvatarView); EaseUserUtils.setUserAvatar(context, message.getFrom(), userAvatarView);
EaseUserUtils.setUserNick(userNick+":", usernickView); EaseUserUtils.setUserNick(userNick + ":", usernickView);
setLevel(level);
tvLevel.setText("LV." + level); tvLevel.setText("LV." + level);
} }
} }
private void setLevel(int level) {
int levelIcon = 0;
switch (level) {
case 1:
levelIcon = R.mipmap.icon_user_level_1;
break;
case 2:
levelIcon = R.mipmap.icon_user_level_2;
break;
case 3:
levelIcon = R.mipmap.icon_user_level_3;
break;
case 4:
levelIcon = R.mipmap.icon_user_level_4;
break;
case 5:
levelIcon = R.mipmap.icon_user_level_5;
break;
case 6:
levelIcon = R.mipmap.icon_user_level_6;
break;
case 7:
levelIcon = R.mipmap.icon_user_level_7;
break;
case 8:
levelIcon = R.mipmap.icon_user_level_8;
break;
case 9:
levelIcon = R.mipmap.icon_user_level_9;
break;
case 10:
levelIcon = R.mipmap.icon_user_level_10;
break;
case 11:
levelIcon = R.mipmap.icon_user_level_11;
break;
case 12:
levelIcon = R.mipmap.icon_user_level_12;
break;
case 13:
levelIcon = R.mipmap.icon_user_level_13;
break;
case 14:
levelIcon = R.mipmap.icon_user_level_14;
break;
case 15:
levelIcon = R.mipmap.icon_user_level_15;
break;
case 16:
levelIcon = R.mipmap.icon_user_level_16;
break;
case 17:
levelIcon = R.mipmap.icon_user_level_17;
break;
case 18:
levelIcon = R.mipmap.icon_user_level_18;
break;
case 19:
levelIcon = R.mipmap.icon_user_level_19;
break;
case 20:
levelIcon = R.mipmap.icon_user_level_20;
break;
case 21:
levelIcon = R.mipmap.icon_user_level_21;
break;
case 22:
levelIcon = R.mipmap.icon_user_level_22;
break;
case 23:
levelIcon = R.mipmap.icon_user_level_23;
break;
case 24:
levelIcon = R.mipmap.icon_user_level_24;
break;
case 25:
levelIcon = R.mipmap.icon_user_level_25;
break;
}
ivLevel.setImageResource(levelIcon);
}
// @Override // @Override
// public void onSetUpView() { // public void onSetUpView() {
// EMTextMessageBody txtBody = (EMTextMessageBody) message.getBody(); // EMTextMessageBody txtBody = (EMTextMessageBody) message.getBody();
......
...@@ -38,39 +38,38 @@ class FollowMatchPresenter : IBasePresenter, FollowMatchContract.Presenter { ...@@ -38,39 +38,38 @@ class FollowMatchPresenter : IBasePresenter, FollowMatchContract.Presenter {
} }
override fun reserveMatch(id: String,parentPosition:Int,position:Int) {
override fun reserveMatch(id: String) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["id"] =id hashMap["id"] =id
RetrofitClient.retrofitService RetrofitClient.retrofitService
.reserveMatch(JsonUtils.toRequestBody(hashMap)) .reserveMatch(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView,false)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onSubscribeMatch("预约成功") mView?.onSubscribeMatch("预约成功",parentPosition, position)
} }
}) })
} }
override fun reserveMatch(id: String, status: Boolean) { override fun reserveMatch(id: String, status: Boolean, parentPosition: Int, position: Int) {
if (status){ if (status){
reserveMatch(id) cancelReserveMatch(id,parentPosition, position)
}else{ }else{
cancelReserveMatch(id) reserveMatch(id,parentPosition, position)
} }
} }
override fun cancelReserveMatch(id: String) { override fun cancelReserveMatch(id: String,parentPosition:Int,position:Int) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["id"] =id hashMap["id"] =id
RetrofitClient.retrofitService RetrofitClient.retrofitService
.cancelReserve(JsonUtils.toRequestBody(hashMap)) .cancelReserve(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView,false)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onSubscribeMatch("取消成功") mView?.onSubscribeMatch("取消成功",parentPosition, position)
} }
}) })
} }
} }
\ No newline at end of file
...@@ -7,6 +7,7 @@ import com.softgarden.baselibrary.network.RxCallback ...@@ -7,6 +7,7 @@ import com.softgarden.baselibrary.network.RxCallback
import com.hupu.tv.player.app.api.RetrofitClient import com.hupu.tv.player.app.api.RetrofitClient
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.FakeMessageEntity import com.hupu.tv.player.app.bean.FakeMessageEntity
import com.hupu.tv.player.app.bean.LiveBean
import com.hupu.tv.player.app.bean.RoomInfoBean import com.hupu.tv.player.app.bean.RoomInfoBean
import com.hupu.tv.player.app.ui.contact.LiveActivityContact import com.hupu.tv.player.app.ui.contact.LiveActivityContact
import com.hupu.tv.player.app.utils.JsonUtils import com.hupu.tv.player.app.utils.JsonUtils
...@@ -30,13 +31,13 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter { ...@@ -30,13 +31,13 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter {
override fun getFakeMessage() { override fun getFakeMessage() {
RetrofitClient.retrofitService RetrofitClient.retrofitService
.getFakeMessage() .getFakeMessage()
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<FakeMessageEntity>() { .subscribe(object : RxCallback<FakeMessageEntity>() {
override fun onSuccess(data: FakeMessageEntity?) { override fun onSuccess(data: FakeMessageEntity?) {
SPUtil.putSerializableObject(Constants.FAKE_MESSAGE,data) SPUtil.putSerializableObject(Constants.FAKE_MESSAGE, data)
} }
}) })
} }
...@@ -44,13 +45,13 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter { ...@@ -44,13 +45,13 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter {
val hashMap = HashMap<String, String>() val hashMap = HashMap<String, String>()
hashMap["id"] = id hashMap["id"] = id
RetrofitClient.retrofitService RetrofitClient.retrofitService
.getRoomInfo(JsonUtils.toRequestBody(hashMap)) .getRoomInfo(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<RoomInfoBean>() { .subscribe(object : RxCallback<RoomInfoBean>() {
override fun onSuccess(data: RoomInfoBean?) { override fun onSuccess(data: RoomInfoBean?) {
mView?.onRequestRoomInfo(data) mView?.onRequestRoomInfo(data)
} }
}) })
} }
...@@ -58,45 +59,60 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter { ...@@ -58,45 +59,60 @@ class LiveActivityPresenter : IBasePresenter, LiveActivityContact.Presenter {
val hashMap = HashMap<String, String>() val hashMap = HashMap<String, String>()
hashMap["id"] = id hashMap["id"] = id
RetrofitClient.retrofitService RetrofitClient.retrofitService
.followAnchor(JsonUtils.toRequestBody(hashMap)) .followAnchor(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onFollowAnchor("已关注主播", true) mView?.onFollowAnchor("已关注主播", true)
} }
}) })
} }
override fun unFollowAnchor(id: String) { override fun unFollowAnchor(id: String) {
val hashMap = HashMap<String, String>() val hashMap = HashMap<String, String>()
hashMap["id"] = id hashMap["id"] = id
RetrofitClient.retrofitService RetrofitClient.retrofitService
.unfollowAnchor(JsonUtils.toRequestBody(hashMap)) .unfollowAnchor(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onFollowAnchor("已取消关注主播", false) mView?.onFollowAnchor("已取消关注主播", false)
} }
}) })
} }
override fun sendGift(giftId: Int, roomId: String,position:Int) { override fun getRecommend(id: String, pageNum: Int) {
val hashMap = HashMap<String, Any>()
hashMap["pageNum"] = pageNum
hashMap["pageSize"] = 10
hashMap["roomId"] = id
RetrofitClient.retrofitService
.getRecommendList(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<LiveBean>() {
override fun onSuccess(data: LiveBean?) {
mView?.onRecommend(data)
}
})
}
override fun sendGift(giftId: Int, roomId: String, position: Int) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["giftId"] = giftId hashMap["giftId"] = giftId
hashMap["roomId"] = roomId hashMap["roomId"] = roomId
RetrofitClient.retrofitService RetrofitClient.retrofitService
.sendGift(JsonUtils.toRequestBody(hashMap)) .sendGift(JsonUtils.toRequestBody(hashMap))
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onSendGift(giftId,position) mView?.onSendGift(giftId, position)
} }
// override fun onError(t: Throwable) { // override fun onError(t: Throwable) {
// super.onError(t) // super.onError(t)
// mView?.onSendGift(giftId,position) // mView?.onSendGift(giftId,position)
// } // }
}) })
} }
......
...@@ -41,7 +41,7 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese ...@@ -41,7 +41,7 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese
} }
override fun reserveMatch(id: String) { override fun reserveMatch(id: String,parentPosition:Int,position:Int) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["id"] =id hashMap["id"] =id
RetrofitClient.retrofitService RetrofitClient.retrofitService
...@@ -49,20 +49,20 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese ...@@ -49,20 +49,20 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onSubscribeMatch("预约成功") mView?.onSubscribeMatch("预约成功",parentPosition, position)
} }
}) })
} }
override fun reserveMatch(id: String, status: Boolean) { override fun reserveMatch(id: String, status: Boolean, parentPosition: Int, position: Int) {
if (status){ if (status){
reserveMatch(id) cancelReserveMatch(id,parentPosition, position)
}else{ }else{
cancelReserveMatch(id) reserveMatch(id,parentPosition, position)
} }
} }
override fun cancelReserveMatch(id: String) { override fun cancelReserveMatch(id: String,parentPosition:Int,position:Int) {
val hashMap = HashMap<String, Any>() val hashMap = HashMap<String, Any>()
hashMap["id"] =id hashMap["id"] =id
RetrofitClient.retrofitService RetrofitClient.retrofitService
...@@ -70,7 +70,7 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese ...@@ -70,7 +70,7 @@ class MatchContentPresenter : IBasePresenter, MatchContentFragmentContract.Prese
.compose(NetworkTransformer(mView)) .compose(NetworkTransformer(mView))
.subscribe(object : RxCallback<String>() { .subscribe(object : RxCallback<String>() {
override fun onSuccess(data: String?) { override fun onSuccess(data: String?) {
mView?.onSubscribeMatch("取消成功") mView?.onSubscribeMatch("取消成功",parentPosition, position)
} }
}) })
} }
......
...@@ -22,6 +22,7 @@ import com.hupu.tv.player.app.app.App.Companion.instance ...@@ -22,6 +22,7 @@ import com.hupu.tv.player.app.app.App.Companion.instance
import com.hupu.tv.player.app.app.Constants import com.hupu.tv.player.app.app.Constants
import com.hupu.tv.player.app.bean.MovieBean.RecordsBean import com.hupu.tv.player.app.bean.MovieBean.RecordsBean
import com.hupu.tv.player.app.event.RefreshUserEvent import com.hupu.tv.player.app.event.RefreshUserEvent
import com.hupu.tv.player.app.ui.activity.LoginActivity
import com.hupu.tv.player.app.utils.DateUtil.unitFormat import com.hupu.tv.player.app.utils.DateUtil.unitFormat
import com.hupu.tv.player.app.widget.LinkTextView import com.hupu.tv.player.app.widget.LinkTextView
import com.hyphenate.util.UriUtils.* import com.hyphenate.util.UriUtils.*
...@@ -263,8 +264,10 @@ object CommonUtils { ...@@ -263,8 +264,10 @@ object CommonUtils {
val intent = Intent(Intent.ACTION_MAIN) val intent = Intent(Intent.ACTION_MAIN)
intent.addCategory(Intent.CATEGORY_LAUNCHER) intent.addCategory(Intent.CATEGORY_LAUNCHER)
intent.flags = Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED or Intent.FLAG_ACTIVITY_NEW_TASK intent.flags = Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED or Intent.FLAG_ACTIVITY_NEW_TASK
@SuppressLint("WrongConstant") val list = pkgMag.queryIntentActivities(intent, @SuppressLint("WrongConstant") val list = pkgMag.queryIntentActivities(
PackageManager.GET_ACTIVITIES) intent,
PackageManager.GET_ACTIVITIES
)
for (i in list.indices) { for (i in list.indices) {
val info = list[i] val info = list[i]
if (info.activityInfo.packageName == packageName) { if (info.activityInfo.packageName == packageName) {
...@@ -286,8 +289,10 @@ object CommonUtils { ...@@ -286,8 +289,10 @@ object CommonUtils {
} else { } else {
// 创建第三方应用的上下文环境 // 创建第三方应用的上下文环境
try { try {
pkgContext = context.createPackageContext(packageName, Context.CONTEXT_IGNORE_SECURITY pkgContext = context.createPackageContext(
or Context.CONTEXT_INCLUDE_CODE) packageName, Context.CONTEXT_IGNORE_SECURITY
or Context.CONTEXT_INCLUDE_CODE
)
} catch (e: PackageManager.NameNotFoundException) { } catch (e: PackageManager.NameNotFoundException) {
e.printStackTrace() e.printStackTrace()
} }
...@@ -435,8 +440,10 @@ object CommonUtils { ...@@ -435,8 +440,10 @@ object CommonUtils {
val minutes = totalSeconds / 60 % 60 val minutes = totalSeconds / 60 % 60
val hours = totalSeconds / 3600 val hours = totalSeconds / 3600
return if (hours > 0) { return if (hours > 0) {
String.format(Locale.US, "%02d:%02d:%02d", hours, minutes, String.format(
seconds) Locale.US, "%02d:%02d:%02d", hours, minutes,
seconds
)
} else { } else {
String.format(Locale.US, "%02d:%02d", minutes, seconds) String.format(Locale.US, "%02d:%02d", minutes, seconds)
} }
...@@ -448,8 +455,10 @@ object CommonUtils { ...@@ -448,8 +455,10 @@ object CommonUtils {
val minutes = totalSeconds / 60 % 60 val minutes = totalSeconds / 60 % 60
val hours = totalSeconds / 3600 val hours = totalSeconds / 3600
return if (hours > 0) { return if (hours > 0) {
String.format(Locale.US, "%02d:%02d:%02d", hours, minutes, String.format(
seconds) Locale.US, "%02d:%02d:%02d", hours, minutes,
seconds
)
} else { } else {
String.format(Locale.US, "%02d:%02d", minutes, seconds) String.format(Locale.US, "%02d:%02d", minutes, seconds)
} }
...@@ -561,7 +570,12 @@ object CommonUtils { ...@@ -561,7 +570,12 @@ object CommonUtils {
//这里可以用过循环处理就可以动态实现文本颜色的差别化了 //这里可以用过循环处理就可以动态实现文本颜色的差别化了
//设置高亮样式一 //设置高亮样式一
for (span in spans) { for (span in spans) {
sp.setSpan(ForegroundColorSpan(instance!!.resources.getColor(R.color.web_blue)), sp.getSpanStart(span), sp.getSpanEnd(span), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) sp.setSpan(
ForegroundColorSpan(instance!!.resources.getColor(R.color.web_blue)),
sp.getSpanStart(span),
sp.getSpanEnd(span),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE
)
} }
textView.movementMethod = LinkTextView.LocalLinkMovementMethod.getInstance() textView.movementMethod = LinkTextView.LocalLinkMovementMethod.getInstance()
return sp return sp
...@@ -579,7 +593,10 @@ object CommonUtils { ...@@ -579,7 +593,10 @@ object CommonUtils {
val selectionArgs = arrayOf(id) val selectionArgs = arrayOf(id)
filePath = getDataColumn(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection, selectionArgs) filePath = getDataColumn(context, MediaStore.Images.Media.EXTERNAL_CONTENT_URI, selection, selectionArgs)
} else if (isDownloadsDocument(uri)) { } else if (isDownloadsDocument(uri)) {
val contentUri = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), java.lang.Long.valueOf(documentId)) val contentUri = ContentUris.withAppendedId(
Uri.parse("content://downloads/public_downloads"),
java.lang.Long.valueOf(documentId)
)
filePath = getDataColumn(context, contentUri, null, null) filePath = getDataColumn(context, contentUri, null, null)
} }
} else if ("content".equals(uri.scheme, ignoreCase = true)) { } else if ("content".equals(uri.scheme, ignoreCase = true)) {
...@@ -613,13 +630,17 @@ object CommonUtils { ...@@ -613,13 +630,17 @@ object CommonUtils {
MobclickAgent.onProfileSignOff() MobclickAgent.onProfileSignOff()
} }
fun exitLogOut(){ fun exitLogOut() {
SPUtil.put(Constants.TOKEN, "") SPUtil.put(Constants.TOKEN, "")
SPUtil.put(Constants.USER_LOGIN, false) SPUtil.put(Constants.USER_LOGIN, false)
EventBus.getDefault().post(RefreshUserEvent()) EventBus.getDefault().post(RefreshUserEvent())
CommonUtils.umengLoginOut() CommonUtils.umengLoginOut()
} }
fun toLogin(context: Context) {
context.startActivity(Intent(context, LoginActivity::class.java))
}
// fun getTestDeviceInfo(context: Context?): Array<String?>? { // fun getTestDeviceInfo(context: Context?): Array<String?>? {
// val deviceInfo = arrayOfNulls<String>(2) // val deviceInfo = arrayOfNulls<String>(2)
......
...@@ -440,6 +440,8 @@ object DialogUtils { ...@@ -440,6 +440,8 @@ object DialogUtils {
} }
fun showLogin(activity: AppCompatActivity?) { fun showLogin(activity: AppCompatActivity?) {
activity?.startActivity(Intent(activity,LoginActivity::class.java)) activity?.startActivity(Intent(activity,LoginActivity::class.java))
// CustomDialog.show(activity, R.layout.dialog_login) { dialog: CustomDialog, v: View -> // CustomDialog.show(activity, R.layout.dialog_login) { dialog: CustomDialog, v: View ->
......
...@@ -10,6 +10,7 @@ import android.view.LayoutInflater; ...@@ -10,6 +10,7 @@ import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewTreeObserver; import android.view.ViewTreeObserver;
import android.widget.RelativeLayout; import android.widget.RelativeLayout;
import android.widget.TextView;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
...@@ -73,6 +74,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -73,6 +74,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
/** /**
* 另一侧的环信id * 另一侧的环信id
*/ */
public TextView tvLive;
private String username; private String username;
private boolean canUseRefresh = true; private boolean canUseRefresh = true;
private EaseChatMessageListLayout.LoadMoreStatus loadMoreStatus; private EaseChatMessageListLayout.LoadMoreStatus loadMoreStatus;
...@@ -98,7 +100,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -98,7 +100,7 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
public CustomEaseChatMessageListLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) { public CustomEaseChatMessageListLayout(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr); super(context, attrs, defStyleAttr);
LayoutInflater.from(context).inflate(R.layout.ease_chat_message_list, this); LayoutInflater.from(context).inflate(R.layout.custom_ease_chat_message_list, this);
EaseChatItemStyleHelper.getInstance().clear(); EaseChatItemStyleHelper.getInstance().clear();
chatSetHelper = EaseChatItemStyleHelper.getInstance(); chatSetHelper = EaseChatItemStyleHelper.getInstance();
presenter = new EaseChatMessagePresenterImpl(); presenter = new EaseChatMessagePresenterImpl();
...@@ -170,10 +172,14 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I ...@@ -170,10 +172,14 @@ public class CustomEaseChatMessageListLayout extends RelativeLayout implements I
} }
} }
public void setLiveName(String liveName){
tvLive.setText(liveName);
}
private void initViews() { private void initViews() {
presenter.attachView(this); presenter.attachView(this);
tvLive = findViewById(R.id.tv_live_name);
rvList = findViewById(R.id.message_list); rvList = findViewById(R.id.message_list);
srlRefresh = findViewById(R.id.srl_refresh); srlRefresh = findViewById(R.id.srl_refresh);
......
...@@ -136,7 +136,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -136,7 +136,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
@Override @Override
public void showNormalStatus() { public void showNormalStatus() {
hideSoftKeyboard(); hideSoftKeyboard();
buttonSetModeVoice.setVisibility(VISIBLE); // buttonSetModeVoice.setVisibility(VISIBLE);
setGiftShowImage(); setGiftShowImage();
buttonSetModeKeyboard.setVisibility(GONE); buttonSetModeKeyboard.setVisibility(GONE);
edittext_layout.setVisibility(VISIBLE); edittext_layout.setVisibility(VISIBLE);
...@@ -168,7 +168,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -168,7 +168,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
@Override @Override
public void showTextStatus() { public void showTextStatus() {
buttonSetModeVoice.setVisibility(VISIBLE); // buttonSetModeVoice.setVisibility(VISIBLE);
buttonSetModeKeyboard.setVisibility(GONE); buttonSetModeKeyboard.setVisibility(GONE);
edittext_layout.setVisibility(VISIBLE); edittext_layout.setVisibility(VISIBLE);
buttonPressToSpeak.setVisibility(GONE); buttonPressToSpeak.setVisibility(GONE);
...@@ -197,7 +197,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -197,7 +197,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
@Override @Override
public void showEmojiconStatus() { public void showEmojiconStatus() {
buttonSetModeVoice.setVisibility(VISIBLE); // buttonSetModeVoice.setVisibility(VISIBLE);
buttonSetModeKeyboard.setVisibility(GONE); buttonSetModeKeyboard.setVisibility(GONE);
edittext_layout.setVisibility(VISIBLE); edittext_layout.setVisibility(VISIBLE);
buttonPressToSpeak.setVisibility(GONE); buttonPressToSpeak.setVisibility(GONE);
...@@ -219,7 +219,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar ...@@ -219,7 +219,7 @@ public class CustomChatPrimaryMenu extends RelativeLayout implements IChatPrimar
public void showMoreStatus() { public void showMoreStatus() {
if (buttonMore.isChecked()) { if (buttonMore.isChecked()) {
hideSoftKeyboard(); hideSoftKeyboard();
buttonSetModeVoice.setVisibility(VISIBLE); // buttonSetModeVoice.setVisibility(VISIBLE);
buttonSetModeKeyboard.setVisibility(GONE); buttonSetModeKeyboard.setVisibility(GONE);
edittext_layout.setVisibility(VISIBLE); edittext_layout.setVisibility(VISIBLE);
buttonPressToSpeak.setVisibility(GONE); buttonPressToSpeak.setVisibility(GONE);
......
...@@ -86,6 +86,11 @@ class DanmakuVideoPlayer : StandardGSYVideoPlayer { ...@@ -86,6 +86,11 @@ class DanmakuVideoPlayer : StandardGSYVideoPlayer {
GlideUtils.loadImage(activityContext,cover,iv_cover,R.mipmap.icon_video_place_holder) GlideUtils.loadImage(activityContext,cover,iv_cover,R.mipmap.icon_video_place_holder)
} }
fun setNumAndFire(num:String?,fire: String?){
tv_room_num?.text = "房间号:$num"
tv_fire_num?.text = "热度:$fire"
}
override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) { override fun touchSurfaceMoveFullLogic(absDeltaX: Float, absDeltaY: Float) {
super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY) super.touchSurfaceMoveFullLogic(absDeltaX, absDeltaY)
//不给触摸快进,如果需要,屏蔽下方代码即可 //不给触摸快进,如果需要,屏蔽下方代码即可
...@@ -204,6 +209,7 @@ class DanmakuVideoPlayer : StandardGSYVideoPlayer { ...@@ -204,6 +209,7 @@ class DanmakuVideoPlayer : StandardGSYVideoPlayer {
gsyVideoPlayer.danmakuStartSeekPosition = currentPositionWhenPlaying.toLong() gsyVideoPlayer.danmakuStartSeekPosition = currentPositionWhenPlaying.toLong()
gsyVideoPlayer.danmaKuShow = danmaKuShow gsyVideoPlayer.danmaKuShow = danmaKuShow
onPrepareDanmaku(gsyVideoPlayer) onPrepareDanmaku(gsyVideoPlayer)
setNumAndFire(tv_room_num.text.toString(),tv_fire_num.text.toString())
} }
return gsyBaseVideoPlayer return gsyBaseVideoPlayer
} }
......
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_selected="true" android:drawable="@mipmap/match_subscribe"/>
<item android:state_selected="false" android:drawable="@mipmap/match_unsubscribed"/>
<item android:drawable="@mipmap/match_unsubscribed"/>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true"><shape android:shape="rectangle">
<solid android:color="#FF4A64" />
<corners android:radius="@dimen/dp_14" />
<padding android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp" />
</shape></item>
<item><shape android:shape="rectangle">
<solid android:color="#FF4A64" />
<padding android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp" />
<corners android:radius="@dimen/dp_14" />
</shape></item>
</selector>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<gradient <solid android:color="#A4A6BD" />
android:angle="135" <corners android:radius="@dimen/dp_13" />
android:endColor="#A4A6BD"
android:startColor="#D1D2E1" />
</shape>
\ No newline at end of file </shape>
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FF5261" />
<corners android:radius="@dimen/dp_13" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/white"/>
<corners android:radius="@dimen/dp_16"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/white" />
<corners android:radius="@dimen/dp_10" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/background_f5"/>
<corners android:radius="@dimen/dp_9"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle" >
<solid android:color="@color/color_F8F8F7"/>
<corners android:radius="@dimen/dp_16"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval" >
<solid android:color="@color/color_FF5655"/>
<size android:width="@dimen/dp_5" android:height="@dimen/dp_5"/>
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:angle="90"
android:endColor="#00000000"
android:startColor="#99000000"/>
</shape>
...@@ -13,65 +13,129 @@ ...@@ -13,65 +13,129 @@
android:layout_height="@dimen/dp_200" /> android:layout_height="@dimen/dp_200" />
<LinearLayout
android:visibility="gone"
android:orientation="vertical"
android:id="@+id/ll_anchor_finish"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_200">
<TextView
android:layout_marginStart="@dimen/dp_10"
android:textColor="@color/white"
android:textSize="@dimen/sp_13"
android:text="主播正在训练中,看看其他主播吧"
android:layout_marginTop="@dimen/dp_24"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<androidx.recyclerview.widget.RecyclerView
android:paddingHorizontal="@dimen/sp_19"
tools:listitem="@layout/item_live_recommend"
android:id="@+id/recycler_recommend"
android:layout_marginTop="@dimen/dp_8"
android:orientation="horizontal"
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
</androidx.recyclerview.widget.RecyclerView>
</LinearLayout>
<RelativeLayout <RelativeLayout
tools:visibility="visible"
android:visibility="gone"
android:id="@+id/iv_live_empty" android:id="@+id/iv_live_empty"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_200" android:layout_height="@dimen/dp_200"
android:background="@color/grey_normal"> android:background="@color/grey_normal"
android:visibility="gone"
tools:visibility="gone">
<ImageView <ImageView
android:layout_centerInParent="true"
android:id="@+id/iv_img" android:id="@+id/iv_img"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:scaleType="centerInside" android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@mipmap/live_empty" /> android:src="@mipmap/live_empty" />
<TextView <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/iv_img" android:layout_below="@id/iv_img"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:textColor="@color/white" tools:text="主播正在赶来的路上......"
android:text="主播正在赶来的路上......" android:textColor="@color/white" />
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_top" android:id="@+id/ll_anchor"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="54dp"
android:layout_below="@+id/player" android:layout_below="@id/player"
android:gravity="center" android:background="@color/background_f5"
android:minHeight="@dimen/dp_40" android:orientation="horizontal"
android:orientation="horizontal"> android:paddingHorizontal="@dimen/dp_14"
android:paddingVertical="@dimen/dp_8">
<com.flyco.tablayout.SlidingTabLayout
android:id="@+id/mTabLayout" <RelativeLayout
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="match_parent" android:layout_height="wrap_content"
android:layout_gravity="center" android:layout_weight="1">
android:layout_marginStart="@dimen/dp_10"
android:layout_weight="1" <com.hupu.tv.player.app.widget.CircleImageView
android:background="@color/transparent" android:id="@+id/iv_avatar"
app:tl_indicator_color="@color/main_select" android:layout_width="36dp"
app:tl_indicator_width="@dimen/dp_25" android:layout_height="36dp" />
app:tl_select_textsize="@dimen/sp_15"
app:tl_tab_width="@dimen/dp_65" <LinearLayout
app:tl_textBold="SELECT" android:layout_width="wrap_content"
app:tl_textSelectColor="@color/main_select" android:layout_height="wrap_content"
app:tl_textUnselectColor="@color/black" android:layout_marginStart="@dimen/dp_10"
app:tl_textsize="@dimen/sp_15" android:layout_toRightOf="@id/iv_avatar"
app:tl_underline_color="@color/transparent" /> android:orientation="vertical">
<LinearLayout
android:gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:textSize="@dimen/sp_13"
tools:text="蟑螂恶霸" />
<ImageView
android:layout_marginStart="@dimen/dp_7"
tools:src="@mipmap/icon_anchor_level_1"
android:id="@+id/iv_anchor_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>
<TextView
android:id="@+id/tv_follow_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_3"
android:textColor="@color/color_9D9D9D"
android:textSize="@dimen/sp_12"
tools:text="粉丝:6.3万" />
</LinearLayout>
</RelativeLayout>
<LinearLayout <LinearLayout
android:id="@+id/ll_follow" android:id="@+id/ll_follow"
android:layout_width="81dp" android:layout_width="@dimen/dp_60"
android:layout_height="match_parent" android:layout_height="@dimen/dp_26"
android:background="@drawable/shape_main_color" android:layout_gravity="center_vertical"
android:background="@drawable/shape_follow_color"
android:gravity="center" android:gravity="center"
android:orientation="horizontal"> android:orientation="horizontal">
...@@ -90,25 +154,42 @@ ...@@ -90,25 +154,42 @@
android:gravity="center" android:gravity="center"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_12"
tools:text="关注" /> tools:text="关注" />
</LinearLayout> </LinearLayout>
</LinearLayout> </LinearLayout>
<androidx.viewpager.widget.ViewPager
<com.flyco.tablayout.SlidingTabLayout
android:id="@+id/mTabLayout"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_35"
android:layout_below="@id/ll_anchor"
android:layout_gravity="center"
android:background="@color/transparent"
app:tl_indicator_color="@color/main_select"
app:tl_indicator_width="@dimen/dp_25"
app:tl_select_textsize="@dimen/sp_13"
app:tl_tab_width="120dp"
app:tl_textBold="SELECT"
app:tl_textSelectColor="@color/black"
app:tl_textUnselectColor="@color/color_999999"
app:tl_textsize="@dimen/sp_13"
app:tl_underline_color="@color/transparent" />
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_live" android:id="@+id/vp_live"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_top" /> android:layout_below="@id/mTabLayout" />
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_below="@id/ll_top" android:layout_below="@id/mTabLayout"
android:layout_alignParentEnd="true" android:layout_alignParentEnd="true"
android:layout_marginTop="55dp" android:layout_marginTop="330dp"
android:layout_marginEnd="@dimen/dp_12" android:layout_marginEnd="@dimen/dp_12"
android:orientation="vertical"> android:orientation="vertical">
......
<?xml version="1.0" encoding="utf-8"?>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/srl_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<TextView
android:id="@+id/tv_live_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:paddingHorizontal="@dimen/dp_10"
android:textColor="#7FB2D4"
android:textSize="@dimen/sp_13"
tools:text="欢迎来到大表哥说球直播间" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_9"
android:paddingHorizontal="@dimen/dp_10"
android:text="平台提醒:直播间内严禁出现违规、赌球、低俗色情、抽 烟酗酒等行为。若有违规,请及时向平台举报。如主播在 直播过程中诱导用户打赏、私下交易,请谨慎判断,严防 电信诈骗。让我们共同营造美好和谐的直播环境!"
android:textColor="#7FB2D4"
android:textSize="@dimen/sp_13" />
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/message_list"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
\ No newline at end of file
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
style="@style/ease_row_receive_iv_userhead_style" /> style="@style/ease_row_receive_iv_userhead_style" />
<LinearLayout <LinearLayout
android:gravity="center_vertical"
android:id="@+id/bubble" android:id="@+id/bubble"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -34,7 +35,14 @@ ...@@ -34,7 +35,14 @@
android:layout_toRightOf="@id/iv_userhead" android:layout_toRightOf="@id/iv_userhead"
android:layout_marginTop="2dp"> android:layout_marginTop="2dp">
<ImageView
android:src="@mipmap/icon_user_level_1"
android:id="@+id/iv_level"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView <TextView
android:visibility="gone"
android:layout_marginLeft="@dimen/chat_nick_margin_left" android:layout_marginLeft="@dimen/chat_nick_margin_left"
android:textSize="@dimen/sp_12" android:textSize="@dimen/sp_12"
android:textColor="@color/white" android:textColor="@color/white"
...@@ -48,12 +56,14 @@ ...@@ -48,12 +56,14 @@
<TextView <TextView
android:id="@+id/tv_userid" android:id="@+id/tv_userid"
android:layout_toEndOf="@id/tv_level" android:layout_toEndOf="@id/tv_level"
style="@style/chat_text_name_style"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_5" android:layout_marginStart="@dimen/dp_5"
android:textSize="@dimen/sp_14" android:textSize="@dimen/sp_13"
android:textColor="#6FA9D0"
tools:text="无敌猪猪:" tools:text="无敌猪猪:"
tools:visibility="visible"
android:visibility="gone" /> android:visibility="gone" />
<TextView <TextView
...@@ -64,10 +74,9 @@ ...@@ -64,10 +74,9 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:autoLink="web" android:autoLink="web"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:gravity="center|left"
android:lineSpacingExtra="2dp" android:lineSpacingExtra="2dp"
android:textColor="#ff000000" android:textColor="#ff000000"
android:textSize="15sp" android:textSize="@dimen/sp_13"
tools:text="文案文案"/> tools:text="文案文案"/>
</LinearLayout> </LinearLayout>
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout <LinearLayout
tools:visibility="gone"
android:id="@+id/ll_not_login" android:id="@+id/ll_not_login"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
tools:visibility="visible"
android:id="@+id/ll_data" android:id="@+id/ll_data"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
...@@ -53,10 +55,11 @@ ...@@ -53,10 +55,11 @@
android:visibility="gone"> android:visibility="gone">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
tools:listitem="@layout/item_match_content"
android:background="@drawable/shape_match_content"
android:id="@+id/mRecyclerView" android:id="@+id/mRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:layout_marginTop="@dimen/dp_20" />
</LinearLayout> </LinearLayout>
......
<?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"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent">
<LinearLayout <LinearLayout
android:id="@+id/ll_notice" android:id="@+id/ll_notice"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@color/background_f5" android:background="@color/color_4_FC5057"
android:orientation="horizontal"> android:orientation="horizontal">
<ImageView <ImageView
android:visibility="gone"
android:id="@+id/iv_notice" android:id="@+id/iv_notice"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
...@@ -23,28 +23,19 @@ ...@@ -23,28 +23,19 @@
android:layout_marginTop="@dimen/dp_7" android:layout_marginTop="@dimen/dp_7"
android:src="@mipmap/icon_live_notice" /> android:src="@mipmap/icon_live_notice" />
<include layout="@layout/layout_marquee" />
<TextView <TextView
android:layout_weight="1" android:id="@+id/tv_report"
android:id="@+id/tv_notice" android:layout_width="48dp"
android:layout_width="0dp" android:layout_height="@dimen/dp_20"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toEndOf="@id/iv_notice"
android:padding="@dimen/dp_7"
android:textColor="@color/black"
android:textSize="@dimen/sp_14"
tools:text="@string/string_movie_detail" />
<TextView
android:visibility="gone"
android:background="@drawable/shape_first_confrim"
android:layout_marginEnd="@dimen/dp_5" android:layout_marginEnd="@dimen/dp_5"
android:text="举报" android:background="@drawable/shape_first_confrim"
android:gravity="center" android:gravity="center"
android:text="举报"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="@dimen/sp_13" android:textSize="@dimen/sp_13"
android:id="@+id/tv_report" android:visibility="gone" />
android:layout_width="48dp"
android:layout_height="@dimen/dp_20"/>
</LinearLayout> </LinearLayout>
...@@ -53,66 +44,67 @@ ...@@ -53,66 +44,67 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_below="@id/ll_notice" /> android:layout_below="@id/ll_notice" />
<LinearLayout <LinearLayout
android:background="@color/white"
android:layout_alignParentBottom="true"
android:id="@+id/ll_need_login" android:id="@+id/ll_need_login"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/white"
android:gravity="bottom"
android:minHeight="52dp" android:minHeight="52dp"
android:orientation="horizontal" android:orientation="horizontal"
android:gravity="bottom"
android:paddingTop="4dp" android:paddingTop="4dp"
android:paddingBottom="4dp"> android:paddingBottom="4dp">
<ImageView <ImageView
style="@style/ease_chat_input_button_size" style="@style/ease_chat_input_button_size"
android:layout_marginBottom="5dp"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginBottom="5dp"
android:src="@mipmap/icon_block_show" android:src="@mipmap/icon_block_show"
android:visibility="visible" /> android:visibility="gone" />
<TextView <TextView
android:layout_weight="1"
android:layout_gravity="center_vertical"
android:gravity="center_vertical"
android:textSize="@dimen/sp_14"
android:text="期待你的神评论"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/ease_send_message_et_bg" android:layout_gravity="center_vertical"
android:focusableInTouchMode="true"
android:layout_marginLeft="6dp" android:layout_marginLeft="6dp"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_weight="1"
android:drawablePadding="@dimen/dp_10"
android:background="@drawable/ease_send_message_et_bg"
android:focusableInTouchMode="true"
android:gravity="center_vertical"
android:maxLines="4" android:maxLines="4"
android:minHeight="32dp" android:minHeight="32dp"
android:paddingLeft="10dp" android:paddingLeft="10dp"
android:paddingTop="3dp" android:paddingTop="3dp"
android:paddingRight="10dp" android:paddingRight="10dp"
android:paddingBottom="3dp" android:paddingBottom="3dp"
/> android:text="说点有爱的评论~"
android:textSize="@dimen/sp_14"
app:drawableStartCompat="@mipmap/icon_comment_left" />
<ImageView <ImageView
android:layout_marginEnd="6dp"
android:layout_gravity="center_vertical"
android:layout_width="@dimen/ease_chat_primary_menu_icon_size" android:layout_width="@dimen/ease_chat_primary_menu_icon_size"
android:layout_height="@dimen/ease_chat_primary_menu_icon_size" android:layout_height="@dimen/ease_chat_primary_menu_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginEnd="6dp"
android:padding="5dp"
android:scaleType="fitCenter" android:scaleType="fitCenter"
android:src="@mipmap/icon_emoji" android:src="@mipmap/icon_emoji"
android:padding="5dp"
android:visibility="visible" /> android:visibility="visible" />
<ImageView <ImageView
android:layout_gravity="center_vertical"
android:layout_width="@dimen/ease_chat_primary_menu_more_icon_size" android:layout_width="@dimen/ease_chat_primary_menu_more_icon_size"
android:layout_height="@dimen/ease_chat_primary_menu_more_icon_size" android:layout_height="@dimen/ease_chat_primary_menu_more_icon_size"
android:layout_gravity="center_vertical"
android:layout_marginRight="@dimen/ease_chat_primary_margin_right" android:layout_marginRight="@dimen/ease_chat_primary_margin_right"
android:background="@drawable/type_select_gift_btn" android:background="@drawable/type_select_gift_btn"
android:button="@null" android:button="@null"
android:visibility="visible" /> android:visibility="visible" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -5,40 +5,101 @@ ...@@ -5,40 +5,101 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical" android:orientation="vertical"
tools:background="@color/red"> tools:background="@color/color_F8F8F7">
<include <include
layout="@layout/layout_empty_no_data" layout="@layout/layout_empty_no_data"
android:visibility="gone" /> android:visibility="gone" />
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<com.flyco.tablayout.SlidingTabLayout
android:id="@+id/tabLayout_main" <LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:layout_marginStart="@dimen/dp_9"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_gravity="center" android:gravity="center_vertical"
android:background="@color/white" android:orientation="horizontal">
android:minHeight="@dimen/dp_50"
android:paddingTop="@dimen/dp_15" <ImageView
android:paddingEnd="@dimen/dp_10" android:layout_width="wrap_content"
app:tl_indicator_width="@dimen/dp_28" android:layout_height="wrap_content"
app:tl_select_textsize="@dimen/sp_20" android:src="@mipmap/icon_app_logo" />
app:tl_textBold="SELECT"
app:tl_textSelectColor="@color/black" <EditText
app:tl_textUnselectColor="@color/black" android:imeOptions="actionSearch"
app:tl_textsize="@dimen/sp_17" android:maxLines="1"
app:tl_indicator_color="@color/main_select" android:id="@+id/rl_search"
app:tl_indicator_height="@dimen/dp_3" android:layout_width="0dp"
app:tl_indicator_style="NORMAL" android:layout_height="@dimen/dp_29"
app:tl_indicator_margin_bottom="@dimen/dp_2" android:layout_marginStart="@dimen/dp_7"
app:tl_underline_color="@color/transparent" /> android:layout_weight="1"
android:background="@drawable/shape_main_search_live"
android:drawableStart="@mipmap/icon_main_search_icon"
<androidx.viewpager.widget.ViewPager android:drawablePadding="@dimen/dp_10"
android:hint="房间号/房间名/主播名"
android:textColorHint="@color/color_999999"
android:textColor="@color/black"
android:paddingStart="@dimen/dp_11"
android:paddingEnd="@dimen/dp_11"
android:textSize="@dimen/sp_12" />
<ImageView
android:id="@+id/iv_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_12"
android:src="@mipmap/icon_sign" />
</LinearLayout>
<LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:gravity="center_vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<com.flyco.tablayout.SlidingTabLayout
android:paddingTop="@dimen/dp_5"
android:layout_weight="1"
android:id="@+id/tabLayout_main"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:background="@color/transparent"
android:minHeight="37dp"
android:paddingEnd="@dimen/dp_10"
app:tl_indicator_color="@color/main_select"
app:tl_indicator_height="@dimen/dp_3"
app:tl_indicator_margin_bottom="@dimen/dp_2"
app:tl_indicator_style="NORMAL"
app:tl_indicator_width="@dimen/dp_14"
app:tl_select_textsize="@dimen/sp_20"
app:tl_textBold="SELECT"
app:tl_textSelectColor="@color/black"
app:tl_textUnselectColor="@color/black"
app:tl_textsize="@dimen/sp_15"
app:tl_underline_color="@color/transparent" />
<ImageView
android:id="@+id/iv_category"
android:layout_marginStart="@dimen/dp_12"
android:layout_marginEnd="@dimen/dp_12"
android:src="@mipmap/icon_main_category"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_main" android:id="@+id/vp_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
...@@ -28,10 +28,10 @@ ...@@ -28,10 +28,10 @@
app:layout_scrollFlags="scroll"> app:layout_scrollFlags="scroll">
<LinearLayout <LinearLayout
android:paddingTop="@dimen/dp_15" android:paddingTop="@dimen/dp_12"
android:paddingStart="@dimen/dp_15" android:paddingStart="@dimen/dp_12"
android:paddingEnd="@dimen/dp_15" android:paddingEnd="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12" android:paddingBottom="@dimen/dp_10"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:orientation="vertical"> android:orientation="vertical">
...@@ -39,11 +39,13 @@ ...@@ -39,11 +39,13 @@
<com.zhpan.bannerview.BannerViewPager <com.zhpan.bannerview.BannerViewPager
android:id="@+id/banner_view" android:id="@+id/banner_view"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="165dp" /> android:layout_height="125dp" />
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager"
android:layout_marginTop="@dimen/dp_20" android:orientation="horizontal"
tools:listitem="@layout/item_match_topl_live_new"
android:layout_marginTop="@dimen/dp_17"
android:id="@+id/mRecyclerView_top" android:id="@+id/mRecyclerView_top"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
...@@ -82,7 +84,7 @@ ...@@ -82,7 +84,7 @@
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_marginTop="@dimen/dp_12" android:layout_marginTop="19dp"
android:orientation="horizontal" android:orientation="horizontal"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content"> android:layout_height="wrap_content">
...@@ -96,11 +98,11 @@ ...@@ -96,11 +98,11 @@
<TextView <TextView
android:textStyle="bold" android:textStyle="bold"
android:textSize="@dimen/sp_16" android:textSize="@dimen/sp_15"
android:textColor="@color/black" android:textColor="@color/black"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:text="正在热播" /> android:text="热门直播" />
</LinearLayout> </LinearLayout>
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
app:srlEnableScrollContentWhenLoaded="true"> app:srlEnableScrollContentWhenLoaded="true">
<!-- elevation 高版本自带一个阴影,不需要去掉即可 --> <!-- elevation 高版本自带一个阴影,不需要去掉即可 -->
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
tools:itemCount="2"
tools:listitem="@layout/item_match_content"
android:id="@+id/mRecyclerView" android:id="@+id/mRecyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" /> android:layout_height="match_parent" />
......
...@@ -3,18 +3,61 @@ ...@@ -3,18 +3,61 @@
xmlns:app="http://schemas.android.com/apk/res-auto" 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"
android:orientation="vertical" android:orientation="vertical">
>
<include layout="@layout/layout_empty_no_data" <include
android:visibility="gone"/> layout="@layout/layout_empty_no_data"
android:visibility="gone" />
<LinearLayout <LinearLayout
android:background="@color/main_color_new"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingStart="@dimen/dp_9"
android:paddingTop="@dimen/dp_10"
android:background="@color/white"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@mipmap/icon_app_logo" />
<EditText
android:id="@+id/rl_search"
android:layout_width="0dp"
android:layout_height="@dimen/dp_29"
android:layout_marginStart="@dimen/dp_7"
android:layout_weight="1"
android:background="@drawable/shape_match_search_live"
android:drawableStart="@mipmap/icon_main_search_icon"
android:drawablePadding="@dimen/dp_10"
android:hint="房间号/房间名/主播名"
android:imeOptions="actionSearch"
android:maxLines="1"
android:paddingStart="@dimen/dp_11"
android:paddingEnd="@dimen/dp_11"
android:textColor="@color/black"
android:textColorHint="@color/color_999999"
android:textSize="@dimen/sp_12" />
<ImageView
android:id="@+id/iv_message"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp_13"
android:layout_marginEnd="@dimen/dp_12"
android:src="@mipmap/icon_sign" />
</LinearLayout>
<com.flyco.tablayout.SlidingTabLayout <com.flyco.tablayout.SlidingTabLayout
android:id="@+id/tabLayout_main" android:id="@+id/tabLayout_main"
android:layout_width="match_parent" android:layout_width="match_parent"
...@@ -22,21 +65,23 @@ ...@@ -22,21 +65,23 @@
android:layout_gravity="center" android:layout_gravity="center"
android:background="@color/white" android:background="@color/white"
android:minHeight="@dimen/dp_50" android:minHeight="@dimen/dp_50"
android:paddingStart="@dimen/dp_12"
android:paddingTop="@dimen/dp_15" android:paddingTop="@dimen/dp_15"
android:paddingEnd="@dimen/dp_10" android:paddingEnd="@dimen/dp_10"
app:tl_indicator_width="@dimen/dp_28" app:tl_indicator_color="@color/main_select"
app:tl_indicator_height="@dimen/dp_3"
app:tl_indicator_margin_bottom="@dimen/dp_2"
app:tl_indicator_style="NORMAL"
app:tl_indicator_width="@dimen/dp_14"
app:tl_select_textsize="@dimen/sp_20" app:tl_select_textsize="@dimen/sp_20"
app:tl_tab_width="55dp"
app:tl_textBold="SELECT" app:tl_textBold="SELECT"
app:tl_textSelectColor="@color/black" app:tl_textSelectColor="@color/black"
app:tl_textUnselectColor="@color/black" app:tl_textUnselectColor="@color/black"
app:tl_textsize="@dimen/sp_17" app:tl_textsize="@dimen/sp_15"
app:tl_indicator_color="@color/main_select"
app:tl_indicator_height="@dimen/dp_3"
app:tl_indicator_style="NORMAL"
app:tl_indicator_margin_bottom="@dimen/dp_2"
app:tl_underline_color="@color/transparent" /> app:tl_underline_color="@color/transparent" />
<androidx.viewpager.widget.ViewPager <androidx.viewpager2.widget.ViewPager2
android:id="@+id/vp_main" android:id="@+id/vp_main"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" /> android:layout_height="wrap_content" />
......
<?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"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
tools:background="@color/cardview_dark_background"> tools:background="@color/cardview_dark_background">
...@@ -9,34 +9,9 @@ ...@@ -9,34 +9,9 @@
<ImageView <ImageView
android:id="@+id/iv_actor" android:id="@+id/iv_actor"
android:layout_width="@dimen/dp_42" android:layout_width="@dimen/dp_15"
android:layout_height="@dimen/dp_42" android:layout_height="@dimen/dp_15"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginTop="@dimen/dp_10"
android:src="@mipmap/icon_default_avatar" /> android:src="@mipmap/icon_default_avatar" />
<ImageView
android:layout_marginTop="-10dp"
android:layout_centerInParent="true"
android:id="@+id/iv_live"
android:layout_below="@id/iv_actor"
android:src="@mipmap/icon_live_living_guest"
android:layout_width="27dp"
android:layout_height="@dimen/dp_12"/>
<TextView
android:layout_centerHorizontal="true"
android:layout_below="@id/iv_actor"
android:layout_gravity="center"
android:layout_marginTop="@dimen/dp_6"
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:singleLine="true"
android:maxWidth="@dimen/dp_42"
android:textColor="@color/movie_text"
android:textSize="@dimen/sp_10"
tools:text="乔曼乔曼乔曼乔曼乔曼" />
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
<?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="221dp"
android:layout_height="125dp"
android:orientation="vertical"
tools:background="@color/red">
<androidx.cardview.widget.CardView
android:layout_width="221dp"
android:layout_height="wrap_content"
app:cardCornerRadius="@dimen/dp_6"
app:cardElevation="0dp"
app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="false">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="match_parent"
android:layout_height="125dp"
android:scaleType="centerCrop" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_alignBottom="@id/iv_cover">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/bg_video_shadow" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginBottom="4dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_11"
tools:text="虎子聊球" />
<TextView
android:id="@+id/tv_hot_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="4dp"
android:drawablePadding="@dimen/dp_8"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:drawableStartCompat="@mipmap/icon_live_fire"
tools:text="69239" />
</RelativeLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout 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" xmlns:tools="http://schemas.android.com/tools"
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"
android:orientation="vertical" android:orientation="vertical"
tools:background="@color/white"> android:background="@color/color_F8F8F7">
<LinearLayout <LinearLayout
android:orientation="vertical"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
<LinearLayout android:orientation="vertical">
android:paddingStart="@dimen/dp_15"
android:background="#F6F7F8" <TextView
android:gravity="center" android:paddingStart="@dimen/dp_12"
android:orientation="horizontal" android:id="@+id/tv_title"
android:id="@+id/ll_more"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="48dp"> android:layout_height="@dimen/dp_32"
<TextView android:gravity="start|center_vertical"
android:id="@+id/tv_title" android:textColor="@color/normal_text_3"
android:textStyle="bold" android:textSize="@dimen/sp_12"
android:textSize="@dimen/sp_20" android:textStyle="bold"
android:textColor="@color/normal_text_3" tools:text="今天 02月 07日 星期一 " />
android:layout_weight="1"
android:gravity="start|center_vertical"
tools:text="今天"
android:layout_width="0dp"
android:layout_height="48dp"/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
tools:listitem="@layout/item_match_include_content_new"
android:layout_marginHorizontal="@dimen/dp_12"
android:background="@drawable/shape_match_content"
android:id="@+id/recycler_content" android:id="@+id/recycler_content"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent" />
android:layout_marginTop="@dimen/dp_5"
android:paddingBottom="@dimen/dp_5" />
<View
android:layout_marginTop="@dimen/dp_5"
android:background="@color/bg_normal"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_4"/>
</LinearLayout> </LinearLayout>
......
...@@ -6,76 +6,116 @@ ...@@ -6,76 +6,116 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
tools:background="@color/red"> tools:background="@color/red">
<ImageView
android:scaleType="centerCrop" <androidx.cardview.widget.CardView
android:id="@+id/iv_cover"
android:layout_width="match_parent"
android:layout_height="90dp" />
<RelativeLayout
android:layout_alignBottom="@id/iv_cover"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="25dp">
<ImageView
android:scaleType="fitXY"
android:src="@mipmap/bg_video_shadow"
android:layout_width="match_parent"
android:layout_height="match_parent"/>
<TextView
android:layout_marginStart="@dimen/dp_5"
android:layout_alignParentBottom="true"
android:layout_marginBottom="2dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:layout_alignParentStart="true"
android:id="@+id/tv_name"
tools:text="虎子聊球"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<TextView
android:layout_alignParentBottom="true"
android:layout_marginBottom="2dp"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_5"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
android:layout_alignParentEnd="true"
android:drawablePadding="@dimen/dp_5"
android:id="@+id/tv_hot_num"
tools:text="69239"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:drawableStartCompat="@mipmap/icon_live_fire" />
</RelativeLayout>
<ImageView
android:layout_marginStart="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:id="@+id/iv_live"
android:src="@mipmap/icon_live_living_gif"
android:layout_width="@dimen/dp_35"
android:layout_height="@dimen/dp_12"/>
<ImageView
android:layout_marginStart="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_5"
android:layout_toEndOf="@id/iv_live"
android:id="@+id/iv_recommend"
android:src="@mipmap/icon_live_recommend"
android:layout_width="38dp"
android:layout_height="@dimen/dp_15"/>
<TextView
android:layout_below="@id/iv_cover"
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_5" app:cardCornerRadius="@dimen/dp_6"
android:ellipsize="end" app:cardElevation="0dp"
android:maxLines="2" app:cardPreventCornerOverlap="false"
android:textColor="@color/black" app:cardUseCompatPadding="false">
android:textSize="@dimen/sp_12"
tools:text="月上重火·透芝夫妇" /> <RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<ImageView
android:id="@+id/iv_cover"
android:layout_width="match_parent"
android:layout_height="90dp"
android:scaleType="centerCrop" />
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_alignBottom="@id/iv_cover">
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitXY"
android:src="@mipmap/bg_video_shadow" />
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_alignParentBottom="true"
android:layout_marginStart="@dimen/dp_10"
android:layout_marginBottom="4dp"
android:textColor="@color/white"
android:textSize="@dimen/sp_11"
tools:text="虎子聊球" />
<TextView
android:id="@+id/tv_hot_num"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentEnd="true"
android:layout_alignParentBottom="true"
android:layout_centerVertical="true"
android:layout_marginEnd="@dimen/dp_10"
android:layout_marginBottom="4dp"
android:drawablePadding="@dimen/dp_8"
android:textColor="@color/white"
android:textSize="@dimen/sp_10"
app:drawableStartCompat="@mipmap/icon_live_fire"
tools:text="69239" />
</RelativeLayout>
<ImageView
android:id="@+id/iv_live"
android:layout_width="@dimen/dp_35"
android:layout_height="@dimen/dp_12"
android:layout_marginStart="@dimen/dp_5"
android:layout_marginTop="@dimen/dp_5"
android:src="@mipmap/icon_live_living_gif"
android:visibility="gone" />
<ImageView
android:id="@+id/iv_recommend"
android:layout_width="38dp"
android:layout_height="@dimen/dp_15"
android:layout_marginStart="@dimen/dp_3"
android:layout_marginTop="@dimen/dp_5"
android:layout_toEndOf="@id/iv_live"
android:src="@mipmap/icon_live_recommend"
android:visibility="gone" />
<TextView
android:id="@+id/tv_title"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/iv_cover"
android:layout_marginHorizontal="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_5"
android:ellipsize="end"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="@dimen/sp_13"
tools:text="月上重火·透芝夫妇" />
<TextView
android:id="@+id/tv_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/tv_title"
android:layout_marginHorizontal="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_7"
android:layout_marginBottom="@dimen/sp_11"
android:background="@drawable/shape_match_item"
android:paddingHorizontal="@dimen/dp_7"
android:paddingVertical="@dimen/dp_1"
android:textColor="#666666"
android:textSize="@dimen/sp_11"
tools:text="篮球" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
</RelativeLayout> </RelativeLayout>
\ No newline at end of file
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_gravity="center_horizontal" android:layout_gravity="center_horizontal"
app:cardCornerRadius="@dimen/dp_4" app:cardCornerRadius="@dimen/dp_4"
app:cardPreventCornerOverlap="true" app:cardPreventCornerOverlap="false"
app:cardUseCompatPadding="true"> app:cardUseCompatPadding="false">
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
......
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/tv_notice"
android:marqueeRepeatLimit="marquee_forever"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:padding="@dimen/dp_7"
android:textColor="@color/color_FC5057"
android:textSize="@dimen/sp_12"
tools:text="@string/string_movie_detail"
tools:showIn="@layout/fragment_live_conversation">
<requestFocus />
</TextView >
\ No newline at end of file
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
android:layout_height="match_parent" android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:orientation="vertical" android:orientation="vertical"
android:background="@color/main_background"> >
<LinearLayout <LinearLayout
android:orientation="vertical" android:orientation="vertical"
android:layout_width="wrap_content" android:layout_width="wrap_content"
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical" android:orientation="vertical"
xmlns:tools="http://schemas.android.com/tools"
android:paddingTop="2dip"> android:paddingTop="2dip">
<View <View
...@@ -22,12 +23,13 @@ ...@@ -22,12 +23,13 @@
android:paddingBottom="4dp"> android:paddingBottom="4dp">
<ImageView <ImageView
android:id="@+id/btn_set_mode_voice" android:id="@+id/btn_set_mode_voice"
style="@style/ease_chat_input_button_size" style="@style/ease_chat_input_button_size"
android:layout_marginLeft="16dp" android:layout_marginLeft="16dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
android:src="@mipmap/icon_block_show" android:src="@mipmap/icon_block_show"
android:visibility="visible" /> android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/btn_set_mode_keyboard" android:id="@+id/btn_set_mode_keyboard"
...@@ -68,7 +70,7 @@ ...@@ -68,7 +70,7 @@
android:id="@+id/edittext_layout" android:id="@+id/edittext_layout"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="6dp" android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="6dp" android:layout_marginRight="6dp"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:layout_weight="1" android:layout_weight="1"
...@@ -83,7 +85,7 @@ ...@@ -83,7 +85,7 @@
android:background="@drawable/ease_send_message_et_bg" android:background="@drawable/ease_send_message_et_bg"
android:focusableInTouchMode="true" android:focusableInTouchMode="true"
android:gravity="center_vertical" android:gravity="center_vertical"
android:hint="期待你的神评论" android:hint="说点有爱的评论~"
android:imeOptions="actionSend" android:imeOptions="actionSend"
android:maxLines="4" android:maxLines="4"
android:minHeight="32dp" android:minHeight="32dp"
...@@ -142,10 +144,11 @@ ...@@ -142,10 +144,11 @@
android:layout_marginEnd="@dimen/ease_chat_primary_margin_right" android:layout_marginEnd="@dimen/ease_chat_primary_margin_right"
android:layout_marginRight="@dimen/ease_chat_primary_margin_right" android:layout_marginRight="@dimen/ease_chat_primary_margin_right"
android:layout_marginBottom="6dp" android:layout_marginBottom="6dp"
android:background="@drawable/ease_chat_send_btn_selector" android:background="@drawable/send_btn_selector"
android:text="@string/button_send" android:text="@string/button_send"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:textSize="13sp"
tools:visibility="visible"
android:visibility="gone" /> android:visibility="gone" />
</FrameLayout> </FrameLayout>
......
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