| | |
| | | import com.android.app_base.utils.Utils; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyAssetsRequestBean; |
| | | import com.application.zhangshi_app_android.bean.FamilyMemorabiliaBean; |
| | | import com.application.zhangshi_app_android.bean.PageResponseBean; |
| | | import com.application.zhangshi_app_android.data.DataRepository; |
| | | |
| | |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | System.out.println(dataListLiveData.getValue().size()); |
| | | if (type == 0) { |
| | | // 从新到旧,null排最后 |
| | | list.sort((o1, o2) -> { |
| | |
| | | dataListLiveData.postValue(list); |
| | | } |
| | | |
| | | /** |
| | | * 本家数据 置顶 |
| | | */ |
| | | public void ownTop(){ |
| | | List<FamilyAssetsBean> list = getDataListLiveData().getValue(); |
| | | if (list == null || list.isEmpty()){ |
| | | return; |
| | | } |
| | | //根据ownData值为1的 放到前面 |
| | | list.sort((o1, o2) -> { |
| | | if (o1.getOwnData() == 1 && o2.getOwnData() == 0) { |
| | | return -1; |
| | | } else if (o1.getOwnData() == 0 && o2.getOwnData() == 1) { |
| | | return 1; |
| | | } |
| | | return 0; |
| | | }); |
| | | getDataListLiveData().setValue(list); |
| | | } |
| | | } |