Merge remote-tracking branch 'origin/master'

This commit is contained in:
18142669586 2022-08-31 16:57:36 +08:00
commit 6f7aef12af
59 changed files with 568 additions and 401 deletions

View File

@ -111,6 +111,15 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
mFooter.setTextSizeTitle(14); mFooter.setTextSizeTitle(14);
} }
/**
* 设置头部字体颜色
*
* @param textColor
*/
public void setHeaderTextColor(int textColor) {
mHeader.setAccentColor(textColor);
}
private HttpCallback mRefreshCallback = new HttpCallback() { private HttpCallback mRefreshCallback = new HttpCallback() {
private int mDataCount; private int mDataCount;
@ -295,7 +304,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
* 手动设置没有更多数据 * 手动设置没有更多数据
* 因为日榜/周榜接口没有分页参数会导致一直读取重复数据 * 因为日榜/周榜接口没有分页参数会导致一直读取重复数据
*/ */
public void setNotLoadMore(){ public void setNotLoadMore() {
mSmartRefreshLayout.finishLoadMoreWithNoMoreData(); mSmartRefreshLayout.finishLoadMoreWithNoMoreData();
} }

View File

@ -4,6 +4,8 @@ import android.content.res.Resources;
import com.yunbao.common.CommonAppContext; import com.yunbao.common.CommonAppContext;
import java.util.Locale;
/** /**
* Created by cxf on 2017/10/10. * Created by cxf on 2017/10/10.
* 获取string.xml中的字 * 获取string.xml中的字
@ -20,4 +22,10 @@ public class WordUtil {
public static String getString(int res) { public static String getString(int res) {
return sResources.getString(res); return sResources.getString(res);
} }
public static boolean isZh() {
Locale locale = sResources.getConfiguration().locale;
String language = locale.getLanguage();
return language.endsWith("zh");
}
} }

View File

@ -21,12 +21,17 @@
<ImageView <ImageView
android:id="@+id/live_type" android:id="@+id/live_type"
android:layout_width="46dp" android:layout_width="wrap_content"
android:layout_height="18dp" android:layout_height="wrap_content"
android:layout_margin="4dp" android:layout_margin="4dp"
android:scaleType="centerCrop"
android:gravity="center" /> android:gravity="center" />
<View
android:layout_width="match_parent"
android:layout_height="25dp"
android:layout_gravity="bottom"
android:background="@mipmap/bg_main_item_bottom" />
<TextView <TextView
android:id="@+id/name" android:id="@+id/name"
android:layout_width="wrap_content" android:layout_width="wrap_content"

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -76,7 +76,6 @@
<string name="completing_mission">completing mission</string> <string name="completing_mission">completing mission</string>
<string name="apply_for_lianmai">ApplyMic</string> <string name="apply_for_lianmai">ApplyMic</string>
<string name="cancel_application">Cancel Mic</string> <string name="cancel_application">Cancel Mic</string>
<string name="quit_mic">Quit Mic</string> <string name="quit_mic">Quit Mic</string>
@ -172,7 +171,7 @@
<string name="only_one">Only one can be given away~</string> <string name="only_one">Only one can be given away~</string>
<string name="guard_guard">Guard</string> <string name="guard_guard">Guard</string>
<string name="guard_week_con">Contribution this week</string> <string name="guard_week_con">Contribution this week</string>
<string name="guard_no_data">Become the girst Guard of he/she</string> <string name="guard_no_data">anchor are waiting at your guard!</string>
<string name="guard_tip_0">Let\'s open up a guard for our favorite anchor</string> <string name="guard_tip_0">Let\'s open up a guard for our favorite anchor</string>
<string name="guard_tip_1">You are the current anchor\'s monthly guard \ n the guard date expires</string> <string name="guard_tip_1">You are the current anchor\'s monthly guard \ n the guard date expires</string>
<string name="guard_tip_2">You are the current anchor\'s annual guardian \ n the guardian date expires</string> <string name="guard_tip_2">You are the current anchor\'s annual guardian \ n the guardian date expires</string>
@ -286,7 +285,7 @@
<string name="live_zg">Tricky</string> <string name="live_zg">Tricky</string>
<string name="live_dr">MultiplayerPK</string> <string name="live_dr">MultiplayerPK</string>
<string name="live_mic">LianmaiVoice</string> <string name="live_mic">LianmaiVoice</string>
<string name="live_wks">ZhouXingbang</string> <string name="live_wks">Start</string>
<string name="live_zslk">LeaveTemporarily</string> <string name="live_zslk">LeaveTemporarily</string>
<string name="live_zslk1">ResumeLive</string> <string name="live_zslk1">ResumeLive</string>
<string name="live_flash">Flash lamp</string> <string name="live_flash">Flash lamp</string>
@ -306,7 +305,7 @@
<string name="live_votes">Harvest</string> <string name="live_votes">Harvest</string>
<string name="live_watch_num">Number of visitors</string> <string name="live_watch_num">Number of visitors</string>
<string name="live_end_ing">Guan Zhong</string> <string name="live_end_ing">Guan Zhong</string>
<string name="live_say_something">Tell you something</string> <string name="live_say_something">Let\'s have a chat~</string>
<string name="live_open_alba">Open the barrage,</string> <string name="live_open_alba">Open the barrage,</string>
<string name="live_tiao">strip</string> <string name="live_tiao">strip</string>
<string name="live_input_password">Please enter the room password</string> <string name="live_input_password">Please enter the room password</string>
@ -372,7 +371,7 @@
<string name="live_choose_live_class">Please select a channel</string> <string name="live_choose_live_class">Please select a channel</string>
<string name="live_follow_anchor">Focus on the anchor</string> <string name="live_follow_anchor">Focus on the anchor</string>
<string name="live_report">Are you sure to report?</string> <string name="live_report">Are you sure to report?</string>
<string name="live_link_mic_2">Interaction between wheat and wheat</string> <string name="live_link_mic_2">Interaction</string>
<string name="live_link_mic_3">End Lian Mai</string> <string name="live_link_mic_3">End Lian Mai</string>
<string name="live_link_mic_4">Allowed even wheat</string> <string name="live_link_mic_4">Allowed even wheat</string>
<string name="live_link_mic_5">Ban Lian Mai</string> <string name="live_link_mic_5">Ban Lian Mai</string>
@ -861,5 +860,13 @@ Limited ride And limited avatar frame</string>
<string name="anchor">anchor</string> <string name="anchor">anchor</string>
<string name="anchor_more">More</string> <string name="anchor_more">More</string>
<string name="wonderful_live">Wonderful live</string> <string name="wonderful_live">Wonderful live</string>
<string name="recommended_for_you">recommended for you</string> <string name="recommended_for_you">More</string>
<string name="fun_games">Fun Games</string>
<string name="value_added_benefits">Value-added benefits</string>
<string name="fan_club">Fan Club</string>
<string name="activity_center">Activity</string>
<string name="basic_tools">Basic tools</string>
<string name="effects_settings">Effect settings</string>
<string name="shield_gift_effect">Shield gift effect</string>
<string name="shield_mount_effect">Shield car effect</string>
</resources> </resources>

View File

@ -123,7 +123,7 @@
<string name="guard_guard">守護</string> <string name="guard_guard">守護</string>
<string name="guard_week_con">本周貢獻</string> <string name="guard_week_con">本周貢獻</string>
<string name="guard_no_data">主播正在等待您成為TA的守護為TA保駕護航</string> <string name="guard_no_data">主播正在等待您的守護!</string>
<string name="guard_tip_0">快去為喜歡的主播開通守護吧</string> <string name="guard_tip_0">快去為喜歡的主播開通守護吧</string>
<string name="guard_tip_1">您是當前主播的月守護\n守護日期截止到</string> <string name="guard_tip_1">您是當前主播的月守護\n守護日期截止到</string>
<string name="guard_tip_2">您是當前主播的年守護\n守護日期截止到</string> <string name="guard_tip_2">您是當前主播的年守護\n守護日期截止到</string>
@ -243,7 +243,7 @@
<string name="live_votes">收穫</string> <string name="live_votes">收穫</string>
<string name="live_watch_num">觀看人數</string> <string name="live_watch_num">觀看人數</string>
<string name="live_end_ing">關播中</string> <string name="live_end_ing">關播中</string>
<string name="live_say_something">和大家說點什麼…</string> <string name="live_say_something">一起来聊聊天吧~</string>
<string name="live_open_alba">開啟彈幕,</string> <string name="live_open_alba">開啟彈幕,</string>
<string name="live_tiao"></string> <string name="live_tiao"></string>
<string name="live_input_password">請輸入房間密碼</string> <string name="live_input_password">請輸入房間密碼</string>
@ -875,11 +875,11 @@
<string name="wonderful_live">精彩直播</string> <string name="wonderful_live">精彩直播</string>
<string name="recommended_for_you">為您推薦</string> <string name="recommended_for_you">為您推薦</string>
<string name="fun_games">趣味游戏</string> <string name="fun_games">趣味游戏</string>
<string name="value_added_benefits">增值</string> <string name="value_added_benefits">增值</string>
<string name="fan_club">粉絲團</string> <string name="fan_club">粉絲團</string>
<string name="activity_center">活動中心</string> <string name="activity_center">活動中心</string>
<string name="basic_tools">工具</string> <string name="basic_tools">工具</string>
<string name="effects_settings">特效設置</string> <string name="effects_settings">特效設置</string>
<string name="shield_gift_effect">屏蔽物特效</string> <string name="shield_gift_effect">屏蔽物特效</string>
<string name="shield_mount_effect">屏蔽坐骑特效</string> <string name="shield_mount_effect">屏蔽座駕特效</string>
</resources> </resources>

View File

@ -35,6 +35,7 @@ import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil; import com.yunbao.common.utils.WordUtil;
import com.yunbao.common.utils.formatBigNum; import com.yunbao.common.utils.formatBigNum;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.live.bean.LiveBean; import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.bean.LiveBuyGuardMsgBean; import com.yunbao.live.bean.LiveBuyGuardMsgBean;
import com.yunbao.live.bean.LiveChatBean; import com.yunbao.live.bean.LiveChatBean;
@ -86,6 +87,7 @@ 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;
import java.util.Arrays;
import java.util.HashSet; import java.util.HashSet;
import java.util.List; import java.util.List;
@ -276,9 +278,9 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
mLiveLinkMicPresenter.onAudienceLeaveRoom(bean); mLiveLinkMicPresenter.onAudienceLeaveRoom(bean);
} }
try { try {
if (mLiveRoomViewHolder!=null) { if (mLiveRoomViewHolder != null) {
if (!"".equals(bean.getHot_num()) && !"0".equals(bean.getHot_num())) { if (!"".equals(bean.getHot_num()) && !"0".equals(bean.getHot_num())) {
// mLiveRoomViewHolder.room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num())); // mLiveRoomViewHolder.room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
mLiveRoomViewHolder.setHotData(formatBigNum.formatBigNum(bean.getHot_num())); mLiveRoomViewHolder.setHotData(formatBigNum.formatBigNum(bean.getHot_num()));
} }
} }
@ -331,7 +333,6 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
} }
@Override @Override
public void onBuyLiangName(LiveReceiveGiftBean bean) { public void onBuyLiangName(LiveReceiveGiftBean bean) {
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
@ -503,8 +504,8 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
} }
@Override @Override
public void onHourRank(LiveChatBean bean,JSONObject ranks) { public void onHourRank(LiveChatBean bean, JSONObject ranks) {
if(mLiveRoomViewHolder!=null){ if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setHourRankData(ranks.getInteger(mLiveUid)); mLiveRoomViewHolder.setHourRankData(ranks.getInteger(mLiveUid));
} }
} }
@ -1261,17 +1262,30 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
} }
/** /**
* 守护列表弹窗 * 守护列表弹窗
*/ */
public void openNewGuardListWindow() { public void openNewGuardListWindow() {
LiveNewGuardListDialogFragment fragment = new LiveNewGuardListDialogFragment(); LiveHttpUtil.getGuardList(mLiveUid, 1, new HttpCallback() {
fragment.setLiveGuardInfo(mLiveGuardInfo); @Override
Bundle bundle = new Bundle(); public void onSuccess(int code, String msg, String[] info) {
bundle.putString(Constants.LIVE_UID, mLiveUid); List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
bundle.putBoolean(Constants.ANCHOR, mIsAnchor); if(list.isEmpty()){
fragment.setArguments(bundle); openNewBuyGuardWindow();
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment"); }else {
LiveNewGuardListDialogFragment fragment = new LiveNewGuardListDialogFragment();
fragment.setList(list);
fragment.setLiveGuardInfo(mLiveGuardInfo);
Bundle bundle = new Bundle();
bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putBoolean(Constants.ANCHOR, mIsAnchor);
fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardDialogFragment");
}
}
});
} }
/** /**
@ -1337,11 +1351,12 @@ public abstract class LiveActivity extends AbsActivity implements SocketMessageL
bundle.putString(Constants.LIVE_UID, mLiveUid); bundle.putString(Constants.LIVE_UID, mLiveUid);
bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName); bundle.putString(Constants.LIVE_ANCHER_NAME, mAncherName);
bundle.putString(Constants.STREAM, mStream); bundle.putString(Constants.STREAM, mStream);
bundle.putString(Constants.LIVE_ANCHER_ICON,mAncherIcon); bundle.putString(Constants.LIVE_ANCHER_ICON, mAncherIcon);
bundle.putString(Constants.USER_ICON,CommonAppConfig.getInstance().getUserBean().getAvatar()); bundle.putString(Constants.USER_ICON, CommonAppConfig.getInstance().getUserBean().getAvatar());
fragment.setArguments(bundle); fragment.setArguments(bundle);
fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment"); fragment.show(getSupportFragmentManager(), "LiveGuardBuyDialogFragment");
} }
/** /**
* 打开购买守护的弹窗 * 打开购买守护的弹窗
*/ */

View File

@ -109,6 +109,8 @@ public class LiveAudienceActivity extends LiveActivity {
private ViewGroup mViewGroup; private ViewGroup mViewGroup;
private int liveBg = 0; private int liveBg = 0;
//直播间进入房间队列
private Handler liveHandler = new Handler();
@Override @Override
@ -246,14 +248,36 @@ public class LiveAudienceActivity extends LiveActivity {
private void loadData(ViewGroup viewGroup, int currentItem) { private void loadData(ViewGroup viewGroup, int currentItem) {
mViewGroup = viewGroup; mViewGroup = viewGroup;
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
//获取直播间状态
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
mLastPosition = currentItem; mLastPosition = currentItem;
liveHandler.removeCallbacks(liveRunnable);
if (mCurrentPage > 0) {
liveHandler.postDelayed(liveRunnable, 800);
} else {
liveHandler.post(liveRunnable);
}
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
//加载当前页面数据
View rootView = manager.getRootView();
if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {
((ViewGroup) (rootView.getParent())).removeView(rootView);
manager.onRemove();
}
mViewGroup.addView(manager.getRootView());
} }
//获取直播间状态
private Runnable liveRunnable = new Runnable() {
@Override
public void run() {
AnchorRecommendItemModel data = itemModelList.get(mCurrentPage);
//获取直播间状态
LiveHttpUtil.getLiveInfo(data.getUid(), liveInfo);
}
};
/** /**
* 获取直播间状态 * 获取直播间状态
*/ */
@ -272,20 +296,13 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveType = liveType; mLiveType = liveType;
mLiveTypeVal = liveTypeVal; mLiveTypeVal = liveTypeVal;
mLiveBean = liveBean1; mLiveBean = liveBean1;
mLiveUid = mLiveBean.getUid(); mLiveUid = liveBean1.getUid();
mStream = mLiveBean.getStream(); mStream = liveBean1.getStream();
mAncherName = liveBean.getUserNiceName(); mAncherName = liveBean1.getUserNiceName();
mAncherIcon = liveBean.getAvatar(); mAncherIcon = liveBean1.getAvatar();
Log.e("收到socket--->", "mLiveUid--------------------------->" + mLiveUid);
//加载当前页面数据 manager.onAdd(liveBean1, liveType, liveTypeVal, liveSdk);
View rootView = manager.getRootView();
if (rootView.getParent() != null && rootView.getParent() instanceof ViewGroup) {
((ViewGroup) (rootView.getParent())).removeView(rootView);
manager.onRemove();
}
mViewGroup.addView(manager.getRootView());
manager.onAdd(liveBean, liveType, liveTypeVal, liveSdk);
}); });
@ -433,7 +450,7 @@ public class LiveAudienceActivity extends LiveActivity {
* 退出直播间 * 退出直播间
*/ */
public void exitLiveRoom() { public void exitLiveRoom() {
manager.exitLiveRoom(); onBackPressed();
} }
@ -602,8 +619,6 @@ public class LiveAudienceActivity extends LiveActivity {
bundle.putInt("LiveBg", liveBg); bundle.putInt("LiveBg", liveBg);
sidebarLiveAudience.setArguments(bundle); sidebarLiveAudience.setArguments(bundle);
sidebarLiveAudience.show(getSupportFragmentManager(), "SidebarLiveAudience"); sidebarLiveAudience.show(getSupportFragmentManager(), "SidebarLiveAudience");
// manager.openDrawer();
break; break;
case BOTTOM_COLLECTION: case BOTTOM_COLLECTION:
LiveTotalDialog liveTotalDialog = new LiveTotalDialog(); LiveTotalDialog liveTotalDialog = new LiveTotalDialog();
@ -726,6 +741,10 @@ public class LiveAudienceActivity extends LiveActivity {
mLiveGuardInfo : event.getParametersModel().getmLiveGuardInfo(); mLiveGuardInfo : event.getParametersModel().getmLiveGuardInfo();
liveBg = TextUtils.equals(String.valueOf(liveBg), String.valueOf(event.getParametersModel().getLiveBg())) ? liveBg = TextUtils.equals(String.valueOf(liveBg), String.valueOf(event.getParametersModel().getLiveBg())) ?
liveBg : event.getParametersModel().getLiveBg(); liveBg : event.getParametersModel().getLiveBg();
is_fans = TextUtils.equals(String.valueOf(is_fans), String.valueOf(event.getParametersModel().getIs_fans())) ?
is_fans : event.getParametersModel().getIs_fans();
fansNum = TextUtils.equals(String.valueOf(fansNum), String.valueOf(event.getParametersModel().getFansNum())) ?
fansNum : event.getParametersModel().getFansNum();
break; break;
case ACTIVITY_CENTER://活动中心 case ACTIVITY_CENTER://活动中心
String url = CommonAppConfig.HOST + "/h5/live/hallOfFame/index.html?g=Appapi&m=Turntable&a=tricky"; String url = CommonAppConfig.HOST + "/h5/live/hallOfFame/index.html?g=Appapi&m=Turntable&a=tricky";

View File

@ -16,6 +16,26 @@ public class OpenParametersModel extends BaseModel {
private int mLiveTypeVal = 0; private int mLiveTypeVal = 0;
private LiveGuardInfo mLiveGuardInfo = null; private LiveGuardInfo mLiveGuardInfo = null;
private int liveBg = 0; private int liveBg = 0;
private int fansNum;
private String is_fans;
public int getFansNum() {
return fansNum;
}
public OpenParametersModel setFansNum(int fansNum) {
this.fansNum = fansNum;
return this;
}
public String getIs_fans() {
return is_fans;
}
public OpenParametersModel setIs_fans(String is_fans) {
this.is_fans = is_fans;
return this;
}
public int getLiveBg() { public int getLiveBg() {
return liveBg; return liveBg;

View File

@ -37,7 +37,7 @@ public class RightGradual extends RecyclerView.ItemDecoration {
float right=parent.getRight(); float right=parent.getRight();
float bottom=parent.getBottom(); float bottom=parent.getBottom();
if(mLinearGradient==null){ if(mLinearGradient==null){
mLinearGradient=new LinearGradient(parent.getMeasuredWidth(), 0.0f, 0.0f, 0.0f, new int[]{0, Color.BLACK}, new float[]{0.0f,0.2f}, Shader.TileMode.CLAMP); mLinearGradient=new LinearGradient(parent.getMeasuredWidth(), 0.0f, 0.0f, 0.0f, new int[]{0, Color.BLACK}, new float[]{0.0f,0.4f}, Shader.TileMode.CLAMP);
} }
mPaint.setXfermode(mXfermode); mPaint.setXfermode(mXfermode);
mPaint.setShader(mLinearGradient); mPaint.setShader(mLinearGradient);

View File

@ -4,6 +4,7 @@ import static com.yunbao.common.CommonAppContext.logger;
import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics; import static com.yunbao.common.CommonAppContext.mFirebaseAnalytics;
import static com.yunbao.common.utils.RouteUtil.PATH_COIN; import static com.yunbao.common.utils.RouteUtil.PATH_COIN;
import android.content.Intent;
import android.graphics.Color; import android.graphics.Color;
import android.os.Build; import android.os.Build;
import android.os.Bundle; import android.os.Bundle;
@ -25,19 +26,28 @@ import android.widget.LinearLayout;
import com.adjust.sdk.Adjust; import com.adjust.sdk.Adjust;
import com.adjust.sdk.AdjustEvent; import com.adjust.sdk.AdjustEvent;
import com.alibaba.android.arouter.launcher.ARouter; import com.alibaba.android.arouter.launcher.ARouter;
import com.alibaba.fastjson.JSON;
import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.bean.JsWishBean; import com.yunbao.common.bean.JsWishBean;
import com.yunbao.common.dialog.AbsDialogFragment; import com.yunbao.common.dialog.AbsDialogFragment;
import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.utils.L; import com.yunbao.common.utils.L;
import com.yunbao.common.utils.RouteUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.activity.LiveActivity; import com.yunbao.live.activity.LiveActivity;
import com.yunbao.live.activity.LiveAudienceActivity; import com.yunbao.live.activity.LiveAudienceActivity;
import com.yunbao.live.activity.ZhuangBanActivity;
import com.yunbao.live.bean.LiveBean;
import com.yunbao.live.http.LiveHttpUtil;
import com.yunbao.live.presenter.LiveRoomCheckLivePresenter;
public class LiveHDDialogFragment extends AbsDialogFragment { public class LiveHDDialogFragment extends AbsDialogFragment {
private WebView mWebView; private WebView mWebView;
private int showType = 0; private int showType = 0;
private boolean isFullWindow=false; private boolean isFullWindow=false;
private String roomId;
public LiveHDDialogFragment() { public LiveHDDialogFragment() {
@ -136,6 +146,7 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
if (bundle == null) { if (bundle == null) {
return; return;
} }
roomId=bundle.getString("roomId",null);
mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口 mWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true); // 是否允许JS打开新窗口
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); mWebView.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW);
@ -217,6 +228,56 @@ public class LiveHDDialogFragment extends AbsDialogFragment {
public void androidGoBack(){ public void androidGoBack(){
dismiss(); dismiss();
} }
@JavascriptInterface
public void androidMethodLookToLive(String liveId) {
//看直播
gotoLive(liveId);
}
@JavascriptInterface
public void androidClickToNewH5PageView(String url){
url = CommonAppConfig.HOST + url;
url += "?uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken();
Log.i("tag", url);
Intent intent = new Intent(mContext, ZhuangBanActivity.class);
intent.putExtra("url", url);
intent.putExtra("isFull", false);
mContext.startActivity(intent);
}
}
private LiveRoomCheckLivePresenter mCheckLivePresenter;
private void gotoLive(final String live_id) {
if(roomId!=null&&roomId.equals(live_id)){
return;
}
LiveHttpUtil.getLiveInfo(live_id, new HttpCallback() {
@Override
public void onSuccess(int code, String msg, String[] info) {
if (code == 0 && info.length > 0) {
LiveBean liveBean = JSON.parseObject(info[0], LiveBean.class);
LiveRoomCheckLivePresenter.isRoom = false;
if (mCheckLivePresenter == null) {
mCheckLivePresenter = new LiveRoomCheckLivePresenter(mContext, new LiveRoomCheckLivePresenter.ActionListener() {
@Override
public void onLiveRoomChanged(LiveBean liveBean, int liveType, int liveTypeVal, int liveSdk) {
if (liveBean == null) {
return;
}
((LiveAudienceActivity) mContext).finish();
LiveAudienceActivity.forward(mContext, liveBean, liveType, liveTypeVal, "", 0, liveSdk);
}
});
}
mCheckLivePresenter.checkLive(liveBean);
} else {
RouteUtil.forwardUserHome(mContext, live_id, 0);
}
}
});
} }
/** /**

View File

@ -239,10 +239,12 @@ public class LiveNewGuardBuyDialogFragment extends AbsDialogFragment implements
bean.setChecked(false); bean.setChecked(false);
} }
for (int i : guardBuyBean.getPrivilege()) { for (int i : guardBuyBean.getPrivilege()) {
mRightList.get(i).setChecked(true); if(i<mRightList.size()) {
mRightList.get(i).setChecked(true);
}
} }
mGuardRightAdapter.notifyDataSetChanged(); mGuardRightAdapter.notifyDataSetChanged();
mBtnBuy.setEnabled(mCoinVal >= guardBuyBean.getCoin()); // mBtnBuy.setEnabled(mCoinVal >= guardBuyBean.getCoin());
} }
} }

View File

@ -34,6 +34,7 @@ import com.yunbao.live.bean.GuardUserBean;
import com.yunbao.live.bean.LiveGuardInfo; import com.yunbao.live.bean.LiveGuardInfo;
import com.yunbao.live.http.LiveHttpUtil; import com.yunbao.live.http.LiveHttpUtil;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
@ -52,6 +53,7 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
private LiveGuardInfo mLiveGuardInfo; private LiveGuardInfo mLiveGuardInfo;
private String mLiveUid; private String mLiveUid;
private boolean mIsAnchor;//是否是主播 private boolean mIsAnchor;//是否是主播
private List<GuardUserBean> list=new ArrayList<>();
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
@ -112,6 +114,9 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
private void initView() { private void initView() {
mRefreshView.setEmptyLayoutId(mIsAnchor ? R.layout.view_no_data_guard_anc : R.layout.view_no_data_guard_aud); mRefreshView.setEmptyLayoutId(mIsAnchor ? R.layout.view_no_data_guard_anc : R.layout.view_no_data_guard_aud);
mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false)); mRefreshView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false));
mGuardAdapter = new GuardAdapter(mContext, true, false);
mGuardAdapter.setList(list);
setAdapterData();
mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GuardUserBean>() { mRefreshView.setDataHelper(new CommonRefreshView.DataHelper<GuardUserBean>() {
@Override @Override
public RefreshAdapter<GuardUserBean> getAdapter() { public RefreshAdapter<GuardUserBean> getAdapter() {
@ -129,36 +134,9 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
@Override @Override
public List<GuardUserBean> processData(String[] info) { public List<GuardUserBean> processData(String[] info) {
List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class); List<GuardUserBean> list = JSON.parseArray(Arrays.toString(info), GuardUserBean.class);
if (list.isEmpty()) { if(!list.isEmpty()){
userLayout.setVisibility(View.INVISIBLE); LiveNewGuardListDialogFragment.this.list=list;
}else { setAdapterData();
GuardUserBean bean = list.get(0);
giftSvga.setImageResource(R.drawable.guardian_img_wings_p);
ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
guardIcon.setVisibility(View.VISIBLE);
userName.setText(bean.getUserNiceName());
String guardString = WordUtil.getString(R.string.guard_week_con);
userGuard.setText(guardString + " " + bean.getContribute());
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), userLevel);
}
}
if (mLiveGuardInfo != null) {
int guardType = mLiveGuardInfo.getMyGuardType();
if (guardType == Constants.GUARD_TYPE_NONE) {
tip1.setText(R.string.guard_tip_0);
} else if (guardType == Constants.GUARD_TYPE_DAY) {
tip1.setText(WordUtil.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
} else if (guardType == Constants.GUARD_TYPE_MONTH) {
tip1.setText(WordUtil.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
} else if (guardType == Constants.GUARD_TYPE_YEAR) {
tip1.setText(WordUtil.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
}
} }
return list; return list;
} }
@ -183,7 +161,8 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
} }
}); });
mRefreshView.initData(); mRefreshView.setRecyclerViewAdapter(mGuardAdapter);
mGuardAdapter.notifyDataSetChanged();
} }
@Override @Override
@ -198,4 +177,40 @@ public class LiveNewGuardListDialogFragment extends AbsDialogFragment implements
initView(); initView();
return show; return show;
} }
private void setAdapterData(){
if (list.isEmpty()) {
userLayout.setVisibility(View.INVISIBLE);
}else {
GuardUserBean bean = list.get(0);
giftSvga.setImageResource(R.drawable.guardian_img_wings_p);
ImgLoader.display(mContext, bean.getAvatar(), guardIcon);
guardIcon.setVisibility(View.VISIBLE);
userName.setText(bean.getUserNiceName());
String guardString = WordUtil.getString(R.string.guard_week_con);
userGuard.setText(guardString + " " + bean.getContribute());
userSex.setImageResource(CommonIconUtil.getSexIcon(bean.getSex()));
LevelBean levelBean = CommonAppConfig.getInstance().getLevel(bean.getLevel());
if (levelBean != null) {
ImgLoader.display(mContext, levelBean.getThumb(), userLevel);
}
}
if (mLiveGuardInfo != null) {
int guardType = mLiveGuardInfo.getMyGuardType();
if (guardType == Constants.GUARD_TYPE_NONE) {
tip1.setText(R.string.guard_tip_0);
} else if (guardType == Constants.GUARD_TYPE_DAY) {
tip1.setText(WordUtil.getString(R.string.guard_tip_day) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
} else if (guardType == Constants.GUARD_TYPE_MONTH) {
tip1.setText(WordUtil.getString(R.string.guard_tip_1) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
} else if (guardType == Constants.GUARD_TYPE_YEAR) {
tip1.setText(WordUtil.getString(R.string.guard_tip_2) + mLiveGuardInfo.getMyGuardEndTime());
mBtnBuy.setText(R.string.guard_buy_3);
}
}
}
public void setList(List<GuardUserBean> list) {
this.list=list;
}
} }

View File

@ -14,6 +14,7 @@ import android.widget.RelativeLayout;
import android.widget.TextView; import android.widget.TextView;
import androidx.annotation.Nullable; import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;
import androidx.recyclerview.widget.LinearLayoutManager; import androidx.recyclerview.widget.LinearLayoutManager;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
@ -58,6 +59,8 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
public TextView audience_btn, guard_btn, fans_btn, tags, btn, gz_view, dayRank, weekRank,title; public TextView audience_btn, guard_btn, fans_btn, tags, btn, gz_view, dayRank, weekRank,title;
private LinearLayout tabs; private LinearLayout tabs;
private ConstraintLayout noMoreLayout;
private TextView noMoreText;
private RelativeLayout bottom_msg;//底部信息的布局在榜单列表下不需要显示底部信息 private RelativeLayout bottom_msg;//底部信息的布局在榜单列表下不需要显示底部信息
private String Tips = "1"; private String Tips = "1";
private String type = "guanzhong"; private String type = "guanzhong";
@ -135,6 +138,8 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
dayRank = mRootView.findViewById(R.id.day_rank_btn);//日榜 dayRank = mRootView.findViewById(R.id.day_rank_btn);//日榜
weekRank = mRootView.findViewById(R.id.week_rank_btn);//周榜 weekRank = mRootView.findViewById(R.id.week_rank_btn);//周榜
gz_view = mRootView.findViewById(R.id.gz_view); gz_view = mRootView.findViewById(R.id.gz_view);
noMoreLayout = mRootView.findViewById(R.id.no_more_layout);
noMoreText = mRootView.findViewById(R.id.no_more_text);
btn.setOnClickListener(new View.OnClickListener() { btn.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View view) { public void onClick(View view) {
@ -233,7 +238,7 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
LiveHttpUtil.getUserList(mLiveUid, stream, type, p, callback); LiveHttpUtil.getUserList(mLiveUid, stream, type, p, callback);
pg = p; pg = p;
if (p == 1) { if (p == 1) {
no_more.setVisibility(View.VISIBLE); noMoreLayout.setVisibility(View.VISIBLE);
mRefreshView.setVisibility(View.GONE); mRefreshView.setVisibility(View.GONE);
} }
} }
@ -290,14 +295,14 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
userMoreInfoAdapter.num = nums; userMoreInfoAdapter.num = nums;
mRefreshView.mRecyclerView.getRecycledViewPool().setMaxRecycledViews(0, data.size()); mRefreshView.mRecyclerView.getRecycledViewPool().setMaxRecycledViews(0, data.size());
mRefreshView.setVisibility(View.VISIBLE); mRefreshView.setVisibility(View.VISIBLE);
no_more.setVisibility(View.GONE); noMoreLayout.setVisibility(View.GONE);
} }
return data; return data;
} }
private List<LiveUserRankBean> processRankData(JSONObject json){ private List<LiveUserRankBean> processRankData(JSONObject json){
JSONArray rank=Integer.parseInt(Tips)==4?json.getJSONArray("listDay"):json.getJSONArray("listWeek"); JSONArray rank=Integer.parseInt(Tips)==4?json.getJSONArray("listDay"):json.getJSONArray("listWeek");
List<LiveUserRankBean> data =new ArrayList<>(); List<LiveUserRankBean> data =new ArrayList<>();
/** /*
* 由于在线观众和粉丝列表实体结构与榜单结构不一致做个兼容操作 * 由于在线观众和粉丝列表实体结构与榜单结构不一致做个兼容操作
*/ */
if(rank==null){ if(rank==null){
@ -310,9 +315,10 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
data.add(bean); data.add(bean);
} }
if(data.size()==0){ if(data.size()==0){
no_more.setVisibility(View.VISIBLE); noMoreLayout.setVisibility(View.VISIBLE);
mRefreshView.setVisibility(View.GONE);
}else{ }else{
no_more.setVisibility(View.GONE); noMoreLayout.setVisibility(View.GONE);
} }
mRefreshView.setNotLoadMore(); mRefreshView.setNotLoadMore();
return data; return data;
@ -340,7 +346,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
void Up() { void Up() {
userMoreInfoAdapter.clearData(); userMoreInfoAdapter.clearData();
bottom_msg.setVisibility(View.VISIBLE); bottom_msg.setVisibility(View.VISIBLE);
mRefreshView.setVisibility(View.VISIBLE);
title.setVisibility(View.GONE); title.setVisibility(View.GONE);
noMoreText.setVisibility(View.GONE);
LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mRefreshView.getLayoutParams(); LinearLayout.LayoutParams params = (LinearLayout.LayoutParams) mRefreshView.getLayoutParams();
params.bottomMargin=DpUtil.dp2px(65); params.bottomMargin=DpUtil.dp2px(65);
if (Tips.equals("1")) { if (Tips.equals("1")) {
@ -377,6 +385,8 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
setTextColor(dayRank,audience_btn,guard_btn,fans_btn,gz_view,weekRank); setTextColor(dayRank,audience_btn,guard_btn,fans_btn,gz_view,weekRank);
gz_view.setVisibility(View.GONE); gz_view.setVisibility(View.GONE);
no_more.setImageResource(R.drawable.img_rank_empty); no_more.setImageResource(R.drawable.img_rank_empty);
noMoreText.setText(R.string.no_more_day_rank);
noMoreText.setVisibility(View.VISIBLE);
}else if (Tips.equals("5")){ }else if (Tips.equals("5")){
params.bottomMargin=DpUtil.dp2px(0); params.bottomMargin=DpUtil.dp2px(0);
userMoreInfoAdapter.type = "5"; userMoreInfoAdapter.type = "5";
@ -384,7 +394,9 @@ public class LiveUserMoreDialogFragment extends AbsDialogFragment implements Vie
type="weekRank"; type="weekRank";
gz_view.setVisibility(View.GONE); gz_view.setVisibility(View.GONE);
no_more.setImageResource(R.drawable.img_rank_empty); no_more.setImageResource(R.drawable.img_rank_empty);
noMoreText.setText(R.string.no_more_day_rank);
setTextColor(weekRank,audience_btn,guard_btn,fans_btn,gz_view,dayRank); setTextColor(weekRank,audience_btn,guard_btn,fans_btn,gz_view,dayRank);
noMoreText.setVisibility(View.VISIBLE);
} }
mRefreshView.setLayoutParams(params); mRefreshView.setLayoutParams(params);
} }

View File

@ -1,6 +1,7 @@
package com.yunbao.live.dialog; package com.yunbao.live.dialog;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.graphics.Color;
import android.os.Bundle; import android.os.Bundle;
import android.text.TextUtils; import android.text.TextUtils;
import android.view.Display; import android.view.Display;
@ -94,6 +95,7 @@ public class SidebarLiveAudience extends AbsDialogFragment {
} }
sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList); sidebarList = (CommonRefreshView) findViewById(R.id.sidebarList);
// sidebarList.setHeaderTextColor(Color.parseColor("#50ffffff"));
GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false); GridLayoutManager gridLayoutManager = new GridLayoutManager(mContext, 2, GridLayoutManager.VERTICAL, false);
gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { gridLayoutManager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() {
@Override @Override

View File

@ -486,43 +486,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
mLiveLinkMicPushViewHolder.addToParent(); mLiveLinkMicPushViewHolder.addToParent();
mLiveLinkMicPushViewHolder.startPush(pushUrl); mLiveLinkMicPushViewHolder.startPush(pushUrl);
EventBus.getDefault().post(new LinkMicTxAccEvent(true)); EventBus.getDefault().post(new LinkMicTxAccEvent(true));
} else {
// LiveHttpUtil.getLiveSdk(new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 0 && info.length > 0) {
// LiveKsyConfigBean liveKsyConfigBean = null;
// try {
// JSONObject obj = JSON.parseObject(info[0]);
// liveKsyConfigBean = JSON.parseObject(obj.getString("android"), LiveKsyConfigBean.class);
// } catch (Exception e) {
// liveKsyConfigBean = LiveConfig.getDefaultKsyConfig();
// }
// mLiveLinkMicPushViewHolder = new LiveLinkMicPushKsyViewHolder(mContext, mSmallContainer, liveKsyConfigBean);
// mLiveLinkMicPushViewHolder.setLivePushListener(new LivePushListener() {
// @Override
// public void onPreviewStart() {
// //预览成功的回调
// }
//
// @Override
// public void onPushStart() {//推流成功的回调
// SocketLinkMicUtil.audienceSendLinkMicUrl(mSocketClient, playUrl);
// }
//
// @Override
// public void onPushFailed() {//推流失败的回调
// DialogUitl.showSimpleDialog(mContext, WordUtil.getString(R.string.link_mic_failed_2), null);
// SocketLinkMicUtil.audienceCloseLinkMic(mSocketClient);
// }
// });
// mLiveLinkMicPushViewHolder.addToParent();
// mLiveLinkMicPushViewHolder.startPush(pushUrl);
//
// }
// }
// });
} }
} }
@ -804,32 +767,6 @@ public class LiveLinkMicPresenter implements View.OnClickListener {
//获取活动 //获取活动
private void getEvent() { private void getEvent() {
if (btn_onecz_event != null) { if (btn_onecz_event != null) {
// HttpClient.getInstance().get("Charge2.IsFirstChargeIcon", "Charge2.IsFirstChargeIcon")
// .params("uid", CommonAppConfig.getInstance().getUid())
// .params("token", CommonAppConfig.getInstance().getToken())
// .execute(new HttpCallback() {
// @Override
// public void onSuccess(int code, String msg, String[] info) {
// if (code == 200) {
// JSONObject obj = JSON.parseObject(info[0]);
// if (obj.getString("is_hidden").equals("1")) {
// btn_onecz_event.setVisibility(View.GONE);
// //首充值
// BannerBean bannerBean1 = new BannerBean();
// bannerBean1.setImageUrl("https://qny.shayucm.com/img/BTN_Firstcharge%20%282%29.png");
// bannerBean1.setLink("sc");
// mBannerList1.add(bannerBean1);
//
// } else {
// btn_onecz_event.setVisibility(View.GONE);
// }
//
// } else {
// btn_onecz_event.setVisibility(View.GONE);
// }
// }
// });
HttpClient.getInstance().get("Charge2.isFirstChargeIcons", "Charge2.isFirstChargeIcons") HttpClient.getInstance().get("Charge2.isFirstChargeIcons", "Charge2.isFirstChargeIcons")
.params("uid", CommonAppConfig.getInstance().getUid()) .params("uid", CommonAppConfig.getInstance().getUid())
.params("token", CommonAppConfig.getInstance().getToken()) .params("token", CommonAppConfig.getInstance().getToken())

View File

@ -140,6 +140,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
Log.e("errqs", "errl"); Log.e("errqs", "errl");
} }
}, null); }, null);
} }
private void svga_new_user_double() { private void svga_new_user_double() {
@ -376,13 +377,10 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo(); NewPeopleInfo peopleInfo = stringResponseModel.getData().getInfo();
if (peopleInfo.getIsShow()) { if (peopleInfo.getIsShow()) {
liveNewPeople.setVisibility(View.VISIBLE); liveNewPeople.setVisibility(View.VISIBLE);
if(peopleInfo.getLink().startsWith("http")){ if (peopleInfo.getLink().startsWith("http")){
newPeopleUrl = peopleInfo.getLink(); newPeopleUrl=peopleInfo.getLink()+"?";
if(!newPeopleUrl.contains("?")){
newPeopleUrl+="?";
}
}else { }else {
newPeopleUrl = CommonAppConfig.HOST + peopleInfo.getLink(); newPeopleUrl = CommonAppConfig.HOST + "/" + peopleInfo.getLink();
} }
} }
}, Throwable::printStackTrace).isDisposed(); }, Throwable::printStackTrace).isDisposed();

