d
This commit is contained in:
@@ -269,6 +269,7 @@
|
|||||||
<activity android:name=".order.SettleActivity" />
|
<activity android:name=".order.SettleActivity" />
|
||||||
<activity android:name=".order.PayActivity" />
|
<activity android:name=".order.PayActivity" />
|
||||||
<activity android:name=".discovery.HistoryRecordActivity" />
|
<activity android:name=".discovery.HistoryRecordActivity" />
|
||||||
|
<activity android:name=".discovery.HistoryRecordActivitytwo" />
|
||||||
<activity android:name=".discovery.ShareCodeActivity" />
|
<activity android:name=".discovery.ShareCodeActivity" />
|
||||||
<activity
|
<activity
|
||||||
android:name=".discovery.PropertyActivity"
|
android:name=".discovery.PropertyActivity"
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ import com.sl.house_property.databinding.ItemCommentBinding;
|
|||||||
import com.sl.house_property.databinding.ItemDiscoveryBinding;
|
import com.sl.house_property.databinding.ItemDiscoveryBinding;
|
||||||
import com.sl.house_property.discovery.GoodsInfoDialog;
|
import com.sl.house_property.discovery.GoodsInfoDialog;
|
||||||
import com.sl.house_property.discovery.HistoryRecordActivity;
|
import com.sl.house_property.discovery.HistoryRecordActivity;
|
||||||
|
import com.sl.house_property.discovery.HistoryRecordActivitytwo;
|
||||||
import com.sl.house_property.discovery.PropertyActivity;
|
import com.sl.house_property.discovery.PropertyActivity;
|
||||||
import com.sl.house_property.discovery.ShareCodeActivity;
|
import com.sl.house_property.discovery.ShareCodeActivity;
|
||||||
import com.sl.house_property.order.SettleActivity;
|
import com.sl.house_property.order.SettleActivity;
|
||||||
@@ -363,15 +364,16 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
|||||||
public void onClick(View v) {
|
public void onClick(View v) {
|
||||||
// Intent intent = new Intent(getContext(), PropertyActivity.class);
|
// Intent intent = new Intent(getContext(), PropertyActivity.class);
|
||||||
// startActivity(intent);
|
// startActivity(intent);
|
||||||
String fangchan = (String) SPUtils.getSp(getActivity(), DoConfig.FANGCHAN_DATA, "0");
|
|
||||||
if(fangchan.equals("0")){
|
|
||||||
Intent intent = new Intent(getActivity(), MyPropertyActivity.class);
|
|
||||||
intent.putExtra("usertitile", "我的房产");
|
|
||||||
startActivityForResult(intent, 0);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Intent intent = new Intent(getContext(), HistoryRecordActivity.class);
|
// String fangchan = (String) SPUtils.getSp(getActivity(), DoConfig.FANGCHAN_DATA, "0");
|
||||||
|
// if(fangchan.equals("0")){
|
||||||
|
// Intent intent = new Intent(getActivity(), MyPropertyActivity.class);
|
||||||
|
// intent.putExtra("usertitile", "我的房产");
|
||||||
|
// startActivityForResult(intent, 0);
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
Intent intent = new Intent(getContext(), HistoryRecordActivitytwo.class);
|
||||||
final RegisterUser user =
|
final RegisterUser user =
|
||||||
Config.getInstance(getActivity()).getUser();
|
Config.getInstance(getActivity()).getUser();
|
||||||
intent.putExtra("userId", user.getUserid());
|
intent.putExtra("userId", user.getUserid());
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.sl.house_property.discovery;
|
package com.sl.house_property.discovery;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
import android.graphics.drawable.BitmapDrawable;
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
import android.graphics.drawable.Drawable;
|
import android.graphics.drawable.Drawable;
|
||||||
@@ -140,6 +141,7 @@ public class HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBindi
|
|||||||
// });
|
// });
|
||||||
// intRecycleView();
|
// intRecycleView();
|
||||||
// mDataBinding.dw.autoRefresh();
|
// mDataBinding.dw.autoRefresh();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,406 @@
|
|||||||
|
package com.sl.house_property.discovery;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.content.Intent;
|
||||||
|
import android.graphics.Bitmap;
|
||||||
|
import android.graphics.drawable.BitmapDrawable;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.support.annotation.Nullable;
|
||||||
|
import android.support.v4.app.Fragment;
|
||||||
|
import android.support.v4.app.FragmentManager;
|
||||||
|
import android.support.v4.app.FragmentPagerAdapter;
|
||||||
|
import android.support.v7.widget.LinearLayoutManager;
|
||||||
|
import android.util.Log;
|
||||||
|
import android.view.View;
|
||||||
|
|
||||||
|
import com.bumptech.glide.Glide;
|
||||||
|
import com.bumptech.glide.request.RequestOptions;
|
||||||
|
import com.google.gson.Gson;
|
||||||
|
import com.google.gson.internal.LinkedTreeMap;
|
||||||
|
import com.google.gson.reflect.TypeToken;
|
||||||
|
import com.gyf.immersionbar.ImmersionBar;
|
||||||
|
import com.lzy.ninegrid.ImageInfo;
|
||||||
|
import com.lzy.ninegrid.preview.NineGridViewClickAdapter;
|
||||||
|
import com.sl.house_property.BaseActivity;
|
||||||
|
import com.sl.house_property.MainTabActivity;
|
||||||
|
import com.sl.house_property.R;
|
||||||
|
import com.sl.house_property.databinding.ItemCommentBinding;
|
||||||
|
import com.sl.house_property.databinding.ItemDiscoveryBinding;
|
||||||
|
import com.sl.house_property.databinding.LayoutHistoryRecordBinding;
|
||||||
|
import com.sl.house_property.databinding.LayoutHistoryRecordtwoBinding;
|
||||||
|
import com.squareup.picasso.Picasso;
|
||||||
|
import com.squareup.picasso.Target;
|
||||||
|
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.lang.reflect.Type;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import adapter.BaseRecycleViewAdapter;
|
||||||
|
import entity.DiscoveryListEntity;
|
||||||
|
import http.ApiConfig;
|
||||||
|
import my_loader.Loader;
|
||||||
|
import my_loader.Resultcode;
|
||||||
|
import my_view.tao_bao_refresh.FullyGridLayoutManager;
|
||||||
|
import rx.Subscription;
|
||||||
|
import rx.functions.Action1;
|
||||||
|
import tools.PicassoRoundTransform;
|
||||||
|
import utils.DateUtils;
|
||||||
|
import utils.Md5;
|
||||||
|
|
||||||
|
public class HistoryRecordActivitytwo extends BaseActivity<LayoutHistoryRecordtwoBinding> {
|
||||||
|
private Context context;
|
||||||
|
private int type = 2;
|
||||||
|
private int page = 1;
|
||||||
|
private String userId;
|
||||||
|
private Loader loader;
|
||||||
|
private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>();
|
||||||
|
private ArrayList<Fragment> fragments;
|
||||||
|
private String[] strings;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getLayoutResId() {
|
||||||
|
return R.layout.layout_history_recordtwo;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||||
|
super.onCreate(savedInstanceState);
|
||||||
|
context = this;
|
||||||
|
loader = new Loader();
|
||||||
|
ImmersionBar.with(this)
|
||||||
|
.keyboardEnable(true) //解决软键盘与底部输入框冲突问题
|
||||||
|
// .keyboardEnable(true, WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE
|
||||||
|
// | WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) //软键盘自动弹出
|
||||||
|
.init();
|
||||||
|
userId = getIntent().getStringExtra("userId");
|
||||||
|
String title = getIntent().getStringExtra("title");
|
||||||
|
mDataBinding.tvTitle.setText(title);
|
||||||
|
// mDataBinding.tvTitle.setText(userName);
|
||||||
|
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
finish();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
strings = new String[2];
|
||||||
|
strings[0] = "说说";
|
||||||
|
// strings[1] = "商品";
|
||||||
|
fragments = new ArrayList<>();
|
||||||
|
|
||||||
|
fragments.add(HistoryRecordFragment.newInstance(1, userId,0,getIntent().getIntExtra("dataType",0)));
|
||||||
|
// fragments.add(HistoryRecordFragment.newInstance(2, userId,0,getIntent().getIntExtra("dataType",0)));
|
||||||
|
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getSupportFragmentManager());
|
||||||
|
mDataBinding.fl.setAdapter(myViewPagerAdapter);
|
||||||
|
mDataBinding.tb.setupWithViewPager(mDataBinding.fl);
|
||||||
|
// mDataBinding.tv1.setOnClickListener(new View.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
//
|
||||||
|
// if (type == 2) {
|
||||||
|
// type = 1;
|
||||||
|
// page = 1;
|
||||||
|
// getData();
|
||||||
|
// mDataBinding.tv1.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
// mDataBinding.tv1.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
// mDataBinding.tv2.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
// mDataBinding.tv2.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// mDataBinding.tv2.setOnClickListener(new View.OnClickListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onClick(View v) {
|
||||||
|
// if (type == 1) {
|
||||||
|
// type = 2;
|
||||||
|
// page = 1;
|
||||||
|
// getData();
|
||||||
|
// mDataBinding.tv2.setTextColor(getResources().getColor(R.color.white));
|
||||||
|
// mDataBinding.tv2.setBackgroundColor(getResources().getColor(R.color.colorPrimary));
|
||||||
|
// mDataBinding.tv1.setTextColor(getResources().getColor(R.color.black));
|
||||||
|
// mDataBinding.tv1.setBackgroundColor(getResources().getColor(R.color.white));
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// mDataBinding.dw.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||||
|
// @Override
|
||||||
|
// public void onLoadMore(@NonNull RefreshLayout refreshLayout) {
|
||||||
|
// getData();
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// @Override
|
||||||
|
// public void onRefresh(@NonNull RefreshLayout refreshLayout) {
|
||||||
|
// page = 1;
|
||||||
|
// getData();
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
// intRecycleView();
|
||||||
|
// mDataBinding.dw.autoRefresh();
|
||||||
|
mDataBinding.tvWuye.setOnClickListener(new View.OnClickListener() {
|
||||||
|
@Override
|
||||||
|
public void onClick(View v) {
|
||||||
|
Intent intent = new Intent(HistoryRecordActivitytwo.this, PropertyActivity.class);
|
||||||
|
startActivity(intent);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//2. 保存MyOnTouchListener接口的列表
|
||||||
|
private ArrayList<MainTabActivity.MyOnTouchListener> onTouchListeners = new ArrayList<MainTabActivity.MyOnTouchListener>();
|
||||||
|
//4.提供给Fragment通过getActivity()方法来注册自己的触摸事件的方法
|
||||||
|
public void registerMyOnTouchListener(MainTabActivity.MyOnTouchListener myOnTouchListener) {
|
||||||
|
onTouchListeners.add(myOnTouchListener);
|
||||||
|
}
|
||||||
|
|
||||||
|
//5.提供给Fragment通过getActivity()方法来注销自己的触摸事件的方法
|
||||||
|
public void unregisterMyOnTouchListener(MainTabActivity.MyOnTouchListener myOnTouchListener) {
|
||||||
|
onTouchListeners.remove(myOnTouchListener);
|
||||||
|
}
|
||||||
|
class MyViewPagerAdapter extends FragmentPagerAdapter {
|
||||||
|
public MyViewPagerAdapter(FragmentManager fm) {
|
||||||
|
super(fm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Fragment getItem(int position) {
|
||||||
|
return fragments.get(position);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getCount() {
|
||||||
|
return fragments.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public CharSequence getPageTitle(int position) {
|
||||||
|
return strings[position];
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void intRecycleView() {
|
||||||
|
|
||||||
|
|
||||||
|
LinearLayoutManager linearLayoutManager = new LinearLayoutManager(context);
|
||||||
|
mDataBinding.recyView.setNestedScrollingEnabled(false);//禁止rcyc嵌套滑动
|
||||||
|
mDataBinding.recyView.setLayoutManager(linearLayoutManager);
|
||||||
|
BaseRecycleViewAdapter<DiscoveryListEntity, ItemDiscoveryBinding> baseRecycleViewAdapter = new BaseRecycleViewAdapter(context, R.layout.item_discovery);
|
||||||
|
baseRecycleViewAdapter.setHasStableIds(true);
|
||||||
|
|
||||||
|
discoveryListEntities = new ArrayList<>();
|
||||||
|
baseRecycleViewAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView() {
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(Object b, final int position) {
|
||||||
|
if (!(position >= discoveryListEntities.size())) {
|
||||||
|
final ItemDiscoveryBinding homeGridAdapterItemBinding = (ItemDiscoveryBinding) b;
|
||||||
|
// homeGridAdapterItemBinding.setMyentity(discoveryListEntities.get(position));
|
||||||
|
homeGridAdapterItemBinding.ivComment.setVisibility(View.GONE);
|
||||||
|
final DiscoveryListEntity discoveryListEntity = discoveryListEntities.get(position);
|
||||||
|
homeGridAdapterItemBinding.tvNikeName.setText(discoveryListEntity.getNickname());
|
||||||
|
homeGridAdapterItemBinding.tvContent.setText(discoveryListEntity.getGoods_detail());
|
||||||
|
|
||||||
|
|
||||||
|
if (discoveryListEntity.getLike().isEmpty()) {
|
||||||
|
homeGridAdapterItemBinding.tvLike.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
homeGridAdapterItemBinding.tvLike.setVisibility(View.VISIBLE);
|
||||||
|
StringBuilder likeString = new StringBuilder();
|
||||||
|
for (int i = 0; i < discoveryListEntity.getLike().size(); i++) {
|
||||||
|
if (i == 0) {
|
||||||
|
likeString.append("❤");
|
||||||
|
|
||||||
|
} else {
|
||||||
|
likeString.append(",");
|
||||||
|
}
|
||||||
|
likeString.append(discoveryListEntity.getLike().get(i).getNickname());
|
||||||
|
}
|
||||||
|
homeGridAdapterItemBinding.tvLike.setText(likeString.toString());
|
||||||
|
|
||||||
|
homeGridAdapterItemBinding.tvTime.setText(DateUtils.getDate(discoveryListEntity.getCtime()));
|
||||||
|
|
||||||
|
}
|
||||||
|
if (discoveryListEntity.getDis_content().isEmpty()) {
|
||||||
|
homeGridAdapterItemBinding.rvComment.setVisibility(View.GONE);
|
||||||
|
} else {
|
||||||
|
homeGridAdapterItemBinding.rvComment.setVisibility(View.VISIBLE);
|
||||||
|
FullyGridLayoutManager mgr = new FullyGridLayoutManager(context, 1);
|
||||||
|
mgr.setOrientation(FullyGridLayoutManager.VERTICAL);
|
||||||
|
mgr.setSmoothScrollbarEnabled(true);
|
||||||
|
homeGridAdapterItemBinding.rvComment.setLayoutManager(mgr);
|
||||||
|
BaseRecycleViewAdapter<DiscoveryListEntity.Dis_content, ItemCommentBinding> baseRecycleViewAdapter = new BaseRecycleViewAdapter(context, R.layout.item_comment);
|
||||||
|
homeGridAdapterItemBinding.rvComment.setAdapter(baseRecycleViewAdapter);
|
||||||
|
final ArrayList<DiscoveryListEntity.Dis_content> dis_content = discoveryListEntity.getDis_content();
|
||||||
|
baseRecycleViewAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView() {
|
||||||
|
@Override
|
||||||
|
public void onBindViewHolder(Object b, int position) {
|
||||||
|
ItemCommentBinding itemCommentBinding = (ItemCommentBinding) b;
|
||||||
|
itemCommentBinding.tvName.setText(dis_content.get(position).getNickname() + ": ");
|
||||||
|
itemCommentBinding.tvInfo.setText(dis_content.get(position).getContents());
|
||||||
|
if (dis_content.get(position).getReply().isEmpty()) {
|
||||||
|
itemCommentBinding.llHf.setVisibility(View.GONE);
|
||||||
|
|
||||||
|
} else {
|
||||||
|
itemCommentBinding.llHf.setVisibility(View.VISIBLE);
|
||||||
|
itemCommentBinding.tvName2.setText(discoveryListEntity.getNickname());
|
||||||
|
itemCommentBinding.tvInfo2.setText("回复");
|
||||||
|
itemCommentBinding.tvName3.setText(dis_content.get(position).getNickname() + ":");
|
||||||
|
itemCommentBinding.tvInfo3.setText(dis_content.get(position).getReply());
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
baseRecycleViewAdapter.setData(dis_content);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
RequestOptions requestOptions = new RequestOptions();
|
||||||
|
requestOptions.placeholder(R.mipmap.icon_default_rectangle);
|
||||||
|
requestOptions.error(R.mipmap.icon_default_rectangle);
|
||||||
|
|
||||||
|
Glide.with(context).load(discoveryListEntity.getAvatar())
|
||||||
|
.apply(requestOptions)
|
||||||
|
.into(homeGridAdapterItemBinding.imageHead);
|
||||||
|
ArrayList<ImageInfo> imageInfos = new ArrayList<>();
|
||||||
|
|
||||||
|
if (discoveryListEntity.getPic().size() > 0) {
|
||||||
|
|
||||||
|
Log.e("pic", discoveryListEntity.getPic().get(0));
|
||||||
|
for (int i = 0; i < discoveryListEntity.getPic().size(); i++) {
|
||||||
|
if (discoveryListEntity.getPic().get(i).endsWith(".mp4") || discoveryListEntity.getPic().get(i).endsWith(".avi")) {
|
||||||
|
ImageInfo imageInfo = new ImageInfo();
|
||||||
|
imageInfo.setType(2);
|
||||||
|
imageInfo.setBigImageUrl(discoveryListEntity.getPic().get(i));
|
||||||
|
imageInfo.setThumbnailUrl(discoveryListEntity.getPic().get(i));
|
||||||
|
imageInfos.add(imageInfo);
|
||||||
|
} else {
|
||||||
|
ImageInfo imageInfo = new ImageInfo();
|
||||||
|
imageInfo.setType(1);
|
||||||
|
imageInfo.setBigImageUrl(discoveryListEntity.getPic().get(i));
|
||||||
|
imageInfo.setThumbnailUrl(discoveryListEntity.getPic().get(i));
|
||||||
|
imageInfos.add(imageInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
ImageInfo imageInfo = new ImageInfo();
|
||||||
|
imageInfo.setType(1);
|
||||||
|
imageInfo.setBigImageUrl(discoveryListEntity.getThumb());
|
||||||
|
imageInfo.setThumbnailUrl(discoveryListEntity.getThumb());
|
||||||
|
imageInfos.add(imageInfo);
|
||||||
|
}
|
||||||
|
homeGridAdapterItemBinding.nineGrid.setAdapter(new NineGridViewClickAdapter(context, imageInfos));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
mDataBinding.recyView.setAdapter(baseRecycleViewAdapter);
|
||||||
|
|
||||||
|
baseRecycleViewAdapter.setData(discoveryListEntities);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void getData() {
|
||||||
|
|
||||||
|
Map<String, String> map = new HashMap<>();
|
||||||
|
map.put("userid", userId);
|
||||||
|
map.put("type", type + "");
|
||||||
|
map.put("app", "Goods");
|
||||||
|
map.put("class", "MyGoodsLists");
|
||||||
|
map.put("page", page + "");
|
||||||
|
map.put("sign", Md5.md5("Goods" + "MyGoodsLists" + Md5.secret));
|
||||||
|
Subscription subscribe = loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||||
|
@Override
|
||||||
|
public void call(Resultcode resultcode) {
|
||||||
|
mDataBinding.dw.finishRefresh();
|
||||||
|
mDataBinding.dw.finishLoadMore();
|
||||||
|
progressDialog.dismiss();
|
||||||
|
if (!(resultcode.status == 0)) {
|
||||||
|
setToast(1, resultcode.msg);
|
||||||
|
}
|
||||||
|
if (resultcode.status == 0) {
|
||||||
|
// intRecycleView();
|
||||||
|
Gson gs = new Gson();
|
||||||
|
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||||
|
String s = gs.toJson(adta);
|
||||||
|
try {
|
||||||
|
JSONObject jsonObject = new JSONObject(s);
|
||||||
|
org.json.JSONArray array = jsonObject.getJSONArray("info");
|
||||||
|
Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() {
|
||||||
|
}.getType();
|
||||||
|
if (page == 1) {
|
||||||
|
String fengmian = jsonObject.getString("fengmian");
|
||||||
|
String avatar = jsonObject.getString("avatar");
|
||||||
|
Picasso.with(context).load(fengmian)
|
||||||
|
.placeholder(R.mipmap.icon_default_rectangle)
|
||||||
|
.into(target);
|
||||||
|
Picasso.with(context).load(avatar)
|
||||||
|
.placeholder(R.mipmap.icon_default_rectangle)
|
||||||
|
.transform(new PicassoRoundTransform())
|
||||||
|
.into(mDataBinding.head);
|
||||||
|
ArrayList<DiscoveryListEntity> o = new Gson().fromJson(array.toString(), type);
|
||||||
|
discoveryListEntities.clear();
|
||||||
|
discoveryListEntities.addAll(o);
|
||||||
|
BaseRecycleViewAdapter baseRecycleViewAdapter = (BaseRecycleViewAdapter) mDataBinding.recyView.getAdapter();
|
||||||
|
baseRecycleViewAdapter.setData(discoveryListEntities);
|
||||||
|
page++;
|
||||||
|
} else {
|
||||||
|
ArrayList<DiscoveryListEntity> o = new Gson().fromJson(array.toString(), type);
|
||||||
|
discoveryListEntities.addAll(o);
|
||||||
|
|
||||||
|
BaseRecycleViewAdapter baseRecycleViewAdapter = (BaseRecycleViewAdapter) mDataBinding.recyView.getAdapter();
|
||||||
|
baseRecycleViewAdapter.setData(discoveryListEntities);
|
||||||
|
Log.e("sizi", discoveryListEntities.size() + "");
|
||||||
|
// int count = jsonObject.getInt("count");
|
||||||
|
if (o.isEmpty()) {
|
||||||
|
mDataBinding.dw.finishLoadMoreWithNoMoreData();
|
||||||
|
} else {
|
||||||
|
|
||||||
|
page++;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, new Action1<Throwable>() {
|
||||||
|
@Override
|
||||||
|
public void call(Throwable throwable) {
|
||||||
|
progressDialog.dismiss();
|
||||||
|
mDataBinding.dw.finishRefresh();
|
||||||
|
mDataBinding.dw.finishLoadMore();
|
||||||
|
setToast(2, getString(R.string.getdatafailure));
|
||||||
|
throwable.printStackTrace();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
addSubscription(subscribe);
|
||||||
|
}
|
||||||
|
|
||||||
|
private Target target = new Target() {
|
||||||
|
@Override
|
||||||
|
public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {
|
||||||
|
Drawable drawable = new BitmapDrawable(bitmap);
|
||||||
|
mDataBinding.v.setBackground(drawable);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBitmapFailed(Drawable errorDrawable) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onPrepareLoad(Drawable placeHolderDrawable) {
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
||||||
12
app/src/main/res/drawable/corner_backgroundtwo.xml
Normal file
12
app/src/main/res/drawable/corner_backgroundtwo.xml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<solid android:color="@color/colorPrimary" />
|
||||||
|
<corners
|
||||||
|
android:bottomLeftRadius="30dp"
|
||||||
|
android:bottomRightRadius="30dp"
|
||||||
|
android:topLeftRadius="30dp"
|
||||||
|
android:topRightRadius="30dp" />
|
||||||
|
<stroke
|
||||||
|
android:width="1dp"
|
||||||
|
android:color="@color/colorPrimary" />
|
||||||
|
</shape>
|
||||||
|
|
||||||
@@ -24,18 +24,20 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:focusable="true" >
|
android:focusable="true" >
|
||||||
</my_view.tao_bao_refresh.RecyView>
|
</my_view.tao_bao_refresh.RecyView>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:layout_width="match_parent"
|
|
||||||
android:layout_marginTop="32dip"
|
|
||||||
android:text="+添加"
|
|
||||||
android:id="@+id/myaddress"
|
android:id="@+id/myaddress"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dip"
|
||||||
android:layout_marginLeft="15dip"
|
android:layout_marginLeft="15dip"
|
||||||
|
android:layout_marginTop="32dip"
|
||||||
android:layout_marginRight="15dip"
|
android:layout_marginRight="15dip"
|
||||||
android:textSize="20sp"
|
|
||||||
android:textColor="@color/white"
|
|
||||||
android:background="@drawable/corner_background"
|
android:background="@drawable/corner_background"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:layout_height="50dip" />
|
android:text="+添加"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="100dip"/>
|
android:layout_height="100dip"/>
|
||||||
|
|||||||
163
app/src/main/res/layout/layout_history_recordtwo.xml
Normal file
163
app/src/main/res/layout/layout_history_recordtwo.xml
Normal file
@@ -0,0 +1,163 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
>
|
||||||
|
<LinearLayout
|
||||||
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_marginBottom="55dp"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:id="@+id/ll"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="45dp"
|
||||||
|
android:layout_marginTop="@dimen/mystatusbar"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/left"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_centerVertical="true"
|
||||||
|
android:layout_gravity="center"
|
||||||
|
android:layout_marginTop="5dp"
|
||||||
|
android:paddingLeft="16dp"
|
||||||
|
android:paddingTop="5dp"
|
||||||
|
android:paddingRight="5dp"
|
||||||
|
android:paddingBottom="5dp"
|
||||||
|
android:src="@mipmap/fanhui" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:layout_centerHorizontal="true"
|
||||||
|
android:gravity="center"
|
||||||
|
android:textSize="16sp"
|
||||||
|
android:id="@+id/tv_title"
|
||||||
|
android:text="哈哈"
|
||||||
|
android:textColor="@color/white" />
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<android.support.design.widget.TabLayout
|
||||||
|
android:id="@+id/tb"
|
||||||
|
android:visibility="gone"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
app:tabIndicatorColor="#FE5200"
|
||||||
|
app:tabSelectedTextColor="#FE5200"
|
||||||
|
app:tabIndicatorFullWidth="false"
|
||||||
|
app:tabTextColor="#000" />
|
||||||
|
|
||||||
|
<android.support.v4.view.ViewPager
|
||||||
|
android:id="@+id/fl"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white">
|
||||||
|
|
||||||
|
</android.support.v4.view.ViewPager>
|
||||||
|
|
||||||
|
<com.scwang.smartrefresh.layout.SmartRefreshLayout
|
||||||
|
android:id="@+id/dw"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="0dp"
|
||||||
|
android:layout_weight="1"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:visibility="gone"
|
||||||
|
app:srlDisableContentWhenLoading="true"
|
||||||
|
app:srlEnableLoadMore="true"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<com.scwang.smartrefresh.layout.header.ClassicsHeader
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
|
<ScrollView
|
||||||
|
android:id="@+id/sv"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:background="@color/white"
|
||||||
|
android:orientation="vertical">
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content">
|
||||||
|
|
||||||
|
|
||||||
|
<View
|
||||||
|
android:id="@+id/v"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="230dp" />
|
||||||
|
|
||||||
|
<ImageView
|
||||||
|
android:id="@+id/head"
|
||||||
|
android:layout_width="60dp"
|
||||||
|
android:layout_height="60dp"
|
||||||
|
android:layout_below="@id/v"
|
||||||
|
android:layout_alignParentRight="true"
|
||||||
|
android:layout_marginTop="-30dp"
|
||||||
|
android:layout_marginRight="16dp" />
|
||||||
|
</RelativeLayout>
|
||||||
|
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
|
||||||
|
<android.support.v7.widget.RecyclerView
|
||||||
|
android:id="@+id/recy_view"
|
||||||
|
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent">
|
||||||
|
|
||||||
|
</android.support.v7.widget.RecyclerView>
|
||||||
|
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</LinearLayout>
|
||||||
|
</ScrollView>
|
||||||
|
|
||||||
|
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="wrap_content" />
|
||||||
|
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
|
||||||
|
|
||||||
|
|
||||||
|
</LinearLayout>
|
||||||
|
<RelativeLayout
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="55dp"
|
||||||
|
android:background="#ffffff"
|
||||||
|
android:layout_alignParentBottom="true"
|
||||||
|
android:orientation="horizontal">
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/tv_wuye"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="50dip"
|
||||||
|
android:layout_marginLeft="15dip"
|
||||||
|
android:layout_marginRight="15dip"
|
||||||
|
android:background="@drawable/corner_backgroundtwo"
|
||||||
|
android:gravity="center"
|
||||||
|
android:text="物业"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="20sp" />
|
||||||
|
|
||||||
|
</RelativeLayout>
|
||||||
|
</RelativeLayout>
|
||||||
|
</layout>
|
||||||
Reference in New Issue
Block a user