add[直播数据-送礼列表]
This commit is contained in:
parent
af8ac39e9c
commit
06bbca07a1
@ -14,11 +14,6 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.yunbao.common.R;
|
import com.yunbao.common.R;
|
||||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
import com.yunbao.common.bean.LiveDataHistoryBean;
|
||||||
import com.yunbao.common.bean.LiveDataHistoryBean;
|
|
||||||
import com.yunbao.common.glide.ImgLoader;
|
|
||||||
import com.yunbao.common.utils.StringUtil;
|
|
||||||
import com.yunbao.common.utils.WordUtil;
|
|
||||||
import com.yunbao.common.views.weight.ClipPathCircleImage;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -30,12 +25,12 @@ import java.util.List;
|
|||||||
public class LiveDataHistoryAdapter extends RecyclerView.Adapter<LiveDataHistoryAdapter.Vh> {
|
public class LiveDataHistoryAdapter extends RecyclerView.Adapter<LiveDataHistoryAdapter.Vh> {
|
||||||
|
|
||||||
private Context mContext;
|
private Context mContext;
|
||||||
private List<LiveDataHistoryBean> mList;
|
private List<LiveDataHistoryBean> mList= new ArrayList<>();
|
||||||
private LayoutInflater mInflater;
|
private LayoutInflater mInflater;
|
||||||
|
|
||||||
public LiveDataHistoryAdapter(Context context, List<LiveDataHistoryBean> list) {
|
public LiveDataHistoryAdapter(Context context, List<LiveDataHistoryBean> list) {
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mInflater = LayoutInflater.from(context);
|
mInflater = LayoutInflater.from(mContext);
|
||||||
mList = list;
|
mList = list;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +54,7 @@ public class LiveDataHistoryAdapter extends RecyclerView.Adapter<LiveDataHistory
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
holder.time.setText(mList.get(position).getAddtime().substring(0,9)+"\n"+mList.get(position).getAddtime().substring(10));
|
holder.time.setText(mList.get(position).getAddtime().substring(0,9)+"\n"+mList.get(position).getAddtime().substring(10));
|
||||||
holder.giftTypeName.setText(mList.get(position).getAction());
|
holder.giftTypeName.setText(mList.get(position).getCateName());
|
||||||
holder.giftName.setText(mList.get(position).getGiftname());
|
holder.giftName.setText(mList.get(position).getGiftname());
|
||||||
holder.income.setText(String.valueOf(mList.get(position).getAnchor_profit_coin()));
|
holder.income.setText(String.valueOf(mList.get(position).getAnchor_profit_coin()));
|
||||||
|
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
package com.yunbao.common.bean;
|
package com.yunbao.common.bean;
|
||||||
|
|
||||||
|
import com.yunbao.common.utils.WordUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 直播数据
|
* 直播数据
|
||||||
*/
|
*/
|
||||||
@ -8,7 +10,9 @@ public class LiveDataHistoryBean extends BaseModel {
|
|||||||
private String anchor_profit_coin;
|
private String anchor_profit_coin;
|
||||||
private String addtime;
|
private String addtime;
|
||||||
private String giftname;
|
private String giftname;
|
||||||
private String action;
|
private String cate_name;
|
||||||
|
private String english_cate_name;
|
||||||
|
|
||||||
|
|
||||||
public String getGiftid() {
|
public String getGiftid() {
|
||||||
return giftid;
|
return giftid;
|
||||||
@ -42,11 +46,19 @@ public class LiveDataHistoryBean extends BaseModel {
|
|||||||
this.giftname = giftname;
|
this.giftname = giftname;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAction() {
|
public String getCateName() {
|
||||||
return action;
|
return WordUtil.isNewZh()?cate_name:english_cate_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setAction(String action) {
|
public void setCate_name(String cate_name) {
|
||||||
this.action = action;
|
this.cate_name = cate_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getEnglish_cate_name() {
|
||||||
|
return english_cate_name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnglish_cate_name(String english_cate_name) {
|
||||||
|
this.english_cate_name = english_cate_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,8 +5,12 @@ import android.os.Bundle;
|
|||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
@ -18,6 +22,7 @@ import com.yunbao.common.bean.LiveDataHistoryBean;
|
|||||||
import com.yunbao.common.http.CommonHttpUtil;
|
import com.yunbao.common.http.CommonHttpUtil;
|
||||||
import com.yunbao.common.http.HttpCallback;
|
import com.yunbao.common.http.HttpCallback;
|
||||||
import com.yunbao.common.utils.ToastUtil;
|
import com.yunbao.common.utils.ToastUtil;
|
||||||
|
import com.yunbao.common.utils.ViewUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -28,80 +33,78 @@ import io.rong.imkit.widget.refresh.listener.OnLoadMoreListener;
|
|||||||
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
import io.rong.imkit.widget.refresh.listener.OnRefreshListener;
|
||||||
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
import io.rong.imkit.widget.refresh.wrapper.RongRefreshHeader;
|
||||||
|
|
||||||
public class LiveDataHistoryFragment extends BaseFragment {
|
public class LiveDataHistoryFragment extends Fragment {
|
||||||
SmartRefreshLayout mRefreshLayout;
|
|
||||||
RecyclerView mList;
|
|
||||||
Context mContext;
|
|
||||||
LiveDataHistoryAdapter adapter;
|
|
||||||
List<LiveDataHistoryBean> list = new ArrayList<>();
|
|
||||||
int mPageCount = 1;//页数
|
|
||||||
|
|
||||||
|
protected SmartRefreshLayout mRefreshLayout;
|
||||||
|
protected RecyclerView mList;
|
||||||
|
private LiveDataHistoryAdapter mAdapter;
|
||||||
|
List<LiveDataHistoryBean> list = new ArrayList<>();
|
||||||
|
private View emptyView;
|
||||||
|
private Context mContext;
|
||||||
|
private String mStream;
|
||||||
|
private int mPageCount = 1;//页数
|
||||||
|
|
||||||
|
public LiveDataHistoryFragment(Context context,String stream) {
|
||||||
|
this.mContext =context;
|
||||||
|
this.mStream = stream;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View createView(LayoutInflater inflater, ViewGroup container) {
|
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
|
emptyView = inflater.inflate(R.layout.view_layout_msg,container, false);
|
||||||
|
ViewUtils.findViewById(emptyView,R.id.imageView, ImageView.class).setImageResource(R.mipmap.ic_addressbook_not_search);
|
||||||
|
ViewUtils.findViewById(emptyView,R.id.textView, TextView.class).setText(R.string.not_data_message_address_book_list);
|
||||||
return inflater.inflate(R.layout.live_data_history_list_fragment, container, false);
|
return inflater.inflate(R.layout.live_data_history_list_fragment, container, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initVariables(Bundle bundle) {
|
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) {
|
||||||
|
super.onViewCreated(view, savedInstanceState);
|
||||||
}
|
mAdapter = new LiveDataHistoryAdapter(mContext,list);
|
||||||
|
this.mList = (RecyclerView) view.findViewById(R.id.rc_conversation_list);
|
||||||
@Override
|
this.mRefreshLayout = (SmartRefreshLayout) view.findViewById(R.id.rc_refresh);
|
||||||
protected void initViews(Bundle savedInstanceState, View contentView) {
|
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getActivity());
|
||||||
initView(contentView);
|
this.mList.setLayoutManager(layoutManager);
|
||||||
|
mList.setAdapter(mAdapter);
|
||||||
initRefreshView();
|
initRefreshView();
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void loadData() {
|
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveDataHistoryFragment(Context context) {
|
|
||||||
this.mContext = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void initView(View view) {
|
|
||||||
mRefreshLayout = view.findViewById(R.id.rc_refresh);
|
|
||||||
mList = view.findViewById(R.id.rc_conversation_list);
|
|
||||||
LinearLayoutManager layoutManager = new LinearLayoutManager(this.getActivity());
|
|
||||||
mList.setLayoutManager(layoutManager);
|
|
||||||
mList.setItemViewCacheSize(0);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void initRefreshView() {
|
protected void initRefreshView() {
|
||||||
mRefreshLayout.setNestedScrollingEnabled(false);
|
this.mRefreshLayout.setNestedScrollingEnabled(false);
|
||||||
mRefreshLayout.setRefreshHeader(new RongRefreshHeader(getContext()));
|
this.mRefreshLayout.setRefreshHeader(new RongRefreshHeader(this.getContext()));
|
||||||
mRefreshLayout.setRefreshFooter(new RongRefreshHeader(getContext()));
|
this.mRefreshLayout.setRefreshFooter(new RongRefreshHeader(this.getContext()));
|
||||||
mRefreshLayout.setEnableLoadMore(false);
|
this.mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
||||||
mRefreshLayout.setOnRefreshListener(new OnRefreshListener() {
|
|
||||||
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||||
mPageCount = 1;
|
mPageCount = 1;
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
this.mRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
|
||||||
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||||
mPageCount++;
|
mPageCount++;
|
||||||
initData();
|
initData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
adapter = new LiveDataHistoryAdapter(mContext,list);
|
|
||||||
mList.setAdapter(adapter);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
CommonHttpUtil.getLiveDataHistoryList("","",new HttpCallback() {
|
CommonHttpUtil.getLiveDataHistoryList(mStream, String.valueOf(mPageCount),new HttpCallback() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(int code, String msg, String[] info) {
|
public void onSuccess(int code, String msg, String[] info) {
|
||||||
if (code == 0 && info != null) {
|
if (code == 0 && info != null) {
|
||||||
JSONObject obj = JSON.parseObject(info[0]);
|
JSONObject obj = JSON.parseObject(info[0]);
|
||||||
if(){
|
List<LiveDataHistoryBean> tempList = JSON.parseArray(obj.getString("data"), LiveDataHistoryBean.class);
|
||||||
|
if(mPageCount==1){
|
||||||
|
list = tempList;
|
||||||
|
mAdapter.setDataCollection(list);
|
||||||
|
mRefreshLayout.finishRefresh(true);
|
||||||
|
}else{
|
||||||
|
list.addAll(tempList);
|
||||||
|
mAdapter.setDataCollection(list);
|
||||||
|
mRefreshLayout.finishLoadMore(true);
|
||||||
}
|
}
|
||||||
list = JSON.parseArray(obj.getString("data"), LiveDataHistoryBean.class);
|
|
||||||
adapter.setDataCollection(list);
|
|
||||||
mRefreshLayout.finishRefresh(true);
|
|
||||||
} else {
|
} else {
|
||||||
ToastUtil.show(msg);
|
ToastUtil.show(msg);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/rc_conversation_item"
|
android:id="@+id/rc_conversation_item"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="50dp"
|
android:layout_height="40dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
@ -7,63 +7,64 @@
|
|||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/titleLayout"
|
android:id="@+id/titleLayout"
|
||||||
|
android:orientation="horizontal"
|
||||||
android:paddingStart="16dp"
|
android:paddingStart="16dp"
|
||||||
android:paddingEnd="16dp"
|
android:layout_centerHorizontal="true"
|
||||||
|
android:paddingEnd="20dp"
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="30dp">
|
android:layout_height="30dp">
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/time"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:paddingStart="20dp"
|
||||||
android:paddingStart="20dp"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1"
|
android:ellipsize="end"
|
||||||
android:text="時間"
|
android:gravity="center_vertical"
|
||||||
android:gravity="center_vertical"
|
android:textColor="#FFFFFF"
|
||||||
android:textColor="#FFFFFF"
|
android:text="@string/live_data_history_time"
|
||||||
android:textSize="14dp" />
|
android:textSize="12dp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/giftTypeName"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="14dp"
|
android:textSize="12dp"
|
||||||
tools:text="分類" />
|
android:text="@string/live_data_history_type"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/giftName"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_weight="1"
|
||||||
android:layout_weight="1"
|
android:ellipsize="end"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:textColor="#FFFFFF"
|
android:textColor="#FFFFFF"
|
||||||
android:textSize="14dp"
|
android:textSize="12dp"
|
||||||
tools:text="禮物" />
|
android:text="@string/live_data_history_name"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/income"
|
android:layout_width="0dp"
|
||||||
android:layout_width="0dp"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginEnd="20dp"
|
android:layout_gravity="center_vertical"
|
||||||
android:layout_height="wrap_content"
|
android:layout_weight="0.7"
|
||||||
android:layout_gravity="center_vertical"
|
android:ellipsize="end"
|
||||||
android:layout_weight="0.7"
|
android:gravity="end|center"
|
||||||
android:gravity="end|center"
|
android:textColor="#FFFFFF"
|
||||||
android:textColor="#FFFFFF"
|
android:textSize="12dp"
|
||||||
android:textSize="14dp"
|
android:text="@string/live_data_history_gain" />
|
||||||
tools:text="10000" />
|
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/line"
|
android:id="@+id/line"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="4dp"
|
||||||
android:layout_below="@+id/titleLayout"
|
android:layout_below="@+id/titleLayout"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:background="#525252"
|
android:background="#525252"
|
||||||
@ -73,10 +74,8 @@
|
|||||||
|
|
||||||
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
<io.rong.imkit.widget.refresh.SmartRefreshLayout
|
||||||
android:id="@+id/rc_refresh"
|
android:id="@+id/rc_refresh"
|
||||||
android:layout_marginStart="16dp"
|
|
||||||
android:layout_below="@+id/line"
|
android:layout_below="@+id/line"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="9dp"
|
||||||
android:layout_marginEnd="16dp"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent">
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
@ -1479,6 +1479,10 @@ Limited ride And limited avatar frame</string>
|
|||||||
<string name="live_interaction_Interaction">Interaction</string>
|
<string name="live_interaction_Interaction">Interaction</string>
|
||||||
<string name="live_interaction_broadcaster_rights">Broadcaster Rights</string>
|
<string name="live_interaction_broadcaster_rights">Broadcaster Rights</string>
|
||||||
<string name="live_interaction_tools">Live streaming tools</string>
|
<string name="live_interaction_tools">Live streaming tools</string>
|
||||||
<string name="live_data_now_data">本場數據</string>
|
<string name="live_data_now_data">This data</string>
|
||||||
<string name="live_data_gift_history">禮物記錄</string>
|
<string name="live_data_gift_history">Gift Record</string>
|
||||||
|
<string name="live_data_history_time">time</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>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1611,5 +1611,9 @@
|
|||||||
<string name="live_interaction_tools">直播工具</string>
|
<string name="live_interaction_tools">直播工具</string>
|
||||||
<string name="live_data_now_data">本場數據</string>
|
<string name="live_data_now_data">本場數據</string>
|
||||||
<string name="live_data_gift_history">禮物記錄</string>
|
<string name="live_data_gift_history">禮物記錄</string>
|
||||||
|
<string name="live_data_history_time">時間</string>
|
||||||
|
<string name="live_data_history_type">分類</string>
|
||||||
|
<string name="live_data_history_name">名稱</string>
|
||||||
|
<string name="live_data_history_gain">收益</string>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -1417,7 +1417,11 @@ Limited ride And limited avatar frame</string>
|
|||||||
<string name="live_interaction_Interaction">Interaction</string>
|
<string name="live_interaction_Interaction">Interaction</string>
|
||||||
<string name="live_interaction_broadcaster_rights">Broadcaster Rights</string>
|
<string name="live_interaction_broadcaster_rights">Broadcaster Rights</string>
|
||||||
<string name="live_interaction_tools">Live streaming tools</string>
|
<string name="live_interaction_tools">Live streaming tools</string>
|
||||||
<string name="live_data_now_data">本場數據</string>
|
<string name="live_data_now_data">This data</string>
|
||||||
<string name="live_data_gift_history">禮物記錄</string>
|
<string name="live_data_gift_history">Gift Record</string>
|
||||||
|
<string name="live_data_history_time">tory_time</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>
|
||||||
|
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -735,6 +735,7 @@ public class LiveSwAnchorActivity extends LiveActivity implements LiveFunctionCl
|
|||||||
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
bundle.putBoolean(Constants.HAS_GAME, hasGame);
|
||||||
bundle.putInt("leave", leave);
|
bundle.putInt("leave", leave);
|
||||||
bundle.putString("liveUid", mLiveUid);
|
bundle.putString("liveUid", mLiveUid);
|
||||||
|
bundle.putString("stream", mStream);
|
||||||
bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking());
|
bundle.putBoolean("isPk", isDRPK == 1 || PKing || mLivePushViewHolder.isPking());
|
||||||
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
bundle.putBoolean(Constants.OPEN_FLASH, mLivePushViewHolder != null && mLivePushViewHolder.isFlashOpen());
|
||||||
bundle.putBoolean("isShowZgRed",mLiveAnchorViewHolder.isShowMenuRed());
|
bundle.putBoolean("isShowZgRed",mLiveAnchorViewHolder.isShowMenuRed());
|
||||||
|
@ -2,20 +2,9 @@ package com.yunbao.live.dialog;
|
|||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.text.Spannable;
|
|
||||||
import android.text.SpannableString;
|
|
||||||
import android.text.Spanned;
|
|
||||||
import android.text.TextPaint;
|
|
||||||
import android.text.method.LinkMovementMethod;
|
|
||||||
import android.text.style.ClickableSpan;
|
|
||||||
import android.text.style.ImageSpan;
|
|
||||||
import android.util.Log;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.ImageView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
import androidx.core.content.ContextCompat;
|
|
||||||
import androidx.fragment.app.Fragment;
|
import androidx.fragment.app.Fragment;
|
||||||
import androidx.fragment.app.FragmentActivity;
|
import androidx.fragment.app.FragmentActivity;
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
@ -24,10 +13,7 @@ import androidx.viewpager2.widget.ViewPager2;
|
|||||||
|
|
||||||
import com.lxj.xpopup.XPopup;
|
import com.lxj.xpopup.XPopup;
|
||||||
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
import com.yunbao.common.dialog.AbsDialogPopupWindow;
|
||||||
import com.yunbao.common.fragment.AbsMainMessageChatListFragment;
|
|
||||||
import com.yunbao.common.fragment.BaseFragment;
|
|
||||||
import com.yunbao.common.fragment.LiveDataHistoryFragment;
|
import com.yunbao.common.fragment.LiveDataHistoryFragment;
|
||||||
import com.yunbao.common.fragment.MainMessageChatListFragment;
|
|
||||||
import com.yunbao.common.http.base.HttpCallback;
|
import com.yunbao.common.http.base.HttpCallback;
|
||||||
import com.yunbao.common.http.live.LiveNetManager;
|
import com.yunbao.common.http.live.LiveNetManager;
|
||||||
import com.yunbao.common.utils.AppManager;
|
import com.yunbao.common.utils.AppManager;
|
||||||
@ -56,23 +42,21 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
private RecyclerView recyclerView;
|
private RecyclerView recyclerView;
|
||||||
private LiveDataInfoRecyclerAdapter adapter;
|
private LiveDataInfoRecyclerAdapter adapter;
|
||||||
private List<LiveDataInfoModel> list;
|
private List<LiveDataInfoModel> list;
|
||||||
private String liveUid;
|
private String mStream;
|
||||||
|
private String mLiveUid;
|
||||||
|
|
||||||
private ViewPager2 viewPager;
|
private ViewPager2 viewPager;
|
||||||
private MagicIndicator mIndicator;
|
private MagicIndicator mIndicator;
|
||||||
private List<BaseFragment> fragmentList = new ArrayList<>();
|
private List<Fragment> fragmentList = new ArrayList<>();
|
||||||
|
|
||||||
public LiveDataInfoDialog(@NonNull Context context) {
|
public LiveDataInfoDialog(@NonNull Context context) {
|
||||||
super(context);
|
super(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
public LiveDataInfoDialog(@NonNull Context context, String liveUid) {
|
public LiveDataInfoDialog(@NonNull Context context, String liveUid, String mStream) {
|
||||||
super(context);
|
super(context);
|
||||||
this.liveUid = liveUid;
|
this.mLiveUid = liveUid;
|
||||||
}
|
this.mStream = mStream;
|
||||||
|
|
||||||
public void setLiveUid(String liveUid) {
|
|
||||||
this.liveUid = liveUid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -88,14 +72,13 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
protected void onCreate() {
|
protected void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
final String[] titles = new String[]{WordUtil.getNewString(R.string.live_data_now_data), WordUtil.getNewString(R.string.live_data_gift_history)};
|
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));
|
fragmentList.add(new LiveDataHistoryFragment( mContext,mStream));
|
||||||
fragmentList.add(new LiveDataHistoryFragment(mContext));
|
fragmentList.add(new LiveDataHistoryFragment( mContext,mStream));
|
||||||
|
|
||||||
mIndicator = findViewById(R.id.indicator);
|
mIndicator = findViewById(R.id.indicator);
|
||||||
viewPager = findViewById(R.id.viewPager);
|
viewPager = findViewById(R.id.viewPager);
|
||||||
|
|
||||||
viewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) AppManager.getInstance().getMainActivity()) {
|
viewPager.setAdapter(new FragmentStateAdapter((FragmentActivity) mContext) {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getItemCount() {
|
public int getItemCount() {
|
||||||
return fragmentList.size();
|
return fragmentList.size();
|
||||||
@ -107,9 +90,20 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
return fragmentList.get(i);
|
return fragmentList.get(i);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
viewPager.setCurrentItem(1);
|
viewPager.setCurrentItem(0);
|
||||||
viewPager.setUserInputEnabled(false);
|
viewPager.setUserInputEnabled(false);
|
||||||
|
|
||||||
|
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) {
|
||||||
CommonNavigator commonNavigator = new CommonNavigator(mContext);
|
CommonNavigator commonNavigator = new CommonNavigator(mContext);
|
||||||
commonNavigator.setAdjustMode(true);
|
commonNavigator.setAdjustMode(true);
|
||||||
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
commonNavigator.setAdapter(new CommonNavigatorAdapter() {
|
||||||
@ -121,13 +115,13 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPagerTitleView getTitleView(Context context, final int index) {
|
public IPagerTitleView getTitleView(Context context, final int index) {
|
||||||
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(context);
|
SimplePagerTitleView simplePagerTitleView = new ColorTransitionPagerTitleView(mContext);
|
||||||
simplePagerTitleView.setNormalColor(Color.parseColor("#777777"));
|
simplePagerTitleView.setNormalColor(Color.parseColor("#C3C3C3"));
|
||||||
simplePagerTitleView.setSelectedColor(Color.parseColor("#333333"));
|
simplePagerTitleView.setSelectedColor(Color.parseColor("#FFFFFF"));
|
||||||
simplePagerTitleView.setText(titles[index]);
|
simplePagerTitleView.setText(titles[index]);
|
||||||
simplePagerTitleView.setTextSize(15);
|
simplePagerTitleView.setTextSize(15);
|
||||||
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
simplePagerTitleView.getPaint().setFakeBoldText(true);
|
||||||
simplePagerTitleView.setOnClickListener(new View.OnClickListener() {
|
simplePagerTitleView.setOnClickListener(new OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
if (viewPager != null) {
|
if (viewPager != null) {
|
||||||
@ -141,25 +135,15 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
@Override
|
@Override
|
||||||
public IPagerIndicator getIndicator(Context context) {
|
public IPagerIndicator getIndicator(Context context) {
|
||||||
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
|
LinePagerIndicator linePagerIndicator = new LinePagerIndicator(context);
|
||||||
linePagerIndicator.setMode(LinePagerIndicator.MODE_WRAP_CONTENT);
|
linePagerIndicator.setMode(LinePagerIndicator.MODE_EXACTLY);
|
||||||
linePagerIndicator.setXOffset(DpUtil.dp2px(5));
|
linePagerIndicator.setLineWidth(DpUtil.dp2px(14));
|
||||||
linePagerIndicator.setRoundRadius(DpUtil.dp2px(2));
|
linePagerIndicator.setLineHeight(DpUtil.dp2px(2));
|
||||||
linePagerIndicator.setColors(Color.parseColor("#EB6FFF"), Color.parseColor("#FF83C6"));
|
linePagerIndicator.setRoundRadius(DpUtil.dp2px(1));
|
||||||
|
linePagerIndicator.setColors(Color.parseColor("#FFFFFF"), Color.parseColor("#FFFFFF"));
|
||||||
return linePagerIndicator;
|
return linePagerIndicator;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
mIndicator.setNavigator(commonNavigator);
|
return commonNavigator;
|
||||||
ViewPageIndicatorUtils.bind(mIndicator, viewPager, new ViewPager2.OnPageChangeCallback() {
|
|
||||||
@Override
|
|
||||||
public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
|
|
||||||
super.onPageScrolled(position, positionOffset, positionOffsetPixels);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
recyclerView = findViewById(R.id.live_data_list);
|
|
||||||
adapter = new LiveDataInfoRecyclerAdapter(getContext());
|
|
||||||
recyclerView.setAdapter(adapter);
|
|
||||||
initData();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initData() {
|
private void initData() {
|
||||||
@ -174,7 +158,7 @@ public class LiveDataInfoDialog extends AbsDialogPopupWindow {
|
|||||||
list.add(new LiveDataInfoModel(getContext().getString(R.string.live_data_fan_group_rate), 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);
|
adapter.setList(list);
|
||||||
LiveNetManager.get(getContext())
|
LiveNetManager.get(getContext())
|
||||||
.getLiveData(liveUid, new HttpCallback<com.yunbao.common.bean.LiveDataInfoModel>() {
|
.getLiveData(mLiveUid, new HttpCallback<com.yunbao.common.bean.LiveDataInfoModel>() {
|
||||||
@Override
|
@Override
|
||||||
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
public void onSuccess(com.yunbao.common.bean.LiveDataInfoModel data) {
|
||||||
list.clear();
|
list.clear();
|
||||||
|
@ -53,6 +53,7 @@ public class LiveInteractionDialogFragment extends AbsDialogFragment implements
|
|||||||
|
|
||||||
private String liveUid;
|
private String liveUid;
|
||||||
private boolean isInteraction;
|
private boolean isInteraction;
|
||||||
|
private String mStream;
|
||||||
|
|
||||||
// boolean isRy = false;
|
// boolean isRy = false;
|
||||||
private boolean isShowRed;
|
private boolean isShowRed;
|
||||||
@ -98,6 +99,7 @@ public class LiveInteractionDialogFragment extends AbsDialogFragment implements
|
|||||||
liveUid = bundle.getString("liveUid");
|
liveUid = bundle.getString("liveUid");
|
||||||
isShowRed = bundle.getBoolean("isShowZgRed");
|
isShowRed = bundle.getBoolean("isShowZgRed");
|
||||||
isInteraction = bundle.getBoolean("isInteraction",false);
|
isInteraction = bundle.getBoolean("isInteraction",false);
|
||||||
|
mStream= bundle.getString("stream");
|
||||||
}
|
}
|
||||||
equityLayout= (LinearLayout) findViewById(R.id.equityLayout);
|
equityLayout= (LinearLayout) findViewById(R.id.equityLayout);
|
||||||
interactionLayout= (LinearLayout) findViewById(R.id.interactionLayout);
|
interactionLayout= (LinearLayout) findViewById(R.id.interactionLayout);
|
||||||
@ -178,7 +180,7 @@ public class LiveInteractionDialogFragment extends AbsDialogFragment implements
|
|||||||
mFunctionClickListener.onClick(LIVE_FUNC_MIC);
|
mFunctionClickListener.onClick(LIVE_FUNC_MIC);
|
||||||
}else if(id == R.id.live_tool_live_data) {
|
}else if(id == R.id.live_tool_live_data) {
|
||||||
//主播数据
|
//主播数据
|
||||||
new LiveDataInfoDialog(mContext, liveUid).showDialog();
|
new LiveDataInfoDialog(mContext,liveUid,mStream).showDialog();
|
||||||
dismiss();
|
dismiss();
|
||||||
}else if (id == R.id.live_tool_robot) {
|
}else if (id == R.id.live_tool_robot) {
|
||||||
mFunctionClickListener.onClick(LIVE_ROBOT);
|
mFunctionClickListener.onClick(LIVE_ROBOT);
|
||||||
@ -188,7 +190,7 @@ public class LiveInteractionDialogFragment extends AbsDialogFragment implements
|
|||||||
dismiss();
|
dismiss();
|
||||||
} else if (id == R.id.broadcast_data) {
|
} else if (id == R.id.broadcast_data) {
|
||||||
//主播数据
|
//主播数据
|
||||||
new LiveDataInfoDialog(mContext, liveUid).showDialog();
|
new LiveDataInfoDialog(mContext,liveUid, mStream).showDialog();
|
||||||
dismiss();
|
dismiss();
|
||||||
} else if (id == R.id.anchor_task) {
|
} else if (id == R.id.anchor_task) {
|
||||||
//主播任务
|
//主播任务
|
||||||
@ -262,8 +264,6 @@ public class LiveInteractionDialogFragment extends AbsDialogFragment implements
|
|||||||
|
|
||||||
case WHAT_ANCHOR_LIVE_TIME:
|
case WHAT_ANCHOR_LIVE_TIME:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -204,7 +204,7 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
|
|||||||
dismiss();
|
dismiss();
|
||||||
} else if (id == R.id.broadcast_data) {
|
} else if (id == R.id.broadcast_data) {
|
||||||
//主播数据
|
//主播数据
|
||||||
new LiveDataInfoDialog(mContext, liveUid).showDialog();
|
new LiveDataInfoDialog(mContext, liveUid,"").showDialog();
|
||||||
dismiss();
|
dismiss();
|
||||||
} else if (id == R.id.anchor_task) {
|
} else if (id == R.id.anchor_task) {
|
||||||
//主播任务
|
//主播任务
|
||||||
@ -212,7 +212,6 @@ public class LiveNewFunctionDialogFragment extends AbsDialogFragment implements
|
|||||||
taskDialog.setLiveUid(liveUid);
|
taskDialog.setLiveUid(liveUid);
|
||||||
taskDialog.updateLiveTimer(mAnchorLiveTime);
|
taskDialog.updateLiveTimer(mAnchorLiveTime);
|
||||||
taskDialog.showDialog();
|
taskDialog.showDialog();
|
||||||
|
|
||||||
} else if (id == R.id.live_tool_call_me) {
|
} else if (id == R.id.live_tool_call_me) {
|
||||||
new LiveAnchorEditCallMeDialog(mContext).setLiveUid(liveUid).showDialog();
|
new LiveAnchorEditCallMeDialog(mContext).setLiveUid(liveUid).showDialog();
|
||||||
} else if (id == R.id.live_tool_anchor_say) {
|
} else if (id == R.id.live_tool_anchor_say) {
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="500dp"
|
||||||
android:background="#000002">
|
android:background="#000002">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
@ -36,6 +36,7 @@
|
|||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="5dp"
|
android:layout_marginTop="5dp"
|
||||||
|
android:visibility="gone"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal">
|
||||||
|
|
||||||
@ -76,6 +77,7 @@
|
|||||||
<androidx.recyclerview.widget.RecyclerView
|
<androidx.recyclerview.widget.RecyclerView
|
||||||
android:id="@+id/live_data_list"
|
android:id="@+id/live_data_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
|
android:visibility="gone"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_marginTop="10dp"
|
android:layout_marginTop="10dp"
|
||||||
android:layout_marginBottom="15dp"
|
android:layout_marginBottom="15dp"
|
||||||
|
Loading…
Reference in New Issue
Block a user