d
This commit is contained in:
@@ -162,6 +162,7 @@
|
||||
<activity android:name="com.sl.house_property.user.MyServiceHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyGuaranteeHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyAuthorizedFamilyHistory" />
|
||||
<activity android:name="com.sl.house_property.user.MyAuthorizedFamilyHistoryt" />
|
||||
<activity android:name="com.sl.house_property.user.MyPropertyActivity" />
|
||||
<activity android:name="com.sl.house_property.user.MyKeyManagement" />
|
||||
<activity android:name="com.sl.house_property.user.MyChargeActivity" />
|
||||
|
||||
@@ -0,0 +1,266 @@
|
||||
package com.sl.house_property.user;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.text.TextUtils;
|
||||
import android.view.View;
|
||||
|
||||
import com.dalong.refreshlayout.OnRefreshListener;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
import com.sl.house_property.databinding.ActivityMyAuthorizedFamilyHistoryBinding;
|
||||
import com.sl.house_property.databinding.ActivityMyAuthorizedFamilyHistorytBinding;
|
||||
import com.sl.house_property.databinding.FamilynumberpermissionBinding;
|
||||
import com.sl.house_property.databinding.FamilynumberpermissionnBinding;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.MyfamilySimpleEntity;
|
||||
import entity.RegisterUser;
|
||||
import entity.SimpleEntity;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import my_view.tao_bao_refresh.FullyGridLayoutManager;
|
||||
import rx.Subscription;
|
||||
import rx.functions.Action1;
|
||||
import tools.Config;
|
||||
import utils.Md5;
|
||||
|
||||
public class MyAuthorizedFamilyHistoryt extends BaseActivity<ActivityMyAuthorizedFamilyHistorytBinding> {
|
||||
|
||||
private Loader mGankLoader;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_my_authorized_family_historyt;
|
||||
}
|
||||
|
||||
private ProgressDialog progressDialog;
|
||||
private OnRefreshListener onrefalshlister = new OnRefreshListener() {
|
||||
@Override
|
||||
public void onRefresh() {
|
||||
getlist();
|
||||
//getGankList(ApiConfig.GETHOMEBANNER,new HashMap<String, String>(),getString(R.string.loading),0);
|
||||
mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mDataBinding.taobaoRefreshLayout.stopRefresh(true);
|
||||
}
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoadMore() {
|
||||
//addRecycleVerization();
|
||||
getlist();
|
||||
mDataBinding.taobaoRefreshLayout.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
mDataBinding.taobaoRefreshLayout.stopLoadMore(true);
|
||||
}
|
||||
}, 3000);
|
||||
|
||||
}
|
||||
};
|
||||
private ArrayList<SimpleEntity> simpleEntities;
|
||||
private BaseRecycleViewAdapter baseRecycleViewAdapter;
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
String usertitile = getIntent().getStringExtra("usertitile");
|
||||
setAbr(usertitile, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
}, R.mipmap.zengjia, new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// Intent intet = new Intent(MyAuthorizedFamilyHistoryt.this, AddAnewFamilyNumberPermissionActivity.class);
|
||||
// startActivity(intet);
|
||||
}
|
||||
}, 0, null, 0,
|
||||
null, "");
|
||||
homeId=getIntent().getStringExtra("homeId");
|
||||
progressDialog = new ProgressDialog(this);
|
||||
// progressDialog.show();
|
||||
// progressDialog.setMessage(getString(R.string.loading));
|
||||
intRecycleVerization();
|
||||
//getGankList(ApiConfig.GETHOMEBANNER,new HashMap<String, String>(),getString(R.string.loading),0);
|
||||
mDataBinding.taobaoRefreshLayout.setOnRefreshListener(onrefalshlister);
|
||||
mDataBinding.taobaoRefreshLayout.setAutoRefresh(true);
|
||||
|
||||
// getlist();
|
||||
|
||||
|
||||
}
|
||||
private String homeId="";
|
||||
private void getlist() {
|
||||
RegisterUser user =
|
||||
Config.getInstance(MyAuthorizedFamilyHistoryt.this).getUser();
|
||||
Map<String, String> map = new HashMap<>();
|
||||
if (user != null) {
|
||||
map.put("userid", user.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "FamilyMemberList");
|
||||
if (!TextUtils.isEmpty(homeId)){
|
||||
map.put("home_id",homeId);
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Cas" + "FamilyMemberList" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.loading), 0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void getGankList(String myurl, Map<String, String> map, String msg, final int requstecode) {
|
||||
// progressDialog.setMessage(msg);
|
||||
// progressDialog.setCancelable(false);
|
||||
// progressDialog.show();
|
||||
|
||||
mGankLoader = new Loader();
|
||||
Subscription subscription = mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
|
||||
|
||||
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
mDataBinding.taobaoRefreshLayout.stopRefresh(true);
|
||||
mDataBinding.taobaoRefreshLayout.stopLoadMore(true);
|
||||
if (!(resultcode.status == 0)) {
|
||||
setToast( resultcode.msg);
|
||||
}
|
||||
if (resultcode.status == 0) {
|
||||
if (requstecode == 0) {
|
||||
Gson gs = new Gson();
|
||||
ArrayList<LinkedTreeMap> adta = (ArrayList<LinkedTreeMap>) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
ArrayList<MyfamilySimpleEntity> list = null;
|
||||
try {
|
||||
JSONArray jsonObject = new JSONArray(s);
|
||||
|
||||
Type type = new TypeToken<ArrayList<MyfamilySimpleEntity>>() {
|
||||
}.getType();
|
||||
list = new Gson().fromJson(jsonObject.toString(), type);
|
||||
simplelist(list);
|
||||
if(list.size()<=0){
|
||||
if(page==1){
|
||||
mDataBinding.content.setVisibility(View.GONE);
|
||||
mDataBinding.noDate.setVisibility(View.VISIBLE);
|
||||
}else {
|
||||
setToast(getString(R.string.no_more_data));
|
||||
}
|
||||
|
||||
}else {
|
||||
mDataBinding.content.setVisibility(View.VISIBLE);
|
||||
mDataBinding.noDate.setVisibility(View.GONE);
|
||||
page = page+1;
|
||||
}
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
setToast( getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
addSubscription(subscription);
|
||||
}
|
||||
|
||||
private void simplelist(ArrayList<MyfamilySimpleEntity> list) {
|
||||
|
||||
ArrayList<SimpleEntity> mysiplentity = new ArrayList<SimpleEntity>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
SimpleEntity mysiplent = new SimpleEntity();
|
||||
mysiplent.setString1(list.get(i).getMember_name());
|
||||
mysiplent.setString2(list.get(i).getPhone());
|
||||
mysiplent.setString3(list.get(i).getF_id());
|
||||
|
||||
|
||||
mysiplentity.add(mysiplent);
|
||||
|
||||
}
|
||||
simpleEntities = mysiplentity;
|
||||
baseRecycleViewAdapter.setData(mysiplentity);
|
||||
}
|
||||
|
||||
|
||||
private void intRecycleVerization() {
|
||||
simpleEntities = new ArrayList<SimpleEntity>();
|
||||
|
||||
final FullyGridLayoutManager mgr = new FullyGridLayoutManager(this, 1);
|
||||
mgr.setOrientation(FullyGridLayoutManager.VERTICAL);
|
||||
mgr.setSmoothScrollbarEnabled(true);
|
||||
mDataBinding.recyView.setLayoutManager(mgr);
|
||||
baseRecycleViewAdapter = new BaseRecycleViewAdapter(this, R.layout.familynumberpermissionn);
|
||||
simpleEntities = new ArrayList<>();
|
||||
baseRecycleViewAdapter.setOnBindViewHolder(new BaseRecycleViewAdapter.BindView() {
|
||||
@SuppressLint("ClickableViewAccessibility")
|
||||
@Override
|
||||
public void onBindViewHolder(Object b, final int position) {
|
||||
if (!(position >= simpleEntities.size())) {
|
||||
final FamilynumberpermissionnBinding homeGridAdapterItemBinding = (FamilynumberpermissionnBinding) b;
|
||||
simpleEntities.get(position).setString12(position+1+"");
|
||||
homeGridAdapterItemBinding.setMyentity(simpleEntities.get(position));
|
||||
homeGridAdapterItemBinding.edit.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
// Intent intet = new Intent(MyAuthorizedFamilyHistoryt.this, AddAnewFamilyNumberPermissionActivity.class);
|
||||
// intet.putExtra("stringentity", simpleEntities.get(position));
|
||||
// startActivityForResult(intet,1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
mDataBinding.recyView.setAdapter(baseRecycleViewAdapter);
|
||||
baseRecycleViewAdapter.setData(simpleEntities);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||
super.onActivityResult(requestCode, resultCode, data);
|
||||
if(resultCode==100){
|
||||
mDataBinding.taobaoRefreshLayout.setAutoRefresh(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -160,7 +160,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -185,7 +185,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -218,7 +218,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -256,7 +256,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -303,7 +303,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -363,7 +363,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -381,7 +381,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
@@ -410,7 +410,7 @@ public class MyPropertyActivity extends BaseActivity<ActivityMyPropertyBinding>
|
||||
public void onItemClick(View itemView, int position) {
|
||||
|
||||
if (homegridentityvArrayList.get(position).isString9()){
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistory.class);
|
||||
Intent intent = new Intent(MyPropertyActivity.this,MyAuthorizedFamilyHistoryt.class);
|
||||
intent.putExtra("usertitile", "授权家庭");
|
||||
intent.putExtra("homeId", homegridentityvArrayList.get(position).getString8());
|
||||
startActivityForResult(intent, 0);
|
||||
|
||||
@@ -55,6 +55,18 @@ public class SimpleEntity extends BaseObservable implements Serializable {
|
||||
private String string8;
|
||||
@Bindable
|
||||
private String string1;
|
||||
|
||||
public String getString12() {
|
||||
return string12;
|
||||
}
|
||||
|
||||
public void setString12(String string12) {
|
||||
this.string12 = string12;
|
||||
notifyPropertyChanged(BR.string10);
|
||||
}
|
||||
|
||||
@Bindable
|
||||
private String string12;
|
||||
@Bindable
|
||||
private String string2;
|
||||
@Bindable
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
<FrameLayout
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginBottom="0dip"
|
||||
android:fitsSystemWindows="true"
|
||||
tools:context=".Main1Fragment">
|
||||
|
||||
<!-- TODO: Update blank fragment layout -->
|
||||
|
||||
|
||||
<RelativeLayout
|
||||
android:id="@+id/content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="0dip"
|
||||
android:background="#F7F7F7"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<my_view.tao_bao_refresh.TaoBaoRefreshLayout
|
||||
android:id="@+id/taobao_refresh_layout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<my_view.tao_bao_refresh.ScrollViewExtend
|
||||
android:id="@+id/scroll_view_extend"
|
||||
android:fillViewport="true"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
|
||||
android:layout_height="match_parent">
|
||||
|
||||
|
||||
<my_view.tao_bao_refresh.RecyView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/recy_view"
|
||||
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</my_view.tao_bao_refresh.RecyView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
</my_view.tao_bao_refresh.ScrollViewExtend>
|
||||
</my_view.tao_bao_refresh.TaoBaoRefreshLayout>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
<include
|
||||
android:id="@+id/noDate"
|
||||
layout="@layout/no_data_view"
|
||||
android:visibility="gone">
|
||||
</include>
|
||||
</FrameLayout>
|
||||
</layout>
|
||||
87
app/src/main/res/layout/familynumberpermissionn.xml
Normal file
87
app/src/main/res/layout/familynumberpermissionn.xml
Normal file
@@ -0,0 +1,87 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<layout xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<data>
|
||||
|
||||
|
||||
<variable
|
||||
name="myentity"
|
||||
type="entity.SimpleEntity">
|
||||
|
||||
</variable>
|
||||
|
||||
|
||||
</data>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical">
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="2dip"
|
||||
android:background="@color/f7" />
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="60dp"
|
||||
android:paddingLeft="12dp"
|
||||
android:gravity="center_vertical"
|
||||
android:background="@color/white"
|
||||
android:orientation="horizontal">
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="家庭成员"
|
||||
android:textColor="#333333"
|
||||
android:textSize="19sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@{myentity.string12}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="19sp" />
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="@{myentity.string1}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="19sp" />
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="10dp"
|
||||
android:text="@{myentity.string2}"
|
||||
android:textColor="@color/lightlittleGrey"
|
||||
android:textSize="15sp" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dip"
|
||||
android:layout_margin="15dp"
|
||||
android:background="@color/LightGray"
|
||||
android:layout_toLeftOf="@+id/edit"
|
||||
android:layout_height="match_parent"/>
|
||||
<ImageView
|
||||
android:id="@+id/edit"
|
||||
android:layout_width="28dp"
|
||||
android:layout_height="28dp"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginBottom="15dp"
|
||||
android:layout_marginStart="24dip"
|
||||
android:visibility="gone"
|
||||
android:layout_marginEnd="24dip"
|
||||
android:background="@mipmap/xie" />
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
</layout>
|
||||
Reference in New Issue
Block a user