View File

@ -3,7 +3,6 @@ package com.yunbao.live.views;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.content.Context; import android.content.Context;
import android.content.Intent;
import android.graphics.Outline; import android.graphics.Outline;
import android.os.Bundle; import android.os.Bundle;
import android.os.Handler; import android.os.Handler;
@ -11,6 +10,7 @@ import android.os.Message;
import android.os.SystemClock; import android.os.SystemClock;
import android.text.TextUtils; import android.text.TextUtils;
import android.util.Log; import android.util.Log;
import android.view.Gravity;
import android.view.LayoutInflater; import android.view.LayoutInflater;
import android.view.View; import android.view.View;
import android.view.ViewGroup; import android.view.ViewGroup;
@ -61,6 +61,7 @@ import com.yunbao.common.http.HttpCallback;
import com.yunbao.common.interfaces.CommonCallback; import com.yunbao.common.interfaces.CommonCallback;
import com.yunbao.common.interfaces.OnItemClickListener; import com.yunbao.common.interfaces.OnItemClickListener;
import com.yunbao.common.utils.Bus; import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DeviceUtils;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.DpUtil; import com.yunbao.common.utils.DpUtil;
import com.yunbao.common.utils.RouteUtil; import com.yunbao.common.utils.RouteUtil;
@ -107,6 +108,8 @@ import com.yunbao.live.presenter.LiveGiftAnimPresenter;
import com.yunbao.live.presenter.LiveLightAnimPresenter; import com.yunbao.live.presenter.LiveLightAnimPresenter;
import org.greenrobot.eventbus.EventBus; import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.lang.ref.WeakReference; import java.lang.ref.WeakReference;
import java.net.MalformedURLException; import java.net.MalformedURLException;
@ -133,7 +136,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
LinearLayout gif_view; LinearLayout gif_view;
RelativeLayout chat_view; RelativeLayout chat_view;
private ImageView mAvatar; private ImageView mAvatar;
private ImageView UserMore; private ImageView userMore;
private RoundedImageView userGuard; private RoundedImageView userGuard;
private ImageView mLevelAnchor; private ImageView mLevelAnchor;
public static TextView mName; public static TextView mName;
@ -578,6 +581,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
@Override @Override
public void init() { public void init() {
EventBus.getDefault().register(this);
btnEvent = findViewById(R.id.btn_event); btnEvent = findViewById(R.id.btn_event);
imgEvent = (ImageView) findViewById(R.id.img_event); imgEvent = (ImageView) findViewById(R.id.img_event);
btn_event2 = (LinearLayout) findViewById(R.id.btn_event2); btn_event2 = (LinearLayout) findViewById(R.id.btn_event2);
@ -662,7 +666,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mVotes = (TextView) findViewById(R.id.votes); mVotes = (TextView) findViewById(R.id.votes);
mTvMedalRank = (TextView) findViewById(R.id.medal_rank_num); mTvMedalRank = (TextView) findViewById(R.id.medal_rank_num);
mGuardNum = (TextView) findViewById(R.id.guard_num); mGuardNum = (TextView) findViewById(R.id.guard_num);
UserMore = (ImageView) findViewById(R.id.user_more); userMore = (ImageView) findViewById(R.id.user_more);
userGuard = (RoundedImageView) findViewById(R.id.user_guard); userGuard = (RoundedImageView) findViewById(R.id.user_guard);
gift_svga = (SVGAImageView) findViewById(R.id.gift_svga); gift_svga = (SVGAImageView) findViewById(R.id.gift_svga);
tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name); tv_avatarOther_name = (TextView) findViewById(R.id.tv_avatarOther_name);
@ -713,7 +717,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
params.topMargin = mScreenWdith * 720 / 960 + 210; params.topMargin = mScreenWdith * 720 / 960 + 210;
chat_view.setLayoutParams(params); chat_view.setLayoutParams(params);
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams) RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
mChatRecyclerView.getLayoutParams(); mChatRecyclerView.getLayoutParams();
params1.topMargin = 180; params1.topMargin = 180;
@ -755,7 +758,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
findViewById(R.id.btn_votes).setOnClickListener(this); findViewById(R.id.btn_votes).setOnClickListener(this);
findViewById(R.id.btn_medal_rank).setOnClickListener(this); findViewById(R.id.btn_medal_rank).setOnClickListener(this);
findViewById(R.id.btn_noble).setOnClickListener(this); findViewById(R.id.btn_noble).setOnClickListener(this);
UserMore.setOnClickListener(this); userMore.setOnClickListener(this);
userGuard.setOnClickListener(this); userGuard.setOnClickListener(this);
findViewById(R.id.btn_guard).setOnClickListener(this); findViewById(R.id.btn_guard).setOnClickListener(this);
@ -855,9 +858,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10); outline.setRoundRect(0, 0, view.getWidth(), view.getHeight(), 10);
} }
}); });
loadWishlistData();
//打开活动窗口
ViewClicksAntiShake.clicksAntiShake(wishListLayout, () -> mContext.startActivity(new Intent(mContext, ZhuangBanActivity.class).putExtra("url", "")));
//打招呼消息 //打招呼消息
fastMsgRecyclerView = (RecyclerView) findViewById(R.id.room_fast_msg); fastMsgRecyclerView = (RecyclerView) findViewById(R.id.room_fast_msg);
fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false)); fastMsgRecyclerView.setLayoutManager(new LinearLayoutManager(mContext, LinearLayoutManager.HORIZONTAL, false));
@ -867,8 +867,16 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
//点击的消息发送出去 //点击的消息发送出去
((LiveActivity) mContext).sendChatMessage(msg); ((LiveActivity) mContext).sendChatMessage(msg);
fastMsgRecyclerView.setVisibility(View.GONE); fastMsgRecyclerView.setVisibility(View.GONE);
params1.bottomMargin = 0;
mChatRecyclerView.setLayoutParams(params1);
}); });
// fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator());
mBanner2.setVisibility(View.GONE);
if (fastMsgRecyclerView.getVisibility() == View.GONE) {
params1.bottomMargin = 0;
mChatRecyclerView.setLayoutParams(params1);
}
// fastMsgRecyclerView.setItemAnimator(new DefaultItemAnimator());
} }
private void showBanner2() { private void showBanner2() {
@ -1067,45 +1075,52 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
wishListFlipper.startFlipping(); wishListFlipper.startFlipping();
}); });
} }
/** /**
* 初始化小时榜 * 初始化小时榜
*/ */
protected void initHourRankList(){ protected void initHourRankList() {
ViewFlipper flipper= (ViewFlipper) findViewById(R.id.hour_rank_list); ViewFlipper flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
LinearLayout.LayoutParams params=new LinearLayout.LayoutParams(DpUtil.dp2px(44),DpUtil.dp2px(16)); LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(44), DpUtil.dp2px(16));
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
textParams.leftMargin = DpUtil.dp2px(5);
API.get().pdLiveApi(mContext).getHourChartRank(mLiveUid) API.get().pdLiveApi(mContext).getHourChartRank(mLiveUid)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(listResponseModel -> { .subscribe(listResponseModel -> {
List<HourRank> info = listResponseModel.getData().getInfo(); List<HourRank> info = listResponseModel.getData().getInfo();
if(!info.isEmpty()){ if (!info.isEmpty()) {
View hotView=LayoutInflater.from(mContext).inflate(R.layout.view_wish_list,null); View hotView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
View hourView=LayoutInflater.from(mContext).inflate(R.layout.view_wish_list,null); View hourView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
ImageView hotPic = hotView.findViewById(R.id.wish_pic); ImageView hotPic = hotView.findViewById(R.id.wish_pic);
ImageView hourPic = hourView.findViewById(R.id.wish_pic); ImageView hourPic = hourView.findViewById(R.id.wish_pic);
mHotText =hotView.findViewById(R.id.wish_index); mHotText = hotView.findViewById(R.id.wish_index);
mHourRank=hourView.findViewById(R.id.wish_index); mHourRank = hourView.findViewById(R.id.wish_index);
mHotText.setLayoutParams(textParams);
hotPic.setImageResource(R.drawable.live_tags_hot); mHourRank.setLayoutParams(textParams);
hourPic.setImageResource(R.drawable.live_tags_hour_list); mHotText.setGravity(Gravity.CENTER);
mHourRank.setGravity(Gravity.CENTER);
setHourRankData(info.get(0).getRank());
hotPic.setImageResource(WordUtil.isZh()?R.drawable.live_tags_hot:R.drawable.live_tags_hot_en);
hourPic.setImageResource(WordUtil.isZh()?R.drawable.live_tags_hour_list:R.drawable.live_tags_hour_list_en);
hotPic.setLayoutParams(params); hotPic.setLayoutParams(params);
hourPic.setLayoutParams(params); hourPic.setLayoutParams(params);
flipper.addView(hotView); flipper.addView(hotView);
flipper.addView(hourView); flipper.addView(hourView);
flipper.setOnClickListener(view -> { flipper.setOnClickListener(view -> {
Bundle bundle=new Bundle(); Bundle bundle = new Bundle();
String path=info.get(0).getUrl(); String path = info.get(0).getUrl();
if(!path.startsWith("/")){ if (!path.startsWith("/")) {
path="/"+path; path = "/" + path;
} }
String url=CommonAppConfig.HOST+path; String url = CommonAppConfig.HOST + path;
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token="
+ CommonAppConfig.getInstance().getToken() + "&liveuid=" + mLiveUid; + CommonAppConfig.getInstance().getToken() + "&anchorUid=" + mLiveUid;
bundle.putString("url", url); bundle.putString("url", url);
// bundle.putInt("height", DpUtil.dp2px(500)); bundle.putInt("height", DpUtil.dp2px(500));
bundle.putInt("show_type", 0); bundle.putInt("show_type", 0);
bundle.putString("roomId",mLiveUid);
LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment(); LiveHDDialogFragment liveHDDialogFragment = new LiveHDDialogFragment();
liveHDDialogFragment.setArguments(bundle); liveHDDialogFragment.setArguments(bundle);
liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment"); liveHDDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveHDDialogFragment");
@ -1118,38 +1133,46 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
/** /**
* 星光值转带k的字符 * 星光值转带k的字符
*
* @param val * @param val
* @retur 字符串 * @retur 字符串
*/ */
private String starlightValToString(long val){ private String starlightValToString(long val) {
if(val>1000) { if (val > 1000) {
double tmp =(double)val / 1000; double tmp = (double) val / 1000;
return tmp + "k"; return tmp + "k";
}else{ } else {
return val+""; return val + "";
} }
} }
/** /**
* 设置小时榜 * 设置小时榜
*
* @param rank 小时榜 * @param rank 小时榜
*/ */
public void setHourRankData(int rank){ public void setHourRankData(long rank) {
if(mHourRank!=null) { if (mHourRank != null) {
mHourRank.setText(formatBigNum.formatBigNum(rank + "")); if (rank == 0) {
mHourRank.setText(R.string.no_rank_data);
} else {
mHourRank.setText(String.format(WordUtil.getString(R.string.hour_rank),formatBigNum.formatBigNum(rank + "")));
}
} }
} }
/** /**
* 设置热度值 * 设置热度值
*
* @param hot 热度值 * @param hot 热度值
*/ */
public void setHotData(String hot){ public void setHotData(String hot) {
if(mHotText!=null) { if (mHotText != null&&!TextUtils.isEmpty(hot)) {
mHotText.setText(hot); mHotText.setText(hot);
} }
} }
/** /**
* 更新心愿单进度 * 更新心愿单进度
* *
@ -1436,7 +1459,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
*/ */
public void setUserList(List<LiveUserGiftBean> list) { public void setUserList(List<LiveUserGiftBean> list) {
if (mLiveUserAdapter != null) { if (mLiveUserAdapter != null) {
resetUserListWidth(DpUtil.dp2px((Math.min(list.size(), 3)) * 38)); //resetUserListWidth(DpUtil.dp2px((Math.min(list.size(), 3)) * 30));
mLiveUserAdapter.refreshList(list); mLiveUserAdapter.refreshList(list);
} }
} }
@ -1521,6 +1544,10 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
private void setGuardIcon(LiveUserGiftBean guard) { private void setGuardIcon(LiveUserGiftBean guard) {
if (guard != null) { if (guard != null) {
nowGuardUser = guard; nowGuardUser = guard;
ViewGroup.LayoutParams params = userGuard.getLayoutParams();
params.height = DpUtil.dp2px(30);
params.width = DpUtil.dp2px(30);
userGuard.setLayoutParams(params);
ImgLoader.displayAvatar(mContext, guard.getAvatar(), userGuard); ImgLoader.displayAvatar(mContext, guard.getAvatar(), userGuard);
gift_svga.setVisibility(View.VISIBLE); gift_svga.setVisibility(View.VISIBLE);
} }
@ -1599,7 +1626,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} else if (i == R.id.ft_hot_add) { } else if (i == R.id.ft_hot_add) {
((LiveActivity) mContext).openHotListWindow(1); ((LiveActivity) mContext).openHotListWindow(1);
} else if (i == R.id.user_guard) { } else if (i == R.id.user_guard) {
// ((LiveActivity) mContext).openUserMoreListWindow(2, true); // ((LiveActivity) mContext).openUserMoreListWindow(2, true);
((LiveActivity) mContext).openNewGuardListWindow(); ((LiveActivity) mContext).openNewGuardListWindow();
} }
@ -1716,43 +1743,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
((LiveRyAnchorActivity) mContext).onBackPressed(); ((LiveRyAnchorActivity) mContext).onBackPressed();
} }
} }
// if (isRy == false) {
// if (forAct == 1) {
// //是否关注0==没关注
// if (isAttention == 0) {
// if (isStayRoomfive) {
// showFollowDialog(mNameText, mAvatarUrl, mContext);
// } else {
// ((LiveAudienceActivity) mContext).setBackIndex(1);
// ((LiveAudienceActivity) mContext).onBackPressed();
// }
// } else {
// ((LiveAudienceActivity) mContext).setBackIndex(1);
// ((LiveAudienceActivity) mContext).onBackPressed();
// }
// } else {
// ((LiveAudienceActivity) mContext).setBackIndex(1);
// ((LiveAnchorActivity) mContext).onBackPressed();
// }
// } else {
// if (forAct == 1) {
// //是否关注0==没关注
// if (isAttention == 0) {
// if (isStayRoomfive) {
// showFollowDialog(mNameText, mAvatarUrl, mContext);
// } else {
// LiveRyAnchorActivity.backIndex = 1;
// ((LiveRyAnchorActivity) mContext).onBackPressed();
// }
// } else {
// LiveRyAnchorActivity.backIndex = 1;
// ((LiveRyAnchorActivity) mContext).onBackPressed();
// }
// } else {
// LiveRyAnchorActivity.backIndex = 1;
// ((LiveRyAnchorActivity) mContext).onBackPressed();
// }
// }
} }
/** /**
@ -1978,7 +1968,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void showGiftMessage(LiveReceiveGiftBean bean) { public void showGiftMessage(LiveReceiveGiftBean bean) {
mVotes.setText(bean.getVotes()); mVotes.setText(bean.getVotes());
room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num())); room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
setHotData(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num())); setHotData(formatBigNum.formatBigNum(bean.getHot_num()));
mTvMedalRank.setText(bean.getMedalRankNum()); mTvMedalRank.setText(bean.getMedalRankNum());
if (mLiveGiftAnimPresenter == null) { if (mLiveGiftAnimPresenter == null) {
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
@ -1992,7 +1982,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
public void showGiftMessage(LiveReceiveGiftBean bean, boolean isAncher) { public void showGiftMessage(LiveReceiveGiftBean bean, boolean isAncher) {
mVotes.setText(bean.getVotes()); mVotes.setText(bean.getVotes());
room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num())); room_hot.setText(formatBigNum.formatBigNum(bean.getHot_num()));
setHotData(formatBigNum.formatBigNum(bean.getLiveChatBean().getHot_num())); setHotData(formatBigNum.formatBigNum(bean.getHot_num()));
mTvMedalRank.setText(bean.getMedalRankNum()); mTvMedalRank.setText(bean.getMedalRankNum());
//开通粉丝勋章成功弹窗 //开通粉丝勋章成功弹窗
if (!isAncher && bean.getMedalFirstGet() != null && bean.getMedalFirstGet().equals("1") if (!isAncher && bean.getMedalFirstGet() != null && bean.getMedalFirstGet().equals("1")
@ -2014,6 +2004,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager); mLiveGiftAnimPresenter = new LiveGiftAnimPresenter(mContext, mContentView, mGifImageView, mSVGAImageView, mLiveGiftPrizePoolContainer, windowManager);
} }
mLiveGiftAnimPresenter.showBuyGuardGiftAnim(bean); mLiveGiftAnimPresenter.showBuyGuardGiftAnim(bean);
setHotData(bean.getHot_num());
} }
//全服通知 购买坐骑 //全服通知 购买坐骑
@ -2222,6 +2213,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
public void release() { public void release() {
EventBus.getDefault().unregister(this);
LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST); LiveHttpUtil.cancel(LiveHttpConsts.GET_USER_LIST);
LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE); LiveHttpUtil.cancel(LiveHttpConsts.TIME_CHARGE);
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION); CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
@ -2291,7 +2283,18 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
} }
public void setFastMessage(List<String> greetings) { public void setFastMessage(List<String> greetings) {
fastMsgRecyclerView.setVisibility(View.VISIBLE);
fastMessageRecyclerViewAdapter.setMessage(greetings); fastMessageRecyclerViewAdapter.setMessage(greetings);
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
mChatRecyclerView.getLayoutParams();
if (greetings.size() > 0) {
params1.bottomMargin = 100;
} else {
params1.bottomMargin = 0;
}
mChatRecyclerView.setLayoutParams(params1);
} }
private static class LiveRoomHandler extends Handler { private static class LiveRoomHandler extends Handler {
@ -2348,5 +2351,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION); CommonHttpUtil.cancel(CommonHttpConsts.SET_ATTENTION);
} }
@Subscribe(threadMode = ThreadMode.MAIN)
public void onUpdata(String str) {
if ("svga_new_user_gif".equals(str)) {
if (fastMsgRecyclerView == null) return;
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
fastMsgRecyclerView.getLayoutParams();
params1.rightMargin = DeviceUtils.getScreenWidth((Activity) mContext) / 3;
fastMsgRecyclerView.setLayoutParams(params1);
} else if ("stop_svga_new_user_gif".equals(str)) {
if (fastMsgRecyclerView == null) return;
RelativeLayout.LayoutParams params1 = (RelativeLayout.LayoutParams)
fastMsgRecyclerView.getLayoutParams();
params1.rightMargin = 0;
fastMsgRecyclerView.setLayoutParams(params1);
}
}
} }

View File

@ -162,9 +162,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
private boolean mLighted; private boolean mLighted;
private boolean mCoinNotEnough;//余额不足 private boolean mCoinNotEnough;//余额不足
private boolean mFirstConnectSocket;//是否是第一次连接成功socket private boolean mFirstConnectSocket;//是否是第一次连接成功socket
private int liveBg; private int liveBg = -1;
private LiveImDeletUtil liveImDeletUtil; private LiveImDeletUtil liveImDeletUtil;
private List<String> greetings = new ArrayList<>(); private List<String> greetings = new ArrayList<>();
private Handler liveHandler = new Handler();
public PortraitLiveManager(Activity context, Intent intent) { public PortraitLiveManager(Activity context, Intent intent) {
this.mContext = context; this.mContext = context;
@ -236,8 +238,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
//直播间背景 //直播间背景
ImgLoader.display(mContext, R.mipmap.live_bg, liveBack); ImgLoader.displayBlurLive(mContext, data.getAvatar(), liveBack);
mask.setVisibility(View.GONE); mask.setVisibility(View.VISIBLE);
mLivePlayViewHolder.setCover(data.getThumb()); mLivePlayViewHolder.setCover(data.getThumb());
mLivePlayViewHolder.play(data.getPull()); mLivePlayViewHolder.play(data.getPull());
mLiveRoomViewHolder.setAvatar(data.getAvatar()); mLiveRoomViewHolder.setAvatar(data.getAvatar());
@ -272,6 +275,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onRemove() { public void onRemove() {
//子线程执行退出操作
liveHandler.post(() -> exitLiveRoom());
if (mLiveAudienceViewHolder != null) { if (mLiveAudienceViewHolder != null) {
mLiveAudienceViewHolder.removeFromParent(); mLiveAudienceViewHolder.removeFromParent();
mLiveAudienceViewHolder.countDownTimerTrickery = null; mLiveAudienceViewHolder.countDownTimerTrickery = null;
@ -284,10 +291,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mSocketRyClient.disConnect(); mSocketRyClient.disConnect();
} }
mSocketRyClient = null; mSocketRyClient = null;
//结束播放 //结束播放
if (mLivePlayViewHolder != null) { if (mLivePlayViewHolder != null) {
mLivePlayViewHolder.stopPlay();
mLivePlayViewHolder.release(); mLivePlayViewHolder.release();
} }
mLivePlayViewHolder = null; mLivePlayViewHolder = null;
@ -302,10 +308,6 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mSocketClient = null; mSocketClient = null;
} }
if (mLivePlayViewHolder != null) {
mLivePlayViewHolder.stopPlay();
}
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.removeFromParent(); mLiveRoomViewHolder.removeFromParent();
@ -543,6 +545,11 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onChat(LiveChatBean bean, int index) { public void onChat(LiveChatBean bean, int index) {
if (bean.getType() == 1) {
if (!bean.getContent().contains(mLiveBean.getUserNiceName())) {
return;
}
}
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.insertChat(bean, index); mLiveRoomViewHolder.insertChat(bean, index);
} }
@ -918,7 +925,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
@Override @Override
public void onHourRank(LiveChatBean bean, JSONObject ranks) { public void onHourRank(LiveChatBean bean, JSONObject ranks) {
if(mLiveRoomViewHolder!=null){ if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setHourRankData(ranks.getInteger(liveID)); mLiveRoomViewHolder.setHourRankData(ranks.getInteger(liveID));
} }
} }
@ -974,15 +981,19 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mChatLevel = obj.getIntValue("speak_limit"); mChatLevel = obj.getIntValue("speak_limit");
mDanMuLevel = obj.getIntValue("barrage_limit"); mDanMuLevel = obj.getIntValue("barrage_limit");
liveBg = obj.getIntValue("live_bg"); liveBg = obj.getIntValue("live_bg");
if (obj.containsKey("greetings")) { if (obj.containsKey("greetings")) {
greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class); greetings = JSONArray.parseArray(obj.getJSONArray("greetings").toJSONString(), String.class);
} }
if (obj.containsKey("live_bg")) {
if (liveBg == 0) {
if (liveBg == 1) { //直播间背景
//直播间背景 ImgLoader.display(mContext, R.mipmap.live_bg, liveBack);
ImgLoader.displayBlurLive(mContext, mLiveBean.getAvatar(), liveBack); mask.setVisibility(View.GONE);
mask.setVisibility(View.VISIBLE); }
} }
//回传参数 //回传参数
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS) .setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
@ -1164,7 +1175,9 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
Bus.get().post(new LiveAudienceEvent() Bus.get().post(new LiveAudienceEvent()
.setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS) .setType(LiveAudienceEvent.LiveAudienceType.OPEN_PARAMETERS)
.setParametersModel(new OpenParametersModel().setmLiveGuardInfo(mLiveGuardInfo))); .setParametersModel(new OpenParametersModel().setmLiveGuardInfo(mLiveGuardInfo)
.setFansNum(fansNum)
.setIs_fans(is_fans)));
if (mLiveRoomViewHolder != null) { if (mLiveRoomViewHolder != null) {
mLiveRoomViewHolder.setGuardNum(guardNum); mLiveRoomViewHolder.setGuardNum(guardNum);
mLiveRoomViewHolder.setFansNum(fansNum); mLiveRoomViewHolder.setFansNum(fansNum);
@ -1281,20 +1294,14 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
mLivePlayViewHolder.release(); mLivePlayViewHolder.release();
} }
mLivePlayViewHolder = null; mLivePlayViewHolder = null;
onRemove();
} }
public void end() { public void end() {
if (mLiveRoomViewHolder != null) if (mLiveRoomViewHolder != null)
mLiveRoomViewHolder.clearList(); mLiveRoomViewHolder.clearList();
boolean canBackPressed = true;
if (mContext instanceof LiveAudienceActivity) {
canBackPressed = ((LiveAudienceActivity) mContext).canBackPressed();
}
IMLoginManager.get(mContext).setisNewUserOne(false); IMLoginManager.get(mContext).setisNewUserOne(false);
if (!mEnd && !canBackPressed) {
return;
}
if (countDownTimer != null) { if (countDownTimer != null) {
countDownTimer.cancel(); countDownTimer.cancel();
countDownTimer = null; countDownTimer = null;
@ -1304,13 +1311,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
if (LiveRoomViewHolder.isAttention == 0) { if (LiveRoomViewHolder.isAttention == 0) {
if (isStayRoomfive) { if (isStayRoomfive) {
LiveRoomViewHolder.showFollowDialog(LiveRoomViewHolder.mNameText, LiveRoomViewHolder.mAvatarUrl, mContext); LiveRoomViewHolder.showFollowDialog(LiveRoomViewHolder.mNameText, LiveRoomViewHolder.mAvatarUrl, mContext);
} else {
backIndex = 1;
((LiveAudienceActivity) mContext).onBackPressed();
} }
} else {
backIndex = 1;
((LiveAudienceActivity) mContext).onBackPressed();
} }
} else { } else {
exitLiveRoom(); exitLiveRoom();
@ -1361,8 +1362,7 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
Log.i("tx", "退出失败"); Log.i("tx", "退出失败");
} }
}); });
endPlay();
mContext.finish();
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -1464,4 +1464,5 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
} }
} }
} }

View File

@ -2,7 +2,7 @@
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:width="112dp" android:height="25dp"> <item android:width="112dp" android:height="25dp">
<shape android:shape="rectangle"> <shape android:shape="rectangle">
<solid android:color="#33000000" /> <solid android:color="#33FFFFFF" />
<corners android:radius="12dp" /> <corners android:radius="12dp" />
</shape> </shape>
</item> </item>

View File

@ -1,15 +1,9 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="true"> <item android:width="102dp" android:height="34dp">
<shape> <shape android:shape="rectangle">
<corners android:radius="15dp"/> <gradient android:type="linear" android:useLevel="true" android:startColor="#ffa98cfd" android:endColor="#ff9d7afd" android:angle="90" />
<gradient android:endColor="#FF7D2F" android:startColor="#FF5623" android:type="linear"/> <corners android:radius="21dp" />
</shape>
</item>
<item android:state_enabled="false">
<shape>
<corners android:radius="15dp"/>
<solid android:color="@color/gray3"/>
</shape> </shape>
</item> </item>
</selector> </selector>

View File

@ -1,5 +1,5 @@
<?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">
<corners android:radius="17dp"/> <corners android:radius="17dp"/>
<solid android:color="#80000000"/> <solid android:color="#30000000"/>
</shape> </shape>

View File

@ -1,6 +1,5 @@
<?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">
<corners android:radius="60dp" /> <corners android:radius="60dp" />
<stroke android:color="#FFBA41" android:width="1dp"/> <solid android:color="#4D000000"/>
<solid android:color="#80000000"/>
</shape> </shape>

View File

@ -1,5 +1,5 @@
<?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">
<corners android:radius="10dp"/> <corners android:radius="10dp"/>
<solid android:color="#80000000"/> <solid android:color="#30000000"/>
</shape> </shape>

View File

@ -3,5 +3,5 @@
<corners <corners
android:bottomLeftRadius="10dp" android:bottomLeftRadius="10dp"
android:topLeftRadius="10dp" /> android:topLeftRadius="10dp" />
<solid android:color="#80000000" /> <solid android:color="#30000000" />
</shape> </shape>

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 85 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 82 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 27 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

After

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 90 KiB

View File

@ -56,7 +56,7 @@
android:paddingLeft="20dp" android:paddingLeft="20dp"
android:paddingRight="5dp" android:paddingRight="5dp"
android:layout_toRightOf="@id/btn_fans" android:layout_toRightOf="@id/btn_fans"
android:text="貴族" android:text="@string/noble"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="14sp"/> android:textSize="14sp"/>
<com.yunbao.common.custom.DrawableTextView <com.yunbao.common.custom.DrawableTextView

View File

@ -132,7 +132,7 @@
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
tools:visibility="gone"> tools:visibility="visible">
<TextView <TextView
@ -164,7 +164,6 @@
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="15dp" android:layout_marginEnd="15dp"
android:background="@drawable/bg_guard_btn_buy" android:background="@drawable/bg_guard_btn_buy"
android:enabled="false"
android:gravity="center" android:gravity="center"
android:text="@string/guard_buy" android:text="@string/guard_buy"
android:textColor="@color/white" android:textColor="@color/white"
@ -245,8 +244,8 @@
android:id="@+id/guard_imageView" android:id="@+id/guard_imageView"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="58dp" android:layout_height="58dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="30dp" android:layout_marginTop="30dp"
android:layout_marginStart="125dp"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/guardian_img_wings" android:src="@drawable/guardian_img_wings"
android:visibility="invisible" android:visibility="invisible"
@ -257,7 +256,7 @@
android:layout_width="65dp" android:layout_width="65dp"
android:layout_height="65dp" android:layout_height="65dp"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_marginStart="-5dp" android:layout_marginStart="-6dp"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:layout_toEndOf="@+id/guard_imageView" android:layout_toEndOf="@+id/guard_imageView"
android:scaleType="centerCrop" android:scaleType="centerCrop"
@ -269,9 +268,9 @@
android:id="@+id/guard_imageView_one" android:id="@+id/guard_imageView_one"
android:layout_width="65dp" android:layout_width="65dp"
android:layout_height="65dp" android:layout_height="65dp"
android:layout_centerHorizontal="true"
android:layout_marginTop="25dp" android:layout_marginTop="25dp"
android:layout_toStartOf="@id/guard_imageView"
android:layout_toStartOf="@id/guard_imageView_two"
android:scaleType="centerCrop" android:scaleType="centerCrop"
android:src="@drawable/guardian_img_wings" android:src="@drawable/guardian_img_wings"
android:visibility="invisible" android:visibility="invisible"

View File

@ -1,5 +1,6 @@
<?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"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:background="@mipmap/bg_black" android:background="@mipmap/bg_black"
@ -103,12 +104,35 @@
android:layout_height="0dp" android:layout_height="0dp"
android:visibility="gone" /> android:visibility="gone" />
<ImageView <androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/no_more" android:id="@+id/no_more_layout"
android:layout_width="233dp" android:layout_width="333dp"
android:layout_height="233dp" android:layout_height="333dp"
android:layout_gravity="center" android:layout_gravity="center"
android:visibility="gone" /> android:visibility="gone">
<ImageView
android:id="@+id/no_more"
android:layout_width="233dp"
android:layout_height="233dp"
android:layout_marginBottom="32dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/no_more_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#B3FFFFFF"
android:textSize="14sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/no_more" />
</androidx.constraintlayout.widget.ConstraintLayout>
<com.yunbao.common.custom.CommonRefreshView <com.yunbao.common.custom.CommonRefreshView
android:id="@+id/refreshView" android:id="@+id/refreshView"

View File

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/room_fast_layout" android:id="@+id/room_fast_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_marginEnd="10dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="@drawable/bg_fast_meg"> android:background="@drawable/bg_fast_meg">

View File

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/live_user_root_layout"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="wrap_content" android:layout_marginEnd="5dp"
> android:layout_height="38dp">
<!-- <ImageView--> <!-- <ImageView-->
<!-- android:id="@+id/wrap"--> <!-- android:id="@+id/wrap"-->
<!-- android:layout_width="32dp"--> <!-- android:layout_width="32dp"-->
<!-- android:layout_height="44dp"--> <!-- android:layout_height="44dp"-->
<!-- android:layout_alignParentBottom="true"--> <!-- android:layout_alignParentBottom="true"-->
<!-- android:scaleType="fitXY"--> <!-- android:scaleType="fitXY"-->
<!-- android:layout_marginBottom="1dp"--> <!-- android:layout_marginBottom="1dp"-->
<!-- android:src="@mipmap/icon_live_user_list_1"/>--> <!-- android:src="@mipmap/icon_live_user_list_1"/>-->
<RelativeLayout <RelativeLayout
android:layout_width="38dp" android:layout_width="38dp"
@ -25,19 +25,19 @@
android:id="@+id/avatar" android:id="@+id/avatar"
android:layout_width="27dp" android:layout_width="27dp"
android:layout_height="27dp" android:layout_height="27dp"
android:layout_centerVertical="true"
android:layout_centerInParent="true" android:layout_centerInParent="true"
android:layout_centerHorizontal="true" android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:scaleType="centerCrop" android:scaleType="centerCrop"
app:riv_oval="true" android:src="@drawable/m_chu_xia"
android:src="@drawable/m_chu_xia"/> app:riv_oval="true" />
<com.opensource.svgaplayer.SVGAImageView <com.opensource.svgaplayer.SVGAImageView
android:id="@+id/gift_svga" android:id="@+id/gift_svga"
android:layout_width="38dp" android:layout_width="38dp"
android:layout_height="38dp" android:layout_height="38dp"
app:autoPlay="true"/> app:autoPlay="true" />
</RelativeLayout> </RelativeLayout>
@ -46,15 +46,15 @@
android:id="@+id/icon" android:id="@+id/icon"
android:layout_width="16dp" android:layout_width="16dp"
android:layout_height="16dp" android:layout_height="16dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:visibility="gone"/> android:layout_alignParentBottom="true"
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/guard_icon" android:id="@+id/guard_icon"
android:layout_width="17dp" android:layout_width="17dp"
android:layout_height="17dp" android:layout_height="17dp"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:visibility="gone"/> android:layout_alignParentBottom="true"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View File

@ -66,7 +66,7 @@
android:layout_height="90dp" android:layout_height="90dp"
android:layout_gravity="right" android:layout_gravity="right"
android:layout_marginRight="10dp" android:layout_marginRight="10dp"
android:layout_marginBottom="18dp" android:layout_marginBottom="88dp"
android:background="@mipmap/live_mission_box" android:background="@mipmap/live_mission_box"
android:gravity="center_horizontal" android:gravity="center_horizontal"
android:orientation="vertical" android:orientation="vertical"
@ -304,14 +304,16 @@
android:layout_height="25dp" android:layout_height="25dp"
android:layout_gravity="center" android:layout_gravity="center"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:visibility="gone"
android:src="@mipmap/icon_live_msg" /> android:src="@mipmap/icon_live_msg" />
<TextView <TextView
android:id="@+id/et_input" android:id="@+id/et_input"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_gravity="center"
android:alpha="0.5" android:alpha="0.5"
android:gravity="center_vertical" android:gravity="center"
android:hint="@string/live_say_something" android:hint="@string/live_say_something"
android:singleLine="true" android:singleLine="true"
android:textColor="@color/textColor" android:textColor="@color/textColor"
@ -336,8 +338,7 @@
android:id="@+id/btn_msg" android:id="@+id/btn_msg"
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_centerHorizontal="true" android:layout_centerInParent="true"
android:layout_centerVertical="true"
android:padding="5dp" android:padding="5dp"
android:src="@mipmap/messagesss" /> android:src="@mipmap/messagesss" />
@ -399,11 +400,10 @@
android:layout_width="40dp" android:layout_width="40dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:layout_marginEnd="16dp"
android:layout_toStartOf="@id/gift_image" android:layout_toStartOf="@id/gift_image"
android:padding="4dp" android:padding="4dp"
android:visibility="gone" android:src="@mipmap/live_icon_newpeople_en"
android:src="@mipmap/live_icon_newpeople_en" /> android:visibility="visible" />
</RelativeLayout> </RelativeLayout>

View File

@ -88,8 +88,8 @@
<LinearLayout <LinearLayout
android:id="@+id/group_1" android:id="@+id/group_1"
android:layout_width="wrap_content" android:layout_width="142dp"
android:layout_height="33dp" android:layout_height="34dp"
android:layout_marginLeft="8dp" android:layout_marginLeft="8dp"
android:layout_marginTop="4dp" android:layout_marginTop="4dp"
android:background="@drawable/bg_live_ico" android:background="@drawable/bg_live_ico"
@ -118,7 +118,7 @@
</RelativeLayout> </RelativeLayout>
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="60dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="5dp" android:layout_marginLeft="5dp"
android:layout_marginRight="5dp" android:layout_marginRight="5dp"
@ -148,19 +148,15 @@
</LinearLayout> </LinearLayout>
<TextView <ImageView
android:id="@+id/btn_follow" android:id="@+id/btn_follow"
android:layout_width="23dp" android:layout_width="34dp"
android:layout_height="23dp" android:layout_height="34dp"
android:layout_marginTop="3dp" android:layout_marginEnd="5dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="3dp"
android:background="@drawable/bg_live_anchor_follow"
android:gravity="center" android:gravity="center"
android:text="+" android:src="@mipmap/live_icon_focus"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" android:visibility="visible" />
android:visibility="gone" />
<ImageView <ImageView
android:id="@+id/view_medal" android:id="@+id/view_medal"
@ -174,76 +170,78 @@
</LinearLayout> </LinearLayout>
<RelativeLayout
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:layout_marginStart="8dp"
android:scaleType="centerCrop">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/user_guard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@mipmap/img_guardian_empty"
app:riv_oval="true" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/gift_svga"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@drawable/img_guardian_online"
android:visibility="gone"
app:autoPlay="true" />
</RelativeLayout>
<RelativeLayout <RelativeLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignBottom="@id/group_1" android:layout_alignBottom="@id/group_1"
android:layout_marginLeft="15dp" android:layout_marginLeft="15dp"
android:layout_marginEnd="10dp"
android:layout_toRightOf="@id/group_1"> android:layout_toRightOf="@id/group_1">
<LinearLayout <LinearLayout
android:layout_width="wrap_content" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
android:gravity="end|center"
android:orientation="horizontal"> android:orientation="horizontal">
<RelativeLayout
android:layout_width="38dp"
android:layout_height="38dp"
android:layout_gravity="center"
android:scaleType="centerCrop">
<com.makeramen.roundedimageview.RoundedImageView
android:id="@+id/user_guard"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_centerInParent="true"
android:scaleType="centerCrop"
android:src="@mipmap/img_guardian_empty"
app:riv_oval="true" />
<com.opensource.svgaplayer.SVGAImageView
android:id="@+id/gift_svga"
android:layout_width="38dp"
android:layout_height="38dp"
android:src="@drawable/img_guardian_online"
android:visibility="gone"
app:autoPlay="true" />
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/user_recyclerView" android:id="@+id/user_recyclerView"
android:layout_width="wrap_content" android:layout_width="80dp"
android:layout_height="40dp" android:layout_height="40dp"
android:layout_gravity="end|center"
android:layout_marginRight="-3dp" android:layout_marginRight="-3dp"
android:overScrollMode="never" /> android:overScrollMode="never" />
<ImageView <ImageView
android:id="@+id/user_more" android:id="@+id/user_more"
android:layout_width="33dp" android:layout_width="30dp"
android:layout_height="33dp" android:layout_height="40dp"
android:layout_marginTop="4dp" android:layout_gravity="center"
android:layout_marginRight="40dp"
android:src="@mipmap/live_users_more" /> android:src="@mipmap/live_users_more" />
<ImageView
android:id="@+id/btn_close"
android:layout_width="30dp"
android:layout_height="40dp"
android:layout_gravity="center"
android:layout_marginStart="6dp"
android:layout_marginEnd="4dp"
android:scaleType="fitCenter"
android:src="@mipmap/icon_live_close_3" />
</LinearLayout> </LinearLayout>
</RelativeLayout> </RelativeLayout>
</LinearLayout> </LinearLayout>
<ImageView
android:id="@+id/btn_close"
android:layout_width="30dp"
android:layout_height="30dp"
android:layout_alignBottom="@id/lin"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dp"
android:layout_marginRight="5dp"
android:layout_marginBottom="4dp"
android:padding="3dp"
android:src="@mipmap/icon_live_close_3" />
<LinearLayout <LinearLayout
android:id="@+id/hour_rank_layout" android:id="@+id/hour_rank_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -260,26 +258,24 @@
<include <include
layout="@layout/view_wish_list" layout="@layout/view_wish_list"
android:layout_width="14dp" android:layout_width="14dp"
android:layout_weight="0.0"
android:layout_height="14dp" android:layout_height="14dp"
android:visibility="gone" android:src="@mipmap/live_icon_wishlist"
android:src="@mipmap/live_icon_wishlist" /> android:visibility="gone" />
<ViewFlipper <ViewFlipper
android:id="@+id/hour_rank_list" android:id="@+id/hour_rank_list"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_marginStart="6dp" android:layout_marginStart="0dp"
android:layout_weight="2" android:layout_marginEnd="4dp"
android:flipInterval="5000" android:flipInterval="5000"
android:layout_marginEnd="6dp"
android:inAnimation="@anim/anim_marquee_in" android:inAnimation="@anim/anim_marquee_in"
android:outAnimation="@anim/anim_marquee_out"/> android:outAnimation="@anim/anim_marquee_out" />
<ImageView <ImageView
android:layout_width="4dp" android:layout_width="4dp"
android:layout_gravity="center"
android:layout_height="8dp" android:layout_height="8dp"
android:layout_gravity="center"
android:src="@drawable/live_icon_right_more" /> android:src="@drawable/live_icon_right_more" />
@ -287,18 +283,18 @@
<!--贡献--> <!--贡献-->
<LinearLayout <LinearLayout
android:id="@+id/btn_votes" android:id="@+id/btn_votes"
android:layout_toRightOf="@id/hour_rank_layout"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:visibility="gone"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_below="@id/lin" android:layout_below="@id/lin"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginTop="8dp" android:layout_marginTop="8dp"
android:layout_toRightOf="@id/hour_rank_layout"
android:background="@drawable/bg_live_item" android:background="@drawable/bg_live_item"
android:gravity="center_vertical" android:gravity="center_vertical"
android:orientation="horizontal" android:orientation="horizontal"
android:paddingLeft="8dp" android:paddingLeft="8dp"
android:paddingRight="5dp"> android:paddingRight="5dp"
android:visibility="gone">
<ImageView <ImageView
android:layout_width="13dp" android:layout_width="13dp"
@ -398,7 +394,7 @@
<!--心愿单--> <!--心愿单-->
<LinearLayout <LinearLayout
android:id="@+id/wish_list_layout" android:id="@+id/wish_list_layout"
android:layout_width="90dp" android:layout_width="80dp"
android:layout_height="21dp" android:layout_height="21dp"
android:layout_alignTop="@id/hour_rank_layout" android:layout_alignTop="@id/hour_rank_layout"
android:layout_marginStart="10dp" android:layout_marginStart="10dp"
@ -505,7 +501,7 @@
<LinearLayout <LinearLayout
android:id="@+id/open_sidebar" android:id="@+id/open_sidebar"
android:layout_width="69dp" android:layout_width="65dp"
android:layout_height="20dp" android:layout_height="20dp"
android:layout_alignTop="@id/hour_rank_layout" android:layout_alignTop="@id/hour_rank_layout"
android:layout_alignParentRight="true" android:layout_alignParentRight="true"
@ -712,15 +708,14 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="10dp" android:layout_marginLeft="10dp"
android:layout_marginRight="80dp" android:layout_marginRight="80dp"
android:layout_marginBottom="50dp"
android:gravity="top" android:gravity="top"
android:orientation="vertical"> android:orientation="vertical">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/chat_recyclerView" android:id="@+id/chat_recyclerView"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="match_parent"
android:layout_marginTop="430dp" android:layout_marginTop="370dp"
android:overScrollMode="never" android:overScrollMode="never"
android:scrollbars="none" /> android:scrollbars="none" />
@ -853,6 +848,7 @@
</LinearLayout> </LinearLayout>
<FrameLayout <FrameLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="300dp" android:layout_height="300dp"
android:layout_below="@id/lin"> android:layout_below="@id/lin">
@ -1868,7 +1864,9 @@
android:id="@+id/room_fast_msg" android:id="@+id/room_fast_msg"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="30dp" android:layout_height="30dp"
android:layout_alignParentBottom="true" /> android:layout_alignParentBottom="true"
android:layout_marginStart="10dp"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View File

@ -21,7 +21,6 @@
android:marqueeRepeatLimit="marquee_forever" android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true" android:scrollHorizontally="true"
android:singleLine="true" android:singleLine="true"
android:text="0"
android:textColor="#FFFFFFFF" android:textColor="#FFFFFFFF"
android:textSize="10sp" /> android:textSize="10sp" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 505 B

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="no_more_day_rank">No one is on the list at the moment</string>
<string name="no_more_guard">anchor are waiting at your guard!</string>
<string name="no_rank_data">Not on the list</string>
<string name="hour_rank">No.%s</string>
<string name="hour_rank_not">Not listed</string>
<string name="day_rank">Day</string>
<string name="week_rank">Weekly</string>
<string name="views_rank">Viewers</string>
<string name="gurad_rank">Guard</string>
<string name="fans">Fans</string>
</resources>

View File

@ -1,4 +1,14 @@
<resources> <resources>
<string name="buy_guard_info" translatable="false">成爲TA的守護爲TA保駕護航</string> <string name="buy_guard_info" translatable="false">成爲TA的守護爲TA保駕護航</string>
<string name="buy_guard_back_coin" translatable="false">返還</string> <string name="buy_guard_back_coin" translatable="false">返還</string>
<string name="no_more_day_rank">暫時無人上榜,快來成為第一位上榜的人吧!</string>
<string name="no_more_guard">主播正在等待您的守護!</string>
<string name="no_rank_data">未上榜</string>
<string name="hour_rank">第%s名</string>
<string name="hour_rank_not">未上榜</string>
<string name="day_rank">日榜</string>
<string name="week_rank">周榜</string>
<string name="views_rank">观众</string>
<string name="gurad_rank">观众</string>
<string name="fans">粉丝</string>
</resources> </resources>

View File

@ -57,7 +57,7 @@ public class MainHomeLiveAdapter extends RefreshAdapter<LiveBean> {
this.context = context; this.context = context;
this.Height = h; this.Height = h;
mHeadView = mInflater.inflate(R.layout.item_main_home_live_head, null, false); mHeadView = mInflater.inflate(R.layout.item_main_home_live_head, null, false);
mHeadView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, DpUtil.dp2px(140))); mHeadView.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, DpUtil.dp2px(120)));
} }
public View getHeadView() { public View getHeadView() {

View File

@ -14,7 +14,7 @@
<com.ms.banner.Banner <com.ms.banner.Banner
android:id="@+id/banner" android:id="@+id/banner"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="130dp" android:layout_height="wrap_content"
android:layout_marginLeft="3dp" android:layout_marginLeft="3dp"
android:layout_marginBottom="5dp" android:layout_marginBottom="5dp"
app:delay_time="3000" app:delay_time="3000"