Merge remote-tracking branch 'origin/master'
# Conflicts: # config.gradle
This commit is contained in:
commit
7330e1ae2b
@ -678,6 +678,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
L.e("createRoom----播放地址--->" + playUrl);
|
L.e("createRoom----播放地址--->" + playUrl);
|
||||||
mLiveBean.setPull(playUrl);
|
mLiveBean.setPull(playUrl);
|
||||||
mTxAppId = obj.getString("tx_appid");
|
mTxAppId = obj.getString("tx_appid");
|
||||||
|
|
||||||
//移除开播前的设置控件,添加直播间控件
|
//移除开播前的设置控件,添加直播间控件
|
||||||
if (mLiveReadyViewHolder != null) {
|
if (mLiveReadyViewHolder != null) {
|
||||||
mLiveReadyViewHolder.removeFromParent();
|
mLiveReadyViewHolder.removeFromParent();
|
||||||
@ -709,6 +710,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
|
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
|
||||||
mLiveAnchorViewHolder.setLiveBean(mLiveBean);
|
mLiveAnchorViewHolder.setLiveBean(mLiveBean);
|
||||||
mLiveAnchorViewHolder.addToParent();
|
mLiveAnchorViewHolder.addToParent();
|
||||||
|
mLiveAnchorViewHolder.startAnchorLiveTime();
|
||||||
}
|
}
|
||||||
mLiveBottomViewHolder = mLiveAnchorViewHolder;
|
mLiveBottomViewHolder = mLiveAnchorViewHolder;
|
||||||
mSocketRyClient = new SocketRyClient(mLiveUid, this);
|
mSocketRyClient = new SocketRyClient(mLiveUid, this);
|
||||||
@ -865,6 +867,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
mLiveEndViewHolder.subscribeActivityLifeCycle();
|
mLiveEndViewHolder.subscribeActivityLifeCycle();
|
||||||
mLiveEndViewHolder.addToParent();
|
mLiveEndViewHolder.addToParent();
|
||||||
mLiveEndViewHolder.showData(mLiveBean, mStream);
|
mLiveEndViewHolder.showData(mLiveBean, mStream);
|
||||||
|
mLiveEndViewHolder.upData(datas.getString("votes"), datas.getString("length"), Long.parseLong(datas.getString("nums")));
|
||||||
}
|
}
|
||||||
if (mLiveAnchorViewHolder != null) {
|
if (mLiveAnchorViewHolder != null) {
|
||||||
mLiveAnchorViewHolder.release();
|
mLiveAnchorViewHolder.release();
|
||||||
@ -986,27 +989,27 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onPause() {
|
protected void onPause() {
|
||||||
if (mLiveRoomViewHolder != null) {
|
// if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.anchorPause();
|
// mLiveRoomViewHolder.anchorPause();
|
||||||
}
|
// }
|
||||||
super.onPause();
|
super.onPause();
|
||||||
if (isKeyBack) {
|
// if (isKeyBack) {
|
||||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
|
// sendSystemMessage(WordUtil.getString(R.string.live_anchor_leave));
|
||||||
}
|
// }
|
||||||
mPaused = true;
|
// mPaused = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onResume() {
|
protected void onResume() {
|
||||||
super.onResume();
|
super.onResume();
|
||||||
if (mPaused) {
|
// if (mPaused) {
|
||||||
if (mLiveRoomViewHolder != null) {
|
// if (mLiveRoomViewHolder != null) {
|
||||||
mLiveRoomViewHolder.anchorResume();
|
// mLiveRoomViewHolder.anchorResume();
|
||||||
}
|
// }
|
||||||
sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
|
// sendSystemMessage(WordUtil.getString(R.string.live_anchor_come_back));
|
||||||
CommonHttpUtil.checkTokenInvalid();
|
// CommonHttpUtil.checkTokenInvalid();
|
||||||
}
|
// }
|
||||||
mPaused = false;
|
// mPaused = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -220,6 +220,26 @@ public class LiveEndViewHolder extends AbsViewHolder implements View.OnClickList
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void upData(String votes, String length, long nums) {
|
||||||
|
Log.e("收", votes + "votes" + length + "length" + nums + "nums");
|
||||||
|
if (type == LiveOfType.USER) {
|
||||||
|
if (liveDurationUser != null) {
|
||||||
|
liveDurationUser.setText(length);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (liveDurationAnchor != null) {
|
||||||
|
liveDurationAnchor.setText(length);
|
||||||
|
}
|
||||||
|
if (liveVotes != null) {
|
||||||
|
liveVotes.setText(votes);
|
||||||
|
}
|
||||||
|
if (liveWatchNum != null) {
|
||||||
|
liveWatchNum.setText(StringUtil.toWan(nums));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void showData(LiveBean liveBean, final String stream) {
|
public void showData(LiveBean liveBean, final String stream) {
|
||||||
if (TextUtils.equals(model.getId() + "", liveBean.getUid())) {
|
if (TextUtils.equals(model.getId() + "", liveBean.getUid())) {
|
||||||
type = LiveOfType.ANCHOR;
|
type = LiveOfType.ANCHOR;
|
||||||
|
@ -210,8 +210,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
private GifImageView mGifImageView;
|
private GifImageView mGifImageView;
|
||||||
public static SVGAImageView mSVGAImageView;
|
public static SVGAImageView mSVGAImageView;
|
||||||
private ViewGroup mLiveGiftPrizePoolContainer;
|
private ViewGroup mLiveGiftPrizePoolContainer;
|
||||||
private TextView mLiveTimeTextView;//主播的直播时长
|
|
||||||
private long mAnchorLiveTime;//主播直播时间
|
|
||||||
private View mBtnPrizePool;//奖池按钮
|
private View mBtnPrizePool;//奖池按钮
|
||||||
private TextView mPrizePoolLevel;//奖池等级
|
private TextView mPrizePoolLevel;//奖池等级
|
||||||
private int forAct;
|
private int forAct;
|
||||||
@ -941,9 +940,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
mBtnRedPack.setOnClickListener(this);
|
mBtnRedPack.setOnClickListener(this);
|
||||||
if (mContext instanceof LiveAudienceActivity) {
|
if (mContext instanceof LiveAudienceActivity) {
|
||||||
mRoot.setOnClickListener(this);
|
mRoot.setOnClickListener(this);
|
||||||
} else {
|
|
||||||
mLiveTimeTextView = (TextView) findViewById(R.id.live_time);
|
|
||||||
mLiveTimeTextView.setVisibility(View.VISIBLE);
|
|
||||||
}
|
}
|
||||||
mLightAnimPresenter = new LiveLightAnimPresenter(mContext, mParentView);
|
mLightAnimPresenter = new LiveLightAnimPresenter(mContext, mParentView);
|
||||||
mLiveEnterRoomAnimPresenter = new LiveEnterRoomAnimPresenter(mContext, mContentView, mScreenWdith);
|
mLiveEnterRoomAnimPresenter = new LiveEnterRoomAnimPresenter(mContext, mContentView, mScreenWdith);
|
||||||
@ -2923,16 +2919,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 主播显示直播时间
|
|
||||||
*/
|
|
||||||
private void showAnchorLiveTime() {
|
|
||||||
if (mLiveTimeTextView != null) {
|
|
||||||
mAnchorLiveTime += 1000;
|
|
||||||
mLiveTimeTextView.setText(StringUtil.getDurationText(mAnchorLiveTime));
|
|
||||||
startAnchorLiveTime();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void startAnchorLiveTime() {
|
public void startAnchorLiveTime() {
|
||||||
if (mLiveRoomHandler != null) {
|
if (mLiveRoomHandler != null) {
|
||||||
@ -3234,9 +3221,6 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
|||||||
case WHAT_TIME_CHARGE:
|
case WHAT_TIME_CHARGE:
|
||||||
mLiveRoomViewHolder.requestTimeCharge();
|
mLiveRoomViewHolder.requestTimeCharge();
|
||||||
break;
|
break;
|
||||||
case WHAT_ANCHOR_LIVE_TIME:
|
|
||||||
mLiveRoomViewHolder.showAnchorLiveTime();
|
|
||||||
break;
|
|
||||||
case WHAT_ANCHOR_PAUSE:
|
case WHAT_ANCHOR_PAUSE:
|
||||||
mLiveRoomViewHolder.anchorEndLive();
|
mLiveRoomViewHolder.anchorEndLive();
|
||||||
break;
|
break;
|
||||||
|
@ -4,13 +4,15 @@ import static com.yunbao.live.activity.LiveActivity.mLiveUid;
|
|||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.PKing;
|
||||||
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
import static com.yunbao.live.activity.LiveRyAnchorActivity.pk_nub;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.START_MESSAGE;
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST;
|
|
||||||
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
import static com.yunbao.live.event.LiveAudienceEvent.LiveAudienceType.WISH_LIST_UPDATE;
|
||||||
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
import static com.yunbao.live.presenter.LiveRyLinkMicPkPresenter.leaveDRRoom;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.os.Handler;
|
||||||
|
import android.os.Message;
|
||||||
|
import android.os.SystemClock;
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -37,6 +39,7 @@ import com.yunbao.common.http.HttpClient;
|
|||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.manager.IMLoginManager;
|
import com.yunbao.common.manager.IMLoginManager;
|
||||||
import com.yunbao.common.utils.Bus;
|
import com.yunbao.common.utils.Bus;
|
||||||
|
import com.yunbao.common.utils.StringUtil;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
import com.yunbao.live.R;
|
import com.yunbao.live.R;
|
||||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||||
@ -77,10 +80,13 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
private LiveBean mLiveBean;
|
private LiveBean mLiveBean;
|
||||||
private List<BannerBean> mBannerList = new ArrayList<>();
|
private List<BannerBean> mBannerList = new ArrayList<>();
|
||||||
private String activityUrl;
|
private String activityUrl;
|
||||||
|
private TextView mLiveTimeTextView;//主播的直播时长
|
||||||
|
private long mAnchorLiveTime;//主播直播时间
|
||||||
|
private LiveRoomHandler mLiveRoomHandler;
|
||||||
|
|
||||||
public LiveRyAnchorViewHolder(Context context, ViewGroup parentView) {
|
public LiveRyAnchorViewHolder(Context context, ViewGroup parentView) {
|
||||||
super(context, parentView);
|
super(context, parentView);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -163,6 +169,9 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
findViewById(R.id.btn_link_mic).setOnClickListener(this);
|
findViewById(R.id.btn_link_mic).setOnClickListener(this);
|
||||||
|
mLiveTimeTextView = (TextView) findViewById(R.id.live_time);
|
||||||
|
mLiveTimeTextView.setVisibility(View.VISIBLE);
|
||||||
|
mLiveRoomHandler = new LiveRoomHandler();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -568,4 +577,50 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
|||||||
initWishList();
|
initWishList();
|
||||||
setLiveUid(mLiveBean.getUid());
|
setLiveUid(mLiveBean.getUid());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主播显示直播时间
|
||||||
|
*/
|
||||||
|
private void showAnchorLiveTime() {
|
||||||
|
if (mLiveTimeTextView != null) {
|
||||||
|
mAnchorLiveTime += 1000;
|
||||||
|
mLiveTimeTextView.setText(StringUtil.getDurationText(mAnchorLiveTime));
|
||||||
|
startAnchorLiveTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void startAnchorLiveTime() {
|
||||||
|
if (mLiveRoomHandler != null) {
|
||||||
|
mLiveRoomHandler.sendEmptyMessageAtTime(WHAT_ANCHOR_LIVE_TIME, getNextTime(1000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int WHAT_ANCHOR_LIVE_TIME = 3;//直播间主播计时
|
||||||
|
|
||||||
|
private class LiveRoomHandler extends Handler {
|
||||||
|
@Override
|
||||||
|
public void handleMessage(Message msg) {
|
||||||
|
|
||||||
|
switch (msg.what) {
|
||||||
|
|
||||||
|
case WHAT_ANCHOR_LIVE_TIME:
|
||||||
|
showAnchorLiveTime();
|
||||||
|
break;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void release() {
|
||||||
|
removeCallbacksAndMessages(null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getNextTime(int time) {
|
||||||
|
long now = SystemClock.uptimeMillis();
|
||||||
|
if (time < 1000) {
|
||||||
|
return now + time;
|
||||||
|
}
|
||||||
|
return now + time + -now % 1000;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -133,6 +133,7 @@ PK"
|
|||||||
android:layout_height="45dp"
|
android:layout_height="45dp"
|
||||||
android:layout_gravity="bottom">
|
android:layout_gravity="bottom">
|
||||||
|
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/btn_close"
|
android:id="@+id/btn_close"
|
||||||
android:layout_width="1dp"
|
android:layout_width="1dp"
|
||||||
@ -231,5 +232,25 @@ PK"
|
|||||||
android:translationY="-4dp"
|
android:translationY="-4dp"
|
||||||
android:visibility="invisible" />
|
android:visibility="invisible" />
|
||||||
|
|
||||||
|
<com.yunbao.common.custom.DrawableTextView
|
||||||
|
android:id="@+id/live_time"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="34dp"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_marginStart="42dp"
|
||||||
|
android:layout_marginEnd="10dp"
|
||||||
|
android:layout_toEndOf="@id/et_input"
|
||||||
|
android:background="@drawable/bg_live_push_time"
|
||||||
|
android:drawablePadding="5dp"
|
||||||
|
android:gravity="center_vertical"
|
||||||
|
android:paddingLeft="10dp"
|
||||||
|
android:paddingRight="10dp"
|
||||||
|
android:text="00:00"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="10sp"
|
||||||
|
android:visibility="invisible"
|
||||||
|
app:dt_left_drawable="@drawable/bg_push_time_point"
|
||||||
|
app:dt_left_height="4dp"
|
||||||
|
app:dt_left_width="4dp" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user