version:4.8
fix: update:增加权重排序
This commit is contained in:
@@ -23,7 +23,8 @@ public class VideoInfo implements Serializable, Parcelable {
|
||||
String video_cover;
|
||||
double video_duration; //时长 单位秒
|
||||
long video_size;//大小 单位字节
|
||||
int weigh;
|
||||
@SerializedName("weigh")
|
||||
int weight;//权重
|
||||
int play_count;//播放次数
|
||||
|
||||
protected VideoInfo(Parcel in) {
|
||||
@@ -35,7 +36,7 @@ public class VideoInfo implements Serializable, Parcelable {
|
||||
video_cover = in.readString();
|
||||
video_duration = in.readDouble();
|
||||
video_size = in.readLong();
|
||||
weigh = in.readInt();
|
||||
weight = in.readInt();
|
||||
play_count = in.readInt();
|
||||
}
|
||||
|
||||
@@ -49,7 +50,7 @@ public class VideoInfo implements Serializable, Parcelable {
|
||||
dest.writeString(video_cover);
|
||||
dest.writeDouble(video_duration);
|
||||
dest.writeLong(video_size);
|
||||
dest.writeInt(weigh);
|
||||
dest.writeInt(weight);
|
||||
dest.writeInt(play_count);
|
||||
}
|
||||
|
||||
@@ -134,12 +135,12 @@ public class VideoInfo implements Serializable, Parcelable {
|
||||
this.video_size = video_size;
|
||||
}
|
||||
|
||||
public int getWeigh() {
|
||||
return weigh;
|
||||
public int getWeight() {
|
||||
return weight;
|
||||
}
|
||||
|
||||
public void setWeigh(int weigh) {
|
||||
this.weigh = weigh;
|
||||
public void setWeight(int weight) {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
public int getPlay_count() {
|
||||
|
||||
@@ -180,6 +180,7 @@ public class GoodsActivity extends DataBindingActivity {
|
||||
if (listBaseResponse.code == 200) {
|
||||
GoodsList goodsList = listBaseResponse.data;
|
||||
List<GoodsInfo> goodsInfos = goodsList.getData();
|
||||
goodsInfos.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
mGoodsAdapter.setGoodsInfoList(goodsInfos);
|
||||
mRecyclerView.setVisibility(View.VISIBLE);
|
||||
mBinding.clNodata.setVisibility(View.GONE);
|
||||
|
||||
@@ -82,6 +82,7 @@ public class InfoListActivity extends BaseActivity {
|
||||
ArticleList articleList = listBaseResponse.data;
|
||||
List<ArticleInfo> articleInfoList = articleList.getData();
|
||||
if (articleInfoList != null && articleInfoList.size() != 0) {
|
||||
articleInfoList.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
iv1.setVisibility(android.view.View.GONE);
|
||||
mArticleAdapter.setArticleBeanList(articleInfoList);
|
||||
} else {
|
||||
|
||||
@@ -175,6 +175,7 @@ public class InformationActivity extends DataBindingActivity {
|
||||
ArticleList articleList = listBaseResponse.data;
|
||||
List<ArticleInfo> articleInfoList = articleList.getData();
|
||||
if (articleInfoList != null && articleInfoList.size() != 0) {
|
||||
articleInfoList.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
mInformationAdapter.setArticleInfos(articleInfoList);
|
||||
rv_video.setVisibility(View.VISIBLE);
|
||||
cl_nodata.setVisibility(android.view.View.GONE);
|
||||
|
||||
@@ -15,7 +15,7 @@ public class ArticleInfo implements Serializable {
|
||||
/*跳转链接*/
|
||||
String jump_url;
|
||||
|
||||
int weight;
|
||||
int weight;//权重
|
||||
int click_count;
|
||||
String third_url;
|
||||
long update_time;
|
||||
|
||||
@@ -6,6 +6,7 @@ import java.io.Serializable;
|
||||
|
||||
public class GoodsInfo implements Serializable {
|
||||
private static final long serialVersionUID = -229267734972111105L;
|
||||
|
||||
String id;
|
||||
/*商品名*/
|
||||
String goods_name;
|
||||
@@ -31,7 +32,7 @@ public class GoodsInfo implements Serializable {
|
||||
String ensure;
|
||||
@SerializedName("class")
|
||||
String type;
|
||||
int weight;
|
||||
int weight;//权重
|
||||
int click_count;
|
||||
int type_id;
|
||||
|
||||
|
||||
@@ -97,6 +97,7 @@ public class SecondPresenter implements SecondContact.Presenter {
|
||||
Log.e("getArticle", "onNext: " + listBaseResponse);
|
||||
ArticleList articleList = listBaseResponse.data;
|
||||
List<ArticleInfo> articleInfoList = articleList.getData();
|
||||
articleInfoList.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
mView.setArticle(articleInfoList);
|
||||
}
|
||||
|
||||
@@ -126,7 +127,9 @@ public class SecondPresenter implements SecondContact.Presenter {
|
||||
public void onNext(@NonNull BaseResponse<ArrayList<VideoInfo>> listBaseResponse) {
|
||||
Log.e("getLivenVideoList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
mView.setLivenVideoList(listBaseResponse.data);
|
||||
ArrayList<VideoInfo> videoInfoArrayList = listBaseResponse.data;
|
||||
videoInfoArrayList.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
mView.setLivenVideoList(videoInfoArrayList);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,7 +158,9 @@ public class SecondPresenter implements SecondContact.Presenter {
|
||||
public void onNext(@NonNull BaseResponse<ArrayList<VideoInfo>> listBaseResponse) {
|
||||
Log.e("getKnowledgeVideoList", "onNext: " + listBaseResponse);
|
||||
if (listBaseResponse.code == 200) {
|
||||
mView.setKnowledgeVideoList(listBaseResponse.data);
|
||||
ArrayList<VideoInfo> videoInfoArrayList = listBaseResponse.data;
|
||||
videoInfoArrayList.sort((o1, o2) -> Integer.compare(o2.getWeight(), o1.getWeight()));
|
||||
mView.setKnowledgeVideoList(videoInfoArrayList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -96,6 +96,6 @@ public class UrlAddress {
|
||||
/*知识视频列表*/
|
||||
public static final String GET_KNOWLEDGE_VIDEO_LIST = "knowledgeVideo/getKnowledgeVideoList";
|
||||
|
||||
public static final String geocoding = "geocoding/v3/";
|
||||
public static final String GEOCODING = "geocoding/v3/";
|
||||
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import retrofit2.http.GET;
|
||||
import retrofit2.http.Query;
|
||||
|
||||
public interface GeocodingApi {
|
||||
@GET(UrlAddress.geocoding)
|
||||
@GET(UrlAddress.GEOCODING)
|
||||
Observable<MapGeoBean> geocoding(
|
||||
@Query("address") String address,
|
||||
@Query("output") String output,
|
||||
|
||||
Reference in New Issue
Block a user