直播间修改
This commit is contained in:
@@ -206,6 +206,17 @@ public class IMLoginModel extends BaseModel {
|
||||
private List<List<ListModel>> list;
|
||||
@SerializedName("slide")
|
||||
private List<SlideModel> slide;
|
||||
@SerializedName("gift_effect")
|
||||
private boolean giftEffect =false;
|
||||
|
||||
public boolean isGiftEffect() {
|
||||
return giftEffect;
|
||||
}
|
||||
|
||||
public IMLoginModel setGiftEffect(boolean giftEffect) {
|
||||
this.giftEffect = giftEffect;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getAvatar() {
|
||||
return avatar;
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,36 @@
|
||||
package com.yunbao.common.bean;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
|
||||
/**
|
||||
* 直播首页轮播和侧边栏轮播
|
||||
*/
|
||||
public class SlideInfoModel extends BaseModel {
|
||||
/**
|
||||
* slide_pic : https://qny.shayucm.com/20220810/81a4c030334a4a5a30eb62b84191f46d.jpg
|
||||
* slide_url : https://napi.yaoulive.com/h5/monthlyActivities/202208QIXI/index.html?t=1660619212
|
||||
*/
|
||||
|
||||
@SerializedName("slide_pic")
|
||||
private String slidePic = "";
|
||||
@SerializedName("slide_url")
|
||||
private String slideUrl = "";
|
||||
|
||||
public String getSlidePic() {
|
||||
return slidePic;
|
||||
}
|
||||
|
||||
public SlideInfoModel setSlidePic(String slidePic) {
|
||||
this.slidePic = slidePic;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getSlideUrl() {
|
||||
return slideUrl;
|
||||
}
|
||||
|
||||
public SlideInfoModel setSlideUrl(String slideUrl) {
|
||||
this.slideUrl = slideUrl;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -2,10 +2,6 @@ package com.yunbao.common.custom;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.TypedArray;
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.view.Gravity;
|
||||
@@ -13,6 +9,11 @@ import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
import androidx.recyclerview.widget.SimpleItemAnimator;
|
||||
|
||||
import com.scwang.smartrefresh.layout.SmartRefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.footer.ClassicsFooter;
|
||||
@@ -163,6 +164,7 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
mDataHelper.onRefreshSuccess(adapter.getList(), adapter.getItemCount());
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -265,6 +267,18 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
}
|
||||
};
|
||||
|
||||
public void onFinish() {
|
||||
if (mLoadFailureView != null && mLoadFailureView.getVisibility() == View.VISIBLE) {
|
||||
mLoadFailureView.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (mEmptyLayout != null && mEmptyLayout.getVisibility() == View.VISIBLE) {
|
||||
mEmptyLayout.setVisibility(View.INVISIBLE);
|
||||
}
|
||||
if (mSmartRefreshLayout != null) {
|
||||
mSmartRefreshLayout.finishRefresh(true);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void setDataHelper(DataHelper<T> dataHelper) {
|
||||
mDataHelper = dataHelper;
|
||||
}
|
||||
@@ -328,6 +342,9 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
mPageCount = 1;
|
||||
mDataHelper.loadData(mPageCount, mRefreshCallback);
|
||||
}
|
||||
if (dataHelperNew != null) {
|
||||
dataHelperNew.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private void loadMore() {
|
||||
@@ -338,6 +355,9 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
mPageCount++;
|
||||
mDataHelper.loadData(mPageCount, mLoadMoreCallback);
|
||||
}
|
||||
if (dataHelperNew != null) {
|
||||
dataHelperNew.loadData(mPageCount);
|
||||
}
|
||||
}
|
||||
|
||||
public int getPageCount() {
|
||||
@@ -376,6 +396,18 @@ public class CommonRefreshView extends FrameLayout implements View.OnClickListen
|
||||
}
|
||||
}
|
||||
|
||||
public interface DataHelperNew {
|
||||
void loadData(int p);
|
||||
|
||||
void refresh();
|
||||
}
|
||||
|
||||
private DataHelperNew dataHelperNew;
|
||||
|
||||
public CommonRefreshView setDataHelperNew(DataHelperNew dataHelperNew) {
|
||||
this.dataHelperNew = dataHelperNew;
|
||||
return this;
|
||||
}
|
||||
|
||||
public interface DataHelper<T> {
|
||||
RefreshAdapter<T> getAdapter();
|
||||
|
||||
@@ -8,10 +8,8 @@ import com.yunbao.common.bean.LiveInfoModel;
|
||||
import com.yunbao.common.bean.NobleTrumpetModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SetAttentsModel;
|
||||
import com.yunbao.common.bean.SlideInBannerModel;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.Observable;
|
||||
@@ -135,4 +133,12 @@ public interface PDLiveApi {
|
||||
Observable<ResponseModel<List<SetAttentsModel>>> setAttents(
|
||||
@Query("touid") String liveuid
|
||||
);
|
||||
|
||||
/**
|
||||
* 获取首页位
|
||||
*/
|
||||
@GET("/api/public/?service=Home.getHot")
|
||||
Observable<ResponseModel<List<SlideInBannerModel>>> getHot(
|
||||
@Query("p") int page
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,16 +2,15 @@ package com.yunbao.common.http.main;
|
||||
|
||||
import android.app.Activity;
|
||||
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.AnchorRecommendModel;
|
||||
import com.yunbao.common.bean.FaceBookUpModel;
|
||||
import com.yunbao.common.bean.IMLoginModel;
|
||||
import com.yunbao.common.bean.SearchModel;
|
||||
import com.yunbao.common.bean.SlideInfoModel;
|
||||
import com.yunbao.common.http.API;
|
||||
import com.yunbao.common.http.ResponseModel;
|
||||
import com.yunbao.common.http.base.HttpCallback;
|
||||
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.reactivex.android.schedulers.AndroidSchedulers;
|
||||
@@ -70,6 +69,7 @@ public class MainNetManager {
|
||||
|
||||
/**
|
||||
* FB是否替换新Key
|
||||
*
|
||||
* @param callback
|
||||
*/
|
||||
public void FaceBookUp(HttpCallback<FaceBookUpModel> callback) {
|
||||
@@ -89,6 +89,7 @@ public class MainNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 猜你喜欢
|
||||
*
|
||||
@@ -120,7 +121,7 @@ public class MainNetManager {
|
||||
* @param p 頁碼
|
||||
*/
|
||||
public void search(String jianKey, String fanKey, int type, int p, HttpCallback<List<List<SearchModel>>> callback) {
|
||||
API.get().pdLiveApi(mContext).search(jianKey,fanKey,type,p)
|
||||
API.get().pdLiveApi(mContext).search(jianKey, fanKey, type, p)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -134,6 +135,7 @@ public class MainNetManager {
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索
|
||||
*
|
||||
@@ -143,7 +145,7 @@ public class MainNetManager {
|
||||
* @param p 頁碼
|
||||
*/
|
||||
public void searchNew(String jianKey, String fanKey, int type, int p, HttpCallback<List<SearchModel>> callback) {
|
||||
API.get().pdLiveApi(mContext).searchNew(jianKey,fanKey,type,p)
|
||||
API.get().pdLiveApi(mContext).searchNew(jianKey, fanKey, type, p)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(listResponseModel -> {
|
||||
@@ -158,4 +160,23 @@ public class MainNetManager {
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取首页轮播
|
||||
*/
|
||||
public void getHot(int page, HttpCallback<List<SlideInfoModel>> callback) {
|
||||
API.get().pdLiveApi(mContext).getHot(page)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(slideInBannerModelResponseModel -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
List<SlideInfoModel> slideInfoModels = slideInBannerModelResponseModel.getData().getInfo().get(0).getSlide();
|
||||
callback.onSuccess(slideInfoModels);
|
||||
}
|
||||
}, throwable -> {
|
||||
if (!mContext.isFinishing() && callback != null) {
|
||||
callback.onError(throwable.getMessage());
|
||||
}
|
||||
}).isDisposed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.yunbao.common.views;
|
||||
|
||||
import android.content.Context;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.ms.banner.holder.BannerViewHolder;
|
||||
import com.yunbao.common.bean.SlideInfoModel;
|
||||
|
||||
public class SlideInBannerViewHolder implements BannerViewHolder<SlideInfoModel> {
|
||||
|
||||
@Override
|
||||
public View createView(Context context, int position, SlideInfoModel data) {
|
||||
// 返回mImageView页面布局
|
||||
ImageView imageView = new ImageView(context);
|
||||
ViewGroup.LayoutParams params = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT
|
||||
);
|
||||
imageView.setLayoutParams(params);
|
||||
imageView.setScaleType(ImageView.ScaleType.FIT_XY);
|
||||
Glide.with(context).load(data.getSlidePic()).into(imageView);
|
||||
|
||||
return imageView;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -33,6 +33,7 @@
|
||||
android:layout_width="24dp"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_gravity="center" />
|
||||
</RelativeLayout>
|
||||
|
||||
@@ -49,6 +50,7 @@
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/clip_image2"
|
||||
android:layout_width="24dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="24dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" />
|
||||
@@ -70,6 +72,7 @@
|
||||
android:id="@+id/clip_image3"
|
||||
android:layout_width="29dp"
|
||||
android:layout_height="29dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" />
|
||||
</RelativeLayout>
|
||||
@@ -83,11 +86,13 @@
|
||||
android:background="@drawable/bg_white_clip"
|
||||
android:gravity="center"
|
||||
android:padding="1dp"
|
||||
|
||||
android:visibility="visible">
|
||||
|
||||
<com.yunbao.common.views.weight.ClipPathCircleImage
|
||||
android:id="@+id/clip_image4"
|
||||
android:layout_width="29dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:layout_height="29dp"
|
||||
android:layout_centerInParent="true"
|
||||
android:layout_gravity="center" />
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
<com.scwang.smartrefresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:id="@+id/refreshLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
>
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<com.scwang.smartrefresh.layout.header.ClassicsHeader
|
||||
android:id="@+id/header"
|
||||
@@ -17,8 +15,7 @@
|
||||
app:srlTextPulling="@string/refresh_header_pulling"
|
||||
app:srlTextRefreshing="@string/refresh_header_refreshing"
|
||||
app:srlTextRelease="@string/refresh_header_release"
|
||||
app:srlTextUpdate="@string/refresh_header_update"
|
||||
/>
|
||||
app:srlTextUpdate="@string/refresh_header_update" />
|
||||
|
||||
<FrameLayout
|
||||
android:layout_width="match_parent"
|
||||
@@ -28,15 +25,13 @@
|
||||
android:id="@+id/recyclerView"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:overScrollMode="never"
|
||||
/>
|
||||
android:overScrollMode="never" />
|
||||
|
||||
<FrameLayout
|
||||
android:id="@+id/no_data_container"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:visibility="invisible"
|
||||
>
|
||||
android:visibility="invisible">
|
||||
|
||||
|
||||
<TextView
|
||||
@@ -46,8 +41,7 @@
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/no_data"
|
||||
android:textColor="@color/gray1"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
</FrameLayout>
|
||||
|
||||
@@ -59,33 +53,29 @@
|
||||
android:gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
android:translationY="-60dp"
|
||||
android:visibility="invisible"
|
||||
>
|
||||
android:visibility="invisible">
|
||||
|
||||
<ImageView
|
||||
android:layout_width="120dp"
|
||||
android:layout_height="74dp"
|
||||
android:scaleType="fitXY"
|
||||
android:src="@mipmap/bg_load_failure"
|
||||
/>
|
||||
android:src="@mipmap/bg_load_failure" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginBottom="8dp"
|
||||
android:text="@string/load_failure"
|
||||
android:textColor="@color/textColor"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@string/load_failure_2"
|
||||
android:textColor="@color/gray1"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/btn_reload"
|
||||
@@ -96,8 +86,7 @@
|
||||
android:gravity="center"
|
||||
android:text="@string/reload"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="14sp"
|
||||
/>
|
||||
android:textSize="14sp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
@@ -107,14 +96,13 @@
|
||||
android:id="@+id/footer"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:visibility="gone"
|
||||
app:srlTextFailed="@string/refresh_footer_failed"
|
||||
app:srlTextFinish="@string/refresh_footer_finish"
|
||||
app:srlTextLoading="@string/refresh_footer_loading"
|
||||
app:srlTextNothing="@string/refresh_footer_nothing"
|
||||
app:srlTextPulling="@string/refresh_footer_pulling"
|
||||
app:srlTextRefreshing="@string/refresh_footer_refreshing"
|
||||
app:srlTextRelease="@string/refresh_footer_release"
|
||||
android:visibility="gone"
|
||||
/>
|
||||
app:srlTextRelease="@string/refresh_footer_release" />
|
||||
|
||||
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||
@@ -846,4 +846,18 @@ Limited ride And limited avatar frame</string>
|
||||
<string name="whole_station_horn">Whole station horn</string>
|
||||
<string name="quote">quote</string>
|
||||
<string name="whole_station_horn_hint">Available times: %s Note: Update times at 4:00 am on the 1st of each month</string>
|
||||
<string name="cannot_be_empty">Content cannot be empty</string>
|
||||
<string name="site_wide_news">Noble exclusive site-wide news</string>
|
||||
<string name="site_wide_news_hint1">Display messages on the whole station and jump to the current live room</string>
|
||||
<string name="site_wide_news_hint2">Open noble king, emperor, super emperor to get free</string>
|
||||
<string name="back">back</string>
|
||||
<string name="go_nobility">to the nobles</string>
|
||||
<string name="use_successfully">Use successfully</string>
|
||||
<string name="use_live">Go to the live room</string>
|
||||
<string name="search_history">search history</string>
|
||||
<string name="you_may_also_like">you may also like</string>
|
||||
<string name="anchor">anchor</string>
|
||||
<string name="anchor_more">More</string>
|
||||
<string name="wonderful_live">Wonderful live</string>
|
||||
<string name="recommended_for_you">recommended for you</string>
|
||||
</resources>
|
||||
|
||||
@@ -871,4 +871,5 @@
|
||||
<string name="anchor">主播</string>
|
||||
<string name="anchor_more">更多</string>
|
||||
<string name="wonderful_live">精彩直播</string>
|
||||
<string name="recommended_for_you">為您推薦</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user