1
This commit is contained in:
@@ -362,6 +362,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
Intent intent = new Intent(getContext(), HistoryRecordActivity.class);
|
||||
intent.putExtra("userId", user.getUserid());
|
||||
intent.putExtra("userName", user.getNickname());
|
||||
intent.putExtra("title", "物业服务");
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
@@ -740,6 +741,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
Intent intent = new Intent(getContext(), HistoryRecordActivity.class);
|
||||
intent.putExtra("userId", discoveryListEntity.getUserid());
|
||||
intent.putExtra("userName", discoveryListEntity.getNickname());
|
||||
intent.putExtra("title", discoveryListEntity.getNickname());
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
@@ -765,7 +767,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (!TextUtils.isEmpty(discoveryListEntity.getThumb())){
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
imageInfo.setType(1);
|
||||
imageInfo.setBigImageUrl(discoveryListEntity.getThumb());
|
||||
|
||||
@@ -1,16 +1,12 @@
|
||||
package com.sl.house_property.discovery;
|
||||
|
||||
import android.Manifest;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.ActivityInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.graphics.drawable.BitmapDrawable;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.content.ContextCompat;
|
||||
import android.support.v7.widget.GridLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -114,8 +110,8 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
// } else {
|
||||
// goodsInfo = goodsInfo + "|" + info;
|
||||
// }
|
||||
Log.e("xxxx",info);
|
||||
Log.e("xxxx1",s);
|
||||
Log.e("xxxx", info);
|
||||
Log.e("xxxx1", s);
|
||||
strings.remove(strings.size() - 1);
|
||||
strings.add(new GoodsInfoEntity(info, s));
|
||||
for (int i = 0; i < strings.size(); i++) {
|
||||
@@ -144,8 +140,8 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
addGoodsDialog.setOnAddGoodsInputListener(new AddGoodsDialog.OnAddGoodsInputListener() {
|
||||
@Override
|
||||
public void onConfirm(String info, String s) {
|
||||
Log.e("xxxx",info);
|
||||
Log.e("xxxx1",s);
|
||||
Log.e("xxxx", info);
|
||||
Log.e("xxxx1", s);
|
||||
strings.set(position, new GoodsInfoEntity(info, s));
|
||||
strings.remove(strings.size() - 1);
|
||||
for (int i = 0; i < strings.size(); i++) {
|
||||
@@ -284,7 +280,7 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
XXPermissions.with(this).permission(Permission.WRITE_EXTERNAL_STORAGE, Permission.CAMERA).request(new OnPermission() {
|
||||
@Override
|
||||
public void hasPermission(List<String> granted, boolean isAll) {
|
||||
if (isAll){
|
||||
if (isAll) {
|
||||
selectImage(requestCode, max);
|
||||
}
|
||||
}
|
||||
@@ -292,14 +288,14 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
@Override
|
||||
public void noPermission(List<String> denied, boolean quick) {
|
||||
if (quick)
|
||||
new XPopup.Builder(AddDiscoveryActivity.this).asConfirm(
|
||||
"提示", "需要相册和相机权限才可以正常使用"
|
||||
, new OnConfirmListener() {
|
||||
@Override
|
||||
public void onConfirm() {
|
||||
XXPermissions.gotoPermissionSettings(AddDiscoveryActivity.this);
|
||||
}
|
||||
}).show();
|
||||
new XPopup.Builder(AddDiscoveryActivity.this).asConfirm(
|
||||
"提示", "需要相册和相机权限才可以正常使用"
|
||||
, new OnConfirmListener() {
|
||||
@Override
|
||||
public void onConfirm() {
|
||||
XXPermissions.gotoPermissionSettings(AddDiscoveryActivity.this);
|
||||
}
|
||||
}).show();
|
||||
}
|
||||
});
|
||||
// if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
|
||||
@@ -334,9 +330,11 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
|
||||
map.put("sign", Md5.md5("Goods" + "AddGoodsInfo" + Md5.secret));
|
||||
|
||||
map.put("type", type + 1 + "");
|
||||
if (additionImageWrapper.getImageList().size() < 1) {
|
||||
setToast("请添加图片或视频");
|
||||
return;
|
||||
if (type == 1) {
|
||||
if (additionImageWrapper.getImageList().size() < 1) {
|
||||
setToast("请添加图片或视频");
|
||||
return;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < additionImageWrapper.getImageList().size(); i++) {
|
||||
if (additionImageWrapper.getImageList().get(i) != null) {
|
||||
|
||||
@@ -477,6 +477,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
Intent intent = new Intent(getContext(), HistoryRecordActivity.class);
|
||||
intent.putExtra("userId", discoveryListEntity.getUserid());
|
||||
intent.putExtra("userName", discoveryListEntity.getNickname());
|
||||
intent.putExtra("title", discoveryListEntity.getNickname());
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
@@ -502,7 +503,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (!TextUtils.isEmpty(discoveryListEntity.getThumb())) {
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
imageInfo.setType(1);
|
||||
imageInfo.setBigImageUrl(discoveryListEntity.getThumb());
|
||||
@@ -797,7 +798,7 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
dis_content1.add(dis_content);
|
||||
|
||||
discoveryListEntity.setDis_content(dis_content1);
|
||||
adapter.upDateOne(position,discoveryListEntity);
|
||||
adapter.upDateOne(position, discoveryListEntity);
|
||||
// BaseRecycleViewAdapter adapter = (BaseRecycleViewAdapter) mDataBinding.recyView.getAdapter();
|
||||
// if (discoveryListEntities.get(position).getDis_content().isEmpty()) {
|
||||
// DiscoveryListEntity.Dis_content dis_content = new DiscoveryListEntity.Dis_content();
|
||||
|
||||
@@ -78,7 +78,8 @@ public class HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBindi
|
||||
// | 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
|
||||
@@ -90,8 +91,8 @@ public class HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBindi
|
||||
strings[0] = "说说";
|
||||
strings[1] = "商品";
|
||||
fragments = new ArrayList<>();
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId));
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId,0));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId,0));
|
||||
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getSupportFragmentManager());
|
||||
mDataBinding.fl.setAdapter(myViewPagerAdapter);
|
||||
mDataBinding.tb.setupWithViewPager(mDataBinding.fl);
|
||||
|
||||
@@ -9,7 +9,6 @@ import android.graphics.drawable.Drawable;
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.support.v4.app.FragmentActivity;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
@@ -74,17 +73,19 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
private String userId;
|
||||
private Loader loader;
|
||||
private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>();
|
||||
private int pageType;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
return R.layout.fragment_history_record;
|
||||
}
|
||||
|
||||
public static HistoryRecordFragment newInstance(int param1, String param2) {
|
||||
public static HistoryRecordFragment newInstance(int param1, String param2,int num) {
|
||||
HistoryRecordFragment fragment = new HistoryRecordFragment();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("param1", param1);
|
||||
args.putString("param2", param2);
|
||||
args.putInt("pageType",num);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -94,7 +95,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
super.onCreate(savedInstanceState);
|
||||
type = getArguments().getInt("param1");
|
||||
userId = getArguments().getString("param2");
|
||||
|
||||
pageType = getArguments().getInt("pageType", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -319,7 +320,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
} else if (!TextUtils.isEmpty(discoveryListEntity.getThumb())){
|
||||
ImageInfo imageInfo = new ImageInfo();
|
||||
imageInfo.setType(1);
|
||||
imageInfo.setBigImageUrl(discoveryListEntity.getThumb());
|
||||
@@ -351,7 +352,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
mDataBinding.llComment.setVisibility(View.VISIBLE);
|
||||
mDataBinding.etComment.requestFocus();
|
||||
mDataBinding.etComment.setHint("评论");
|
||||
if (getActivity() instanceof MainTabActivity){
|
||||
if (getActivity() instanceof MainTabActivity) {
|
||||
MainTabActivity activity = (MainTabActivity) getActivity();
|
||||
activity.visibilyBottom(View.GONE);
|
||||
}
|
||||
@@ -412,7 +413,9 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private int commentPosition = -1;
|
||||
|
||||
private void comment(String goodsId, final int position, String reply_id, final String content) {
|
||||
final RegisterUser user =
|
||||
Config.getInstance(getContext()).getUser();
|
||||
@@ -459,7 +462,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
dis_content1.add(dis_content);
|
||||
|
||||
discoveryListEntity.setDis_content(dis_content1);
|
||||
adapter.upDateOne(position,discoveryListEntity);
|
||||
adapter.upDateOne(position, discoveryListEntity);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -697,15 +700,21 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
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);
|
||||
if (pageType == 1) {
|
||||
mDataBinding.rl1.setVisibility(View.GONE);
|
||||
} else {
|
||||
mDataBinding.rl1.setVisibility(View.VISIBLE);
|
||||
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);
|
||||
|
||||
@@ -87,8 +87,8 @@ public class LikeFragment extends BaseFragment<FragmentLikeBinding> {
|
||||
userId = "0";
|
||||
}
|
||||
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId));
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId,1));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId,1));
|
||||
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getChildFragmentManager());
|
||||
mDataBinding.fl.setAdapter(myViewPagerAdapter);
|
||||
mDataBinding.tb.setupWithViewPager(mDataBinding.fl);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
android:id="@+id/ll_image_viewer_root"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/white"
|
||||
android:orientation="vertical">
|
||||
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/rl1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
@@ -42,15 +43,23 @@
|
||||
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"
|
||||
<FrameLayout
|
||||
android:layout_below="@id/v"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginTop="-30dp"
|
||||
android:layout_marginRight="16dp" />
|
||||
android:layout_marginRight="16dp"
|
||||
android:layout_width="wrap_content"
|
||||
android:background="@color/white"
|
||||
android:layout_height="wrap_content">
|
||||
<ImageView
|
||||
android:layout_margin="1dp"
|
||||
android:id="@+id/head"
|
||||
android:layout_width="59dp"
|
||||
android:layout_height="59dp"
|
||||
|
||||
/>
|
||||
</FrameLayout>
|
||||
|
||||
</RelativeLayout>
|
||||
|
||||
<RelativeLayout
|
||||
|
||||
@@ -14,28 +14,29 @@
|
||||
android:layout_marginTop="@dimen/mystatusbar"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<ImageView
|
||||
android:visibility="gone"
|
||||
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:paddingBottom="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="5dp"
|
||||
android:src="@mipmap/fanhui" />
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tb"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center_horizontal" />
|
||||
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:background="@color/white"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
app:tabIndicatorColor="#FE5200"
|
||||
app:tabSelectedTextColor="#FE5200"
|
||||
app:tabIndicatorFullWidth="false"
|
||||
app:tabTextColor="#000"
|
||||
android:gravity="center_horizontal" />
|
||||
<android.support.v4.view.ViewPager
|
||||
android:id="@+id/fl"
|
||||
android:layout_width="match_parent"
|
||||
|
||||
@@ -18,25 +18,39 @@
|
||||
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:paddingBottom="5dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_centerVertical="true"
|
||||
android:paddingRight="5dp"
|
||||
android:paddingBottom="5dp"
|
||||
android:src="@mipmap/fanhui" />
|
||||
|
||||
<android.support.design.widget.TabLayout
|
||||
android:id="@+id/tb"
|
||||
android:layout_width="wrap_content"
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_centerHorizontal="true"
|
||||
android:gravity="center_horizontal" />
|
||||
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: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"
|
||||
|
||||
Reference in New Issue
Block a user