This commit is contained in:
jinyuer
2021-02-01 16:02:15 +08:00
parent 40af0a3aa4
commit 3642d5ade3
12 changed files with 168 additions and 22 deletions

View File

@@ -363,6 +363,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
intent.putExtra("userId", user.getUserid()); intent.putExtra("userId", user.getUserid());
intent.putExtra("userName", user.getNickname()); intent.putExtra("userName", user.getNickname());
intent.putExtra("title", "物业服务"); intent.putExtra("title", "物业服务");
intent.putExtra("dataType",1);
startActivity(intent); startActivity(intent);
} }
}); });
@@ -627,6 +628,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
@Override @Override
public void onClick(final View v) { public void onClick(final View v) {
final CommentDialog commentDialog = new CommentDialog(baseActivity); final CommentDialog commentDialog = new CommentDialog(baseActivity);
commentDialog.setShowBug(discoveryListEntity.getType() == 2); commentDialog.setShowBug(discoveryListEntity.getType() == 2);
commentDialog.setPraise(discoveryListEntity.getIs_like() == 1); commentDialog.setPraise(discoveryListEntity.getIs_like() == 1);
final int mBottomY = getCoordinateY(homeGridAdapterItemBinding.ivComment) + homeGridAdapterItemBinding.ivComment.getHeight(); final int mBottomY = getCoordinateY(homeGridAdapterItemBinding.ivComment) + homeGridAdapterItemBinding.ivComment.getHeight();
@@ -669,6 +671,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
} }
} }
}); });
new XPopup.Builder(baseActivity).hasShadowBg(false).atView(homeGridAdapterItemBinding.ivComment).asCustom(commentDialog) new XPopup.Builder(baseActivity).hasShadowBg(false).atView(homeGridAdapterItemBinding.ivComment).asCustom(commentDialog)
.show(); .show();
@@ -742,6 +745,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
intent.putExtra("userId", discoveryListEntity.getUserid()); intent.putExtra("userId", discoveryListEntity.getUserid());
intent.putExtra("userName", discoveryListEntity.getNickname()); intent.putExtra("userName", discoveryListEntity.getNickname());
intent.putExtra("title", discoveryListEntity.getNickname()); intent.putExtra("title", discoveryListEntity.getNickname());
startActivity(intent); startActivity(intent);
} }
}); });

View File

@@ -0,0 +1,55 @@
package com.sl.house_property.discovery;
import android.content.Context;
import android.support.annotation.NonNull;
import android.view.View;
import com.lxj.xpopup.core.BottomPopupView;
import com.lxj.xpopup.interfaces.OnSelectListener;
import com.sl.house_property.R;
public class CreateTypeSelectDialog extends BottomPopupView {
private OnSelectListener onSelectListener;
public CreateTypeSelectDialog(@NonNull Context context) {
super(context);
}
@Override
protected int getImplLayoutId() {
return R.layout.dialog_select_create_type;
}
@Override
protected void onCreate() {
super.onCreate();
findViewById(R.id.btn_1).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
if (onSelectListener != null) {
onSelectListener.onSelect(1, "发布商品");
dismiss();
}
}
});
findViewById(R.id.btn_2).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
onSelectListener.onSelect(0, "发布说说");
dismiss();
}
});
findViewById(R.id.btn_cancel).setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dismiss();
}
});
}
public void setOnSelectListener(OnSelectListener onSelectListener) {
this.onSelectListener = onSelectListener;
}
}

View File

@@ -113,14 +113,24 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
mDataBinding.ivAdd.setOnClickListener(new View.OnClickListener() { mDataBinding.ivAdd.setOnClickListener(new View.OnClickListener() {
@Override @Override
public void onClick(View v) { public void onClick(View v) {
new XPopup.Builder(activity).atView(mDataBinding.ivAdd).asAttachList(data, null, new OnSelectListener() { // new XPopup.Builder(activity).atView(mDataBinding.ivAdd).asAttachList(data, null, new OnSelectListener() {
// @Override
// public void onSelect(int position, String text) {
// Intent intent = new Intent(getContext(), AddDiscoveryActivity.class);
// intent.putExtra("type", position);
// startActivityForResult(intent, 14);
// }
// }).show();
CreateTypeSelectDialog createTypeSelectDialog = new CreateTypeSelectDialog(activity);
createTypeSelectDialog.setOnSelectListener(new OnSelectListener() {
@Override @Override
public void onSelect(int position, String text) { public void onSelect(int position, String text) {
Intent intent = new Intent(getContext(), AddDiscoveryActivity.class); Intent intent = new Intent(getContext(), AddDiscoveryActivity.class);
intent.putExtra("type", position); intent.putExtra("type", position);
startActivityForResult(intent, 14); startActivityForResult(intent, 14);
} }
}).show(); });
new XPopup.Builder(activity).asCustom(createTypeSelectDialog).show();
} }
}); });

