This commit is contained in:
jinyuer
2020-09-04 16:28:12 +08:00
parent ca565aafc6
commit 08e216bb0a
9 changed files with 566 additions and 50 deletions

View File

@@ -297,6 +297,7 @@
<activity android:name=".order.OrderDetailActivity" />
<activity android:name=".order.SettleActivity" />
<activity android:name=".order.PayActivity" />
<activity android:name=".discovery.HistoryRecordActivity" />
</application>
</manifest>

View File

@@ -5,6 +5,7 @@ import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.v4.app.Fragment;
import android.text.TextPaint;
import android.view.LayoutInflater;
@@ -14,9 +15,11 @@ import android.widget.LinearLayout;
import android.widget.RadioButton;
import com.cutil.ScreenUtils;
import com.dalong.refreshlayout.OnRefreshListener;
import com.google.gson.Gson;
import com.google.gson.internal.LinkedTreeMap;
import com.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.sl.house_property.user.MyMarketShopActivity;
import com.sl.house_property.databinding.FragmentMainBinding;
import com.sl.house_property.databinding.FragmentRecyclerviewHorizationItemBinding;
@@ -147,26 +150,26 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
// progressDialog.setMessage(getActivity().getString(R.string.loading));
//getGankList(ApiConfig.GETHOMEBANNER,new HashMap<String, String>(),getString(R.string.loading),0);
mDataBinding.taobaoRefreshLayout.setOnRefreshListener(onrefalshlister);
mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
/* configFragments();
intRecycleHorization();
intRecycleVerization();*/
user =
Config.getInstance(getActivity()).getUser();
Map<String, String> map = new HashMap<>();
if (user != null) {
map.put("userid", user.getUserid());
} else {
map.put("userid", 0 + "");
}
map.put("app", "Advert");
map.put("class", "Advertr_an_AdvertHomeList");
map.put("sign", Md5.md5("Advert" + "Advertr_an_AdvertHomeList" + Md5.secret));
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), 0, true);
}
}, 0);
// mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
// @Override
// public void run() {
// /* configFragments();
// intRecycleHorization();
// intRecycleVerization();*/
// user =
// Config.getInstance(getActivity()).getUser();
// Map<String, String> map = new HashMap<>();
// if (user != null) {
// map.put("userid", user.getUserid());
// } else {
// map.put("userid", 0 + "");
// }
// map.put("app", "Advert");
// map.put("class", "Advertr_an_AdvertHomeList");
// map.put("sign", Md5.md5("Advert" + "Advertr_an_AdvertHomeList" + Md5.secret));
// getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), 0, true);
// }
// }, 0);
mDataBinding.scan.setOnClickListener(this);
mDataBinding.entrancegurd.setOnClickListener(this);
mDataBinding.cargara.setOnClickListener(this);
@@ -176,7 +179,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
LinearLayout.LayoutParams bannerLP = (LinearLayout.LayoutParams) banner.getLayoutParams();
bannerLP.width = ScreenUtils.getScreenWidth();
banner.setLayoutParams(bannerLP);
mDataBinding.taobaoRefreshLayout.setAutoRefresh(true);
mDataBinding.taobaoRefreshLayout.autoRefresh();
}
// TODO: Rename method, update argument and hook method into UI event
@@ -420,7 +423,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
private OnRefreshListener onrefalshlister = new OnRefreshListener() {
@Override
public void onRefresh() {
public void onRefresh(@NonNull RefreshLayout refreshLayout) {
RegisterUser user =
Config.getInstance(getActivity()).getUser();
Map<String, String> map = new HashMap<>();
@@ -433,26 +436,11 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
map.put("class", "Advertr_an_AdvertHomeList");
map.put("sign", Md5.md5("Advert" + "Advertr_an_AdvertHomeList" + Md5.secret));
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), 0, false);
mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mDataBinding.taobaoRefreshLayout.stopRefresh(true);
}
}, 10000);
}
@Override
public void onLoadMore() {
mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
@Override
public void run() {
mDataBinding.taobaoRefreshLayout.stopLoadMore(true);
}
}, 1000);
}
};
@@ -461,8 +449,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
Subscription subscription = mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
@Override
public void call(Resultcode resultcode) {
mDataBinding.taobaoRefreshLayout.stopRefresh(true);
mDataBinding.taobaoRefreshLayout.stopLoadMore(true);
mDataBinding.taobaoRefreshLayout.finishRefresh();
if (!(resultcode.status == 0)) {
baseActivity.setToast(1, resultcode.msg);
}
@@ -486,6 +473,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
}, new Action1<Throwable>() {
@Override
public void call(Throwable throwable) {
mDataBinding.taobaoRefreshLayout.finishRefresh();
baseActivity.setToast(2, getString(R.string.getdatafailure));
throwable.printStackTrace();
}

View File

@@ -479,6 +479,15 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
Glide.with(getContext()).load(discoveryListEntity.getAvatar())
.apply(requestOptions)
.into(homeGridAdapterItemBinding.imageHead);
homeGridAdapterItemBinding.imageHead.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(getContext(), HistoryRecordActivity.class);
intent.putExtra("userId", discoveryListEntity.getUserid());
intent.putExtra("userName", discoveryListEntity.getNickname());
startActivity(intent);
}
});
ArrayList<ImageInfo> imageInfos = new ArrayList<>();
if (discoveryListEntity.getPic().size() > 0) {
@@ -539,7 +548,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
baseActivity.setToast(1, resultcode.msg);
}
if (resultcode.status == 0) {
// intRecycleView();
// intRecycleView();
Gson gs = new Gson();
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
String s = gs.toJson(adta);
@@ -794,4 +803,12 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
baseActivity.addSubscription(subscription);
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
page = 1;
getlist(1);
}
}

