Merge branch 'master' into dev_6.5.4_tmp
# Conflicts: # common/src/main/java/com/yunbao/common/http/PDLiveApi.java # common/src/main/java/com/yunbao/common/http/live/LiveNetManager.java # common/src/main/java/com/yunbao/common/utils/JavascriptInterfaceUtils.java # common/src/main/res/values-en-rUS/string.xml # common/src/main/res/values-zh-rHK/strings.xml # common/src/main/res/values-zh-rTW/strings.xml # common/src/main/res/values-zh/strings.xml # common/src/main/res/values/strings.xml # live/src/main/java/com/yunbao/live/views/LiveRoomViewHolder.java
@@ -5,6 +5,7 @@
|
||||
<!--com.kugou.fanxing.allinone.watch.liveroominone.media.FALiveRoomInOneActivity"-->
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.VIBRATE" />
|
||||
|
||||
<application
|
||||
android:allowBackup="true"
|
||||
|
||||
@@ -15,6 +16,11 @@
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name=".activity.GiftWallActivity"
|
||||
android:screenOrientation="portrait"
|
||||
android:theme="@style/AppTheme"
|
||||
android:windowSoftInputMode="adjustPan|stateAlwaysHidden" />
|
||||
<activity
|
||||
android:name=".activity.LiveAudienceActivity"
|
||||
android:configChanges="screenLayout|orientation"
|
||||
|
||||
@@ -0,0 +1,194 @@
|
||||
package com.yunbao.live.activity;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.alibaba.android.arouter.facade.annotation.Route;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.activity.AbsActivity;
|
||||
import com.yunbao.common.event.GiftWallItemEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.fragment.AllServiceChampionFragment;
|
||||
import com.yunbao.common.fragment.GiftWithoutWallFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.dialog.CodexDialog;
|
||||
import com.yunbao.live.dialog.GiftWallItemPopup;
|
||||
import com.yunbao.live.dialog.MedalAchievementPopup;
|
||||
import com.yunbao.live.views.GiftAlreadyWallFragment;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Route(path = RouteUtil.PATH_GIFT_WALL)
|
||||
public class GiftWallActivity extends AbsActivity {
|
||||
private LinearLayout layoutLitIcon, layoutUnlitIcon, layoutAllServiceChampion;
|
||||
private TextView textLitIcon, textUnlitIcon, textAllServiceChampion, anchorName;
|
||||
private View viewAllServiceChampion, viewUnlitIcon, viewLitIcon;
|
||||
private RoundedImageView avatar;
|
||||
private List<TextView> tabText = new ArrayList<>();
|
||||
private List<View> tabView = new ArrayList<>();
|
||||
private String mStream, mAnchorName, mLiveUid, mAvatarUrl;
|
||||
private int isAttention = 0;//是否关注 0=没关注,
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.activity_live_gift_wall;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
Bus.getOff(this);
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
layoutLitIcon = findViewById(R.id.layout_lit_icon);
|
||||
layoutUnlitIcon = findViewById(R.id.layout_unlit_icon);
|
||||
layoutAllServiceChampion = findViewById(R.id.layout_all_service_champion);
|
||||
textLitIcon = findViewById(R.id.text_lit_icon);
|
||||
textUnlitIcon = findViewById(R.id.text_unlit_icon);
|
||||
textAllServiceChampion = findViewById(R.id.text_all_service_champion);
|
||||
viewAllServiceChampion = findViewById(R.id.view_all_service_champion);
|
||||
viewUnlitIcon = findViewById(R.id.view_unlit_icon);
|
||||
viewLitIcon = findViewById(R.id.view_lit_icon);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
anchorName = findViewById(R.id.anchor_name);
|
||||
tabText.add(textLitIcon);
|
||||
tabText.add(textUnlitIcon);
|
||||
tabText.add(textAllServiceChampion);
|
||||
tabView.add(viewLitIcon);
|
||||
tabView.add(viewUnlitIcon);
|
||||
tabView.add(viewAllServiceChampion);
|
||||
selectTab(textLitIcon, viewLitIcon);
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> {
|
||||
selectTab(textLitIcon, viewLitIcon);
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
|
||||
transaction.commit();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
selectTab(textUnlitIcon, viewUnlitIcon);
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
|
||||
transaction.commit();
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutAllServiceChampion, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
selectTab(textAllServiceChampion, viewAllServiceChampion);
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, AllServiceChampionFragment.newInstance(mStream, mLiveUid));
|
||||
transaction.commit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(GiftWallActivity.this)
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(GiftWallActivity.this, mStream, mLiveUid, false))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(GiftWallActivity.this)
|
||||
.enableDrag(false)
|
||||
.asCustom(new MedalAchievementPopup(GiftWallActivity.this, false, mLiveUid,mLiveUid))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(avatar, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
forwardHomePage();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(anchorName, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
forwardHomePage();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
Intent intent = getIntent();
|
||||
if (intent == null) {
|
||||
return;
|
||||
}
|
||||
mLiveUid = intent.getStringExtra(Constants.LIVE_UID);
|
||||
mStream = intent.getStringExtra(Constants.STREAM);
|
||||
mAnchorName = intent.getStringExtra("mAnchorName");
|
||||
mAvatarUrl = intent.getStringExtra("mAvatarUrl");
|
||||
isAttention = intent.getIntExtra("isAttention", 0);
|
||||
|
||||
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, mLiveUid));
|
||||
transaction.commit();
|
||||
ImgLoader.display(GiftWallActivity.this, mAvatarUrl, avatar);
|
||||
anchorName.setText(mAnchorName);
|
||||
}
|
||||
|
||||
private void selectTab(TextView textView, View tab) {
|
||||
for (TextView view : tabText) {
|
||||
if (textView == view) {
|
||||
view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD_ITALIC);
|
||||
} else {
|
||||
view.setTypeface(Typeface.SANS_SERIF, Typeface.ITALIC);
|
||||
}
|
||||
}
|
||||
for (View view : tabView) {
|
||||
view.setVisibility(view == tab ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
private void forwardHomePage() {
|
||||
finish();
|
||||
RouteUtil.forwardUserHome(mContext, mLiveUid, false, mLiveUid, 0);
|
||||
}
|
||||
/**
|
||||
* 关于点击礼物分类的通知
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftWallItemEvent(GiftWallItemEvent event) {
|
||||
new XPopup.Builder(this)
|
||||
.asCustom(new GiftWallItemPopup(this, event.getGiftWallModel(), event.isUnlit(), mLiveUid, mStream))
|
||||
.show();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
|
||||
onBackPressed();
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,7 @@ import com.yunbao.common.dialog.SlideSettingsDialog;
|
||||
import com.yunbao.common.dialog.YoursystemisolderDialog;
|
||||
import com.yunbao.common.event.CustomDrawerPopupEvent;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.GiftWallIlluminateEvent;
|
||||
import com.yunbao.common.event.JavascriptInterfaceEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
@@ -90,8 +91,9 @@ import com.yunbao.live.bean.ImUserBean;
|
||||
import com.yunbao.live.bean.LiveChatBean;
|
||||
import com.yunbao.live.dialog.LiveFansFragment;
|
||||
import com.yunbao.live.dialog.LiveGameDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGiftDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveGiftPopup;
|
||||
import com.yunbao.live.dialog.LiveHDDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveMicUserDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveTotalDialog;
|
||||
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
||||
@@ -442,18 +444,16 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
*/
|
||||
public void openGiftWindow() {
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setPkStatus(isPk);
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.setOnDismissListener(dialog -> checkMsgRed());
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setPk(isPk)
|
||||
.setLiveGuardInfo(mLiveGuardInfo));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -461,16 +461,13 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setPkStatus(isPk);
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, giftId);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.setOnDismissListener(dialog -> checkMsgRed());
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setPk(isPk)
|
||||
.setLiveGuardInfo(mLiveGuardInfo)
|
||||
.setmWishGiftId(giftId));
|
||||
}
|
||||
|
||||
public void openGiftWindow(String giftId, String for_by) {
|
||||
@@ -478,19 +475,15 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
return;
|
||||
}
|
||||
new Handler(Looper.getMainLooper()).post(() -> {
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
fragment.setPkStatus(isPk);
|
||||
fragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, giftId);
|
||||
if (for_by.equals("1")) {
|
||||
bundle.putString("by", "1");
|
||||
}
|
||||
fragment.setArguments(bundle);
|
||||
fragment.setOnDismissListener(dialog -> checkMsgRed());
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setPk(isPk)
|
||||
.setLiveGuardInfo(mLiveGuardInfo)
|
||||
.setmWishGiftId(giftId)
|
||||
.setUname("1"));//setUname==by
|
||||
});
|
||||
|
||||
}
|
||||
@@ -1022,18 +1015,29 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
break;
|
||||
|
||||
case GIFT_POPUP:
|
||||
|
||||
if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
return;
|
||||
}
|
||||
LiveGiftDialogFragment liveGiftDialogFragment = new LiveGiftDialogFragment();
|
||||
liveGiftDialogFragment.setPkStatus(isPk);
|
||||
liveGiftDialogFragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
liveGiftDialogFragment.setArguments(bundle);
|
||||
liveGiftDialogFragment.setOnDismissListener(dialog -> checkMsgRed());
|
||||
liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
LiveGiftPopup liveGiftPopup = new LiveGiftPopup();
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("WishGiftId", event.getmWishGiftId());
|
||||
bundle.putBoolean("ContactGift", event.getIsContactGift());
|
||||
bundle.putParcelable("GuardInfo", event.getLiveGuardInfo());
|
||||
bundle.putBoolean("pk", event.isPk());
|
||||
liveGiftPopup.setArguments(bundle);
|
||||
liveGiftPopup.show(getSupportFragmentManager(), "LiveGiftPopup");
|
||||
// new XPopup.Builder(mContext)
|
||||
// .asCustom(new LiveGiftPopup(mContext, this))
|
||||
// .show();
|
||||
// if (TextUtils.isEmpty(mLiveUid) || TextUtils.isEmpty(mStream)) {
|
||||
// return;
|
||||
// }
|
||||
// LiveGiftDialogFragment liveGiftDialogFragment = new LiveGiftDialogFragment();
|
||||
// liveGiftDialogFragment.setPkStatus(isPk);
|
||||
// liveGiftDialogFragment.setLiveGuardInfo(mLiveGuardInfo);
|
||||
// bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
// bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
// liveGiftDialogFragment.setArguments(bundle);
|
||||
// liveGiftDialogFragment.setOnDismissListener(dialog -> checkMsgRed());
|
||||
// liveGiftDialogFragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
break;
|
||||
case CURRENT_ACTIVITY:
|
||||
String type = event.getModel().getActiveId();
|
||||
@@ -1408,16 +1412,50 @@ public class LiveAudienceActivity extends LiveActivity {
|
||||
manager.redPacketManage(event.getRedPacketModel());
|
||||
}
|
||||
break;
|
||||
case RED_PACKET_SUPER_JACKPOT:
|
||||
case RED_PACKET_SUPER_JACKPOT:
|
||||
if (manager != null) {
|
||||
manager.setRedPacketInfoModel(event.getRedPacketInfoModel());
|
||||
}
|
||||
break;
|
||||
case INPUT_DIALOG:
|
||||
LiveInputDialogFragment liveInputDialogFragment = new LiveInputDialogFragment();
|
||||
Bundle liveInputBundle = new Bundle();
|
||||
liveInputBundle.putString(Constants.LIVE_DANMU_PRICE, mDanmuPrice);
|
||||
liveInputBundle.putString(Constants.COIN_NAME, mCoinName);
|
||||
liveInputBundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
liveInputBundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
liveInputBundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
if (event.getOlineUserlistModel() == null) {
|
||||
liveInputBundle.putString("TagUser", "");
|
||||
} else {
|
||||
liveInputBundle.putString("TagUser", GsonUtils.toJson(event.getOlineUserlistModel()));
|
||||
}
|
||||
liveInputDialogFragment.setArguments(liveInputBundle);
|
||||
liveInputDialogFragment.show(getSupportFragmentManager(), "LiveInputDialogFragment");
|
||||
break;
|
||||
case IS_ATTENTION:
|
||||
if (manager != null) {
|
||||
manager.setAttention(event.getLiveType());
|
||||
}
|
||||
|
||||
break;
|
||||
case GIFT_WALL:
|
||||
if (manager != null) {
|
||||
manager.showGiftWall(event.getUid());
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) {
|
||||
if (manager != null) {
|
||||
manager.setGiftWall(String.valueOf(event.getNewNumber()), String.valueOf(event.getMaxNumber()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 跳转到消息中心的系统信息web
|
||||
*
|
||||
|
||||
@@ -50,6 +50,7 @@ import com.yunbao.common.bean.LiveUserGiftBean;
|
||||
import com.yunbao.common.bean.MicUserBean;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.NotCancelableDialog;
|
||||
import com.yunbao.common.event.GiftWallIlluminateEvent;
|
||||
import com.yunbao.common.event.LoginInvalidEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
@@ -792,6 +793,7 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
mLiveRoomViewHolder.startAnchorLight();
|
||||
//初始化女神说
|
||||
mLiveRoomViewHolder.initAnchorSay();
|
||||
mLiveRoomViewHolder.setGiftWall(obj.getString("gift_wall_lighten_number"),obj.getString("gift_wall_lighten_total"));
|
||||
}
|
||||
if (mLiveAnchorViewHolder == null) {
|
||||
mLiveAnchorViewHolder = new LiveRyAnchorViewHolder(mContext, mContainer);
|
||||
@@ -1654,9 +1656,19 @@ public class LiveRyAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
mLiveRoomViewHolder.blindBoxAllServerNotify(event.getAllServerNotifyEvent());
|
||||
}
|
||||
break;
|
||||
case GIFT_WALL:
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGiftWall(event.getUid());
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void GiftWallIlluminateEvent(GiftWallIlluminateEvent event) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setGiftWall(String.valueOf(event.getNewNumber()), String.valueOf(event.getMaxNumber()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查指定直播间连麦人数
|
||||
*
|
||||
|
||||
@@ -296,7 +296,7 @@ public class ZhuangBanActivity extends AbsActivity {
|
||||
Intent intent = new Intent(context, ZhuangBanActivity.class);
|
||||
Log.i("tag", url);
|
||||
intent.putExtra(Constants.URL, url);
|
||||
if (url.contains("Noble/index.html")) {
|
||||
if (url.contains("Noble/index.html")||url.contains("RongYuQiang")) {
|
||||
intent.putExtra("title", "");
|
||||
}
|
||||
context.startActivity(intent);
|
||||
|
||||
47
live/src/main/java/com/yunbao/live/adapter/CodexAdapter.java
Normal file
@@ -0,0 +1,47 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.live.views.CodexViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodexAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftGuideModel> giftGuideModels = new ArrayList<>();
|
||||
private boolean history;
|
||||
private String mStream, mLiveUid;
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex, parent, false);
|
||||
return new CodexViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
CodexViewHolder codexViewHolder = (CodexViewHolder) holder;
|
||||
codexViewHolder.showData(giftGuideModels.get(position), history,mStream,mLiveUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftGuideModels.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftGuideModel> mGiftWall, boolean history, String mStream, String mLiveUid) {
|
||||
this.history = history;
|
||||
this.mStream = mStream;
|
||||
this.mLiveUid = mLiveUid;
|
||||
giftGuideModels.clear();
|
||||
giftGuideModels.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.live.views.CodexItemViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class CodexItemAdapter extends RecyclerView.Adapter {
|
||||
private List<GiftWallModel> giftData = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_codex_item, parent, false);
|
||||
return new CodexItemViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
CodexItemViewHolder codexItemViewHolder = (CodexItemViewHolder) holder;
|
||||
codexItemViewHolder.showData(giftData.get(position));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftData.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftWallModel> mGiftWall) {
|
||||
giftData.clear();
|
||||
giftData.addAll(mGiftWall);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.event.LiveGiftItemEvent;
|
||||
import com.yunbao.live.views.FrameGiftViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FrameGiftAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private String mStream, mLiveUid, wishGiftId;
|
||||
|
||||
public FrameGiftAdapter(int contextLayoutGiftHeight, List<LiveGiftBean> giftJson, String mStream, String mLiveUid, String wishGiftId) {
|
||||
this.contextLayoutGiftHeight = contextLayoutGiftHeight;
|
||||
this.giftJson = giftJson;
|
||||
this.mStream = mStream;
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.wishGiftId = wishGiftId;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_frame_gift, parent, false);
|
||||
return new FrameGiftViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(giftJson.get(position).getId() + "", wishGiftId)) {
|
||||
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(giftJson.get(position)));
|
||||
}
|
||||
|
||||
FrameGiftViewHolder frameGiftViewHolder = (FrameGiftViewHolder) holder;
|
||||
frameGiftViewHolder.showData(contextLayoutGiftHeight, giftJson.get(position));
|
||||
frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new FrameGiftViewHolder.FrameGiftClickListener() {
|
||||
@Override
|
||||
public void onCallBack(int position, LiveGiftBean model) {
|
||||
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model));
|
||||
wishGiftId = null;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void giftSelect(LiveGiftBean model) {
|
||||
for (int i = 0; i < giftJson.size(); i++) {
|
||||
giftJson.get(i).setChecked(giftJson.get(i).getId() == model.getId());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftJson.size();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.GiftTopBean;
|
||||
import com.yunbao.live.views.GiftTitleViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class GiftTitleAdapter extends RecyclerView.Adapter {
|
||||
|
||||
List<GiftTopBean> name = new ArrayList<>();
|
||||
private int index = 0;
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_gift_top_new, parent, false);
|
||||
return new GiftTitleViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
GiftTitleViewHolder itemViewHolder = (GiftTitleViewHolder) holder;
|
||||
itemViewHolder.showData(name.get(position), position, new GiftTitleViewHolder.ClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks(int mPosition) {
|
||||
index = mPosition;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
});
|
||||
itemViewHolder.selectData(index == position);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return name.size();
|
||||
}
|
||||
|
||||
public void addAllData(List<GiftTopBean> giftTopBeans) {
|
||||
name.clear();
|
||||
name.addAll(giftTopBeans);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void uncheck() {
|
||||
index = -1;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
@@ -41,6 +41,7 @@ import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.custom.VerticalImageSpan;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
@@ -237,6 +238,20 @@ public class LiveChatAdapter extends RecyclerView.Adapter {
|
||||
}
|
||||
|
||||
void setData(final LiveChatBean bean, int position) {
|
||||
itemView.setOnLongClickListener(new View.OnLongClickListener() {
|
||||
@Override
|
||||
public boolean onLongClick(View v) {
|
||||
if (!TextUtils.isEmpty(bean.getId())&&!TextUtils.isEmpty(bean.getUserNiceName())){
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG)
|
||||
.setOlineUserlistModel(new OlineUserlistModel().setId(bean.getId()).setUserNicename(bean.getUserNiceName())));
|
||||
|
||||
}
|
||||
|
||||
Log.e("eqwewqeweq", bean.toString());
|
||||
return true;
|
||||
}
|
||||
});
|
||||
mTextView.setTextSize(fountSize);
|
||||
automatic_chat.setTextSize(fountSize);
|
||||
itemView.setTag(bean);
|
||||
|
||||
@@ -35,7 +35,7 @@ import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.custom.GiftMarkView;
|
||||
import com.yunbao.live.dialog.SendRendPacketPopup;
|
||||
import com.yunbao.live.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.List;
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentManager;
|
||||
import androidx.fragment.app.FragmentPagerAdapter;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class LiveGiftFragmentPagerAdapter extends FragmentPagerAdapter {
|
||||
|
||||
private List<Fragment> fragmentList;
|
||||
|
||||
|
||||
public LiveGiftFragmentPagerAdapter(FragmentManager fm, Context mContext, List<Fragment> fragmentList) {
|
||||
super(fm);
|
||||
|
||||
this.fragmentList = fragmentList;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Fragment getItem(int i) {
|
||||
return fragmentList.get(i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCount() {
|
||||
return fragmentList.size();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.yunbao.live.adapter;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.event.LiveGiftItemEvent;
|
||||
import com.yunbao.live.views.LiveParcelItemViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveParcelItemAdapter extends RecyclerView.Adapter {
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private String mStream, mLiveUid;
|
||||
|
||||
public LiveParcelItemAdapter(int contextLayoutGiftHeight, List<LiveGiftBean> giftJson, String mStream, String mLiveUid) {
|
||||
this.contextLayoutGiftHeight = contextLayoutGiftHeight;
|
||||
this.giftJson = giftJson;
|
||||
this.mStream = mStream;
|
||||
this.mLiveUid = mLiveUid;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View herdView = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_live_parcel, parent, false);
|
||||
return new LiveParcelItemViewHolder(herdView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
LiveParcelItemViewHolder frameGiftViewHolder = (LiveParcelItemViewHolder) holder;
|
||||
frameGiftViewHolder.showData(contextLayoutGiftHeight, giftJson.get(position));
|
||||
frameGiftViewHolder.giftSelect(giftJson.get(position), position, mStream, mLiveUid, new LiveParcelItemViewHolder.FrameGiftClickListener() {
|
||||
@Override
|
||||
public void onCallBack(int position, LiveGiftBean model) {
|
||||
Bus.get().post(new LiveGiftItemEvent().setLiveGiftModel(model));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void giftSelect(LiveGiftBean model) {
|
||||
for (int i = 0; i < giftJson.size(); i++) {
|
||||
giftJson.get(i).setChecked(giftJson.get(i).getId() == model.getId());
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
public void refreshWrapListAfterSend(LiveGiftBean model) {
|
||||
for (int i = 0; i < giftJson.size(); i++) {
|
||||
if (giftJson.get(i).getId() == model.getId()) {
|
||||
|
||||
|
||||
String giftNum = giftJson.get(i).getGiftNum();
|
||||
int number = 0;
|
||||
try {
|
||||
number = Integer.parseInt(giftNum);
|
||||
} catch (NumberFormatException e) {
|
||||
e.printStackTrace();
|
||||
number = 0;
|
||||
}
|
||||
if (number == 1) {
|
||||
|
||||
giftJson.remove(i);
|
||||
} else {
|
||||
giftJson.get(i).setGiftNum(String.valueOf(number - 1));
|
||||
}
|
||||
}
|
||||
}
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return giftJson.size();
|
||||
}
|
||||
}
|
||||
133
live/src/main/java/com/yunbao/live/bean/CoinModel.java
Normal file
@@ -0,0 +1,133 @@
|
||||
package com.yunbao.live.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class CoinModel extends BaseModel {
|
||||
//钻石余额
|
||||
@SerializedName("coin")
|
||||
private String coin;
|
||||
//金豆余额
|
||||
@SerializedName("gold")
|
||||
private String gold;
|
||||
|
||||
@SerializedName("uid")
|
||||
private String uid;
|
||||
//平台最大等级
|
||||
@SerializedName("user_level_max")
|
||||
private String userLevelMax;
|
||||
//当前用户等级
|
||||
@SerializedName("user_level")
|
||||
private String userLevel;
|
||||
//升级下一级需要的经验
|
||||
@SerializedName("user_next_level_rewards")
|
||||
private String userNextLevelRewards;
|
||||
//当前已经获取到的经验值
|
||||
@SerializedName("user_level_current_consumption")
|
||||
private String userLevelCurrentConsumption;
|
||||
//升级需要的经验值(总的)
|
||||
@SerializedName("user_level_upgrades")
|
||||
private String userLevelUpgrades;
|
||||
//包裹红点
|
||||
@SerializedName("users_pack_red_dot")
|
||||
private String usersPackRedDot;
|
||||
|
||||
public String getCoin() {
|
||||
long coinMoney = Long.parseLong(coin);
|
||||
if (999999999 < coinMoney && coinMoney <= 999999999999L) {
|
||||
coin = coin.substring(0, coin.length() - 2);
|
||||
coin = coin + "k";
|
||||
}
|
||||
if (999999999999L < coinMoney && coinMoney <= 999999999999999L) {
|
||||
coin = coin.substring(0, coin.length() - 2);
|
||||
coin = coin + "M";
|
||||
}
|
||||
return coin;
|
||||
}
|
||||
|
||||
public CoinModel setCoin(String coin) {
|
||||
this.coin = coin;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGold() {
|
||||
long goldMoney = Long.parseLong(gold);
|
||||
if (999999999 < goldMoney && goldMoney <= 999999999999L) {
|
||||
gold = gold.substring(0, gold.length() - 2);
|
||||
gold = gold + "k";
|
||||
}
|
||||
if (999999999999L < goldMoney && goldMoney <= 999999999999999L) {
|
||||
gold = gold.substring(0, gold.length() - 2);
|
||||
gold = gold + "M";
|
||||
}
|
||||
return gold;
|
||||
}
|
||||
|
||||
public CoinModel setGold(String gold) {
|
||||
this.gold = gold;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUid() {
|
||||
return uid;
|
||||
}
|
||||
|
||||
public CoinModel setUid(String uid) {
|
||||
this.uid = uid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserLevelMax() {
|
||||
return userLevelMax;
|
||||
}
|
||||
|
||||
public CoinModel setUserLevelMax(String userLevelMax) {
|
||||
this.userLevelMax = userLevelMax;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserLevel() {
|
||||
return userLevel;
|
||||
}
|
||||
|
||||
public CoinModel setUserLevel(String userLevel) {
|
||||
this.userLevel = userLevel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserNextLevelRewards() {
|
||||
return userNextLevelRewards;
|
||||
}
|
||||
|
||||
public CoinModel setUserNextLevelRewards(String userNextLevelRewards) {
|
||||
this.userNextLevelRewards = userNextLevelRewards;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserLevelCurrentConsumption() {
|
||||
return userLevelCurrentConsumption;
|
||||
}
|
||||
|
||||
public CoinModel setUserLevelCurrentConsumption(String userLevelCurrentConsumption) {
|
||||
this.userLevelCurrentConsumption = userLevelCurrentConsumption;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUserLevelUpgrades() {
|
||||
return userLevelUpgrades;
|
||||
}
|
||||
|
||||
public CoinModel setUserLevelUpgrades(String userLevelUpgrades) {
|
||||
this.userLevelUpgrades = userLevelUpgrades;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getUsersPackRedDot() {
|
||||
return usersPackRedDot;
|
||||
}
|
||||
|
||||
public CoinModel setUsersPackRedDot(String usersPackRedDot) {
|
||||
this.usersPackRedDot = usersPackRedDot;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -54,6 +54,87 @@ public class LiveReceiveGiftBean extends BaseModel {
|
||||
private String opentype;
|
||||
private String anchorUid;
|
||||
private boolean isBlindBox = false;
|
||||
private String namingLiveuid;
|
||||
private String namingUid;
|
||||
private String namingLiveName;
|
||||
private String namingUserName;
|
||||
private String namingLiveAvatar;
|
||||
private String namingUserAvatar;
|
||||
private String namingStatus;
|
||||
private String namingCoin;
|
||||
|
||||
public String getNamingLiveuid() {
|
||||
return namingLiveuid;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingLiveuid(String namingLiveuid) {
|
||||
this.namingLiveuid = namingLiveuid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingUid() {
|
||||
return namingUid;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingUid(String namingUid) {
|
||||
this.namingUid = namingUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingLiveName() {
|
||||
return namingLiveName;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingLiveName(String namingLiveName) {
|
||||
this.namingLiveName = namingLiveName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingUserName() {
|
||||
return namingUserName;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingUserName(String namingUserName) {
|
||||
this.namingUserName = namingUserName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingLiveAvatar() {
|
||||
return namingLiveAvatar;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingLiveAvatar(String namingLiveAvatar) {
|
||||
this.namingLiveAvatar = namingLiveAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingUserAvatar() {
|
||||
return namingUserAvatar;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingUserAvatar(String namingUserAvatar) {
|
||||
this.namingUserAvatar = namingUserAvatar;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingStatus() {
|
||||
return namingStatus;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingStatus(String namingStatus) {
|
||||
this.namingStatus = namingStatus;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getNamingCoin() {
|
||||
return namingCoin;
|
||||
}
|
||||
|
||||
public LiveReceiveGiftBean setNamingCoin(String namingCoin) {
|
||||
this.namingCoin = namingCoin;
|
||||
return this;
|
||||
}
|
||||
|
||||
private AllServerNotifyEvent event = new AllServerNotifyEvent();
|
||||
|
||||
public AllServerNotifyEvent getEvent() {
|
||||
|
||||
114
live/src/main/java/com/yunbao/live/dialog/CodexDialog.java
Normal file
@@ -0,0 +1,114 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.common.event.CodexEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.CodexAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CodexDialog extends BottomPopupView {
|
||||
private String mStream, mLiveUid;
|
||||
private RecyclerView liveCodex;
|
||||
private CodexAdapter codexAdapter;
|
||||
private boolean history;
|
||||
|
||||
public CodexDialog(@NonNull Context context, String mStream, String mLiveUid, boolean history) {
|
||||
super(context);
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.mStream = mStream;
|
||||
this.history = history;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_live_codex;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
if (history) {
|
||||
LiveNetManager.get(getContext()).
|
||||
getGiftGuideHistory(mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftGuideModel> data) {
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LiveNetManager.get(getContext()).
|
||||
getGiftGuide(mLiveUid, new HttpCallback<List<GiftGuideModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<GiftGuideModel> data) {
|
||||
codexAdapter.addAllData(data,history,mStream,mLiveUid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
liveCodex = findViewById(R.id.live_codex);
|
||||
codexAdapter = new CodexAdapter();
|
||||
liveCodex.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
liveCodex.setAdapter(codexAdapter);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDismiss() {
|
||||
Bus.getOff(this);
|
||||
|
||||
super.onDismiss();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onCodexEvent(CodexEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
235
live/src/main/java/com/yunbao/live/dialog/GiftWallDialog.java
Normal file
@@ -0,0 +1,235 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.DialogInterface;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.makeramen.roundedimageview.RoundedImageView;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.GiftWallItemEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.fragment.AllServiceChampionFragment;
|
||||
import com.yunbao.common.fragment.GiftWithoutWallFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.views.GiftAlreadyWallFragment;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物墙
|
||||
*/
|
||||
public class GiftWallDialog extends AbsDialogFragment {
|
||||
private LinearLayout layoutLitIcon, layoutUnlitIcon, layoutAllServiceChampion;
|
||||
private TextView textLitIcon, textUnlitIcon, textAllServiceChampion, anchorName, regularBubble;
|
||||
private View viewAllServiceChampion, viewUnlitIcon, viewLitIcon, attention;
|
||||
private RoundedImageView avatar;
|
||||
private List<TextView> tabText = new ArrayList<>();
|
||||
private List<View> tabView = new ArrayList<>();
|
||||
private String mStream, mAnchorName, mLiveUid, mAvatarUrl, toUid;
|
||||
private int isAttention = 0;//是否关注 0=没关注,
|
||||
private boolean isLive;//是否正在直播
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
Bus.getOn(this);
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
layoutLitIcon = mRootView.findViewById(R.id.layout_lit_icon);
|
||||
layoutUnlitIcon = mRootView.findViewById(R.id.layout_unlit_icon);
|
||||
layoutAllServiceChampion = mRootView.findViewById(R.id.layout_all_service_champion);
|
||||
textLitIcon = mRootView.findViewById(R.id.text_lit_icon);
|
||||
textUnlitIcon = mRootView.findViewById(R.id.text_unlit_icon);
|
||||
textAllServiceChampion = mRootView.findViewById(R.id.text_all_service_champion);
|
||||
viewAllServiceChampion = mRootView.findViewById(R.id.view_all_service_champion);
|
||||
viewUnlitIcon = mRootView.findViewById(R.id.view_unlit_icon);
|
||||
viewLitIcon = mRootView.findViewById(R.id.view_lit_icon);
|
||||
avatar = mRootView.findViewById(R.id.avatar);
|
||||
attention = mRootView.findViewById(R.id.attention);
|
||||
anchorName = mRootView.findViewById(R.id.anchor_name);
|
||||
regularBubble = mRootView.findViewById(R.id.regular_bubble);
|
||||
tabText.add(textLitIcon);
|
||||
tabText.add(textUnlitIcon);
|
||||
tabText.add(textAllServiceChampion);
|
||||
tabView.add(viewLitIcon);
|
||||
tabView.add(viewUnlitIcon);
|
||||
tabView.add(viewAllServiceChampion);
|
||||
selectTab(textLitIcon, viewLitIcon);
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutLitIcon, () -> {
|
||||
selectTab(textLitIcon, viewLitIcon);
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid));
|
||||
transaction.commit();
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutUnlitIcon, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
selectTab(textUnlitIcon, viewUnlitIcon);
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftWithoutWallFragment.newInstance(mStream, mLiveUid, toUid));
|
||||
transaction.commit();
|
||||
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(layoutAllServiceChampion, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
selectTab(textAllServiceChampion, viewAllServiceChampion);
|
||||
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, AllServiceChampionFragment.newInstance(mStream, mLiveUid));
|
||||
transaction.commit();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(attention, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
CommonHttpUtil.setAttention(mLiveUid, new CommonCallback<Integer>() {
|
||||
@Override
|
||||
public void callback(Integer isAttention) {
|
||||
if (isAttention == 1) {
|
||||
LiveActivity.sendSystemMessage(IMLoginManager.get(getContext()).getUserInfo().getUserNicename()
|
||||
+ getActivity().getString(R.string.live_follow_anchor));
|
||||
attention.setVisibility(View.GONE);
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.IS_ATTENTION).setLiveType(isAttention));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(regularBubble, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.asCustom(new RegularIntroducePopup(getContext()))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.codex_layout), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(getContext(), mStream, mLiveUid, false))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.medal_achievement), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new MedalAchievementPopup(getContext(), isLive, toUid,mLiveUid))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
Bundle bundle = getArguments();
|
||||
if (bundle == null) {
|
||||
return;
|
||||
}
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
mStream = bundle.getString(Constants.STREAM);
|
||||
mAnchorName = bundle.getString("mAnchorName");
|
||||
mAvatarUrl = bundle.getString("mAvatarUrl");
|
||||
toUid = bundle.getString("toUid");
|
||||
isAttention = bundle.getInt("isAttention");
|
||||
isLive = bundle.getBoolean("isLive");
|
||||
FragmentTransaction transaction = getChildFragmentManager().beginTransaction();
|
||||
transaction.replace(R.id.context_layout_gift, GiftAlreadyWallFragment.newInstance(mStream, mLiveUid, toUid));
|
||||
transaction.commit();
|
||||
ImgLoader.display(getContext(), mAvatarUrl, avatar);
|
||||
anchorName.setText(mAnchorName);
|
||||
attention.setVisibility(isAttention == 0 ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
|
||||
private void selectTab(TextView textView, View tab) {
|
||||
for (TextView view : tabText) {
|
||||
if (textView == view) {
|
||||
view.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD_ITALIC);
|
||||
} else {
|
||||
view.setTypeface(Typeface.SANS_SERIF, Typeface.ITALIC);
|
||||
}
|
||||
}
|
||||
for (View view : tabView) {
|
||||
view.setVisibility(view == tab ? View.VISIBLE : View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDismiss(DialogInterface dialog) {
|
||||
super.onDismiss(dialog);
|
||||
Bus.getOff(this);
|
||||
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.dialog_live_gift_wall;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(com.yunbao.common.R.style.bottomToTopAnim);
|
||||
window.setDimAmount(0f);//去掉遮罩层(全透明)
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 关于点击礼物分类的通知
|
||||
*/
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onGiftWallItemEvent(GiftWallItemEvent event) {
|
||||
new XPopup.Builder(getActivity())
|
||||
.asCustom(new GiftWallItemPopup(getActivity(), event.getGiftWallModel(), event.isUnlit(), mLiveUid, mStream))
|
||||
.show();
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveGiftDialogEvent(LiveGiftDialogEvent event) {
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
110
live/src/main/java/com/yunbao/live/dialog/GiftWallItemPopup.java
Normal file
@@ -0,0 +1,110 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.cardview.widget.CardView;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallGiftDetail;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
|
||||
public class GiftWallItemPopup extends CenterPopupView {
|
||||
private CardView layout;
|
||||
private ImageView giftImg, avatar;
|
||||
private TextView price, giftDetailsBtn, distanceNaming, vacantPositionAwaits, giftDetails, vacantPosition;
|
||||
private GiftWallModel giftWallModel;
|
||||
private boolean unlit;
|
||||
private String mLiveUid, mStream;
|
||||
|
||||
public GiftWallItemPopup(@NonNull Context context, GiftWallModel giftWallModel,
|
||||
boolean unlit, String mLiveUid, String mStream) {
|
||||
super(context);
|
||||
this.giftWallModel = giftWallModel;
|
||||
this.unlit = unlit;
|
||||
this.mLiveUid = mLiveUid;
|
||||
this.mStream = mStream;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.popup_gift_wall_item;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
layout = findViewById(R.id.layout);
|
||||
giftImg = findViewById(R.id.gift_img);
|
||||
price = findViewById(R.id.price);
|
||||
giftDetails = findViewById(R.id.gift_details);
|
||||
giftDetailsBtn = findViewById(R.id.gift_details_btn);
|
||||
distanceNaming = findViewById(R.id.distance_naming);
|
||||
vacantPositionAwaits = findViewById(R.id.vacant_position_awaits);
|
||||
vacantPosition = findViewById(R.id.vacant_position);
|
||||
avatar = findViewById(R.id.avatar);
|
||||
if (unlit) {
|
||||
giftDetailsBtn.setText(getContext().getText(R.string.send_hem));
|
||||
} else {
|
||||
giftDetailsBtn.setText(getContext().getText(R.string.instant_light));
|
||||
}
|
||||
ImgLoader.display(getContext(), giftWallModel.getGifticon(), giftImg);
|
||||
giftDetails.setText(giftWallModel.getGiftname());
|
||||
price.setText(giftWallModel.getNeedcoin());
|
||||
loadData();
|
||||
ViewClicksAntiShake.clicksAntiShake(giftDetailsBtn, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setmWishGiftId(giftWallModel.getId()));
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
LiveNetManager.get(getContext()).
|
||||
giftDetail(mLiveUid, String.valueOf(giftDetails.getId()), new HttpCallback<GiftWallGiftDetail>() {
|
||||
@Override
|
||||
public void onSuccess(GiftWallGiftDetail data) {
|
||||
if (data.getUid() == 0) {
|
||||
ImgLoader.display(getContext(), R.mipmap.icon_vacant_position_awaits, avatar);
|
||||
vacantPositionAwaits.setText(getContext().getText(R.string.vacant_position_awaits));
|
||||
vacantPosition.setText("?");
|
||||
} else {
|
||||
ImgLoader.display(getContext(), data.getAvatar(), avatar);
|
||||
vacantPositionAwaits.setText(data.getUserNicename());
|
||||
vacantPosition.setText(giftWallModel.getGiftname());
|
||||
}
|
||||
if (data.getNamingCoin() == 0) {
|
||||
distanceNaming.setVisibility(GONE);
|
||||
} else {
|
||||
distanceNaming.setVisibility(VISIBLE);
|
||||
distanceNaming.setText(String.format(getContext().getString(R.string.distance_naming), String.valueOf(data.getNamingCoin())));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -80,7 +80,7 @@ import com.yunbao.live.bean.GiftTopBean;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.custom.GiftViewPager;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.ToolsButton;
|
||||
|
||||
1154
live/src/main/java/com/yunbao/live/dialog/LiveGiftPopup.java
Normal file
@@ -26,9 +26,11 @@ import android.widget.RadioGroup;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.blankj.utilcode.util.GsonUtils;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.custom.MyRadioButton;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.event.LiveInputEvent;
|
||||
@@ -37,7 +39,6 @@ import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.common.views.weight.AtTextWatcher;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
@@ -168,9 +169,10 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
}
|
||||
String danmuPrice = bundle.getString(Constants.LIVE_DANMU_PRICE);
|
||||
String coinName = bundle.getString(Constants.COIN_NAME);
|
||||
|
||||
mLiveUid = bundle.getString(Constants.LIVE_UID);
|
||||
mHint1 =mContext.getString(R.string.live_open_alba) + danmuPrice + coinName + "/" +mContext.getString(R.string.live_tiao);
|
||||
mHint2 =mContext.getString(R.string.live_say_something);
|
||||
mHint1 = mContext.getString(R.string.live_open_alba) + danmuPrice + coinName + "/" + mContext.getString(R.string.live_tiao);
|
||||
mHint2 = mContext.getString(R.string.live_say_something);
|
||||
mCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(CompoundButton button, boolean isChecked) {
|
||||
@@ -195,7 +197,16 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
}
|
||||
});
|
||||
atTextWatcher = new AtTextWatcher();
|
||||
if (!TextUtils.isEmpty(bundle.getString("TagUser"))) {
|
||||
OlineUserlistModel olineUserlistModel = GsonUtils.fromJson(bundle.getString("TagUser"), OlineUserlistModel.class);
|
||||
atTextWatcher.insertTextForAt(olineUserlistModel, mInput);
|
||||
new Handler().postDelayed(() -> {
|
||||
|
||||
mInput.requestFocus();
|
||||
//软键盘弹出
|
||||
imm.showSoftInput(mInput, InputMethodManager.SHOW_FORCED);
|
||||
}, 600);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -218,19 +229,19 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
.nobleUseTrumpet(trumpetMsg, mLiveUid, new HttpCallback<List<BaseModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<BaseModel> data) {
|
||||
// dismiss();
|
||||
// dismiss();
|
||||
ToastUtil.show(getResources().getString(R.string.use_successfully));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
// dismiss();
|
||||
// dismiss();
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
ToastUtil.show(R.string.enough_speakers);
|
||||
// dismiss();
|
||||
// dismiss();
|
||||
}
|
||||
|
||||
break;
|
||||
@@ -243,7 +254,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
/* if (imm != null) {//收软键盘
|
||||
imm.hideSoftInputFromWindow(mInput.getWindowToken(), 0);
|
||||
}*/
|
||||
// dismiss();
|
||||
// dismiss();
|
||||
break;
|
||||
}
|
||||
mInput.setText("");
|
||||
@@ -312,7 +323,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
messageType = SendMessageType.POPUPSCREEN;
|
||||
} else {
|
||||
radioButton.setCompoundDrawablesRelativeWithIntrinsicBounds(worldHornP, null, null, null);
|
||||
mInput.setHint(String.format(mContext.getString(R.string.whole_station_horn_hint), trumpetNum));
|
||||
mInput.setHint(String.format(mContext.getString(R.string.whole_station_horn_hint), trumpetNum + ""));
|
||||
messageType = SendMessageType.WORLDHORN;
|
||||
}
|
||||
} else {
|
||||
@@ -367,7 +378,7 @@ public class LiveInputDialogFragment extends AbsDialogFragment implements View.O
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show( R.string.net_error);
|
||||
ToastUtil.show(R.string.net_error);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.app.Dialog;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -29,13 +28,14 @@ import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.FansMedalBean;
|
||||
import com.yunbao.common.bean.LevelBean;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.bean.UserBean;
|
||||
import com.yunbao.common.dialog.AbsDialogFragment;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.interfaces.OnItemClickListener;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.CommonIconUtil;
|
||||
import com.yunbao.common.utils.DialogUitl;
|
||||
@@ -45,11 +45,11 @@ import com.yunbao.common.utils.RouteUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.StringUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
import com.yunbao.live.activity.LiveReportActivity;
|
||||
import com.yunbao.live.activity.LiveRyAnchorActivity;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -109,7 +109,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
private TextView mUnion;
|
||||
private TextView mHonorVal;
|
||||
private TextView mNobleTitleVal;
|
||||
private TextView mLvVal;
|
||||
private TextView mLvVal, textGiftWall, valueGiftWall;
|
||||
private ImageView mFollowImage;
|
||||
private ImageView mSex;
|
||||
private ImageView good_nub_ico;
|
||||
@@ -121,13 +121,13 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
private ImageView shawl;
|
||||
private ImageView honorIcon;
|
||||
private ImageView mTitleBg;
|
||||
private ImageView mSetting;
|
||||
private ImageView mSetting, iconGiftWall;
|
||||
private UserBean mUserBean;
|
||||
private LinearLayout mGuardLayout;
|
||||
private LinearLayout mUnionLayout;
|
||||
private LinearLayout mNobleIconLayout;
|
||||
private LinearLayout mUserLevelLayout;
|
||||
private LinearLayout mHonorLayout;
|
||||
private LinearLayout mHonorLayout, giftWall;
|
||||
private boolean mFollowing;
|
||||
GifImageView btn_live;
|
||||
SVGAImageView gift_svga;
|
||||
@@ -239,6 +239,10 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
mNobleIconLayout = mRootView.findViewById(R.id.noble_icon_layout);
|
||||
mNobleTitleVal = mRootView.findViewById(R.id.noble_title_val);
|
||||
mHonorLayout = mRootView.findViewById(R.id.honor_layout);
|
||||
giftWall = mRootView.findViewById(R.id.gift_wall);
|
||||
textGiftWall = mRootView.findViewById(R.id.text_gift_wall);
|
||||
valueGiftWall = mRootView.findViewById(R.id.value_gift_wall);
|
||||
iconGiftWall = mRootView.findViewById(R.id.icon_gift_wall);
|
||||
mTitleBg = mRootView.findViewById(R.id.title_bg);
|
||||
mSetting = mRootView.findViewById(R.id.btn_setting);
|
||||
mLvVal = mRootView.findViewById(R.id.user_card_lv_val);
|
||||
@@ -264,6 +268,15 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
}
|
||||
});*/
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(mToUid));
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -343,19 +356,6 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
case SETTING_ACTION_ANC_ADM:
|
||||
mSetting.setVisibility(View.VISIBLE);
|
||||
}
|
||||
if (isAnchor) {
|
||||
mGuardLayout.setVisibility(View.VISIBLE);
|
||||
if (obj.containsKey("user_president_name") && !StringUtil.isEmpty(obj.getString("user_president_name"))) {
|
||||
mUnion.setText(obj.getString("user_president_name"));
|
||||
mUnionLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mNoble.setVisibility(View.GONE);
|
||||
mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_lv);
|
||||
mNobleTitleVal.setText(R.string.live_noble_fens_anchor);
|
||||
mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans);
|
||||
} else {
|
||||
mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_au_lv);
|
||||
}
|
||||
mName.setText(obj.getString("user_nicename"));
|
||||
if (mUserBean.getGoodnum() != null && !mUserBean.getGoodnum().equals("")) {
|
||||
if (!isAnchor) {
|
||||
@@ -369,7 +369,34 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
good_nub_ico.setVisibility(View.GONE);
|
||||
mID.setText(mUserBean.getId());
|
||||
}
|
||||
giftWall.setBackgroundResource(R.drawable.bg_gift_wall_lv);
|
||||
ImgLoader.display(mContext, R.drawable.icon_gift_wall, iconGiftWall);
|
||||
textGiftWall.setText(mContext.getString(R.string.gift_wall));
|
||||
valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number")));
|
||||
mSex.setImageResource(CommonIconUtil.getSexIconForUserCard(obj.getIntValue("sex")));
|
||||
if (isAnchor) {
|
||||
mGuardLayout.setVisibility(View.VISIBLE);
|
||||
if (obj.containsKey("user_president_name") && !StringUtil.isEmpty(obj.getString("user_president_name"))) {
|
||||
mUnion.setText(obj.getString("user_president_name"));
|
||||
mUnionLayout.setVisibility(View.VISIBLE);
|
||||
}
|
||||
mNoble.setVisibility(View.GONE);
|
||||
mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_lv);
|
||||
|
||||
mHonorLayout.setBackgroundResource(R.drawable.bg_user_card_honor);
|
||||
mNobleTitleVal.setText(R.string.live_noble_fens_anchor);
|
||||
mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans);
|
||||
} else {
|
||||
mUserLevelLayout.setBackgroundResource(R.drawable.bg_user_card_au_lv);
|
||||
// giftWall.setBackgroundResource(R.drawable.bg_gift_wall_lv);
|
||||
// mNobleIconLayout.setBackgroundResource(R.drawable.bg_user_card_fans);
|
||||
// mHonorLayout.setBackgroundResource(R.drawable.bg_user_card_honor);
|
||||
//
|
||||
// ImgLoader.display(mContext, R.drawable.icon_gift_wall, mNobleIcon);
|
||||
// ImgLoader.display(mContext, R.drawable.icon_gift_wall, mNobleIcon);
|
||||
// textGiftWall.setText(mContext.getString(R.string.gift_wall));
|
||||
// valueGiftWall.setText(String.format(mContext.getString(R.string.has_been_lit), obj.getString("gift_wall_lighten_number")));
|
||||
}
|
||||
LevelBean levelBean;
|
||||
if (isAnchor) {
|
||||
levelBean = CommonAppConfig.getInstance().getAnchorLevel(mUserBean.getLevelAnchor());
|
||||
@@ -498,7 +525,17 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.ai_te), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (!TextUtils.isEmpty(mUserBean.getId()) && !TextUtils.isEmpty(mUserBean.getUserNiceName())) {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.INPUT_DIALOG)
|
||||
.setOlineUserlistModel(new OlineUserlistModel().setId(mUserBean.getId()).setUserNicename(mUserBean.getUserNiceName())));
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void updateFollow() {
|
||||
@@ -557,7 +594,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
updateFollow();
|
||||
if (isAttention == 1 && mLiveUid.equals(mToUid)) {//关注了主播
|
||||
((LiveActivity) mContext).sendSystemMessage(
|
||||
CommonAppConfig.getInstance().getUserBean().getUserNiceName() +mContext.getString(R.string.live_follow_anchor));
|
||||
CommonAppConfig.getInstance().getUserBean().getUserNiceName() + mContext.getString(R.string.live_follow_anchor));
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -674,7 +711,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
if (isAnchor) {
|
||||
dismiss();
|
||||
((LiveActivity) mContext).openFansWindow(mToUid);
|
||||
}else{
|
||||
} else {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.NOBLE));
|
||||
}
|
||||
@@ -758,7 +795,7 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
} else if (tag == R.string.live_setting_close_live_2) {//禁用直播
|
||||
closeLive2();
|
||||
} else if (tag==R.string.live_setting_gap_3){
|
||||
} else if (tag == R.string.live_setting_gap_3) {
|
||||
setShutUp3();
|
||||
}
|
||||
}
|
||||
@@ -857,14 +894,15 @@ public class LiveUserDialogFragment extends AbsDialogFragment implements View.On
|
||||
dismiss();
|
||||
LiveHttpUtil.superCloseRoom(mLiveUid, 1, mSuperCloseRoomCallback);
|
||||
}
|
||||
private void setShutUp3(){
|
||||
|
||||
private void setShutUp3() {
|
||||
new LiveSettingSilenceDialog(mContext)
|
||||
.setItemClickListener((bean, position) -> {
|
||||
LiveHttpUtil.setShutUp(mLiveUid, mStream, 1, mToUid, bean+"",new HttpCallback() {
|
||||
LiveHttpUtil.setShutUp(mLiveUid, mStream, 1, mToUid, bean + "", new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0) {
|
||||
((LiveActivity) mContext).setShutUp(mToUid, mToName, 2,bean);
|
||||
((LiveActivity) mContext).setShutUp(mToUid, mToName, 2, bean);
|
||||
dismiss();
|
||||
} else {
|
||||
ToastUtil.show(msg);
|
||||
|
||||
@@ -0,0 +1,124 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import android.content.Context;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.BottomPopupView;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.adapter.MedalAchievementAdapter;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.MedalAchievementModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.ZhuangBanActivity;
|
||||
|
||||
public class MedalAchievementPopup extends BottomPopupView {
|
||||
private boolean isLive;
|
||||
private String toUid,mLiveUid;
|
||||
private TextView achievementText;
|
||||
private RecyclerView achievementList;
|
||||
private MedalAchievementAdapter medalAchievementAdapter;
|
||||
|
||||
public MedalAchievementPopup(@NonNull Context context, boolean isLive, String toUid, String mLiveUid) {
|
||||
super(context);
|
||||
this.isLive = isLive;
|
||||
this.toUid = toUid;
|
||||
this.mLiveUid = mLiveUid;
|
||||
}
|
||||
|
||||
// 返回自定义弹窗的布局
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_medal_achievement;
|
||||
}
|
||||
|
||||
// 执行初始化操作,比如:findView,设置点击,或者任何你弹窗内的业务逻辑
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
initView();
|
||||
initDate();
|
||||
}
|
||||
|
||||
private void initDate() {
|
||||
if (isLive) {
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveMedalList(mLiveUid,new HttpCallback<MedalAchievementModel>() {
|
||||
@Override
|
||||
public void onSuccess(MedalAchievementModel data) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(data.getMedalLightNumber())
|
||||
.append("/")
|
||||
.append(data.getMedalTotalNumber());
|
||||
achievementText.setText(stringBuffer.toString());
|
||||
medalAchievementAdapter.addAllData(data.getMedalData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
LiveNetManager.get(getContext())
|
||||
.getUserMedalList(toUid, new HttpCallback<MedalAchievementModel>() {
|
||||
@Override
|
||||
public void onSuccess(MedalAchievementModel data) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(data.getMedalLightNumber())
|
||||
.append("/")
|
||||
.append(data.getMedalTotalNumber());
|
||||
achievementText.setText(stringBuffer.toString());
|
||||
medalAchievementAdapter.addAllData(data.getMedalData());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
achievementText = findViewById(R.id.achievement_text);
|
||||
achievementList = findViewById(R.id.achievement_list);
|
||||
if (isLive) {
|
||||
achievementList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false));
|
||||
} else {
|
||||
achievementList.setLayoutManager(new GridLayoutManager(getContext(), 4, GridLayoutManager.VERTICAL, false));
|
||||
}
|
||||
medalAchievementAdapter = new MedalAchievementAdapter();
|
||||
achievementList.setAdapter(medalAchievementAdapter);
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.wall_honor), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
StringBuffer htmlUrl = new StringBuffer();
|
||||
IMLoginModel userInfo = IMLoginManager.get(getContext()).getUserInfo();
|
||||
htmlUrl.append(CommonAppConfig.HOST)
|
||||
.append("/h5/shequ/index.html#/h5/shequ/RongYuQiang?")
|
||||
.append("touid=")
|
||||
.append(toUid)
|
||||
.append("&token=")
|
||||
.append(userInfo.getToken())
|
||||
.append("&uid=")
|
||||
.append(userInfo.getId());
|
||||
ZhuangBanActivity.forward(getContext(), htmlUrl.toString(), false);
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,8 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
|
||||
mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc);
|
||||
mPkBtnDesc.setVisibility(View.VISIBLE);
|
||||
mPkBtn.setBackgroundResource(R.drawable.bg_live_room_random_pk_timer);
|
||||
mPkBtn.setTag(true);
|
||||
mRandomPkSwitch.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,6 +69,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
|
||||
public void onPkEndStart() {
|
||||
super.onPkEndStart();
|
||||
mPkBtn.setEnabled(false);
|
||||
mRandomPkSwitch.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,6 +78,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
|
||||
mPkBtnTitle.setText(String.format(mContext.getString(R.string.random_pk_info_btn_end), time));
|
||||
mPkBtnDesc.setText(R.string.random_pk_info_btn_end_desc);
|
||||
mPkBtn.setEnabled(false);
|
||||
mRandomPkSwitch.setEnabled(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -194,7 +198,7 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show( R.string.net_error);
|
||||
ToastUtil.show(R.string.net_error);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -276,7 +280,9 @@ public class RandomPkDialogFragment extends AbsDialogFragment implements View.On
|
||||
* 恢复按钮状态
|
||||
*/
|
||||
private void resetPkBtn() {
|
||||
mRandomPkSwitch.setEnabled(true);
|
||||
mPkBtnDesc.setVisibility(View.GONE);
|
||||
mPkBtn.setEnabled(true);
|
||||
mPkBtnTitle.setText(R.string.random_pk_info_btn_start);
|
||||
mPkBtn.setBackgroundResource(R.drawable.bg_live_random_pk_info_btn);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.Spannable;
|
||||
import android.text.SpannableStringBuilder;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.lxj.xpopup.impl.FullScreenPopupView;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.utils.LinearGradientFontSpan;
|
||||
|
||||
/**
|
||||
* 礼物冠名规则
|
||||
*/
|
||||
public class RegularIntroducePopup extends FullScreenPopupView {
|
||||
private TextView regularTitle;
|
||||
|
||||
public RegularIntroducePopup(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.rogular_introduce_popup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
regularTitle = findViewById(R.id.regular_title);
|
||||
String title = getContext().getString(R.string.rule_introduction);
|
||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||
builder.append(title);
|
||||
builder.setSpan(new LinearGradientFontSpan(Color.parseColor("#ffffff"),
|
||||
Color.parseColor("#F7FDFF")), 0, title.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
|
||||
regularTitle.setText(builder);
|
||||
//初始化
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.close_btn), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
dialog.dismiss();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
26
live/src/main/java/com/yunbao/live/event/GiftTitleEvent.java
Normal file
@@ -0,0 +1,26 @@
|
||||
package com.yunbao.live.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
|
||||
public class GiftTitleEvent extends BaseModel {
|
||||
private String giftTitle;
|
||||
private int mPosition;
|
||||
|
||||
public int getmPosition() {
|
||||
return mPosition;
|
||||
}
|
||||
|
||||
public GiftTitleEvent setmPosition(int mPosition) {
|
||||
this.mPosition = mPosition;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getGiftTitle() {
|
||||
return giftTitle;
|
||||
}
|
||||
|
||||
public GiftTitleEvent setGiftTitle(String giftTitle) {
|
||||
this.giftTitle = giftTitle;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -7,12 +7,14 @@ import com.yunbao.common.bean.AnchorRecommendItemModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LiveBean;
|
||||
import com.yunbao.common.bean.MsgModel;
|
||||
import com.yunbao.common.bean.OlineUserlistModel;
|
||||
import com.yunbao.common.bean.RedPacketInfoModel;
|
||||
import com.yunbao.common.bean.RedPacketModel;
|
||||
import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.live.bean.LiveGuardInfo;
|
||||
import com.yunbao.live.bean.LivePKUserListBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.bean.OpenParametersModel;
|
||||
@@ -47,6 +49,85 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
private AllServerNotifyEvent allServerNotifyEvent;
|
||||
private RedPacketModel redPacketModel;
|
||||
private RedPacketInfoModel redPacketInfoModel;
|
||||
private OlineUserlistModel olineUserlistModel;
|
||||
private LiveGuardInfo liveGuardInfo;
|
||||
private String mWishGiftId;
|
||||
private boolean isContactGift;
|
||||
private boolean isPk;
|
||||
public String mStream;
|
||||
public String mLiveUid,giftId;
|
||||
|
||||
public String getGiftId() {
|
||||
return giftId;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setGiftId(String giftId) {
|
||||
this.giftId = giftId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getmStream() {
|
||||
return mStream;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setmStream(String mStream) {
|
||||
this.mStream = mStream;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getmLiveUid() {
|
||||
return mLiveUid;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setmLiveUid(String mLiveUid) {
|
||||
this.mLiveUid = mLiveUid;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isPk() {
|
||||
return isPk;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setPk(boolean pk) {
|
||||
isPk = pk;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean getIsContactGift() {
|
||||
return isContactGift;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setIsContactGift(boolean isContactGift) {
|
||||
this.isContactGift = isContactGift;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getmWishGiftId() {
|
||||
return mWishGiftId;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setmWishGiftId(String mWishGiftId) {
|
||||
this.mWishGiftId = mWishGiftId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public LiveGuardInfo getLiveGuardInfo() {
|
||||
return liveGuardInfo;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setLiveGuardInfo(LiveGuardInfo liveGuardInfo) {
|
||||
this.liveGuardInfo = liveGuardInfo;
|
||||
return this;
|
||||
}
|
||||
|
||||
public OlineUserlistModel getOlineUserlistModel() {
|
||||
return olineUserlistModel;
|
||||
}
|
||||
|
||||
public LiveAudienceEvent setOlineUserlistModel(OlineUserlistModel olineUserlistModel) {
|
||||
this.olineUserlistModel = olineUserlistModel;
|
||||
return this;
|
||||
}
|
||||
|
||||
public RedPacketInfoModel getRedPacketInfoModel() {
|
||||
return redPacketInfoModel;
|
||||
@@ -380,7 +461,10 @@ public class LiveAudienceEvent extends BaseModel {
|
||||
VOTE_END(67, "投票结束"),
|
||||
BLIND_BOX(68, "盲盒全服通知"),
|
||||
RED_PACKET(69, "RedPacket"),
|
||||
RED_PACKET_SUPER_JACKPOT(70, "超级红包");
|
||||
RED_PACKET_SUPER_JACKPOT(70, "超级红包"),
|
||||
INPUT_DIALOG(71, "输入框"),
|
||||
IS_ATTENTION(72,"是否关注主播"),
|
||||
GIFT_WALL(73,"礼物墙");
|
||||
|
||||
private int type;
|
||||
private String name;
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.yunbao.live.event;
|
||||
|
||||
public class LiveGiftDialogEvent {
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.yunbao.live.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
|
||||
/**
|
||||
* 选中的礼物
|
||||
*/
|
||||
public class LiveGiftItemEvent extends BaseModel {
|
||||
private LiveGiftBean liveGiftModel;
|
||||
|
||||
public LiveGiftBean getLiveGiftModel() {
|
||||
return liveGiftModel;
|
||||
}
|
||||
|
||||
public LiveGiftItemEvent setLiveGiftModel(LiveGiftBean liveGiftModel) {
|
||||
this.liveGiftModel = liveGiftModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.yunbao.live.event;
|
||||
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
|
||||
public class LiveParcelItemRefreshEvent extends BaseModel {
|
||||
private LiveGiftBean liveGiftModel;
|
||||
|
||||
public LiveGiftBean getLiveGiftModel() {
|
||||
return liveGiftModel;
|
||||
}
|
||||
|
||||
public LiveParcelItemRefreshEvent setLiveGiftModel(LiveGiftBean liveGiftModel) {
|
||||
this.liveGiftModel = liveGiftModel;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import android.animation.ObjectAnimator;
|
||||
import android.animation.ValueAnimator;
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.os.CountDownTimer;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
@@ -46,6 +45,7 @@ import com.yunbao.common.http.CommonHttpUtil;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.manager.IMLoginManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.HtmlTagHandler;
|
||||
@@ -53,12 +53,11 @@ import com.yunbao.common.utils.L;
|
||||
import com.yunbao.common.utils.MicStatusManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveAudienceActivity;
|
||||
import com.yunbao.live.bean.LiveGiftPrizePoolWinBean;
|
||||
import com.yunbao.live.bean.LiveLuckGiftWinBean;
|
||||
import com.yunbao.live.bean.LiveReceiveGiftBean;
|
||||
import com.yunbao.live.custom.FrameImageView;
|
||||
import com.yunbao.live.dialog.LiveGiftDialogFragment;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
import com.yunbao.live.utils.AllMsgTextRender;
|
||||
@@ -339,14 +338,12 @@ public class LiveGiftAnimPresenter {
|
||||
new Handler().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
LiveGiftDialogFragment fragment = new LiveGiftDialogFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString(Constants.LIVE_WISH_GIFTID, blindBox.getEvent().getBlindBoxId() + "");
|
||||
bundle.putBoolean("isContactGift", true);
|
||||
fragment.setArguments(bundle);
|
||||
fragment.show(((LiveAudienceActivity) mContext).getSupportFragmentManager(), "LiveGiftDialogFragment");
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setmWishGiftId(blindBox.getEvent().getBlindBoxId() + "")
|
||||
.setIsContactGift(true));
|
||||
}
|
||||
}, 1000);
|
||||
} else {
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.yunbao.common.bean.WishModel;
|
||||
import com.yunbao.common.bean.XydCompleteModel;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.CustomFullServiceNotifyEvent;
|
||||
import com.yunbao.common.event.GiftWallIlluminateEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
@@ -707,6 +708,13 @@ public class SocketRyClient {
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.RED_PACKET_SUPER_JACKPOT)
|
||||
.setRedPacketInfoModel(redPacketInfoModel));
|
||||
break;
|
||||
case "GiftWallIlluminate":
|
||||
Log.e("GiftWallIlluminate", map.toString());
|
||||
Bus.get().post(new GiftWallIlluminateEvent()
|
||||
.setNewNumber(map.getInteger("new_number"))
|
||||
.setMaxNumber(map.getInteger("max_number")));
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1036,6 +1044,10 @@ public class SocketRyClient {
|
||||
receiveGiftBean.setAncherName(map.getString("ancherName"));
|
||||
receiveGiftBean.setHot_num(map.getString("hot_num"));
|
||||
receiveGiftBean.setDrpk_status(map.getString("drpk_status"));
|
||||
receiveGiftBean.setNamingCoin(map.getString("naming_live_name"));
|
||||
receiveGiftBean.setNamingLiveName(map.getString("naming_live_name"));
|
||||
receiveGiftBean.setNamingUid(map.getString("naming_uid"));
|
||||
receiveGiftBean.setNamingLiveuid(map.getString("naming_liveuid"));
|
||||
receiveGiftBean.setmLiveUId(mLiveUid);
|
||||
receiveGiftBean.setmTypeBuyGuard(false);
|
||||
receiveGiftBean.setAllServerNotify(false);
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftWallModel;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
|
||||
public class CodexItemViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftImg;
|
||||
private TextView giftName, giftWall;
|
||||
|
||||
public CodexItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
giftImg = itemView.findViewById(R.id.gift_img);
|
||||
giftName = itemView.findViewById(R.id.gift_name);
|
||||
giftWall = itemView.findViewById(R.id.gift_wall);
|
||||
}
|
||||
|
||||
public void showData(GiftWallModel giftWallModel) {
|
||||
ImgLoader.display(itemView.getContext(), giftWallModel.getGifticon(), giftImg);
|
||||
giftName.setText(giftWallModel.getGiftname());
|
||||
giftName.setTextColor(Color.parseColor(giftWallModel.getFontColor()));
|
||||
giftWall.setSelected(TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "2"));
|
||||
if (TextUtils.equals(String.valueOf(giftWallModel.getIlluminateStatus()), "2")) {
|
||||
giftWall.setText(itemView.getContext().getString(R.string.received_wall2));
|
||||
giftWall.setTextColor(Color.parseColor("#FFFFFF"));
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmWishGiftId(giftWallModel.getId())
|
||||
.setmLiveUid("")
|
||||
.setmStream(""));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
giftWall.setText(itemView.getContext().getString(R.string.received_wall));
|
||||
giftWall.setTextColor(Color.parseColor("#49669F"));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.GiftGuideModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.adapter.CodexItemAdapter;
|
||||
import com.yunbao.live.dialog.CodexDialog;
|
||||
|
||||
public class CodexViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView codexLayout, titleIcon;
|
||||
private TextView titleName, weekNumber, weekNumber2;
|
||||
private RecyclerView giftList;
|
||||
private CodexItemAdapter codexItemAdapter;
|
||||
|
||||
public CodexViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
codexLayout = itemView.findViewById(R.id.codex_layout);
|
||||
titleIcon = itemView.findViewById(R.id.title_icon);
|
||||
titleName = itemView.findViewById(R.id.title_name);
|
||||
weekNumber = itemView.findViewById(R.id.week_number);
|
||||
weekNumber2 = itemView.findViewById(R.id.week_number2);
|
||||
giftList = itemView.findViewById(R.id.gift_list);
|
||||
codexItemAdapter = new CodexItemAdapter();
|
||||
giftList.setLayoutManager(new LinearLayoutManager(itemView.getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
giftList.setAdapter(codexItemAdapter);
|
||||
}
|
||||
|
||||
public void showData(GiftGuideModel giftGuideModel, boolean history, String mStream, String mLiveUid) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(giftGuideModel.getIlluminateCount())
|
||||
.append("/")
|
||||
.append(giftGuideModel.getIlluminateTotal());
|
||||
ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideBackgroundPicturePath(), codexLayout);
|
||||
ImgLoader.display(itemView.getContext(), giftGuideModel.getGuideNameImgPath(), titleIcon);
|
||||
titleName.setText(stringBuffer.toString());
|
||||
titleName.setTextColor(Color.parseColor(giftGuideModel.getNumber()));
|
||||
weekNumber.setText(giftGuideModel.getWeekNumber());
|
||||
weekNumber.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE);
|
||||
if (history) {
|
||||
weekNumber2.setVisibility(View.GONE);
|
||||
} else {
|
||||
weekNumber2.setVisibility(TextUtils.isEmpty(giftGuideModel.getWeekNumber()) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
codexItemAdapter.addAllData(giftGuideModel.getGiftData());
|
||||
ViewClicksAntiShake.clicksAntiShake(weekNumber2, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
new XPopup.Builder(itemView.getContext())
|
||||
.enableDrag(false)
|
||||
.asCustom(new CodexDialog(itemView.getContext(), mStream, mLiveUid,true))
|
||||
.show();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,164 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.text.TextUtils;
|
||||
import android.util.TypedValue;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.dialog.SendRendPacketPopup;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class FrameGiftViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon, mPayIco, cornerMark;
|
||||
private Context mContext;
|
||||
private TextView giftName, mPrice;
|
||||
private RelativeLayout giftLayout;
|
||||
private ScaleAnimation mAnimation;
|
||||
private LinearLayout mLoadingLayout;
|
||||
private ImageView mLoading;
|
||||
|
||||
public FrameGiftViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mContext = itemView.getContext();
|
||||
giftIcon = itemView.findViewById(R.id.gift_icon);
|
||||
giftName = itemView.findViewById(R.id.gift_name);
|
||||
mPayIco = itemView.findViewById(R.id.pay_ico);
|
||||
mPrice = itemView.findViewById(R.id.price);
|
||||
cornerMark = itemView.findViewById(R.id.corner_mark);
|
||||
giftLayout = itemView.findViewById(R.id.gift_layout);
|
||||
mLoadingLayout = itemView.findViewById(R.id.gift_loading_layout);
|
||||
mLoading = itemView.findViewById(R.id.gift_loading);
|
||||
|
||||
mAnimation = new ScaleAnimation(0.9f, 1.1f, 0.9f, 1.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
mAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mAnimation.setDuration(400);
|
||||
mAnimation.setRepeatMode(Animation.REVERSE);
|
||||
mAnimation.setRepeatCount(-1);
|
||||
}
|
||||
|
||||
public void showData(int contextLayoutGiftHeight, LiveGiftBean model) {
|
||||
//设置高度
|
||||
itemView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GridLayoutManager.LayoutParams linearParams = (GridLayoutManager.LayoutParams) itemView.getLayoutParams();
|
||||
linearParams.height = contextLayoutGiftHeight / 2;
|
||||
itemView.setLayoutParams(linearParams);
|
||||
}
|
||||
});
|
||||
giftLayout.setSelected(model.isChecked());
|
||||
if (model.isChecked()) {
|
||||
giftIcon.startAnimation(mAnimation);
|
||||
}
|
||||
ImgLoader.display(mContext, model.getIcon(), giftIcon);
|
||||
ImgLoader.display(mContext, model.getCornerMark(), cornerMark);
|
||||
if (!TextUtils.equals(model.getNamingLiveuid(), "0") && !TextUtils.equals(model.getNamingUid(), "0")) {
|
||||
giftName.setText(model.getNamingUserName());
|
||||
} else {
|
||||
giftName.setText(model.getName());
|
||||
}
|
||||
|
||||
//特殊礼物红包
|
||||
if (model.getType() == 9999999) {
|
||||
mPayIco.setVisibility(View.GONE);
|
||||
mPrice.setText(mContext.getString(R.string.build_up_popularity));
|
||||
mPrice.setTextColor(Color.parseColor("#db8c4a"));
|
||||
mPrice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 8);
|
||||
|
||||
} else {
|
||||
mPrice.setTextSize(TypedValue.COMPLEX_UNIT_SP, 11);
|
||||
mPrice.setTextColor(Color.parseColor("#c8c8c8"));
|
||||
mPayIco.setVisibility(View.VISIBLE);
|
||||
//普通礼物
|
||||
if (model.getSendType() != null && model.getSendType().equals("1")) {
|
||||
mPayIco.setImageResource(R.mipmap.gold_coin);
|
||||
} else {
|
||||
mPayIco.setImageResource(R.mipmap.diamond);
|
||||
}
|
||||
mPrice.setText(model.getPrice());
|
||||
}
|
||||
if (model.getSwf() != null && model.getSwf().isEmpty()) {
|
||||
mLoadingLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
mLoadingLayout.setVisibility(GiftCacheUtil.checkGiftIsDownload(model.getId()) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void giftSelect(LiveGiftBean model, int position, String mStream, String mLiveUid, FrameGiftClickListener frameGiftClickListener) {
|
||||
ViewClicksAntiShake.clicksAntiShake(mLoadingLayout, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mLoading.setImageResource(R.mipmap.icon_loading_gift);
|
||||
Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_loading_gift);
|
||||
animation.setRepeatMode(Animation.RESTART);
|
||||
animation.setRepeatCount(Animation.INFINITE);
|
||||
animation.setInterpolator(new LinearInterpolator());
|
||||
mLoading.startAnimation(animation);
|
||||
GiftCacheUtil.getInstance().pause();
|
||||
GiftCacheUtil.getInstance().downloadGiftForId(mContext, model, new CommonCallback<File>() {
|
||||
@Override
|
||||
public void callback(File bean) {
|
||||
if (bean == null) {
|
||||
ToastUtil.show(mContext.getString(R.string.load_failure_2));
|
||||
mLoading.setImageResource(R.mipmap.icon_download_gift);
|
||||
animation.setRepeatCount(0);
|
||||
animation.setDuration(0);
|
||||
animation.cancel();
|
||||
mLoading.setAnimation(animation);
|
||||
} else {
|
||||
mLoadingLayout.setVisibility(View.GONE);
|
||||
}
|
||||
GiftCacheUtil.getInstance().restart();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(giftLayout, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (model.getType() == 9999999) {
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new SendRendPacketPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
} else {
|
||||
if (frameGiftClickListener != null) {
|
||||
frameGiftClickListener.onCallBack(position, model);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface FrameGiftClickListener {
|
||||
void onCallBack(int position, LiveGiftBean model);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,104 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.GiftAlreadyWallAdapter;
|
||||
import com.yunbao.common.bean.GiftAlreadyWallModel;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
|
||||
/**
|
||||
* 已点亮礼物墙
|
||||
*/
|
||||
public class GiftAlreadyWallFragment extends BaseFragment {
|
||||
private String mStream, mLiveUid,toUid;
|
||||
private LinearLayout giftWallNoData, giftWallData;
|
||||
private RecyclerView alreadyList;
|
||||
private GiftAlreadyWallAdapter alreadyWallAdapter;
|
||||
private TextView litIcon, giftAll;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.fragment_gift_already_wall, viewGroup, false);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
mStream = bundle.getString("mStream");
|
||||
mLiveUid = bundle.getString("mLiveUid");
|
||||
toUid = bundle.getString("toUid");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
giftWallNoData = contentView.findViewById(R.id.gift_wall_no_data);
|
||||
giftWallData = contentView.findViewById(R.id.gift_wall_data);
|
||||
alreadyList = contentView.findViewById(R.id.already_list);
|
||||
litIcon = contentView.findViewById(R.id.lit_icon);
|
||||
giftAll = contentView.findViewById(R.id.gift_all);
|
||||
alreadyWallAdapter = new GiftAlreadyWallAdapter();
|
||||
alreadyList.setLayoutManager(new GridLayoutManager(getContext(), 3, GridLayoutManager.VERTICAL, false));
|
||||
alreadyList.setAdapter(alreadyWallAdapter);
|
||||
ViewClicksAntiShake.clicksAntiShake(contentView.findViewById(R.id.instant_light), new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream));
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
LiveNetManager.get(getActivity()).
|
||||
giftAlreadyWall(mLiveUid,toUid, new HttpCallback<GiftAlreadyWallModel>() {
|
||||
@Override
|
||||
public void onSuccess(GiftAlreadyWallModel data) {
|
||||
if (data.getGiftWall().size() > 0) {
|
||||
giftWallNoData.setVisibility(View.GONE);
|
||||
giftWallData.setVisibility(View.VISIBLE);
|
||||
alreadyWallAdapter.addAllData(data.getGiftWall());
|
||||
litIcon.setText(data.getGiftWallLightenNumber());
|
||||
giftAll.setText("/" + data.getGiftWallLightenTotal());
|
||||
} else {
|
||||
giftWallNoData.setVisibility(View.VISIBLE);
|
||||
giftWallData.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static GiftAlreadyWallFragment newInstance(String mStream, String mLiveUid,String toUid) {
|
||||
GiftAlreadyWallFragment liveGiftFragment = new GiftAlreadyWallFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
bundle.putString("toUid", toUid);
|
||||
liveGiftFragment.setArguments(bundle);
|
||||
return liveGiftFragment;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.graphics.Typeface;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.custom.DrawableTextView;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.GiftTopBean;
|
||||
import com.yunbao.live.event.GiftTitleEvent;
|
||||
|
||||
public class GiftTitleViewHolder extends RecyclerView.ViewHolder {
|
||||
private DrawableTextView name;
|
||||
|
||||
public GiftTitleViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
name = itemView.findViewById(R.id.name);
|
||||
}
|
||||
|
||||
public void showData(GiftTopBean giftTopBean, int mPosition, ClicksCallBack callBack) {
|
||||
name.setText(giftTopBean.getName());
|
||||
ViewClicksAntiShake.clicksAntiShake(itemView, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (callBack != null) {
|
||||
callBack.onViewClicks(mPosition);
|
||||
Bus.get().post(new GiftTitleEvent().setmPosition(mPosition).setGiftTitle(giftTopBean.getName()));
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void selectData(boolean isSelect) {
|
||||
if (isSelect) {
|
||||
name.setAlpha(1.0f);
|
||||
name.setTypeface(Typeface.SANS_SERIF, Typeface.BOLD);
|
||||
} else {
|
||||
name.setAlpha(0.5f);
|
||||
name.setTypeface(Typeface.SANS_SERIF, Typeface.NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ClicksCallBack {
|
||||
void onViewClicks(int mPosition);
|
||||
}
|
||||
}
|
||||
@@ -10,7 +10,6 @@ import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Vibrator;
|
||||
import android.text.TextUtils;
|
||||
import android.util.DisplayMetrics;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
@@ -20,16 +19,12 @@ import android.view.ViewGroup;
|
||||
import android.view.WindowManager;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.ViewFlipper;
|
||||
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
|
||||
import com.opensource.svgaplayer.SVGADrawable;
|
||||
import com.opensource.svgaplayer.SVGAImageView;
|
||||
import com.opensource.svgaplayer.SVGAParser;
|
||||
import com.opensource.svgaplayer.SVGAVideoEntity;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.CommonAppConfig;
|
||||
import com.yunbao.common.Constants;
|
||||
import com.yunbao.common.bean.NewPeopleInfo;
|
||||
@@ -39,11 +34,10 @@ import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.http.HttpClient;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ProcessResultUtil;
|
||||
import com.yunbao.common.utils.SVGAViewUtils;
|
||||
import com.yunbao.common.utils.SpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.live.dialog.LiveGiftPopup;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.activity.LiveActivity;
|
||||
@@ -200,6 +194,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
ViewClicksAntiShake.clicksAntiShake(giftImage, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP));
|
||||
}
|
||||
@@ -382,6 +377,7 @@ public class LiveAudienceViewHolder extends AbsLiveViewHolder {
|
||||
|
||||
} else if (i == R.id.btn_gift) {
|
||||
openGiftWindow();
|
||||
|
||||
//全屏
|
||||
} else if (i == R.id.btn_more) {
|
||||
((LiveActivity) mContext).openMoreWindow();
|
||||
|
||||
149
live/src/main/java/com/yunbao/live/views/LiveGiftFragment.java
Normal file
@@ -0,0 +1,149 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 礼物列表
|
||||
*/
|
||||
public class LiveGiftFragment extends BaseFragment {
|
||||
private ViewPager fragmentViewpager;
|
||||
private int pageCount;
|
||||
private static final int GIFT_COUNT = 8;//每页8个礼物
|
||||
private RadioGroup mRadioGroup;
|
||||
private LiveGiftFragmentPagerAdapter giftFragmentPagerAdapter;
|
||||
private ArrayList<Fragment> ViewList = new ArrayList<>(); //页卡视图集合
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private String mStream, mLiveUid, wishGiftId, type;
|
||||
private int currentPage = 0;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.fragment_live_gift, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class);
|
||||
contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight");
|
||||
mStream = bundle.getString("mStream");
|
||||
wishGiftId = bundle.getString("wishGiftId");
|
||||
mLiveUid = bundle.getString("mLiveUid");
|
||||
type = bundle.getString("type");
|
||||
pageCount = giftJson.size() / GIFT_COUNT;
|
||||
if (giftJson.size() % GIFT_COUNT > 0) {
|
||||
pageCount++;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
|
||||
fragmentViewpager = contentView.findViewById(R.id.context_layout);
|
||||
mRadioGroup = contentView.findViewById(R.id.radio_group);
|
||||
|
||||
|
||||
fragmentViewpager.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
contextLayoutGiftHeight = fragmentViewpager.getHeight();
|
||||
Log.e("giftJson", "height=" + contextLayoutGiftHeight);
|
||||
int fromIndex = 0;
|
||||
int size = giftJson.size();
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
int endIndex = fromIndex + GIFT_COUNT;
|
||||
if (endIndex > size) {
|
||||
endIndex = size;
|
||||
}
|
||||
List<LiveGiftBean> liveGiftBeans = new ArrayList<>();
|
||||
for (int j = fromIndex; j < endIndex; j++) {
|
||||
LiveGiftBean bean = giftJson.get(j);
|
||||
bean.setPage(i);
|
||||
liveGiftBeans.add(bean);
|
||||
if (!TextUtils.isEmpty(wishGiftId) && TextUtils.equals(bean.getId() + "", wishGiftId)) {
|
||||
currentPage = i;
|
||||
Log.e("LiveGiftItemFragment", type);
|
||||
}
|
||||
}
|
||||
fromIndex = endIndex;
|
||||
ViewList.add(LiveGiftItemFragment.newInstance(JSON.toJSONString(liveGiftBeans), contextLayoutGiftHeight, mStream, mLiveUid, wishGiftId));
|
||||
}
|
||||
giftFragmentPagerAdapter = new LiveGiftFragmentPagerAdapter(getChildFragmentManager(), getActivity(), ViewList);
|
||||
fragmentViewpager.setAdapter(giftFragmentPagerAdapter);
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||
for (int i = 0, size2 = ViewList.size(); i < size2; i++) {
|
||||
RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.view_gift_indicator, mRadioGroup, false);
|
||||
radioButton.setId(i + 10000);
|
||||
if (i == 0) {
|
||||
radioButton.setChecked(true);
|
||||
}
|
||||
mRadioGroup.addView(radioButton);
|
||||
|
||||
}
|
||||
fragmentViewpager.setCurrentItem(currentPage);
|
||||
//移除监听
|
||||
fragmentViewpager.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
});
|
||||
|
||||
fragmentViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) {
|
||||
((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
|
||||
public static LiveGiftFragment newInstance(String giftJson, String type,
|
||||
String mStream, String mLiveUid, String wishGiftId) {
|
||||
LiveGiftFragment liveGiftFragment = new LiveGiftFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("giftJson", giftJson);
|
||||
bundle.putString("type", type);
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
bundle.putString("wishGiftId", wishGiftId);
|
||||
liveGiftFragment.setArguments(bundle);
|
||||
return liveGiftFragment;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.FrameGiftAdapter;
|
||||
import com.yunbao.live.event.LiveGiftItemEvent;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveGiftItemFragment extends BaseFragment {
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private RecyclerView frameGiftList;
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private FrameGiftAdapter frameGiftAdapter;
|
||||
private String mStream, mLiveUid, wishGiftId;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.fragment_live_gift_item, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class);
|
||||
contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight");
|
||||
mStream = bundle.getString("mStream");
|
||||
mLiveUid = bundle.getString("mLiveUid");
|
||||
wishGiftId = bundle.getString("wishGiftId");
|
||||
Log.e("giftJson", giftJson.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
|
||||
|
||||
frameGiftList = contentView.findViewById(R.id.frame_gift_list);
|
||||
frameGiftList.setHasFixedSize(true);
|
||||
frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false));
|
||||
frameGiftAdapter = new FrameGiftAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid, wishGiftId);
|
||||
frameGiftList.setAdapter(frameGiftAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
|
||||
public static LiveGiftItemFragment newInstance(String giftJson, int contextLayoutGiftHeight,
|
||||
String mStream, String mLiveUid, String wishGiftId) {
|
||||
LiveGiftItemFragment liveGiftFragment = new LiveGiftItemFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("giftJson", giftJson);
|
||||
bundle.putInt("contextLayoutGiftHeight", contextLayoutGiftHeight);
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
bundle.putString("wishGiftId", wishGiftId);
|
||||
liveGiftFragment.setArguments(bundle);
|
||||
return liveGiftFragment;
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveGiftItemEvent(LiveGiftItemEvent event) {
|
||||
frameGiftAdapter.giftSelect(event.getLiveGiftModel());
|
||||
}
|
||||
}
|
||||
@@ -30,7 +30,7 @@ import com.yunbao.live.utils.LiveTextRender;
|
||||
|
||||
public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
|
||||
private View mRoot;
|
||||
private View mRoot, root_back;
|
||||
private View mBg;
|
||||
private View mStar;
|
||||
private ImageView mAvatar;
|
||||
@@ -62,6 +62,7 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
@Override
|
||||
public void init() {
|
||||
mRoot = findViewById(R.id.root);
|
||||
root_back = findViewById(R.id.root_back);
|
||||
mBg = findViewById(R.id.bg);
|
||||
mStar = findViewById(R.id.star);
|
||||
mAvatar = (ImageView) findViewById(R.id.avatar);
|
||||
@@ -127,7 +128,7 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
* 显示礼物动画
|
||||
*/
|
||||
public void show(LiveReceiveGiftBean bean, boolean isSameUser) {
|
||||
if (bean.getMark()==3) {//这是幸运礼物
|
||||
if (bean.getMark() == 3) {//这是幸运礼物
|
||||
if (!mIdle) {
|
||||
hideNormal();
|
||||
}
|
||||
@@ -177,6 +178,13 @@ public class LiveGiftViewHolder extends AbsViewHolder {
|
||||
mGiftCount.setText(new LiveTextRender().renderGiftCount(mLianCount));
|
||||
}
|
||||
mLastGiftKey = bean.getKey();
|
||||
if (!TextUtils.equals(bean.getNamingLiveuid(), "0") && !TextUtils.equals(bean.getNamingUid(), "0")) {
|
||||
root_back.setBackgroundResource(R.drawable.background_naming);
|
||||
findViewById(R.id.naming_icon).setVisibility(View.VISIBLE);
|
||||
} else {
|
||||
root_back.setBackgroundResource(R.mipmap.icon_live_gift_anim_3);
|
||||
findViewById(R.id.naming_icon).setVisibility(View.GONE);
|
||||
}
|
||||
if (lian && mGiftCount != null && mAnimation != null) {
|
||||
mGiftCount.startAnimation(mAnimation);
|
||||
}
|
||||
|
||||
162
live/src/main/java/com/yunbao/live/views/LiveParcelFragment.java
Normal file
@@ -0,0 +1,162 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.view.ViewTreeObserver;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.viewpager.widget.ViewPager;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.common.http.HttpCallback;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveGiftFragmentPagerAdapter;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveParcelFragment extends BaseFragment {
|
||||
private ViewPager fragmentViewpager;
|
||||
private int pageCount;
|
||||
private static final int GIFT_COUNT = 8;//每页8个礼物
|
||||
private RadioGroup mRadioGroup;
|
||||
private LiveGiftFragmentPagerAdapter giftFragmentPagerAdapter;
|
||||
private ArrayList<Fragment> ViewList = new ArrayList<>(); //页卡视图集合
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private String mStream, mLiveUid;
|
||||
private LinearLayout parcelDataList, parcelDataNo;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.fragment_live_parcel, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
mStream = bundle.getString("mStream");
|
||||
mLiveUid = bundle.getString("mLiveUid");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
fragmentViewpager = contentView.findViewById(R.id.context_layout);
|
||||
mRadioGroup = contentView.findViewById(R.id.radio_group);
|
||||
parcelDataList = contentView.findViewById(R.id.parcel_data_list);
|
||||
parcelDataNo = contentView.findViewById(R.id.parcel_data_no);
|
||||
|
||||
fragmentViewpager.addOnPageChangeListener(new ViewPager.OnPageChangeListener() {
|
||||
@Override
|
||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageSelected(int position) {
|
||||
if (mRadioGroup != null && mRadioGroup.getChildAt(position) != null) {
|
||||
((RadioButton) mRadioGroup.getChildAt(position)).setChecked(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPageScrollStateChanged(int state) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
LiveHttpUtil.getWrapList(new HttpCallback() {
|
||||
@Override
|
||||
public void onSuccess(int code, String msg, String[] info) {
|
||||
if (code == 0 && info.length > 0) {
|
||||
JSONObject obj = JSON.parseObject(info[0]);
|
||||
String giftJson = obj.getString("giftlist");
|
||||
List<LiveGiftBean> list = JSON.parseArray(giftJson, LiveGiftBean.class);
|
||||
GiftCacheUtil.getInstance().addDownloadList(list);
|
||||
if (!GiftCacheUtil.getInstance().isDownloading()) {
|
||||
GiftCacheUtil.getInstance().downloadAllGift();
|
||||
}
|
||||
if (list.size() == 0) {
|
||||
parcelDataNo.setVisibility(View.VISIBLE);
|
||||
parcelDataList.setVisibility(View.GONE);
|
||||
} else {
|
||||
parcelDataList.setVisibility(View.VISIBLE);
|
||||
parcelDataNo.setVisibility(View.GONE);
|
||||
pageCount = list.size() / GIFT_COUNT;
|
||||
if (list.size() % GIFT_COUNT > 0) {
|
||||
pageCount++;
|
||||
}
|
||||
|
||||
fragmentViewpager.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {
|
||||
@Override
|
||||
public void onGlobalLayout() {
|
||||
contextLayoutGiftHeight = fragmentViewpager.getHeight();
|
||||
Log.e("giftJson", "height=" + contextLayoutGiftHeight);
|
||||
int fromIndex = 0;
|
||||
int size = list.size();
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
int endIndex = fromIndex + GIFT_COUNT;
|
||||
if (endIndex > size) {
|
||||
endIndex = size;
|
||||
}
|
||||
List<LiveGiftBean> liveGiftBeans = new ArrayList<>();
|
||||
for (int j = fromIndex; j < endIndex; j++) {
|
||||
LiveGiftBean bean = list.get(j);
|
||||
bean.setPage(i);
|
||||
liveGiftBeans.add(bean);
|
||||
}
|
||||
fromIndex = endIndex;
|
||||
ViewList.add(LiveParcelItemFragment.newInstance(JSON.toJSONString(liveGiftBeans), contextLayoutGiftHeight, mStream, mLiveUid));
|
||||
}
|
||||
giftFragmentPagerAdapter = new LiveGiftFragmentPagerAdapter(getChildFragmentManager(), getActivity(), ViewList);
|
||||
fragmentViewpager.setAdapter(giftFragmentPagerAdapter);
|
||||
|
||||
LayoutInflater inflater = LayoutInflater.from(getContext());
|
||||
for (int i = 0, size2 = ViewList.size(); i < size2; i++) {
|
||||
RadioButton radioButton = (RadioButton) inflater.inflate(R.layout.view_gift_indicator, mRadioGroup, false);
|
||||
radioButton.setId(i + 10000);
|
||||
if (i == 0) {
|
||||
radioButton.setChecked(true);
|
||||
}
|
||||
mRadioGroup.addView(radioButton);
|
||||
|
||||
}
|
||||
//移除监听
|
||||
fragmentViewpager.getViewTreeObserver().removeOnGlobalLayoutListener(this);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onFinish() {
|
||||
// if (mLoading != null) {
|
||||
// mLoading.setVisibility(View.INVISIBLE);
|
||||
// }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static LiveParcelFragment newInstance(String mStream, String mLiveUid) {
|
||||
LiveParcelFragment liveParcelFragment = new LiveParcelFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
liveParcelFragment.setArguments(bundle);
|
||||
return liveParcelFragment;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.fragment.BaseFragment;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveParcelItemAdapter;
|
||||
import com.yunbao.live.event.LiveGiftItemEvent;
|
||||
import com.yunbao.live.event.LiveParcelItemRefreshEvent;
|
||||
|
||||
import org.greenrobot.eventbus.Subscribe;
|
||||
import org.greenrobot.eventbus.ThreadMode;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveParcelItemFragment extends BaseFragment {
|
||||
private List<LiveGiftBean> giftJson = new ArrayList<>();
|
||||
private RecyclerView frameGiftList;
|
||||
private int contextLayoutGiftHeight = 0;
|
||||
private LiveParcelItemAdapter frameGiftAdapter;
|
||||
private String mStream, mLiveUid;
|
||||
|
||||
@Override
|
||||
public View createView(LayoutInflater layoutInflater, ViewGroup viewGroup) {
|
||||
return layoutInflater.inflate(R.layout.fragment_live_gift_item, viewGroup, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initVariables(Bundle bundle) {
|
||||
giftJson = JSON.parseArray(bundle.getString("giftJson"), LiveGiftBean.class);
|
||||
contextLayoutGiftHeight = bundle.getInt("contextLayoutGiftHeight");
|
||||
mStream = bundle.getString("mStream");
|
||||
mLiveUid = bundle.getString("mLiveUid");
|
||||
Log.e("giftJson", giftJson.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
||||
|
||||
frameGiftList = contentView.findViewById(R.id.frame_gift_list);
|
||||
frameGiftList.setHasFixedSize(true);
|
||||
frameGiftList.setLayoutManager(new GridLayoutManager(getActivity(), 4, GridLayoutManager.VERTICAL, false));
|
||||
frameGiftAdapter = new LiveParcelItemAdapter(contextLayoutGiftHeight, giftJson, mStream, mLiveUid);
|
||||
frameGiftList.setAdapter(frameGiftAdapter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void loadData() {
|
||||
|
||||
}
|
||||
|
||||
public static LiveParcelItemFragment newInstance(String giftJson, int contextLayoutGiftHeight, String mStream, String mLiveUid) {
|
||||
LiveParcelItemFragment liveGiftFragment = new LiveParcelItemFragment();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString("giftJson", giftJson);
|
||||
bundle.putInt("contextLayoutGiftHeight", contextLayoutGiftHeight);
|
||||
bundle.putString("mStream", mStream);
|
||||
bundle.putString("mLiveUid", mLiveUid);
|
||||
liveGiftFragment.setArguments(bundle);
|
||||
return liveGiftFragment;
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveGiftItemEvent(LiveGiftItemEvent event) {
|
||||
frameGiftAdapter.giftSelect(event.getLiveGiftModel());
|
||||
}
|
||||
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void onLiveParcelItemRefreshEvent(LiveParcelItemRefreshEvent event) {
|
||||
frameGiftAdapter.refreshWrapListAfterSend(event.getLiveGiftModel());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,138 @@
|
||||
package com.yunbao.live.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.animation.AccelerateDecelerateInterpolator;
|
||||
import android.view.animation.Animation;
|
||||
import android.view.animation.AnimationUtils;
|
||||
import android.view.animation.LinearInterpolator;
|
||||
import android.view.animation.ScaleAnimation;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RelativeLayout;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.bean.LiveGiftBean;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.interfaces.CommonCallback;
|
||||
import com.yunbao.common.utils.Bus;
|
||||
import com.yunbao.common.utils.GiftCacheUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.views.weight.ViewClicksAntiShake;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.dialog.SendRendPacketPopup;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
public class LiveParcelItemViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView giftIcon, cornerMark;
|
||||
private Context mContext;
|
||||
private TextView giftName, mPrice, giftNumber;
|
||||
private RelativeLayout giftLayout;
|
||||
private ScaleAnimation mAnimation;
|
||||
private LinearLayout mLoadingLayout;
|
||||
private ImageView mLoading;
|
||||
|
||||
public LiveParcelItemViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
mContext = itemView.getContext();
|
||||
giftIcon = itemView.findViewById(R.id.gift_icon);
|
||||
giftName = itemView.findViewById(R.id.gift_name);
|
||||
mPrice = itemView.findViewById(R.id.price);
|
||||
giftLayout = itemView.findViewById(R.id.gift_layout);
|
||||
giftNumber = itemView.findViewById(R.id.gift_number);
|
||||
cornerMark = itemView.findViewById(R.id.corner_mark);
|
||||
mLoadingLayout = itemView.findViewById(R.id.gift_loading_layout);
|
||||
mLoading = itemView.findViewById(R.id.gift_loading);
|
||||
|
||||
mAnimation = new ScaleAnimation(0.9f, 1.1f, 0.9f, 1.1f, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
|
||||
mAnimation.setInterpolator(new AccelerateDecelerateInterpolator());
|
||||
mAnimation.setDuration(400);
|
||||
mAnimation.setRepeatMode(Animation.REVERSE);
|
||||
mAnimation.setRepeatCount(-1);
|
||||
}
|
||||
|
||||
public void showData(int contextLayoutGiftHeight, LiveGiftBean model) {
|
||||
//设置高度
|
||||
itemView.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GridLayoutManager.LayoutParams linearParams = (GridLayoutManager.LayoutParams) itemView.getLayoutParams();
|
||||
linearParams.height = contextLayoutGiftHeight / 2;
|
||||
itemView.setLayoutParams(linearParams);
|
||||
}
|
||||
});
|
||||
giftLayout.setSelected(model.isChecked());
|
||||
if (model.isChecked()) {
|
||||
giftIcon.startAnimation(mAnimation);
|
||||
}
|
||||
ImgLoader.display(mContext, model.getIcon(), giftIcon);
|
||||
ImgLoader.display(mContext, model.getCornerMark(), cornerMark);
|
||||
giftName.setText(model.getName());
|
||||
mPrice.setText(model.getEnd_time());
|
||||
giftNumber.setText(model.getGiftNum());
|
||||
|
||||
if (model.getSwf() != null && model.getSwf().isEmpty()) {
|
||||
mLoadingLayout.setVisibility(View.GONE);
|
||||
} else {
|
||||
mLoadingLayout.setVisibility(GiftCacheUtil.checkGiftIsDownload(model.getId()) ? View.GONE : View.VISIBLE);
|
||||
}
|
||||
}
|
||||
|
||||
public void giftSelect(LiveGiftBean model, int position, String mStream, String mLiveUid, FrameGiftClickListener frameGiftClickListener) {
|
||||
ViewClicksAntiShake.clicksAntiShake(mLoadingLayout, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
mLoading.setImageResource(R.mipmap.icon_loading_gift);
|
||||
Animation animation = AnimationUtils.loadAnimation(mContext, R.anim.anim_loading_gift);
|
||||
animation.setRepeatMode(Animation.RESTART);
|
||||
animation.setRepeatCount(Animation.INFINITE);
|
||||
animation.setInterpolator(new LinearInterpolator());
|
||||
mLoading.startAnimation(animation);
|
||||
GiftCacheUtil.getInstance().pause();
|
||||
GiftCacheUtil.getInstance().downloadGiftForId(mContext, model, new CommonCallback<File>() {
|
||||
@Override
|
||||
public void callback(File bean) {
|
||||
if (bean == null) {
|
||||
ToastUtil.show(mContext.getString(R.string.load_failure_2));
|
||||
mLoading.setImageResource(R.mipmap.icon_download_gift);
|
||||
animation.setRepeatCount(0);
|
||||
animation.setDuration(0);
|
||||
animation.cancel();
|
||||
mLoading.setAnimation(animation);
|
||||
} else {
|
||||
mLoadingLayout.setVisibility(View.GONE);
|
||||
}
|
||||
GiftCacheUtil.getInstance().restart();
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
ViewClicksAntiShake.clicksAntiShake(giftLayout, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
if (model.getType() == 9999999) {
|
||||
Bus.get().post(new LiveGiftDialogEvent());
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new SendRendPacketPopup(mContext, mLiveUid))
|
||||
.show();
|
||||
} else {
|
||||
if (frameGiftClickListener != null) {
|
||||
frameGiftClickListener.onCallBack(position, model);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface FrameGiftClickListener {
|
||||
void onCallBack(int position, LiveGiftBean model);
|
||||
}
|
||||
}
|
||||
@@ -148,6 +148,7 @@ import com.yunbao.live.bean.WishlistItemModel;
|
||||
import com.yunbao.live.custom.LiveLightView;
|
||||
import com.yunbao.live.custom.RightGradual;
|
||||
import com.yunbao.live.custom.TopGradual;
|
||||
import com.yunbao.live.dialog.GiftWallDialog;
|
||||
import com.yunbao.live.dialog.LiveContactDetailsSendGiftDialog;
|
||||
import com.yunbao.live.dialog.LiveFaceUnityDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveFansMedalDialogFragment;
|
||||
@@ -353,7 +354,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
|
||||
//接口整合新加参数
|
||||
private GuardUserModel guardUserModel;
|
||||
private static ViewFlipper flipper;
|
||||
private static ViewFlipper flipper, wksAndGiftWall;
|
||||
private TextView mRandomPkTimer;
|
||||
|
||||
//全服通知
|
||||
@@ -958,6 +959,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
mic_view1 = (RelativeLayout) findViewById(R.id.mic_view1);
|
||||
mic_view2 = (RelativeLayout) findViewById(R.id.mic_view2);
|
||||
flipper = (ViewFlipper) findViewById(R.id.hour_rank_list);
|
||||
wksAndGiftWall = (ViewFlipper) findViewById(R.id.live_wks_and_gift_wall);
|
||||
mic_ico = (ImageView) findViewById(R.id.mic_ico);
|
||||
newMessage = (ImageView) findViewById(R.id.new_message);
|
||||
atMessage = (ImageView) findViewById(R.id.at_message);
|
||||
@@ -1381,7 +1383,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
reloadIM();
|
||||
// initStarChallengeStatus();
|
||||
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1);
|
||||
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, wishListLayout2, "rectangle_new.png", 1);
|
||||
|
||||
}
|
||||
@@ -1395,11 +1397,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
private Runnable timeRunnable = new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (redTimeCountdown > 0) {
|
||||
if (redTimeCountdown > 1) {
|
||||
redTimeCountdown = redTimeCountdown - 1;
|
||||
timeHandler.postDelayed(timeRunnable, 1000);
|
||||
redPacketCountdown.setText(String.format(mContext.getString(R.string.red_packet_countdown), TimeUtils.getTime(redTimeCountdown)));
|
||||
} else {
|
||||
redTimeCountdown = 0;
|
||||
timeHandler.removeCallbacks(timeRunnable);
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(mRedPacketModel.getRedPacketRemain())
|
||||
@@ -1501,6 +1504,7 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
@Override
|
||||
public void onSuccess(RedPacketInfoModel data) {
|
||||
if (TextUtils.equals(data.getReceiveStatus(), "0")) {
|
||||
redTimeCountdown = redTimeCountdown - 1;
|
||||
new XPopup.Builder(mContext)
|
||||
.asCustom(new ReceiveRendPacketPopup(mContext, redTimeCountdown, mLiveUid, mStream, redPacketModel.getRedPacketId(), data, false))
|
||||
.show();
|
||||
@@ -2437,13 +2441,13 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
});
|
||||
//点击打开周星榜
|
||||
ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_wks_layout),
|
||||
() -> {
|
||||
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS));
|
||||
});
|
||||
// //点击打开周星榜
|
||||
// ViewClicksAntiShake.clicksAntiShake(findViewById(R.id.live_wks_layout),
|
||||
// () -> {
|
||||
//
|
||||
// Bus.get().post(new LiveAudienceEvent()
|
||||
// .setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS));
|
||||
// });
|
||||
}
|
||||
|
||||
public static int pkEndIndex = 0;
|
||||
@@ -2666,6 +2670,21 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
public void showGiftWall(String toUid) {
|
||||
GiftWallDialog giftWallDialog = new GiftWallDialog();
|
||||
Bundle bundle = new Bundle();
|
||||
bundle.putString(Constants.LIVE_UID, mLiveUid);
|
||||
bundle.putString(Constants.LIVE_STREAM, mStream);
|
||||
bundle.putString("mAnchorName", mAnchorName);
|
||||
bundle.putString("mAvatarUrl", mAvatarUrl);
|
||||
bundle.putString("toUid", toUid);
|
||||
bundle.putInt("isAttention", isAttention);
|
||||
bundle.putBoolean("isLive", mContext instanceof LiveRyAnchorActivity);
|
||||
giftWallDialog.setArguments(bundle);
|
||||
giftWallDialog.show(((AbsActivity) mContext).getSupportFragmentManager(), "GiftWallDialog");
|
||||
|
||||
}
|
||||
|
||||
public boolean pkHandler = true;
|
||||
|
||||
//左上角显示对方主播头像及昵称
|
||||
@@ -2820,6 +2839,56 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置礼物墙和周星榜
|
||||
*/
|
||||
public void setGiftWall(String giftWallLightenNumber, String giftWallLightenTotal) {
|
||||
if (wksAndGiftWall.getChildCount() > 0) {
|
||||
wksAndGiftWall.removeAllViews();
|
||||
}
|
||||
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(DpUtil.dp2px(16), DpUtil.dp2px(16));
|
||||
LinearLayout.LayoutParams textParams = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
|
||||
textParams.leftMargin = DpUtil.dp2px(5);
|
||||
textParams.rightMargin = DpUtil.dp2px(5);
|
||||
params.leftMargin = DpUtil.dp2px(5);
|
||||
View weekView = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
ImageView weekViewPic = weekView.findViewById(R.id.wish_pic);
|
||||
TextView week = weekView.findViewById(R.id.wish_index);
|
||||
week.setLayoutParams(textParams);
|
||||
week.setGravity(Gravity.CENTER);
|
||||
week.setText(mContext.getString(R.string.live_wks));
|
||||
weekViewPic.setImageResource(R.mipmap.live_icon_zhouxing);
|
||||
weekViewPic.setLayoutParams(params);
|
||||
if (!TextUtils.isEmpty(giftWallLightenNumber) && !TextUtils.isEmpty(giftWallLightenTotal)) {
|
||||
StringBuffer stringBuffer = new StringBuffer();
|
||||
stringBuffer.append(mContext.getString(R.string.gift_wall))
|
||||
.append(giftWallLightenNumber)
|
||||
.append("/")
|
||||
.append(giftWallLightenTotal);
|
||||
View giftWall = LayoutInflater.from(mContext).inflate(R.layout.view_wish_list, null);
|
||||
ImageView giftWallPic = giftWall.findViewById(R.id.wish_pic);
|
||||
TextView giftText = giftWall.findViewById(R.id.wish_index);
|
||||
giftText.setText(stringBuffer.toString());
|
||||
giftText.setGravity(Gravity.CENTER);
|
||||
giftText.setLayoutParams(textParams);
|
||||
giftWallPic.setImageResource(R.mipmap.icon_gift_wall);
|
||||
giftWallPic.setLayoutParams(params);
|
||||
wksAndGiftWall.addView(giftWall);
|
||||
ViewClicksAntiShake.clicksAntiShake(giftWall, new ViewClicksAntiShake.ViewClicksCallBack() {
|
||||
@Override
|
||||
public void onViewClicks() {
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_WALL).setUid(String.valueOf(IMLoginManager.get(mContext).getUserInfo().getId())));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ViewClicksAntiShake.clicksAntiShake(weekView, () -> Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.LIVE_WKS)));
|
||||
wksAndGiftWall.addView(weekView);
|
||||
wksAndGiftWall.startFlipping();
|
||||
new LoadDian9TuUtil().loadDian9TuAssets2(mContext, liveWksLayout, "rectangle_new.png", 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* 守护信息发生变化
|
||||
@@ -5157,15 +5226,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
.showDialog();
|
||||
return;
|
||||
}
|
||||
new LiveContactDetailsSendGiftDialog(mContext)
|
||||
.setGiftId(data.getGiftId())
|
||||
.setAnchorName(mAnchorName)
|
||||
.setStream(mStream)
|
||||
.setLiveUid(mLiveUid)
|
||||
.setOnDismissListener(dialog1 -> {
|
||||
checkNewLetter();
|
||||
})
|
||||
.showDialog();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setmWishGiftId(data.getGiftId() + "")
|
||||
.setIsContactGift(true));
|
||||
loading.dismiss();
|
||||
}
|
||||
|
||||
@@ -5237,15 +5303,12 @@ public class LiveRoomViewHolder extends AbsViewHolder implements View.OnClickLis
|
||||
.showDialog();
|
||||
return;
|
||||
}
|
||||
new LiveContactDetailsSendGiftDialog(mContext)
|
||||
.setGiftId(data.getGiftId())
|
||||
.setAnchorName(mAnchorName)
|
||||
.setStream(mStream)
|
||||
.setLiveUid(mLiveUid)
|
||||
.setOnDismissListener(dialog1 -> {
|
||||
checkNewLetter();
|
||||
})
|
||||
.showDialog();
|
||||
Bus.get().post(new LiveAudienceEvent()
|
||||
.setType(LiveAudienceEvent.LiveAudienceType.GIFT_POPUP)
|
||||
.setmLiveUid(mLiveUid)
|
||||
.setmStream(mStream)
|
||||
.setmWishGiftId(data.getGiftId() + "")
|
||||
.setIsContactGift(true));
|
||||
loading.dismiss();
|
||||
}
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@ import com.yunbao.common.custom.MyViewPager;
|
||||
import com.yunbao.common.event.AllServerNotifyEvent;
|
||||
import com.yunbao.common.event.FollowEvent;
|
||||
import com.yunbao.common.event.LiveFloatEvent;
|
||||
import com.yunbao.common.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.common.event.SendBlindGiftEvent;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
import com.yunbao.common.http.CommonHttpConsts;
|
||||
@@ -83,7 +84,6 @@ import com.yunbao.live.dialog.BlowkissDialog;
|
||||
import com.yunbao.live.dialog.NewUserDialog;
|
||||
import com.yunbao.live.event.LinkMicTxAccEvent;
|
||||
import com.yunbao.live.event.LiveAudienceEvent;
|
||||
import com.yunbao.live.event.LiveGiftDialogEvent;
|
||||
import com.yunbao.live.event.LiveRoomChangeEvent;
|
||||
import com.yunbao.live.http.LiveHttpConsts;
|
||||
import com.yunbao.live.http.LiveHttpUtil;
|
||||
@@ -663,6 +663,8 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.setFansNum(fansNum);
|
||||
//红包相关
|
||||
mLiveRoomViewHolder.setRedPackBtnVisible(Integer.parseInt(data.getEnterRoomInfo().getIsred()) == 1);
|
||||
//礼物墙相关
|
||||
mLiveRoomViewHolder.setGiftWall(data.getEnterRoomInfo().getGiftWallLightenNumber(), data.getEnterRoomInfo().getGiftWallLightenTotal());
|
||||
}
|
||||
|
||||
//奖池等级
|
||||
@@ -1904,6 +1906,18 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
|
||||
}
|
||||
|
||||
public void setAttention(int attention) {
|
||||
if (mLiveRoomViewHolder != null)
|
||||
mLiveRoomViewHolder.setAttention(attention);
|
||||
}
|
||||
|
||||
public void showGiftWall(String toUid) {
|
||||
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.showGiftWall(toUid);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 全服喇叭
|
||||
*
|
||||
@@ -2066,4 +2080,10 @@ public class PortraitLiveManager implements LivePlayListener, SocketMessageListe
|
||||
mLiveRoomViewHolder.setRedPacketInfoModel(redPacket);
|
||||
}
|
||||
}
|
||||
|
||||
public void setGiftWall(String giftWallLightenNumber, String giftWallLightenTotal) {
|
||||
if (mLiveRoomViewHolder != null) {
|
||||
mLiveRoomViewHolder.setGiftWall(giftWallLightenNumber, giftWallLightenTotal);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
9
live/src/main/res/drawable/background_fc6945.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="13dp" />
|
||||
<solid android:color="#FC6945" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
13
live/src/main/res/drawable/background_gift_select.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_selected="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="4dp" />
|
||||
<solid android:color="#e6272C42" />
|
||||
<stroke android:width="0.6dp" android:color="#AEAEB2" />
|
||||
</shape>
|
||||
</item>
|
||||
<item android:state_selected="false">
|
||||
<shape android:shape="rectangle"></shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="90"
|
||||
android:centerColor="#8391FE"
|
||||
android:endColor="#818CFF"
|
||||
android:startColor="#8D9DFF" />
|
||||
</shape>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<gradient
|
||||
android:angle="180"
|
||||
android:centerColor="#FF9615"
|
||||
android:endColor="#EB7314"
|
||||
android:startColor="#FFBD14" />
|
||||
<corners android:radius="12dp" />
|
||||
</shape>
|
||||
9
live/src/main/res/drawable/background_naming.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="25dp" />
|
||||
<gradient android:endColor="#EC9BFF" android:startColor="#BA68FF" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
live/src/main/res/drawable/background_naming_icon.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:bottomLeftRadius="25dp" android:topRightRadius="25dp" />
|
||||
<solid android:color="#F7D80B" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
8
live/src/main/res/drawable/background_regular.xml
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="90" android:centerColor="#D5C9FF" android:endColor="#E5EBFF" android:startColor="#8C96FF" android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
live/src/main/res/drawable/background_regular_center.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10dp" />
|
||||
<gradient android:angle="90" android:endColor="#FDFBFF" android:startColor="#F8EEFF" android:type="linear" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
9
live/src/main/res/drawable/bg_gift_wall_lv.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="56dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:angle="180" android:endColor="#74C7FB" android:startColor="#CD8BFA" android:type="linear" android:useLevel="true" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="56dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffff9782" android:endColor="#ffffbf8a" android:angle="180" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#FE9C54" android:endColor="#FFC764" android:angle="180" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="56dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#fffe9afc" android:endColor="#ff8ab3ff" android:angle="180" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#B76DFF" android:endColor="#D477EF" android:angle="180" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:width="112dp" android:height="56dp">
|
||||
<shape android:shape="rectangle">
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#ffff8abd" android:endColor="#fffe9aaa" android:angle="180" />
|
||||
<gradient android:type="linear" android:useLevel="true" android:startColor="#F96496" android:endColor="#FFA999" android:angle="180" />
|
||||
<corners android:radius="6dp" />
|
||||
</shape>
|
||||
</item>
|
||||
|
||||
BIN
live/src/main/res/drawable/icon_gift_wall.png
Normal file
|
After Width: | Height: | Size: 8.1 KiB |
188
live/src/main/res/layout/activity_live_gift_wall.xml
Normal file
@@ -0,0 +1,188 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/background_gift_wall_shape"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@mipmap/background_gift_wall"
|
||||
android:orientation="vertical">
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="11dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/anchor_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播昵称"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@mipmap/background_giftwall_tab">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/codex_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/codex"
|
||||
android:textColor="#184DED"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/medal_achievement"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/honorary_achievement"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/bg_gift_wall_list"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="41dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_lit_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_lit_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/lit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic|bold" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_lit_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_unlit_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_unlit_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/unlit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_unlit_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_all_service_champion"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_all_service_champion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/all_service_champion"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_all_service_champion"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/context_layout_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="148dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@mipmap/background_gift_wall_title"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_wall"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="15sp" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
208
live/src/main/res/layout/dialog_live_gift_wall.xml
Normal file
@@ -0,0 +1,208 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="bottom">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="540dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="522dp"
|
||||
android:layout_alignParentBottom="true"
|
||||
android:background="@mipmap/background_gift_wall"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="27dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/anchor_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="主播昵称"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/attention"
|
||||
android:layout_width="15dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_marginStart="4dp"
|
||||
android:src="@mipmap/icon_following_anchor" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:layout_marginStart="6dp"
|
||||
android:layout_marginTop="16dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:background="@mipmap/background_giftwall_tab">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/codex_layout"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/codex"
|
||||
android:textColor="#184DED"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/medal_achievement"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="@string/honorary_achievement"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="15dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="4dp"
|
||||
android:background="@drawable/bg_gift_wall_list"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="41dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_lit_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_lit_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/lit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic|bold" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_lit_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_unlit_icon"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_unlit_icon"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/unlit_icon"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_unlit_icon"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/layout_all_service_champion"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_all_service_champion"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:padding="2dp"
|
||||
android:text="@string/all_service_champion"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="italic" />
|
||||
|
||||
<View
|
||||
android:id="@+id/view_all_service_champion"
|
||||
android:layout_width="18dp"
|
||||
android:layout_height="5dp"
|
||||
android:background="@drawable/tablayout_gift_wall" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/context_layout_gift"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="148dp"
|
||||
android:layout_height="27dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:background="@mipmap/background_gift_wall_title"
|
||||
android:gravity="center"
|
||||
android:text="@string/gift_wall"
|
||||
android:textColor="#3E68FF"
|
||||
android:textSize="15sp" />
|
||||
</FrameLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.makeramen.roundedimageview.RoundedImageView
|
||||
android:id="@+id/avatar"
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="41dp"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@drawable/m_chu_xia"
|
||||
app:riv_oval="true" />
|
||||
</RelativeLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/regular_bubble"
|
||||
android:layout_width="45dp"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="134dp"
|
||||
android:background="@mipmap/icon_regular_bubble"
|
||||
android:gravity="center"
|
||||
android:textColor="@color/white"
|
||||
android:text="@string/regular_bubble"
|
||||
android:textSize="8sp" />
|
||||
|
||||
</FrameLayout>
|
||||
81
live/src/main/res/layout/dialog_medal_achievement.xml
Normal file
@@ -0,0 +1,81 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="524dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:background="@drawable/background_dialog_live_codex"
|
||||
android:orientation="vertical"
|
||||
tools:ignore="MissingDefaultResource">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_btn"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_margin="13dp"
|
||||
android:src="@mipmap/icon_regular_black" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/background_medal_achievement">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="15dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_1"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
|
||||
<TextView
|
||||
|
||||
android:id="@+id/achievement_text"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="9dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/wall_honor"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical|end"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/wall_honor"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="16dp"
|
||||
android:layout_height="16dp"
|
||||
android:layout_marginTop="1dp"
|
||||
android:src="@mipmap/icon_right" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/achievement_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="14dp"
|
||||
android:paddingStart="10dp"
|
||||
android:paddingEnd="10dp" />
|
||||
</LinearLayout>
|
||||
@@ -145,14 +145,20 @@
|
||||
android:layout_marginTop="25dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="gone">
|
||||
tools:visibility="visible">
|
||||
|
||||
|
||||
<TextView
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/guard_coin_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:textColor="#9E7CFD"
|
||||
android:textSize="14sp" />
|
||||
@@ -173,13 +179,13 @@
|
||||
android:id="@+id/guard_btn_buy"
|
||||
android:layout_width="110dp"
|
||||
android:layout_height="30dp"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:layout_alignParentEnd="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:background="@drawable/bg_guard_btn_buy"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center"
|
||||
android:maxLines="1"
|
||||
android:text="@string/guard_buy"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
@@ -194,7 +200,7 @@
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
tools:visibility="visible">
|
||||
tools:visibility="invisible">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -115,21 +115,27 @@
|
||||
app:layout_constraintStart_toStartOf="parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="280dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_centerVertical="true"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/guard_tip1"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text=""
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="#A281FD"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/guard_tip2"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@@ -138,6 +144,12 @@
|
||||
android:layout_marginLeft="10dp"
|
||||
android:drawablePadding="4dp"
|
||||
android:text="456"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="#A281FD"
|
||||
android:textSize="14sp"
|
||||
android:visibility="gone" />
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -20,18 +19,37 @@
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_report"
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="14dp"
|
||||
android:layout_marginEnd="14dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/report"
|
||||
android:textColor="#B1B1B1"
|
||||
android:visibility="visible"
|
||||
android:gravity="end"
|
||||
android:orientation="vertical"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_report"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:text="@string/report"
|
||||
android:textColor="#B1B1B1"
|
||||
android:visibility="visible" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/ai_te"
|
||||
android:layout_width="41dp"
|
||||
android:layout_height="25dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:background="@drawable/background_fc6945"
|
||||
android:gravity="center"
|
||||
android:text="\@TA"
|
||||
android:textColor="@color/white"
|
||||
android:visibility="visible" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/btn_guard"
|
||||
@@ -154,9 +172,9 @@
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="17dp"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginTop="13dp"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
@@ -231,11 +249,11 @@
|
||||
android:layout_marginLeft="4dp" />
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:orientation="horizontal"
|
||||
android:layout_width="46.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginStart="6dp">
|
||||
android:layout_marginStart="6dp"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/user_card_lv_icon"
|
||||
@@ -292,28 +310,32 @@
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@mipmap/emperor_rom" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp">
|
||||
|
||||
<ImageView
|
||||
android:src="@mipmap/icon_user_card_t1"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="top"
|
||||
android:layout_height="14dp"/>
|
||||
android:src="@mipmap/icon_user_card_t1" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/sign"
|
||||
android:text="這家夥很懶,什麽都沒留下"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="這家夥很懶,什麽都沒留下"
|
||||
android:textColor="#B1B1B1"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:src="@mipmap/icon_user_card_t2"
|
||||
android:layout_width="17dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_height="14dp"/>
|
||||
android:src="@mipmap/icon_user_card_t2" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
@@ -379,29 +401,32 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="0dp"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/user_level_layout"
|
||||
android:layout_width="112dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_user_card_lv"
|
||||
android:gravity="center">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/live_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@mipmap/icon_chat_face"
|
||||
android:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -410,7 +435,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_user_level_anchor"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lv_val"
|
||||
@@ -418,31 +443,75 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Lv.0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_wall"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_user_card_lv"
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_gift_wall"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@mipmap/icon_chat_face"
|
||||
android:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_gift_wall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_user_level_anchor"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/value_gift_wall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Lv.0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/noble_icon_layout"
|
||||
android:layout_width="112dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@mipmap/img_aristocrat_notopen"
|
||||
android:gravity="center">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/noble_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@mipmap/img_fans_default"
|
||||
android:visibility="invisible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -451,7 +520,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_noble_level_anchor"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/noble_val"
|
||||
@@ -459,29 +528,32 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="Lv.0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/honor_layout"
|
||||
android:layout_width="112dp"
|
||||
android:layout_height="56dp"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="55dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@drawable/bg_user_card_honor"
|
||||
android:gravity="center">
|
||||
android:gravity="center_vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/honor_icon"
|
||||
android:layout_width="48dp"
|
||||
android:layout_height="48dp"
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:src="@mipmap/img_honor_default"
|
||||
android:visibility="visible" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="4dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
@@ -489,7 +561,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_honor_number_anchor"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="12sp" />
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/honor_val"
|
||||
@@ -497,7 +569,7 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:text="0"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp" />
|
||||
android:textSize="9sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
23
live/src/main/res/layout/fragment_live_gift.xml
Normal file
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/context_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:orientation="horizontal" />
|
||||
</LinearLayout>
|
||||
13
live/src/main/res/layout/fragment_live_gift_item.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/frame_gift_list"
|
||||
android:layout_width="match_parent"
|
||||
android:overScrollMode="never"
|
||||
android:layout_height="match_parent" />
|
||||
|
||||
</LinearLayout>
|
||||
52
live/src/main/res/layout/fragment_live_parcel.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/parcel_data_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:visibility="gone">
|
||||
|
||||
<androidx.viewpager.widget.ViewPager
|
||||
android:id="@+id/context_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginEnd="16dp"
|
||||
android:layout_weight="1" />
|
||||
|
||||
<RadioGroup
|
||||
android:id="@+id/radio_group"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="6dp"
|
||||
android:layout_gravity="center_horizontal|bottom"
|
||||
android:layout_marginTop="7dp"
|
||||
android:layout_marginBottom="9dp"
|
||||
android:orientation="horizontal" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/parcel_data_no"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="112dp"
|
||||
android:layout_height="90dp"
|
||||
android:src="@mipmap/icon_empty_parcel" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/nothing_in_the_package_yet"
|
||||
android:textColor="#717375"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</FrameLayout>
|
||||
79
live/src/main/res/layout/item_frame_gift.xml
Normal file
@@ -0,0 +1,79 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/gift_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_gift_select"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_icon"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp" />
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pay_ico"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="2dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/corner_mark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="11dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="2dp" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_loading_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#C0000000"
|
||||
android:gravity="center"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="30dp"
|
||||
android:src="@mipmap/icon_download_gift" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
18
live/src/main/res/layout/item_gift_top_new.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.yunbao.common.custom.DrawableTextView
|
||||
android:id="@+id/name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="8dp"
|
||||
android:layout_marginEnd="8dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@string/live_wrap"
|
||||
android:textStyle="bold"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
|
||||
</LinearLayout>
|
||||
97
live/src/main/res/layout/item_live_parcel.xml
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:id="@+id/gift_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/background_gift_select"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="55dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_icon"
|
||||
android:layout_width="55dp"
|
||||
android:layout_height="55dp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_number"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="2dp"
|
||||
android:background="@drawable/bg_parcel_point"
|
||||
android:paddingStart="3dp"
|
||||
android:paddingEnd="3dp"
|
||||
android:text="11"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="8sp" />
|
||||
</RelativeLayout>
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="1dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/pay_ico"
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_marginEnd="2dp"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/price"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/corner_mark"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="11dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginEnd="2dp" />
|
||||
</FrameLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/gift_loading_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#C0000000"
|
||||
android:gravity="center"
|
||||
android:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/gift_loading"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_margin="30dp"
|
||||
android:src="@mipmap/icon_download_gift" />
|
||||
</LinearLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
@@ -6,79 +6,86 @@
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="visible">
|
||||
|
||||
<LinearLayout
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:id="@+id/linearLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/background_7792d0"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="230dp"
|
||||
android:fillViewport="true"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/random_pk_info_title"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:background="@drawable/background_7792d0"
|
||||
android:orientation="vertical">
|
||||
|
||||
android:text="@string/random_pk_info_desc_1"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/random_pk_info_title"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/random_pk_info_desc_2"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/random_pk_info_desc_3"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/random_pk_info_time_desc"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="@string/random_pk_info_time"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
android:text="@string/random_pk_info_desc_1"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/random_pk_info_desc_2"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@string/random_pk_info_desc_3"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:text="@string/random_pk_info_time_desc"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:text="@string/random_pk_info_time"
|
||||
android:textColor="#F6F7FB"
|
||||
android:textSize="14sp" />
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
194
live/src/main/res/layout/rogular_introduce_popup.xml
Normal file
@@ -0,0 +1,194 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/background_regular"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/close_btn"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_marginStart="23dp"
|
||||
android:layout_marginTop="37dp"
|
||||
android:src="@mipmap/icon_regular_black" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="58dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:background="@drawable/background_regular_center">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:paddingStart="11dp"
|
||||
android:paddingEnd="11dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="33dp"
|
||||
android:text="@string/gift_wall_entrance"
|
||||
android:textColor="#1D31FE"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/gift_wall_entrance1"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/gift_wall_entrance2"
|
||||
android:textColor="#1D31FE"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/gift_wall_entrance3"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/gift_wall_entrance4"
|
||||
android:textColor="#1D31FE"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/gift_wall_entrance5"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/codex"
|
||||
android:textColor="#1D31FE"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/gift_wall_entrance6"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="16dp"
|
||||
android:text="@string/gift_wall_entrance7"
|
||||
android:textColor="#1D31FE"
|
||||
android:textSize="14sp"
|
||||
android:textStyle="bold" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:text="@string/gift_wall_entrance8_1"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_2"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_3"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_4"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_5"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_6"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_7"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_8"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/gift_wall_entrance8_9"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:text="@string/gift_wall_entrance8_10"
|
||||
android:textColor="#7480FF"
|
||||
android:textSize="13sp" />
|
||||
|
||||
</LinearLayout>
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/regular_title"
|
||||
android:layout_width="142dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:layout_marginTop="28dp"
|
||||
android:background="@mipmap/background_regular_title"
|
||||
android:gravity="center"
|
||||
android:textSize="16sp"
|
||||
android:textStyle="bold" />
|
||||
</FrameLayout>
|
||||
@@ -1,147 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="170dp"
|
||||
android:layout_height="110dp">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="159dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_gravity="end"
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical">
|
||||
<!--凤凰,龙,麒麟-->
|
||||
<FrameLayout
|
||||
android:id="@+id/frame_blind_top"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="86.5dp"
|
||||
android:background="@mipmap/bg_kirin">
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="51dp"
|
||||
android:layout_marginTop="59dp"
|
||||
android:orientation="vertical">
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind3"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="30"
|
||||
android:progressDrawable="@drawable/bg_blind_progres"
|
||||
android:visibility="gone" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind1"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/bg_blind_progress"
|
||||
android:visibility="visible" />
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/progress_blind2"
|
||||
style="@android:style/Widget.ProgressBar.Horizontal"
|
||||
android:layout_width="80dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_gravity="center"
|
||||
android:max="100"
|
||||
android:progress="50"
|
||||
android:progressDrawable="@drawable/bg_blind_progress1"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/text_blind_progress"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:textSize="6sp" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/blind_number"
|
||||
android:layout_width="90dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="47dp"
|
||||
android:layout_marginTop="71dp"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="8sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/description"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_gravity="end"
|
||||
android:layout_marginTop="40dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:src="@mipmap/icon_what" />
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="149dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@mipmap/bg_blind_bottom">
|
||||
|
||||
<com.yunbao.common.views.weight.MarqueeTextView
|
||||
android:id="@+id/text_blind_gift_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_margin="5dp"
|
||||
android:ellipsize="marquee"
|
||||
android:focusable="true"
|
||||
android:focusableInTouchMode="true"
|
||||
android:gravity="center"
|
||||
android:marqueeRepeatLimit="marquee_forever"
|
||||
android:scrollHorizontally="true"
|
||||
android:singleLine="true"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="10sp" />
|
||||
</FrameLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/blind_svga"
|
||||
android:layout_width="71dp"
|
||||
android:layout_marginStart="5dp"
|
||||
android:layout_height="71dp"
|
||||
android:layout_marginTop="29dp" />
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="42dp"
|
||||
android:layout_height="42dp"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginTop="43dp">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/icon_masking"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
/>
|
||||
</RelativeLayout>
|
||||
|
||||
<com.opensource.svgaplayer.SVGAImageView
|
||||
android:id="@+id/blind_box_open"
|
||||
android:layout_width="61dp"
|
||||
android:layout_height="110dp"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="2dp" />
|
||||
</FrameLayout>
|
||||
@@ -8,6 +8,7 @@
|
||||
android:visibility="invisible">
|
||||
|
||||
<View
|
||||
android:id="@+id/root_back"
|
||||
android:layout_width="204dp"
|
||||
android:layout_height="50dp"
|
||||
android:layout_gravity="bottom"
|
||||
@@ -107,4 +108,15 @@
|
||||
android:visibility="invisible" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/naming_icon"
|
||||
android:layout_width="56dp"
|
||||
android:layout_height="15dp"
|
||||
android:layout_gravity="bottom"
|
||||
android:layout_marginStart="11dp"
|
||||
android:background="@drawable/background_naming_icon"
|
||||
android:gravity="center"
|
||||
android:text="@string/the_title_financier2"
|
||||
android:textColor="#DB7008"
|
||||
android:textSize="10sp" />
|
||||
</FrameLayout>
|
||||
|
||||
@@ -360,7 +360,7 @@
|
||||
<!--周星榜-->
|
||||
<FrameLayout
|
||||
android:id="@+id/live_wks_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="20dp"
|
||||
android:layout_alignTop="@id/hour_rank_layout"
|
||||
android:layout_marginStart="4dp"
|
||||
@@ -371,26 +371,44 @@
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_wks_layout2"
|
||||
android:layout_width="56dp"
|
||||
android:layout_width="70dp"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="horizontal" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@mipmap/live_icon_zhouxing" />
|
||||
|
||||
<TextView
|
||||
<ViewFlipper
|
||||
android:id="@+id/live_wks_and_gift_wall"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/live_wks"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="10sp" />
|
||||
android:layout_height="20dp"
|
||||
android:layout_marginStart="0dp"
|
||||
android:flipInterval="5000"
|
||||
android:inAnimation="@anim/anim_marquee_in"
|
||||
android:outAnimation="@anim/anim_marquee_out" />
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="12dp"
|
||||
android:layout_height="12dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="6dp"
|
||||
android:src="@mipmap/live_icon_zhouxing"
|
||||
android:visibility="gone" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginStart="20dp"
|
||||
android:layout_marginEnd="6dp"
|
||||
android:text="@string/live_wks"
|
||||
android:textColor="#FFFFFFFF"
|
||||
android:textSize="10sp"
|
||||
android:visibility="gone" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</FrameLayout>
|
||||
<!--心愿单-->
|
||||
@@ -524,7 +542,8 @@
|
||||
android:clickable="true"
|
||||
android:focusable="true"
|
||||
android:gravity="center"
|
||||
android:visibility="invisible">
|
||||
android:visibility="invisible"
|
||||
tools:visibility="visible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
|
||||
|
Before Width: | Height: | Size: 233 B |
|
Before Width: | Height: | Size: 6.8 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/background_gift_wall_title.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/background_giftwall_tab.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/background_regular_title.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
|
Before Width: | Height: | Size: 2.3 KiB |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_following_anchor.png
Normal file
|
After Width: | Height: | Size: 933 B |
BIN
live/src/main/res/mipmap-xxxhdpi/icon_regular_bubble.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 331 B After Width: | Height: | Size: 357 B |