直播间修改底部菜单修改
@@ -0,0 +1,50 @@
|
||||
package com.yunbao.common.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.ActiveModel;
|
||||
import com.yunbao.common.views.FunGamesViewHolder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class FunGamesAdapter extends RecyclerView.Adapter {
|
||||
private List<ActiveModel> activeModels = new ArrayList<>();
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
View funGameView = LayoutInflater.from(parent.getContext()).inflate(R.layout.view_fun_games, parent, false);
|
||||
return new FunGamesViewHolder(funGameView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
if (holder instanceof FunGamesViewHolder) {
|
||||
FunGamesViewHolder funGamesViewHolder = (FunGamesViewHolder) holder;
|
||||
funGamesViewHolder.showView(activeModels.get(position));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return activeModels.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据源
|
||||
*
|
||||
* @param mActiveModels
|
||||
*/
|
||||
public void addData(List<ActiveModel> mActiveModels) {
|
||||
activeModels.clear();
|
||||
activeModels.addAll(mActiveModels);
|
||||
notifyDataSetChanged();
|
||||
}
|
||||
}
|
||||
72
common/src/main/java/com/yunbao/common/bean/ActiveModel.java
Normal file
@@ -0,0 +1,72 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 活动
|
||||
*/
|
||||
public class ActiveModel extends BaseModel {
|
||||
/**
|
||||
* active_id : 3
|
||||
* active_name : 闖關熱戀
|
||||
* active_img : https://qny.shayucm.com/chuangguan.png
|
||||
* active_src : h5/activity/PassionateLove/index.html
|
||||
* show_type : 0
|
||||
*/
|
||||
|
||||
@SerializedName("active_id")
|
||||
private String activeId = "";
|
||||
@SerializedName("active_name")
|
||||
private String activeName = "";
|
||||
@SerializedName("active_img")
|
||||
private String activeImg = "";
|
||||
@SerializedName("active_src")
|
||||
private String activeSrc = "";
|
||||
@SerializedName("show_type")
|
||||
private String showType = "";
|
||||
|
||||
public String getActiveId() {
|
||||
return activeId;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveId(String activeId) {
|
||||
this.activeId = activeId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveName() {
|
||||
return activeName;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveName(String activeName) {
|
||||
this.activeName = activeName;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveImg() {
|
||||
return activeImg;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveImg(String activeImg) {
|
||||
this.activeImg = activeImg;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getActiveSrc() {
|
||||
return activeSrc;
|
||||
}
|
||||
|
||||
public ActiveModel setActiveSrc(String activeSrc) {
|
||||
this.activeSrc = activeSrc;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public ActiveModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package com.yunbao.common.dialog;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Gravity;
|
||||
import android.view.Window;
|
||||
import android.view.WindowManager;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.adapter.FunGamesAdapter;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
import com.yunbao.common.utils.ToastUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 直播间合计弹窗
|
||||
*/
|
||||
public class LiveTotalDialog extends AbsDialogFragment {
|
||||
private RecyclerView funGamesList;
|
||||
private FunGamesAdapter gamesAdapter;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.view_live_total;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getDialogStyle() {
|
||||
return R.style.dialog2;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canCancel() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onActivityCreated(Bundle savedInstanceState) {
|
||||
super.onActivityCreated(savedInstanceState);
|
||||
funGamesList = (RecyclerView) findViewById(R.id.fun_games_list);
|
||||
gamesAdapter = new FunGamesAdapter();
|
||||
funGamesList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.HORIZONTAL, false));
|
||||
funGamesList.setAdapter(gamesAdapter);
|
||||
LiveNetManager.get(getContext())
|
||||
.getActiveList(new HttpCallback<List<ActiveModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<ActiveModel> data) {
|
||||
if (!isDetached())
|
||||
gamesAdapter.addData(data);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
ToastUtil.show(error);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void setWindowAttributes(Window window) {
|
||||
window.setWindowAnimations(R.style.bottomToTopAnim);
|
||||
WindowManager.LayoutParams params = window.getAttributes();
|
||||
params.width = WindowManager.LayoutParams.MATCH_PARENT;
|
||||
params.height = WindowManager.LayoutParams.WRAP_CONTENT;
|
||||
params.gravity = Gravity.BOTTOM;
|
||||
window.setAttributes(params);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.yunbao.common.http;
|
||||
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
@@ -141,4 +142,10 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<SlideInBannerModel>>> getHot(
|
||||
@Query("p") int page
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取活动
|
||||
*/
|
||||
@GET("/api/public/?service=Active.getActiveList")
|
||||
Observable<ResponseModel<List<ActiveModel>>> getActiveList();
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@ package com.yunbao.common.http.live;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.List;
|
||||
@@ -136,4 +136,20 @@ public class LiveNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取活动列表
|
||||
*/
|
||||
public void getActiveList(HttpCallback<List<ActiveModel>> callback) {
|
||||
API.get().pdLiveApi(mContext).getActiveList()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
if (callback != null)
|
||||
callback.onSuccess(listResponseModel.getData().getInfo());
|
||||
}, throwable -> {
|
||||
if (callback != null)
|
||||
callback.onError(throwable.getMessage());
|
||||
}).isDisposed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
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.ActiveModel;
|
||||
import com.yunbao.common.glide.ImgLoader;
|
||||
|
||||
public class FunGamesViewHolder extends RecyclerView.ViewHolder {
|
||||
private ImageView funGamePic;
|
||||
private TextView funGameName;
|
||||
|
||||
public FunGamesViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
funGamePic = itemView.findViewById(R.id.fun_game_pic);
|
||||
funGameName = itemView.findViewById(R.id.fun_game_name);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置数据
|
||||
*
|
||||
* @param model 数据模型
|
||||
*/
|
||||
public void showView(ActiveModel model) {
|
||||
ImgLoader.display(itemView.getContext(), model.getActiveImg(), funGamePic);
|
||||
funGameName.setText(model.getActiveName());
|
||||
}
|
||||
}
|
||||
5
common/src/main/res/drawable/bg_live_tota.xml
Normal file
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners android:topLeftRadius="12dp" android:topRightRadius="12dp" />
|
||||
<solid android:color="#98000000" />
|
||||
</shape>
|
||||
25
common/src/main/res/layout/view_fun_games.xml
Normal file
@@ -0,0 +1,25 @@
|
||||
<?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="wrap_content"
|
||||
android:layout_marginEnd="20dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/fun_game_pic"
|
||||
android:padding="3dp"
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fun_game_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/guard_guard"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
206
common/src/main/res/layout/view_live_total.xml
Normal file
@@ -0,0 +1,206 @@
|
||||
<?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:background="@drawable/bg_live_tota"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="24dp"
|
||||
android:text="@string/fun_games"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/fun_games_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="62dp"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="@string/value_added_benefits"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_fans" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/fan_club"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="28dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_guard" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/guard_guard"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="28dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_aristocrat" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/noble"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="28dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_zhouxinglist" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/live_wks"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="28dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_events" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/activity_center"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="30dp"
|
||||
android:text="@string/basic_tools"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginBottom="20dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_connect" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/live_link_mic_2"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="23dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="40dp"
|
||||
android:layout_height="40dp"
|
||||
android:src="@mipmap/live_more_icon_special" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/effects_settings"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="12sp" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_aristocrat.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_connect.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_events.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_fans.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_guard.png
Normal file
|
After Width: | Height: | Size: 28 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_special.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
|
After Width: | Height: | Size: 20 KiB |
@@ -872,4 +872,10 @@
|
||||
<string name="anchor_more">更多</string>
|
||||
<string name="wonderful_live">精彩直播</string>
|
||||
<string name="recommended_for_you">為您推薦</string>
|
||||
<string name="fun_games">趣味游戏</string>
|
||||
<string name="value_added_benefits">增值权益</string>
|
||||
<string name="fan_club">粉絲團</string>
|
||||
<string name="activity_center">活動中心</string>
|
||||
<string name="basic_tools">基础工具</string>
|
||||
<string name="effects_settings">特效設置</string>
|
||||
</resources>
|
||||
|
||||