add[直播数据-当场数据、PK弹窗]
This commit is contained in:
parent
06bbca07a1
commit
86c7bd56d1
@ -1,4 +1,4 @@
|
||||
package com.yunbao.live.adapter;
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
@ -10,21 +10,21 @@ import android.widget.TextView;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.LiveDataInfoNowModel;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataInfoRecyclerAdapter extends RecyclerView.Adapter<LiveDataInfoRecyclerAdapter.LiveDataHolder> {
|
||||
private Context mContext;
|
||||
private List<LiveDataInfoModel> list=new ArrayList<>();
|
||||
private List<LiveDataInfoNowModel> list=new ArrayList<>();
|
||||
|
||||
public LiveDataInfoRecyclerAdapter(Context mContext) {
|
||||
this.mContext = mContext;
|
||||
}
|
||||
|
||||
public void setList(List<LiveDataInfoModel> list) {
|
||||
public void setList(List<LiveDataInfoNowModel> list) {
|
||||
this.list = list;
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
@ -54,12 +54,8 @@ public class LiveDataInfoRecyclerAdapter extends RecyclerView.Adapter<LiveDataIn
|
||||
data = itemView.findViewById(R.id.item_data);
|
||||
}
|
||||
|
||||
public void setData(LiveDataInfoModel model) {
|
||||
if (model.getColor() != null) {
|
||||
data.setText(Html.fromHtml("<font color='" + model.getColor() + "'>" + model.getData() + "</font>"));
|
||||
} else {
|
||||
data.setText(model.getData());
|
||||
}
|
||||
public void setData(LiveDataInfoNowModel model) {
|
||||
data.setText(model.getData());
|
||||
title.setText(model.getTitle());
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
|
||||
public class LiveDataInfoNowModel extends BaseModel {
|
||||
private String color;
|
||||
private String title;
|
||||
private String data;
|
||||
|
||||
public LiveDataInfoNowModel(String color, String title, String data) {
|
||||
this.color = color;
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel(String title, String data) {
|
||||
this.title = title;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
public LiveDataInfoNowModel() {
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(String data) {
|
||||
this.data = data;
|
||||
}
|
||||
}
|
@ -0,0 +1,91 @@
|
||||
package com.yunbao.common.fragment;
|
||||
|
||||
import static com.umeng.commonsdk.stateless.UMSLEnvelopeBuild.mContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.LiveDataInfoRecyclerAdapter;
|
||||
import com.yunbao.common.bean.LiveDataInfoModel;
|
||||
import com.yunbao.common.bean.LiveDataInfoNowModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataNowFragment extends Fragment {
|
||||
|
||||
private RecyclerView recyclerView;
|
||||
private LiveDataInfoRecyclerAdapter adapter;
|
||||
private List<LiveDataInfoNowModel> list;
|
||||
private String mLiveUid;
|
||||
private onDataResult onDataResult;
|
||||
|
||||
public LiveDataNowFragment(Context context, String liveUid,LiveDataNowFragment.onDataResult onDataResult) {
|
||||
this.mLiveUid = liveUid;
|
||||
this.onDataResult = onDataResult;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
return inflater.inflate(R.layout.live_data_now_fragment, container, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||
super.onViewCreated(view, savedInstanceState);
|
||||
recyclerView = view.findViewById(R.id.live_data_list);
|
||||
adapter = new LiveDataInfoRecyclerAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), getContext().getString(R.string.live_data_loading)));
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveData(mLiveUid, new HttpCallback<LiveDataInfoModel>() {
|
||||
@Override
|
||||
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
||||
list.clear();
|
||||
list.add(new LiveDataInfoNowModel("#00FFFF", getContext().getString(R.string.live_data_coin), data.getTotalCoin() + ""));
|
||||
list.add(new LiveDataInfoNowModel("#FFF69F", getContext().getString(R.string.live_data_gold), data.getTotalGold() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_accept), data.getAcceptNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_enter), data.getEnterNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention), data.getAttentionNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group), data.getFanGroupNum() + ""));
|
||||
list.add(new LiveDataInfoNowModel(getContext().getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + ""));
|
||||
adapter.setList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public interface onDataResult{
|
||||
void Result(String countZs,String countPerson);
|
||||
}
|
||||
}
|
31
common/src/main/res/layout/item_live_data.xml
Normal file
31
common/src/main/res/layout/item_live_data.xml
Normal file
@ -0,0 +1,31 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:gravity="center"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:orientation="vertical"
|
||||
android:layout_marginBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:text="222"
|
||||
android:textColor="#92949A"
|
||||
android:textSize="11sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_marginTop="5dp"
|
||||
android:id="@+id/item_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="111"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp"/>
|
||||
|
||||
</LinearLayout>
|
61
common/src/main/res/layout/live_data_now_fragment.xml
Normal file
61
common/src/main/res/layout/live_data_now_fragment.xml
Normal file
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/live_data_msg1"
|
||||
android:textColor="#808080"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/live_data_img"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginEnd="5dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="14dp"
|
||||
android:text="@string/live_data_msg2"
|
||||
android:textColor="#595959" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/live_data_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="3"
|
||||
tools:listitem="@layout/item_live_data" />
|
||||
|
||||
</RelativeLayout>
|
@ -1485,4 +1485,8 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="live_data_history_type">type</string>
|
||||
<string name="live_data_history_name">name</string>
|
||||
<string name="live_data_history_gain">gain</string>
|
||||
|
||||
<string name="live_data_tip">* Non-real-time calculation of data</string>
|
||||
<string name="live_data_msg2">Historical data can be viewed in the anchor center</string>
|
||||
<string name="live_data_msg1">This live data statistics</string>
|
||||
</resources>
|
||||
|
@ -1615,5 +1615,8 @@
|
||||
<string name="live_data_history_type">分類</string>
|
||||
<string name="live_data_history_name">名稱</string>
|
||||
<string name="live_data_history_gain">收益</string>
|
||||
<string name="live_data_tip">* 人數及新增相關數據非实时计算</string>
|
||||
<string name="live_data_msg2">歷史數據可在主播中心查看</string>
|
||||
<string name="live_data_msg1">本場直播數據統計</string>
|
||||
|
||||
</resources>
|
||||
|
@ -1424,4 +1424,7 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="live_data_history_name">name</string>
|
||||
<string name="live_data_history_gain">gain</string>
|
||||
|
||||
<string name="live_data_tip">* Non-real-time calculation of data</string>
|
||||
<string name="live_data_msg2">Historical data can be viewed in the anchor center</string>
|
||||
<string name="live_data_msg1">This live data statistics</string>
|
||||
</resources>
|
||||
|
@ -96,6 +96,7 @@ import com.yunbao.live.dialog.FreePkDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveInputDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveInteractionDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveNewFunctionDialogFragment;
|
||||
import com.yunbao.live.dialog.LivePkTypeDialog;
|
||||
import com.yunbao.live.dialog.LivePrankDialogFragment;
|
||||
import com.yunbao.live.dialog.LiveTaskDialog;
|
||||
import com.yunbao.live.dialog.LiveWishListDialogFragment4Audience;
|
||||
@ -1428,13 +1429,9 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
|
||||
* 发起主播连麦pk
|
||||
*/
|
||||
public void applyLinkMicPk() {
|
||||
String pkUid = null;
|
||||
if (mLiveLinkMicAnchorPresenter != null) {
|
||||
pkUid = mLiveLinkMicAnchorPresenter.getPkUid();
|
||||
}
|
||||
if (!TextUtils.isEmpty(pkUid) && mLiveSwLinkMicPkPresenter != null) {
|
||||
mLiveSwLinkMicPkPresenter.applyLinkMicPk(pkUid, mStream);
|
||||
}
|
||||
LivePkTypeDialog livePkTypeDialog = new LivePkTypeDialog(mContext);
|
||||
livePkTypeDialog.setFunctionClickListener(this);
|
||||
livePkTypeDialog.showDialog();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -7,24 +7,17 @@ import android.view.View;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.fragment.LiveDataHistoryFragment;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.AppManager;
|
||||
import com.yunbao.common.fragment.LiveDataNowFragment;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
import com.yunbao.common.utils.ViewPageIndicatorUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.adapter.LiveDataInfoRecyclerAdapter;
|
||||
import com.yunbao.live.bean.LiveDataInfoModel;
|
||||
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
@ -39,9 +32,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
||||
private RecyclerView recyclerView;
|
||||
private LiveDataInfoRecyclerAdapter adapter;
|
||||
private List<LiveDataInfoModel> list;
|
||||
private String mStream;
|
||||
private String mLiveUid;
|
||||
|
||||
@ -72,7 +62,12 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
final String[] titles = new String[]{WordUtil.getNewString(R.string.live_data_now_data), WordUtil.getNewString(R.string.live_data_gift_history)};
|
||||
fragmentList.add(new LiveDataHistoryFragment( mContext,mStream));
|
||||
fragmentList.add(new LiveDataNowFragment(mContext, mLiveUid, new LiveDataNowFragment.onDataResult() {
|
||||
@Override
|
||||
public void Result(String countZs, String countPerson) {
|
||||
|
||||
}
|
||||
}));
|
||||
fragmentList.add(new LiveDataHistoryFragment( mContext,mStream));
|
||||
|
||||
mIndicator = findViewById(R.id.indicator);
|
||||
@ -96,11 +91,6 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
||||
CommonNavigator commonNavigator = getCommonNavigator(titles);
|
||||
mIndicator.setNavigator(commonNavigator);
|
||||
ViewPageIndicatorUtils.bind(mIndicator, viewPager, null);
|
||||
|
||||
recyclerView = findViewById(R.id.live_data_list);
|
||||
adapter = new LiveDataInfoRecyclerAdapter(getContext());
|
||||
recyclerView.setAdapter(adapter);
|
||||
initData();
|
||||
}
|
||||
|
||||
private @NonNull CommonNavigator getCommonNavigator(String[] titles) {
|
||||
@ -145,39 +135,4 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
||||
});
|
||||
return commonNavigator;
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
list = new ArrayList<>();
|
||||
list.add(new LiveDataInfoModel("#00FFFF", getContext().getString(R.string.live_data_coin), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel("#FFF69F", getContext().getString(R.string.live_data_gold), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_accept), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_enter), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention_rate), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group), getContext().getString(R.string.live_data_loading)));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group_rate), getContext().getString(R.string.live_data_loading)));
|
||||
adapter.setList(list);
|
||||
LiveNetManager.get(getContext())
|
||||
.getLiveData(mLiveUid, new HttpCallback<com.yunbao.common.bean.LiveDataInfoModel>() {
|
||||
@Override
|
||||
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
||||
list.clear();
|
||||
list.add(new LiveDataInfoModel("#00FFFF", getContext().getString(R.string.live_data_coin), data.getTotalCoin() + ""));
|
||||
list.add(new LiveDataInfoModel("#FFF69F", getContext().getString(R.string.live_data_gold), data.getTotalGold() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_accept), data.getAcceptNum() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_enter), data.getEnterNum() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention), data.getAttentionNum() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_attention_rate), data.getAttentionNumRate() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group), data.getFanGroupNum() + ""));
|
||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group_rate), data.getFanGroupNumRate() + ""));
|
||||
adapter.setList(list);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(mContext.getString(com.yunbao.common.R.string.net_error));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,83 @@
|
||||
package com.yunbao.live.dialog;
|
||||
|
||||
import static com.yunbao.common.Constants.LIVE_FUNC_DR;
|
||||
import static com.yunbao.common.Constants.LIVE_FUNC_LINK_MIC;
|
||||
import static com.yunbao.common.Constants.LIVE_FUNC_RANDOM_PK;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Color;
|
||||
import android.os.Bundle;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||
import com.yunbao.common.fragment.LiveDataHistoryFragment;
|
||||
import com.yunbao.common.fragment.LiveDataNowFragment;
|
||||
import com.yunbao.common.utils.DpUtil;
|
||||
import com.yunbao.common.utils.ViewPageIndicatorUtils;
|
||||
import com.yunbao.common.utils.WordUtil;
|
||||
import com.yunbao.live.R;
|
||||
import com.yunbao.live.interfaces.LiveFunctionClickListener;
|
||||
|
||||
import net.lucode.hackware.magicindicator.MagicIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView;
|
||||
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.SimplePagerTitleView;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class LivePkTypeDialog extends AbsDialogPopupWindow {
|
||||
|
||||
private LiveFunctionClickListener mFunctionClickListener;
|
||||
|
||||
public void setFunctionClickListener(LiveFunctionClickListener functionClickListener) {
|
||||
mFunctionClickListener = functionClickListener;
|
||||
}
|
||||
|
||||
public LivePkTypeDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void buildDialog(XPopup.Builder builder) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int bindLayoutId() {
|
||||
return R.layout.dialog_pk_type;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
findViewById(R.id.type_pk_1v1).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mFunctionClickListener.onClick(LIVE_FUNC_LINK_MIC);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.type_pk_dr).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mFunctionClickListener.onClick(LIVE_FUNC_DR);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.type_pk_random).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
mFunctionClickListener.onClick(LIVE_FUNC_RANDOM_PK);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
@ -229,7 +229,7 @@ public class LiveRyAnchorViewHolder extends AbsLiveViewHolder {
|
||||
findViewById(R.id.btn_task).setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
((LiveSwAnchorActivity) mContext).showTaskDialog();
|
||||
((LiveSwAnchorActivity) mContext).showFunctionDialog();
|
||||
}
|
||||
});
|
||||
findViewById(R.id.btn_fz).setOnClickListener(new View.OnClickListener() {
|
||||
|
9
live/src/main/res/drawable/bg_live_pk_type.xml
Normal file
9
live/src/main/res/drawable/bg_live_pk_type.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="8dp" />
|
||||
<solid android:color="#282A30" />
|
||||
</shape>
|
||||
</item>
|
||||
</selector>
|
@ -1,9 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="500dp"
|
||||
android:layout_height="320dp"
|
||||
android:background="#000002">
|
||||
|
||||
<LinearLayout
|
||||
@ -20,79 +19,65 @@
|
||||
|
||||
<net.lucode.hackware.magicindicator.MagicIndicator
|
||||
android:id="@+id/indicator"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_gravity="center"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="37dp" />
|
||||
|
||||
<androidx.viewpager2.widget.ViewPager2
|
||||
android:id="@+id/viewPager"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="50dp"
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1"
|
||||
android:overScrollMode="never"
|
||||
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:visibility="gone"
|
||||
android:gravity="center"
|
||||
android:orientation="horizontal">
|
||||
android:layout_height="30dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="11sp"
|
||||
android:textColor="#92949A"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="@string/live_data_msg1"
|
||||
android:textColor="#808080"
|
||||
android:textSize="16sp" />
|
||||
android:text="@string/live_data_now_bottom_zs" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
<TextView
|
||||
android:id="@+id/countZs"
|
||||
android:layout_marginStart="2dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="end|center"
|
||||
android:orientation="horizontal">
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="14sp"
|
||||
android:text="0" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/live_data_img"
|
||||
android:layout_width="13dp"
|
||||
android:layout_height="13dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
tools:srcCompat="@mipmap/icon_free_pk_waring" />
|
||||
<TextView
|
||||
android:layout_marginStart="62dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:textSize="11sp"
|
||||
android:textColor="#92949A"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_data_now_bottom_person" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:maxLines="1"
|
||||
android:ellipsize="end"
|
||||
android:textSize="14dp"
|
||||
android:text="@string/live_data_msg2"
|
||||
android:textColor="#595959" />
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:textSize="14sp"
|
||||
android:layout_marginStart="2dp"
|
||||
android:id="@+id/countPerson"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="#FFFFFF"
|
||||
android:text="0" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/live_data_list"
|
||||
android:layout_width="match_parent"
|
||||
android:visibility="gone"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:overScrollMode="never"
|
||||
app:layoutManager="androidx.recyclerview.widget.GridLayoutManager"
|
||||
app:spanCount="2"
|
||||
tools:listitem="@layout/item_live_data" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:layout_marginBottom="20dp"
|
||||
android:gravity="center"
|
||||
android:text="@string/live_data_tip"
|
||||
android:textColor="#808080" />
|
||||
android:layout_width="match_parent"
|
||||
android:textSize="11sp"
|
||||
android:textColor="#92949A"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/live_data_tip" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
101
live/src/main/res/layout/dialog_pk_type.xml
Normal file
101
live/src/main/res/layout/dialog_pk_type.xml
Normal file
@ -0,0 +1,101 @@
|
||||
<?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="150dp"
|
||||
android:gravity="center"
|
||||
android:background="#000002">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/type_pk_1v1"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="79dp"
|
||||
android:background="@drawable/bg_live_pk_type"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_pk_1v1" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="1v1PK"
|
||||
android:textColor="#DCAB75"
|
||||
android:textSize="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/type_pk_dr"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="79dp"
|
||||
android:background="@drawable/bg_live_pk_type"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_pk_dr" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/live_dr"
|
||||
android:textColor="#DCAB75"
|
||||
android:textSize="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/type_pk_random"
|
||||
android:layout_width="79dp"
|
||||
android:layout_height="79dp"
|
||||
android:background="@drawable/bg_live_pk_type"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_pk_sj" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@string/random_pk_info_view_title"
|
||||
android:textColor="#DCAB75"
|
||||
android:textSize="12dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
@ -1,44 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="10dp"
|
||||
android:background="@drawable/background_151515">
|
||||
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_data"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="11dp"
|
||||
android:text="111"
|
||||
android:textColor="#FFFFFF"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/item_title"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingStart="14dp"
|
||||
android:paddingTop="5dp"
|
||||
android:paddingEnd="14dp"
|
||||
android:paddingBottom="10dp"
|
||||
android:text="222"
|
||||
android:textColor="#808080"
|
||||
android:textSize="14sp"
|
||||
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/item_data" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
BIN
live/src/main/res/mipmap-xhdpi/live_pk_1v1.png
Normal file
BIN
live/src/main/res/mipmap-xhdpi/live_pk_1v1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
BIN
live/src/main/res/mipmap-xhdpi/live_pk_dr.png
Normal file
BIN
live/src/main/res/mipmap-xhdpi/live_pk_dr.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
BIN
live/src/main/res/mipmap-xhdpi/live_pk_sj.png
Normal file
BIN
live/src/main/res/mipmap-xhdpi/live_pk_sj.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
@ -160,5 +160,7 @@
|
||||
<string name="live_end_level">我的等级</string>
|
||||
<string name="live_end_total">共</string>
|
||||
<string name="live_end_minute">分鐘</string>
|
||||
<string name="live_data_now_bottom_zs">本場總計鑽石:</string>
|
||||
<string name="live_data_now_bottom_person">打賞人數:</string>
|
||||
|
||||
</resources>
|
||||
|
@ -163,4 +163,6 @@
|
||||
<string name="live_end_level">My level</string>
|
||||
<string name="live_end_total">total</string>
|
||||
<string name="live_end_minute">minute</string>
|
||||
<string name="live_data_now_bottom_zs">Get diamonds:</string>
|
||||
<string name="live_data_now_bottom_person">Gift givers:</string>
|
||||
</resources>
|
Loading…
Reference in New Issue
Block a user