1
This commit is contained in:
@@ -363,6 +363,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
intent.putExtra("userId", user.getUserid());
|
||||
intent.putExtra("userName", user.getNickname());
|
||||
intent.putExtra("title", "物业服务");
|
||||
intent.putExtra("dataType",1);
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
@@ -627,6 +628,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
@Override
|
||||
public void onClick(final View v) {
|
||||
final CommentDialog commentDialog = new CommentDialog(baseActivity);
|
||||
|
||||
commentDialog.setShowBug(discoveryListEntity.getType() == 2);
|
||||
commentDialog.setPraise(discoveryListEntity.getIs_like() == 1);
|
||||
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)
|
||||
.show();
|
||||
|
||||
@@ -742,6 +745,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
intent.putExtra("userId", discoveryListEntity.getUserid());
|
||||
intent.putExtra("userName", discoveryListEntity.getNickname());
|
||||
intent.putExtra("title", discoveryListEntity.getNickname());
|
||||
|
||||
startActivity(intent);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -113,14 +113,24 @@ public class DiscoveryFragment extends BaseFragment<FragmentDiscoveryBinding> im
|
||||
mDataBinding.ivAdd.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
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
|
||||
public void onSelect(int position, String text) {
|
||||
Intent intent = new Intent(getContext(), AddDiscoveryActivity.class);
|
||||
intent.putExtra("type", position);
|
||||
startActivityForResult(intent, 14);
|
||||
}
|
||||
}).show();
|
||||
});
|
||||
new XPopup.Builder(activity).asCustom(createTypeSelectDialog).show();
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
@@ -91,8 +91,9 @@ public class HistoryRecordActivity extends BaseActivity<LayoutHistoryRecordBindi
|
||||
strings[0] = "说说";
|
||||
strings[1] = "商品";
|
||||
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());
|
||||
mDataBinding.fl.setAdapter(myViewPagerAdapter);
|
||||
mDataBinding.tb.setupWithViewPager(mDataBinding.fl);
|
||||
|
||||
@@ -73,19 +73,20 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
private String userId;
|
||||
private Loader loader;
|
||||
private ArrayList<DiscoveryListEntity> discoveryListEntities = new ArrayList<>();
|
||||
private int pageType;
|
||||
private int num;
|
||||
|
||||
@Override
|
||||
protected int getLayoutId() {
|
||||
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();
|
||||
Bundle args = new Bundle();
|
||||
args.putInt("param1", param1);
|
||||
args.putString("param2", param2);
|
||||
args.putInt("pageType",num);
|
||||
args.putInt("num",i);
|
||||
args.putInt("dataType",num);
|
||||
fragment.setArguments(args);
|
||||
return fragment;
|
||||
}
|
||||
@@ -95,7 +96,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
super.onCreate(savedInstanceState);
|
||||
type = getArguments().getInt("param1");
|
||||
userId = getArguments().getString("param2");
|
||||
pageType = getArguments().getInt("pageType", 0);
|
||||
num = getArguments().getInt("num", 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -245,7 +246,7 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
homeGridAdapterItemBinding.tvLike.setVisibility(View.VISIBLE);
|
||||
StringBuilder likeString = new StringBuilder();
|
||||
for (int i = 0; i < discoveryListEntity.getLike().size(); i++) {
|
||||
if (i != 0 && i != discoveryListEntity.getLike().size() - 1) {
|
||||
if (i != 0 ) {
|
||||
likeString.append(",");
|
||||
}
|
||||
likeString.append(discoveryListEntity.getLike().get(i).getNickname());
|
||||
@@ -677,9 +678,16 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
map.put("userid", userId);
|
||||
map.put("type", type + "");
|
||||
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("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>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
@@ -700,12 +708,13 @@ public class HistoryRecordFragment extends BaseFragment<FragmentHistoryRecordBin
|
||||
Type type = new TypeToken<ArrayList<DiscoveryListEntity>>() {
|
||||
}.getType();
|
||||
if (page == 1) {
|
||||
if (pageType == 1) {
|
||||
if (num == 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);
|
||||
|
||||
@@ -87,8 +87,8 @@ public class LikeFragment extends BaseFragment<FragmentLikeBinding> {
|
||||
userId = "0";
|
||||
}
|
||||
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId,1));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId,1));
|
||||
fragments.add(HistoryRecordFragment.newInstance(1, userId, 0, 0));
|
||||
fragments.add(HistoryRecordFragment.newInstance(2, userId, 0, 0));
|
||||
MyViewPagerAdapter myViewPagerAdapter = new MyViewPagerAdapter(getChildFragmentManager());
|
||||
mDataBinding.fl.setAdapter(myViewPagerAdapter);
|
||||
mDataBinding.tb.setupWithViewPager(mDataBinding.fl);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package my_view;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.widget.TextView;
|
||||
@@ -65,7 +66,6 @@ public class CommentDialog extends HorizontalAttachPopupView {
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
|
||||
}
|
||||
|
||||
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) {
|
||||
listener = li;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<corners android:radius="8dp" />
|
||||
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:shape="rectangle"
|
||||
>
|
||||
<corners android:radius="8dp"/>
|
||||
<solid android:color="#95000000"/>
|
||||
<stroke android:color="@color/transparent" />
|
||||
</shape>
|
||||
6
app/src/main/res/drawable/round_white.xml
Normal file
6
app/src/main/res/drawable/round_white.xml
Normal 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>
|
||||
@@ -2,7 +2,7 @@
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="#4D4B4C"
|
||||
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
@@ -20,7 +20,7 @@
|
||||
android:paddingBottom="5dp"
|
||||
android:text="赞"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
@@ -43,7 +43,7 @@
|
||||
android:paddingBottom="5dp"
|
||||
android:text="评论"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="16sp" />
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:id="@+id/v"
|
||||
|
||||
55
app/src/main/res/layout/dialog_select_create_type.xml
Normal file
55
app/src/main/res/layout/dialog_select_create_type.xml
Normal 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>
|
||||
@@ -34,7 +34,6 @@
|
||||
<!-- <style name="MyTheme" parent="@android:style/Theme.Black.NoTitleBar.Fullscreen">-->
|
||||
<item name="android:windowBackground">@android:color/transparent</item>
|
||||
<item name="android:colorBackgroundCacheHint">@null</item>
|
||||
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
</style>
|
||||
<style name="TAppTheme" parent="Theme.AppCompat.Light.NoActionBar">
|
||||
|
||||
Reference in New Issue
Block a user