View File

@@ -0,0 +1,349 @@
package com.sl.house_property.discovery;
import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
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.scwang.smartrefresh.layout.api.RefreshLayout;
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
import com.sl.house_property.BaseActivity;
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.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 HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBinding> {
private Context context;
private int type = 2;
private int page = 1;
private String userId;
private Loader loader;
private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>();
@Override
protected int getLayoutResId() {
return R.layout.layout_history_record;
}
@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 userName = getIntent().getStringExtra("userName");
mDataBinding.tvTitle.setText(userName);
mDataBinding.left.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
finish();
}
});
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();
}
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) {
}
};
}

View File

@@ -55,13 +55,18 @@
android:layout_weight="1"
android:background="@color/lighteeeeee"
app:srlEnableLoadMore="true"
app:srlEnableLoadMoreWhenContentNotFull="true">
app:srlDisableContentWhenLoading="true">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rec"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</LinearLayout>
</layout>

View File

@@ -43,11 +43,16 @@
android:layout_weight="1"
android:background="@color/white"
app:srlEnableLoadMore="true"
app:srlEnableLoadMoreWhenContentNotFull="true">
app:srlDisableContentWhenLoading="true">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rec"
android:layout_width="match_parent"
android:layout_height="match_parent" />
<com.scwang.smartrefresh.layout.footer.ClassicsFooter
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.scwang.smartrefresh.layout.SmartRefreshLayout>

View File

@@ -47,7 +47,9 @@
android:layout_weight="1"
app:srlEnableLoadMoreWhenContentNotFull="false">
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<android.support.v7.widget.RecyclerView
android:id="@+id/rec"

View File

@@ -54,11 +54,17 @@
android:layout_height="match_parent"
android:background="@color/f7">
<my_view.tao_bao_refresh.TaoBaoRefreshLayout
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id="@+id/taobao_refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_height="match_parent"
app:srlEnableLoadMore="false"
>
<com.scwang.smartrefresh.layout.header.ClassicsHeader
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<my_view.tao_bao_refresh.ScrollViewExtend
android:id="@+id/scroll_view_extend"
@@ -229,7 +235,8 @@
android:focusable="true"></my_view.tao_bao_refresh.RecyView>
</LinearLayout>
</my_view.tao_bao_refresh.ScrollViewExtend>
</my_view.tao_bao_refresh.TaoBaoRefreshLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</RelativeLayout>

View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:app="http://schemas.android.com/apk/res-auto">
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<LinearLayout
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_gravity="center"
android:paddingLeft="16dp"
android:paddingTop="5dp"
android:paddingRight="5dp"
android:paddingBottom="5dp"
android:src="@mipmap/fanhui" />
<TextView
android:id="@+id/tv_title"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_marginLeft="16dp"
android:layout_weight="1"
android:gravity="center"
android:textColor="@color/white"
android:textSize="16sp" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="40dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_1"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/white"
android:gravity="center"
android:text="说说"
android:textColor="@color/black"
android:textSize="14sp" />
<TextView
android:id="@+id/tv_2"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:gravity="center"
android:text="商品"
android:textColor="@color/white"
android:textSize="14sp" />
</LinearLayout>
<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"
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>
</layout>