View File

@@ -91,8 +91,9 @@ public class HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBindi
strings[0] = "说说"; strings[0] = "说说";
strings[1] = "商品"; strings[1] = "商品";
fragments = new ArrayList<>(); fragments = new ArrayList<>();
fragments.add(HistoryRecordFragment.newInstance(1, userId,0));
fragments.add(HistoryRecordFragment.newInstance(2, userId,0)); 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()); MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getSupportFragmentManager());
mDataBinding.fl.setAdapter(myViewPagerAdapter); mDataBinding.fl.setAdapter(myViewPagerAdapter);
mDataBinding.tb.setupWithViewPager(mDataBinding.fl); mDataBinding.tb.setupWithViewPager(mDataBinding.fl);

View File

@@ -73,19 +73,20 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
private String userId; private String userId;
private Loader loader; private Loader loader;
private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>(); private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>();
private int pageType; private int num;
@Override @Override
protected int getLayoutId() { protected int getLayoutId() {
return R.layout.fragment_history_record; return R.layout.fragment_history_record;
} }
public static HistoryRecordFragment newInstance(int param1, String param2,int num) { public static HistoryRecordFragment newInstance(int param1, String param2, int i, int num) {
HistoryRecordFragment fragment = new HistoryRecordFragment(); HistoryRecordFragment fragment = new HistoryRecordFragment();
Bundle args = new Bundle(); Bundle args = new Bundle();
args.putInt("param1", param1); args.putInt("param1", param1);
args.putString("param2", param2); args.putString("param2", param2);
args.putInt("pageType",num); args.putInt("num",i);
args.putInt("dataType",num);
fragment.setArguments(args); fragment.setArguments(args);
return fragment; return fragment;
} }
@@ -95,7 +96,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
type = getArguments().getInt("param1"); type = getArguments().getInt("param1");
userId = getArguments().getString("param2"); userId = getArguments().getString("param2");
pageType = getArguments().getInt("pageType", 0); num = getArguments().getInt("num", 0);
} }
@Override @Override
@@ -245,7 +246,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
homeGridAdapterItemBinding.tvLike.setVisibility(View.VISIBLE); homeGridAdapterItemBinding.tvLike.setVisibility(View.VISIBLE);
StringBuilder likeString = new StringBuilder(); StringBuilder likeString = new StringBuilder();
for (int i = 0; i < discoveryListEntity.getLike().size(); i++) { for (int i = 0; i < discoveryListEntity.getLike().size(); i++) {
if (i != 0 && i != discoveryListEntity.getLike().size() - 1) { if (i != 0 ) {
likeString.append(","); likeString.append(",");
} }
likeString.append(discoveryListEntity.getLike().get(i).getNickname()); likeString.append(discoveryListEntity.getLike().get(i).getNickname());
@@ -677,9 +678,16 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
map.put("userid", userId); map.put("userid", userId);
map.put("type", type + ""); map.put("type", type + "");
map.put("app", "Goods"); map.put("app", "Goods");
map.put("class", "MyGoodsLists"); if (getArguments().getInt("dataType")==1){
map.put("class", "WyGoodsLists");
map.put("sign", Md5.md5("Goods" + "WyGoodsLists" + Md5.secret));
}else {
map.put("class", "MyGoodsLists");
map.put("sign", Md5.md5("Goods" + "MyGoodsLists" + Md5.secret));
}
map.put("page", page + ""); map.put("page", page + "");
map.put("sign", Md5.md5("Goods" + "MyGoodsLists" + Md5.secret));
// map.put("sign", Md5.md5("Goods" + "MyGoodsLists" + Md5.secret));
Subscription subscribe = loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() { Subscription subscribe = loader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
@Override @Override
public void call(Resultcode resultcode) { public void call(Resultcode resultcode) {
@@ -700,12 +708,13 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() { Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() {
}.getType(); }.getType();
if (page == 1) { if (page == 1) {
if (pageType == 1) { if (num == 1) {
mDataBinding.rl1.setVisibility(View.GONE); mDataBinding.rl1.setVisibility(View.GONE);
} else { } else {
mDataBinding.rl1.setVisibility(View.VISIBLE); mDataBinding.rl1.setVisibility(View.VISIBLE);
String fengmian = jsonObject.getString("fengmian"); String fengmian = jsonObject.getString("fengmian");
String avatar = jsonObject.getString("avatar"); String avatar = jsonObject.getString("avatar");
Picasso.with(context).load(fengmian) Picasso.with(context).load(fengmian)
.placeholder(R.mipmap.icon_default_rectangle) .placeholder(R.mipmap.icon_default_rectangle)
.into(target); .into(target);

View File

@@ -87,8 +87,8 @@ public class LikeFragment extends BaseFragment<FragmentLikeBinding> {
userId = "0"; userId = "0";
} }
fragments.add(HistoryRecordFragment.newInstance(1, userId,1)); fragments.add(HistoryRecordFragment.newInstance(1, userId, 0, 0));
fragments.add(HistoryRecordFragment.newInstance(2, userId,1)); fragments.add(HistoryRecordFragment.newInstance(2, userId, 0, 0));
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getChildFragmentManager()); MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getChildFragmentManager());
mDataBinding.fl.setAdapter(myViewPagerAdapter); mDataBinding.fl.setAdapter(myViewPagerAdapter);
mDataBinding.tb.setupWithViewPager(mDataBinding.fl); mDataBinding.tb.setupWithViewPager(mDataBinding.fl);

View File

@@ -1,6 +1,7 @@
package my_view; package my_view;
import android.content.Context; import android.content.Context;
import android.graphics.drawable.Drawable;
import android.support.annotation.NonNull; import android.support.annotation.NonNull;
import android.view.View; import android.view.View;
import android.widget.TextView; import android.widget.TextView;
@@ -65,7 +66,6 @@ public class CommentDialog extends HorizontalAttachPopupView {
@Override @Override
protected void onCreate() { protected void onCreate() {
super.onCreate(); super.onCreate();
} }
public void setShowBug(boolean type) { public void setShowBug(boolean type) {
@@ -91,6 +91,11 @@ public class CommentDialog extends HorizontalAttachPopupView {
} }
} }
@Override
protected Drawable getPopupBackground() {
return getResources().getDrawable(R.drawable.round_blank);
}
public void setOnCommentOperateListener(OnCommentOperateListener li) { public void setOnCommentOperateListener(OnCommentOperateListener li) {
listener = li; listener = li;
} }

View File

@@ -1,6 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"> <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"
<corners android:radius="8dp" /> >
<corners android:radius="8dp"/>
<solid android:color="#95000000"/> <solid android:color="#95000000"/>
<stroke android:color="@color/transparent" />
</shape> </shape>

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<corners android:radius="8dp" />
<solid android:color="#ffffff"/>
</shape>

View File

@@ -2,7 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:background="#4D4B4C"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView <TextView
@@ -20,7 +20,7 @@
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:text="赞" android:text="赞"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="14sp" />
<View <View
android:layout_width="0.5dp" android:layout_width="0.5dp"
@@ -43,7 +43,7 @@
android:paddingBottom="5dp" android:paddingBottom="5dp"
android:text="评论" android:text="评论"
android:textColor="@color/white" android:textColor="@color/white"
android:textSize="16sp" /> android:textSize="14sp" />
<View <View
android:id="@+id/v" android:id="@+id/v"

View File

@@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="8dp"
android:background="@null"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:background="@drawable/round_white"
android:layout_height="wrap_content">
<Button
android:id="@+id/btn_1"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingBottom="5dp"
android:text="发布商品"
android:textAllCaps="false"
android:textSize="16sp" />
<View
android:layout_width="match_parent"
android:layout_height="0.5dip"
android:background="@color/LightGray" />
<Button
android:id="@+id/btn_2"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:paddingBottom="5dp"
android:text="发布说说"
android:textAllCaps="false"
android:textSize="16sp" />
</LinearLayout>
<Button
android:id="@+id/btn_cancel"
style="?android:attr/borderlessButtonStyle"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginTop="15dp"
android:background="@drawable/round_white"
android:paddingTop="5dp"
android:paddingBottom="5dp"
android:text="取消"
android:textAllCaps="false"
android:textSize="16sp" />
</LinearLayout>

View File

@@ -34,7 +34,6 @@
<!-- <style name="MyTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen">--> <!-- <style name="MyTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen">-->
<item name="android:windowBackground">@android:color/transparent</item> <item name="android:windowBackground">@android:color/transparent</item>
<item name="android:colorBackgroundCacheHint">@null</item> <item name="android:colorBackgroundCacheHint">@null</item>
<item name="android:windowIsTranslucent">true</item> <item name="android:windowIsTranslucent">true</item>
</style> </style>
<style name="TAppTheme" parent="Theme.AppCompat.Light.NoActionBar"> <style name="TAppTheme" parent="Theme.AppCompat.Light.NoActionBar">