侧边栏
This commit is contained in:
@@ -188,4 +188,6 @@ dependencies {
|
||||
api 'com.github.princekin-f:EasyFloat:2.0.4'
|
||||
api files('libs/Msc.jar')
|
||||
|
||||
api 'com.github.li-xiaojun:XPopup:2.9.1'
|
||||
|
||||
}
|
||||
|
||||
@@ -168,6 +168,7 @@ public class Constants {
|
||||
public static final String STAR_CHALLENGE_UPDATE = "starChallengeUpdate";//星级助力
|
||||
public static final String AI_AUTOMATIC_SPEECH = "aiAutomaticSpeech";//机器人助手
|
||||
public static final String STAR_CHALLENGE_UPGRADE_NOTIFY = "starChallengeUpgradeNotify";//星级挑战成功
|
||||
public static final String SUPER_VISION = "supervision";//超级发言警告
|
||||
|
||||
//游戏socket
|
||||
public static final String SOCKET_GAME_ZJH = "startGame";//炸金花
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.yunbao.common.adapter;
|
||||
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 新侧边栏适配器
|
||||
*/
|
||||
public class CustomDrawerPopupAdapter extends RecyclerView.Adapter {
|
||||
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getItemCount() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
public class CustomSidebarChildModel extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("parent_id")
|
||||
private String parentId;
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
@SerializedName("subtitle")
|
||||
private String subtitle;
|
||||
@SerializedName("icon")
|
||||
private String icon;
|
||||
@SerializedName("src")
|
||||
private String src;
|
||||
@SerializedName("show_type")
|
||||
private String showType;
|
||||
@SerializedName("sort")
|
||||
private String sort;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSrc(String src) {
|
||||
this.src = src;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public CustomSidebarChildModel setSort(String sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 新版自定义侧边栏
|
||||
*/
|
||||
public class CustomSidebarInfoModel extends BaseModel {
|
||||
@SerializedName("id")
|
||||
private String id;
|
||||
@SerializedName("title")
|
||||
private String title;
|
||||
@SerializedName("subtitle")
|
||||
private String subtitle;
|
||||
@SerializedName("sort")
|
||||
private String sort;
|
||||
@SerializedName("show_type")
|
||||
private String showType;
|
||||
@SerializedName("src")
|
||||
private String src;
|
||||
@SerializedName("type")
|
||||
private String type;
|
||||
@SerializedName("child")
|
||||
private List<CustomSidebarChildModel> child;
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setId(String id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setTitle(String title) {
|
||||
this.title = title;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSubtitle() {
|
||||
return subtitle;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSubtitle(String subtitle) {
|
||||
this.subtitle = subtitle;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSort(String sort) {
|
||||
this.sort = sort;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getShowType() {
|
||||
return showType;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setShowType(String showType) {
|
||||
this.showType = showType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSrc() {
|
||||
return src;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setSrc(String src) {
|
||||
this.src = src;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setType(String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<CustomSidebarChildModel> getChild() {
|
||||
return child;
|
||||
}
|
||||
|
||||
public CustomSidebarInfoModel setChild(List<CustomSidebarChildModel> child) {
|
||||
this.child = child;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.ContributeModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.HourRank;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
@@ -236,7 +237,8 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<NobleRankHideUserListModel>> getNobleRankHideUserList();
|
||||
|
||||
/**
|
||||
*获取当前星级
|
||||
* 获取当前星级
|
||||
*
|
||||
* @param liveUid
|
||||
* @return
|
||||
*/
|
||||
@@ -248,4 +250,10 @@ public interface PDLiveApi {
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getLiveRoomActivtyBanner")
|
||||
Observable<ResponseModel<List<LiveRoomActivityBanner>>> getLiveRoomActivityBanner();
|
||||
|
||||
/**
|
||||
* 新侧边栏请求
|
||||
*/
|
||||
@GET("/api/public/?service=Live.getCustomSidebarInfo")
|
||||
Observable<ResponseModel<List<CustomSidebarInfoModel>>> getCustomSidebarInfo();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import android.text.TextUtils;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.ActiveModel;
|
||||
import com.yunbao.common.bean.BaseModel;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.LiveRoomActivityBanner;
|
||||
import com.yunbao.common.bean.NobleRankHideUserListModel;
|
||||
@@ -14,7 +15,6 @@ import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.StarChallengeStatusModel;
|
||||
import com.yunbao.common.bean.VipModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import java.util.List;
|
||||
@@ -63,6 +63,7 @@ public class LiveNetManager {
|
||||
if (callback != null)
|
||||
callback.onError(throwable.getMessage());
|
||||
}).isDisposed();
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -237,7 +238,6 @@ public class LiveNetManager {
|
||||
|
||||
/**
|
||||
* 获取 【新人特惠】【趣味游戏】【幸运天使】
|
||||
*
|
||||
*/
|
||||
public void getLiveRoomActivityBanner(HttpCallback<List<LiveRoomActivityBanner>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
@@ -253,4 +253,22 @@ public class LiveNetManager {
|
||||
throwable.printStackTrace();
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取新侧边数据
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void getCustomSidebarInfo(HttpCallback<List<CustomSidebarInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext)
|
||||
.getCustomSidebarInfo()
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> callback.onSuccess(listResponseModel.getData().getInfo()), throwable -> {
|
||||
if (callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
throwable.printStackTrace();
|
||||
}).isDisposed();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.lxj.xpopup.core.DrawerPopupView;
|
||||
import com.yunbao.common.R;
|
||||
import com.yunbao.common.bean.CustomSidebarInfoModel;
|
||||
import com.yunbao.common.http.live.LiveNetManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CustomDrawerPopupView extends DrawerPopupView {
|
||||
private Context mContext;
|
||||
|
||||
private RecyclerView drawerList;
|
||||
|
||||
public CustomDrawerPopupView(@NonNull Context context) {
|
||||
super(context);
|
||||
mContext = context;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.custom_drawer_popup;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
initView();
|
||||
initData();
|
||||
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
drawerList = findViewById(R.id.drawerList);
|
||||
}
|
||||
|
||||
private void initData() {
|
||||
LiveNetManager.get(mContext)
|
||||
.getCustomSidebarInfo(new com.yunbao.common.http.base.HttpCallback<List<CustomSidebarInfoModel>>() {
|
||||
@Override
|
||||
public void onSuccess(List<CustomSidebarInfoModel> data) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(String error) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 侧边栏推荐布局 任务
|
||||
*/
|
||||
public class DrawerRecommendViewHolder extends RecyclerView.ViewHolder {
|
||||
public DrawerRecommendViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
/**
|
||||
* 侧边栏任务布局
|
||||
*/
|
||||
public class DrawerTaskViewHolder extends RecyclerView.ViewHolder {
|
||||
public DrawerTaskViewHolder(@NonNull View itemView) {
|
||||
super(itemView);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<corners
|
||||
android:bottomLeftRadius="16dp"
|
||||
android:topLeftRadius="16dp" />
|
||||
<solid android:color="#15151D" />
|
||||
</shape>
|
||||
168
common/src/main/res/layout/custom_drawer_popup.xml
Normal file
168
common/src/main/res/layout/custom_drawer_popup.xml
Normal file
@@ -0,0 +1,168 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="330dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/backgroud_custom_drawer_popup"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/drawerList"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:layout_marginTop="48dp"
|
||||
android:layout_weight="1"
|
||||
android:background="@color/white" />
|
||||
|
||||
|
||||
<HorizontalScrollView
|
||||
android:id="@+id/basic_tools_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:scrollbars="none">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="16dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:layout_marginBottom="34dp"
|
||||
android:paddingEnd="16dp">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/live_link_mic"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_connect_new" />
|
||||
|
||||
<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="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/effects_settings_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_special_new" />
|
||||
|
||||
<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="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/slide_settings_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_sliding_new" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/slide_settings"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/float_settings_layout"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_fenestrule_new" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/small_window"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/system_notice"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_hd" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/system_notice"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/online"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="12dp"
|
||||
android:gravity="center"
|
||||
android:orientation="vertical">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="26dp"
|
||||
android:layout_height="26dp"
|
||||
android:src="@mipmap/live_more_icon_more" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="6dp"
|
||||
android:text="@string/online_service"
|
||||
android:textColor="#FF9A9A9A"
|
||||
android:textSize="10sp" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</HorizontalScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_connect_new.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_connect_new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.4 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_hd.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_hd.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.0 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_more.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_more.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 817 B |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_sliding_new.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_sliding_new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_special_new.png
Normal file
BIN
common/src/main/res/mipmap-xxhdpi/live_more_icon_special_new.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
Reference in New Issue
Block a user