version:4.8
fix: update:增加权重排序
This commit is contained in:
@@ -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