This commit is contained in:
jinyuer
2021-01-28 10:19:14 +08:00
parent 0ee1f2589f
commit 6d89086472
10 changed files with 110 additions and 74 deletions

View File

@@ -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());

View File

@@ -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;
@@ -334,10 +330,12 @@ public class AddDiscoveryActivity extends BaseActivity<ActivityAddDiscoveryBindi
map.put("sign", Md5.md5("Goods" + "AddGoodsInfo" + Md5.secret));
map.put("type", type + 1 + "");
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) {
map.put("pic" + i, additionImageWrapper.getImageList().get(i));

View File

@@ -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());

View File

@@ -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);

View File

@@ -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());
@@ -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();
@@ -697,6 +700,10 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() {
}.getType();
if (page == 1) {
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)
@@ -706,6 +713,8 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
.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);

View File

@@ -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);

View File

@@ -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">

View File

@@ -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

View File

@@ -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" />
<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:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_centerHorizontal="true"
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" />
</RelativeLayout>
<android.support.v4.view.ViewPager
android:id="@+id/fl"
android:layout_width="match_parent"

View File

@@ -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"