2020-08-03 09:11:54 +08:00
|
|
|
package com.sl.house_property;
|
|
|
|
|
|
|
|
|
|
import android.content.Context;
|
|
|
|
|
import android.content.Intent;
|
|
|
|
|
import android.net.Uri;
|
|
|
|
|
import android.os.Bundle;
|
|
|
|
|
import android.support.v4.app.Fragment;
|
|
|
|
|
import android.util.DisplayMetrics;
|
|
|
|
|
import android.view.LayoutInflater;
|
|
|
|
|
import android.view.View;
|
|
|
|
|
import android.widget.ImageView;
|
|
|
|
|
import android.widget.LinearLayout;
|
|
|
|
|
import android.widget.RelativeLayout;
|
|
|
|
|
|
|
|
|
|
import com.cutil.SizeUtils;
|
|
|
|
|
import com.cutil.StringUtils;
|
2020-08-21 13:39:24 +08:00
|
|
|
import com.sl.house_property.cart.AddressListActivity;
|
|
|
|
|
import com.sl.house_property.databinding.FragmentMain4Binding;
|
2020-08-03 09:11:54 +08:00
|
|
|
import com.sl.house_property.f1.UserdlistActivity;
|
2020-08-27 15:34:03 +08:00
|
|
|
import com.sl.house_property.order.OrderActivity;
|
2020-08-03 09:11:54 +08:00
|
|
|
import com.sl.house_property.user.MyAuthorizedFamilyHistory;
|
|
|
|
|
import com.sl.house_property.user.MyBillHistory;
|
|
|
|
|
import com.sl.house_property.user.MyGuaranteeHistory;
|
|
|
|
|
import com.sl.house_property.user.MyKeyManagement;
|
|
|
|
|
import com.sl.house_property.user.MyMarketShopActivity;
|
|
|
|
|
import com.sl.house_property.user.MyPropertyActivity;
|
|
|
|
|
import com.sl.house_property.user.MyServiceHistory;
|
|
|
|
|
import com.sl.house_property.user.MyUserMessage;
|
|
|
|
|
import com.sl.house_property.user.MyWalletActivity;
|
|
|
|
|
import com.squareup.picasso.Picasso;
|
|
|
|
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
|
|
|
|
|
|
import adapter.BaseRecycleViewAdapter;
|
|
|
|
|
import entity.MyUserFEntity;
|
|
|
|
|
import entity.RegisterUser;
|
|
|
|
|
import tools.Config;
|
|
|
|
|
import utils.BitmapTools;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* A simple {@link Fragment} subclass.
|
|
|
|
|
* Activities that contain this fragment must implement the
|
|
|
|
|
* {@link Main1Fragment.OnFragmentInteractionListener} interface
|
|
|
|
|
* to handle interaction events.
|
|
|
|
|
* Use the {@link Main1Fragment#newInstance} factory method to
|
|
|
|
|
* create an instance of this fragment.
|
|
|
|
|
*/
|
2020-08-21 13:39:24 +08:00
|
|
|
public class Main4Fragment extends BaseFragment<FragmentMain4Binding> {
|
2020-08-03 09:11:54 +08:00
|
|
|
// TODO: Rename parameter arguments, choose names that match
|
|
|
|
|
// the fragment initialization parameters, e.g. ARG_ITEM_NUMBER
|
|
|
|
|
private static final String ARG_PARAM1 = "param1";
|
|
|
|
|
private static final String ARG_PARAM2 = "param2";
|
|
|
|
|
private String otherphoto = "otherphoto.jpg";
|
|
|
|
|
private ArrayList<String> deletePath = new ArrayList<String>();
|
|
|
|
|
// TODO: Rename and change types of parameters
|
|
|
|
|
private String mParam1;
|
|
|
|
|
private String mParam2;
|
2020-08-21 13:39:24 +08:00
|
|
|
private int userImgeREQUST = 10000;
|
2020-08-03 09:11:54 +08:00
|
|
|
private OnFragmentInteractionListener mListener;
|
|
|
|
|
private boolean istakepic;
|
|
|
|
|
private ArrayList<MyUserFEntity> myUserFEntities;
|
|
|
|
|
private BaseRecycleViewAdapter baseRecycleViewAdapter;
|
|
|
|
|
private ImageView userImageView;
|
|
|
|
|
|
|
|
|
|
public Main4Fragment() {
|
|
|
|
|
// Required empty public constructor
|
|
|
|
|
}
|
2020-08-21 13:39:24 +08:00
|
|
|
|
2020-08-03 09:11:54 +08:00
|
|
|
@Override
|
|
|
|
|
protected void onCreateVew(LayoutInflater inflater, Bundle savedInstanceState) {
|
|
|
|
|
super.onCreateVew(inflater, savedInstanceState);
|
|
|
|
|
mDataBinding.setting.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
2020-08-21 13:39:24 +08:00
|
|
|
Intent intent = new Intent(getActivity(), SettingActivity.class);
|
|
|
|
|
startActivity(intent);
|
2020-08-03 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
//mDataBinding.myRecyView;
|
|
|
|
|
mDataBinding.userImage.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
2020-09-18 09:14:08 +08:00
|
|
|
Intent intent = new Intent(getActivity(), MyUserMessage.class);
|
|
|
|
|
intent.putExtra("usertitile", "个人信息");
|
|
|
|
|
startActivityForResult(intent, 0);
|
2020-08-03 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
initTopView();
|
2020-08-21 13:39:24 +08:00
|
|
|
// initMyReycyView();
|
2020-08-03 09:11:54 +08:00
|
|
|
initData();
|
2020-08-21 13:39:24 +08:00
|
|
|
// mDataBinding.usermale;
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* toolbar.set*/
|
|
|
|
|
/*baseActivity.setAbr(getString(R.string.news4), new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, R.mipmap.shezhi, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, 0, null, R.mipmap.head);
|
|
|
|
|
*/
|
2020-08-21 13:39:24 +08:00
|
|
|
// int height= MyPhoneValue.getStatusBarHeight(getActivity());
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* mDataBinding.myhistory.setOnClickListener(this);
|
|
|
|
|
mDataBinding.mynew.setOnClickListener(this);
|
|
|
|
|
mDataBinding.myqrrel.setOnClickListener(this);*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
2020-08-21 13:39:24 +08:00
|
|
|
*
|
|
|
|
|
* 初始化顶部view
|
|
|
|
|
* */
|
|
|
|
|
private void initTopView() {
|
2020-08-03 09:11:54 +08:00
|
|
|
DisplayMetrics dm = getResources().getDisplayMetrics();
|
|
|
|
|
View topView = mDataBinding.topView;
|
|
|
|
|
LinearLayout.LayoutParams topViewLp = (LinearLayout.LayoutParams) topView.getLayoutParams();
|
|
|
|
|
topViewLp.width = dm.widthPixels;
|
2020-08-21 13:39:24 +08:00
|
|
|
topViewLp.height = topViewLp.width * 152 / 375;
|
2020-08-03 09:11:54 +08:00
|
|
|
topView.setLayoutParams(topViewLp);
|
|
|
|
|
|
|
|
|
|
View userView = mDataBinding.userLayout;
|
|
|
|
|
RelativeLayout.LayoutParams userViewLp = (RelativeLayout.LayoutParams) userView.getLayoutParams();
|
|
|
|
|
userViewLp.width = dm.widthPixels;
|
|
|
|
|
userViewLp.height = topViewLp.height - SizeUtils.dp2px(28);
|
|
|
|
|
|
|
|
|
|
userView.setLayoutParams(userViewLp);
|
|
|
|
|
|
|
|
|
|
userImageView = mDataBinding.userImage;
|
|
|
|
|
RelativeLayout.LayoutParams userImageLP = (RelativeLayout.LayoutParams) userImageView.getLayoutParams();
|
2020-08-21 13:39:24 +08:00
|
|
|
int userImageHeight = (int) (userViewLp.height * 0.7);
|
2020-08-03 09:11:54 +08:00
|
|
|
userImageLP.height = userImageHeight;
|
|
|
|
|
userImageLP.width = userImageHeight;
|
|
|
|
|
userImageView.setLayoutParams(userImageLP);
|
2020-08-21 13:39:24 +08:00
|
|
|
mDataBinding.llQianbao.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), MyWalletActivity.class);
|
|
|
|
|
intent.putExtra("usertitile", "我的钱包");
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.llShouquan.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(),MyAuthorizedFamilyHistory.class);
|
|
|
|
|
intent.putExtra("usertitile", "授权家庭");
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.llFangchan.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), MyPropertyActivity.class);
|
|
|
|
|
intent.putExtra("usertitile", "我的房产");
|
|
|
|
|
startActivityForResult(intent, 0);
|
2020-08-03 09:11:54 +08:00
|
|
|
|
2020-08-21 13:39:24 +08:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.llYaoshi.setOnClickListener(new View.OnClickListener() {
|
2020-08-03 09:11:54 +08:00
|
|
|
@Override
|
2020-08-21 13:39:24 +08:00
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), MyKeyManagement.class);
|
|
|
|
|
intent.putExtra("usertitile", "钥匙管理");
|
|
|
|
|
startActivityForResult(intent, 0);
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-10-13 15:29:40 +08:00
|
|
|
mDataBinding.llRenxiang.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
//弹出激活对话框
|
|
|
|
|
new DialogHelptwo().showDownloadDialog(getActivity(), "", "","确认", new DialogHelptwo.ClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void confirm() {
|
|
|
|
|
Intent intent = new Intent(getActivity(), MyPropertyActivity.class);
|
|
|
|
|
intent.putExtra("usertitile", "我的房产");
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void cancle() {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-08-03 09:11:54 +08:00
|
|
|
|
2020-09-22 16:41:50 +08:00
|
|
|
// mDataBinding.llGeren.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onClick(View v) {
|
|
|
|
|
// Intent intent = new Intent(getActivity(), MyUserMessage.class);
|
|
|
|
|
// intent.putExtra("usertitile", "个人信息");
|
|
|
|
|
// startActivityForResult(intent, 0);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
2020-08-21 13:39:24 +08:00
|
|
|
mDataBinding.llShouhuo.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), AddressListActivity.class);
|
|
|
|
|
intent.putExtra("usertitile", "收货地址");
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-08-27 15:34:03 +08:00
|
|
|
mDataBinding.tvOrder1.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 1);
|
|
|
|
|
intent.putExtra("orderType", 1);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.tvOrder2.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 1);
|
|
|
|
|
intent.putExtra("orderType", 2);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.tvOrder3.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 1);
|
|
|
|
|
intent.putExtra("orderType", 3);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-09-15 10:18:52 +08:00
|
|
|
mDataBinding.tvOrder7.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 1);
|
|
|
|
|
intent.putExtra("orderType", 4);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-08-27 15:34:03 +08:00
|
|
|
mDataBinding.tvOrder4.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 2);
|
|
|
|
|
intent.putExtra("orderType", 1);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.tvOrder5.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 2);
|
|
|
|
|
intent.putExtra("orderType", 2);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
mDataBinding.tvOrder6.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 2);
|
|
|
|
|
intent.putExtra("orderType", 3);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-09-15 10:18:52 +08:00
|
|
|
mDataBinding.tvOrder8.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View v) {
|
|
|
|
|
Intent intent = new Intent(getActivity(), OrderActivity.class);
|
|
|
|
|
intent.putExtra("type", 2);
|
|
|
|
|
intent.putExtra("orderType", 4);
|
|
|
|
|
startActivityForResult(intent, 0);
|
|
|
|
|
}
|
|
|
|
|
});
|
2020-08-03 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
|
2020-08-21 13:39:24 +08:00
|
|
|
// private void initMyReycyView() {
|
|
|
|
|
// myUserFEntities=getMyActivityList();
|
|
|
|
|
//
|
|
|
|
|
// FullyGridLayoutManager mgr = new FullyGridLayoutManager(getActivity(),1);
|
|
|
|
|
// mgr.setOrientation(FullyGridLayoutManager.VERTICAL);
|
|
|
|
|
// mgr.setSmoothScrollbarEnabled(true);
|
|
|
|
|
// mDataBinding.myRecyView.setLayoutManager(mgr);
|
|
|
|
|
//
|
|
|
|
|
// baseRecycleViewAdapter=new BaseRecycleViewAdapter(getActivity(),R.layout.user_fragment_item);
|
|
|
|
|
//
|
|
|
|
|
// baseRecycleViewAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onBindViewHolder(Object b, final int position) {
|
|
|
|
|
// if(!(position>=myUserFEntities.size())) {
|
|
|
|
|
// UserFragmentItemBinding homeGridAdapterItemBinding = (UserFragmentItemBinding) b;
|
|
|
|
|
// homeGridAdapterItemBinding.setMyentity(myUserFEntities.get(position));
|
|
|
|
|
// homeGridAdapterItemBinding.imageViewlogo.setImageResource(myUserFEntities.get(position).getImagetResource());homeGridAdapterItemBinding.userFragmentItem.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
// @Override
|
|
|
|
|
// public void onClick(View view) {
|
|
|
|
|
// Intent intent = new Intent(getActivity(), myUserFEntities.get(position).getMyclazz());
|
|
|
|
|
// intent.putExtra("usertitile", myUserFEntities.get(position).getTitile());
|
|
|
|
|
// startActivityForResult(intent,0);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
//
|
|
|
|
|
// mDataBinding.myRecyView.setAdapter(baseRecycleViewAdapter);
|
|
|
|
|
// baseRecycleViewAdapter.setData(myUserFEntities);
|
|
|
|
|
//
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
public void refreshData() {
|
2020-08-03 09:11:54 +08:00
|
|
|
initTopView();
|
2020-08-21 13:39:24 +08:00
|
|
|
// initMyReycyView();
|
2020-08-03 09:11:54 +08:00
|
|
|
initData();
|
|
|
|
|
}
|
2020-08-21 13:39:24 +08:00
|
|
|
|
2020-08-03 09:11:54 +08:00
|
|
|
/*
|
2020-08-21 13:39:24 +08:00
|
|
|
* 初始化数据
|
|
|
|
|
* */
|
|
|
|
|
private void initData() {
|
|
|
|
|
RegisterUser user = Config.getInstance(getActivity()).getUser();
|
2020-08-03 09:11:54 +08:00
|
|
|
mDataBinding.username.setText(user.getNickname());
|
2020-08-21 13:39:24 +08:00
|
|
|
if (StringUtils.isEmpty(user.getAvatar())) {
|
2020-08-03 09:11:54 +08:00
|
|
|
Picasso.with(getActivity()).load(R.mipmap.head).error(R.mipmap.head).placeholder(R.mipmap.head).into(mDataBinding.userImage);
|
2020-08-21 13:39:24 +08:00
|
|
|
} else {
|
2020-08-03 09:11:54 +08:00
|
|
|
Picasso.with(getActivity()).load(user.getAvatar()).error(R.mipmap.head).placeholder(R.mipmap.head).into(mDataBinding.userImage);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
String gender = user.getGender();
|
2020-08-21 13:39:24 +08:00
|
|
|
if (gender.equals("0")) {
|
2020-08-03 09:11:54 +08:00
|
|
|
Picasso.with(getActivity()).load(R.mipmap.icon_secret).into(mDataBinding.usermale);
|
2020-08-21 13:39:24 +08:00
|
|
|
} else if (gender.equals("1")) {
|
2020-08-03 09:11:54 +08:00
|
|
|
Picasso.with(getActivity()).load(R.mipmap.boy).into(mDataBinding.usermale);
|
2020-08-21 13:39:24 +08:00
|
|
|
} else if (gender.equals("2")) {
|
2020-08-03 09:11:54 +08:00
|
|
|
Picasso.with(getActivity()).load(R.mipmap.lady).into(mDataBinding.usermale);
|
2020-08-21 13:39:24 +08:00
|
|
|
} else {
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Use this factory method to create a new instance of
|
|
|
|
|
* this fragment using the provided parameters.
|
|
|
|
|
*
|
|
|
|
|
* @param param1 Parameter 1.
|
|
|
|
|
* @param param2 Parameter 2.
|
|
|
|
|
* @return A new instance of fragment Main1Fragment.
|
|
|
|
|
*/
|
|
|
|
|
// TODO: Rename and change types and number of parameters
|
|
|
|
|
public static Main4Fragment newInstance(String param1, String param2) {
|
|
|
|
|
Main4Fragment fragment = new Main4Fragment();
|
|
|
|
|
Bundle args = new Bundle();
|
|
|
|
|
args.putString(ARG_PARAM1, param1);
|
|
|
|
|
args.putString(ARG_PARAM2, param2);
|
|
|
|
|
fragment.setArguments(args);
|
|
|
|
|
return fragment;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-21 13:39:24 +08:00
|
|
|
private boolean onclik = false;
|
|
|
|
|
|
2020-08-03 09:11:54 +08:00
|
|
|
@Override
|
|
|
|
|
public void onPause() {
|
|
|
|
|
super.onPause();
|
2020-08-21 13:39:24 +08:00
|
|
|
onclik = false;
|
2020-08-03 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onCreate(Bundle savedInstanceState) {
|
|
|
|
|
super.onCreate(savedInstanceState);
|
|
|
|
|
if (getArguments() != null) {
|
|
|
|
|
mParam1 = getArguments().getString(ARG_PARAM1);
|
|
|
|
|
mParam2 = getArguments().getString(ARG_PARAM2);
|
|
|
|
|
}
|
|
|
|
|
/* Toolbar toolbar = (Toolbar)getActivity(). findViewById(R.id.toolbar);
|
|
|
|
|
BaseActivity baseActivity= (BaseActivity) getActivity();
|
|
|
|
|
baseActivity.setSupportActionBar(toolbar);*/
|
|
|
|
|
|
2020-08-21 13:39:24 +08:00
|
|
|
/* toolbar.set*/
|
2020-08-03 09:11:54 +08:00
|
|
|
/* baseActivity.setAbr(getString(R.string.news4), new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, R.mipmap.shezhi, new View.OnClickListener() {
|
|
|
|
|
@Override
|
|
|
|
|
public void onClick(View view) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}, 0, null, R.mipmap.head);
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* @Override
|
|
|
|
|
public View onCreateView(LayoutInflater inflater, ViewGroup container,
|
|
|
|
|
Bundle savedInstanceState) {
|
|
|
|
|
// Inflate the layout for this fragment
|
|
|
|
|
return inflater.inflate(R.layout.fragment_main1, container, false);
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
// TODO: Rename method, update argument and hook method into UI event
|
|
|
|
|
public void onButtonPressed(Uri uri) {
|
|
|
|
|
if (mListener != null) {
|
|
|
|
|
mListener.onFragmentInteraction(uri);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onAttach(Context context) {
|
|
|
|
|
super.onAttach(context);
|
|
|
|
|
if (context instanceof OnFragmentInteractionListener) {
|
|
|
|
|
mListener = (OnFragmentInteractionListener) context;
|
|
|
|
|
} else {
|
|
|
|
|
throw new RuntimeException(context.toString()
|
|
|
|
|
+ " must implement OnFragmentInteractionListener");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onDetach() {
|
|
|
|
|
super.onDetach();
|
|
|
|
|
mListener = null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected int getLayoutId() {
|
|
|
|
|
return R.layout.fragment_main4;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
protected void loadData() {
|
2020-08-21 13:39:24 +08:00
|
|
|
initData();
|
2020-08-03 09:11:54 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onResume() {
|
|
|
|
|
|
|
|
|
|
super.onResume();
|
2020-08-21 13:39:24 +08:00
|
|
|
onclik = true;
|
2020-08-03 09:11:54 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public ArrayList<MyUserFEntity> getMyActivityList() {
|
2020-08-21 13:39:24 +08:00
|
|
|
ArrayList<MyUserFEntity> myUserFEntities = new ArrayList<>();
|
|
|
|
|
String myActivityListString[] = getActivity().getResources().getStringArray(R.array.useraction);
|
|
|
|
|
int imageres[] = {R.mipmap.genren,
|
2020-08-03 09:11:54 +08:00
|
|
|
R.mipmap.qianbao,
|
|
|
|
|
R.mipmap.shangcheng,
|
|
|
|
|
R.mipmap.zhangdan,
|
|
|
|
|
R.mipmap.fuwu,
|
|
|
|
|
R.mipmap.fuwu,
|
|
|
|
|
R.mipmap.baoxiu,
|
|
|
|
|
R.mipmap.shouquan,
|
|
|
|
|
R.mipmap.fangchan,
|
|
|
|
|
R.mipmap.yaoshi};
|
2020-08-21 13:39:24 +08:00
|
|
|
Class tClass[] = {MyUserMessage.class,
|
2020-08-03 09:11:54 +08:00
|
|
|
MyWalletActivity.class,
|
|
|
|
|
MyMarketShopActivity.class,
|
|
|
|
|
MyBillHistory.class,
|
|
|
|
|
MyServiceHistory.class,
|
|
|
|
|
UserdlistActivity.class,
|
|
|
|
|
MyGuaranteeHistory.class,
|
|
|
|
|
MyAuthorizedFamilyHistory.class,
|
|
|
|
|
MyPropertyActivity.class,
|
|
|
|
|
MyKeyManagement.class};
|
2020-08-21 13:39:24 +08:00
|
|
|
for (int i = 0; i < 9; i++) {
|
|
|
|
|
MyUserFEntity myUserFEntity = new MyUserFEntity();
|
2020-08-03 09:11:54 +08:00
|
|
|
myUserFEntity.setImagetResource(imageres[i]);
|
|
|
|
|
myUserFEntity.setMyclazz(tClass[i]);
|
|
|
|
|
myUserFEntity.setTitile(myActivityListString[i]);
|
|
|
|
|
myUserFEntities.add(myUserFEntity);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return myUserFEntities;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This interface must be implemented by activities that contain this
|
|
|
|
|
* fragment to allow an interaction in this fragment to be communicated
|
|
|
|
|
* to the activity and potentially other fragments contained in that
|
|
|
|
|
* activity.
|
|
|
|
|
* <p>
|
|
|
|
|
* See the Android Training lesson <a href=
|
|
|
|
|
* "http://developer.android.com/training/basics/fragments/communicating.html"
|
|
|
|
|
* >Communicating with Other Fragments</a> for more information.
|
|
|
|
|
*/
|
|
|
|
|
public interface OnFragmentInteractionListener {
|
|
|
|
|
// TODO: Update argument type and name
|
|
|
|
|
void onFragmentInteraction(Uri uri);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onDestroy() {
|
|
|
|
|
super.onDestroy();
|
2020-08-21 13:39:24 +08:00
|
|
|
if (deletePath.size() > 0) {
|
|
|
|
|
for (int i = 0; i < deletePath.size(); i++) {
|
2020-08-03 09:11:54 +08:00
|
|
|
BitmapTools.deleteFile(new File(deletePath.get(i)));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|