1
This commit is contained in:
@@ -298,6 +298,7 @@
|
||||
<activity android:name=".order.SettleActivity" />
|
||||
<activity android:name=".order.PayActivity" />
|
||||
<activity android:name=".discovery.HistoryRecordActivity" />
|
||||
<activity android:name=".discovery.ShareCodeActivity" />
|
||||
</application>
|
||||
|
||||
</manifest>
|
||||
361
app/src/main/java/com/sl/house_property/BindHouseDialog.java
Normal file
361
app/src/main/java/com/sl/house_property/BindHouseDialog.java
Normal file
@@ -0,0 +1,361 @@
|
||||
package com.sl.house_property;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.EditText;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.selectpicker.OptionsPopupWindow;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import entity.MyHomequEntity;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import rx.functions.Action1;
|
||||
import utils.Md5;
|
||||
|
||||
public class BindHouseDialog extends CenterPopupView {
|
||||
|
||||
private TextView tvQu;
|
||||
private TextView tvLou;
|
||||
private TextView tvDan;
|
||||
private TextView tvFang;
|
||||
private EditText etName;
|
||||
private EditText etCardNumber;
|
||||
private String userId = "";
|
||||
Loader mGankLoader = new Loader();
|
||||
public ProgressDialog progressDialog;
|
||||
private MyHomequEntity mQu = null;
|
||||
private MyHomequEntity mLou = null;
|
||||
private MyHomequEntity mDan = null;
|
||||
private MyHomequEntity mFang = null;
|
||||
private OnBindHouseListener listener;
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public BindHouseDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_bind_house;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
progressDialog = new ProgressDialog(getContext());
|
||||
tvQu = findViewById(R.id.tv_qu);
|
||||
tvLou = findViewById(R.id.lou);
|
||||
tvDan = findViewById(R.id.dan);
|
||||
tvFang = findViewById(R.id.fang);
|
||||
etName = findViewById(R.id.et_name);
|
||||
etCardNumber = findViewById(R.id.et_cardNumber);
|
||||
findViewById(R.id.ll_qu).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("userid", userId);
|
||||
map.put("app", "Trend");
|
||||
map.put("class", "GetHomeByPid");
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Trend" + "GetHomeByPid" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, 1);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.ll_lou).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mQu == null) {
|
||||
Toast.makeText(getContext(), "请选择小区", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("userid", userId);
|
||||
map.put("app", "Trend");
|
||||
map.put("class", "GetHomeByPid");
|
||||
map.put("home_id", mQu.getHome_id());
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Trend" + "GetHomeByPid" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, 2);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
findViewById(R.id.ll_dan).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mQu == null) {
|
||||
Toast.makeText(getContext(), "请选择小区", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mLou == null) {
|
||||
Toast.makeText(getContext(), "请选择楼号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("userid", userId);
|
||||
map.put("app", "Trend");
|
||||
map.put("class", "GetHomeByPid");
|
||||
map.put("home_id", mLou.getHome_id());
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Trend" + "GetHomeByPid" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, 3);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.ll_fang).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mQu == null) {
|
||||
Toast.makeText(getContext(), "请选择小区", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mLou == null) {
|
||||
Toast.makeText(getContext(), "请选择楼号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mDan == null) {
|
||||
Toast.makeText(getContext(), "请选择单元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("userid", userId);
|
||||
map.put("app", "Trend");
|
||||
map.put("class", "GetHomeByPid");
|
||||
map.put("home_id", mDan.getHome_id());
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Trend" + "GetHomeByPid" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, 4);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.tv_submit).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (mQu == null) {
|
||||
Toast.makeText(getContext(), "请选择小区", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mLou == null) {
|
||||
Toast.makeText(getContext(), "请选择楼号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mDan == null) {
|
||||
Toast.makeText(getContext(), "请选择单元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
if (mFang == null) {
|
||||
Toast.makeText(getContext(), "请选择单元", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String name = etName.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(name)) {
|
||||
Toast.makeText(getContext(), "请输入户主姓名", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
String cardNumber = etCardNumber.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(cardNumber)) {
|
||||
Toast.makeText(getContext(), "请输入身份证号", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("userid", userId);
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "AddMyHouse");
|
||||
map.put("home_id", mFang.getHome_id());
|
||||
map.put("relname", name);
|
||||
map.put("idcard", cardNumber);
|
||||
//map.put("home_id", "GetHomeByPid");
|
||||
map.put("sign", Md5.md5("Cas" + "AddMyHouse" + Md5.secret));
|
||||
getGankList(ApiConfig.BASE_URL, map, 5);
|
||||
}
|
||||
});
|
||||
findViewById(R.id.tv_cancel).setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void getGankList(String myurl, Map<String, String> map, final int requstecode) {
|
||||
mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
|
||||
if (!(resultcode.status == 0)) {
|
||||
Toast.makeText(getContext(), resultcode.msg, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
if (resultcode.status == 0) {
|
||||
if (requstecode == 1) {
|
||||
//选择区
|
||||
Gson gs = new Gson();
|
||||
ArrayList<LinkedTreeMap> adta = (ArrayList<LinkedTreeMap>) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
//final ArrayList<MyHomequEntity> list = null;
|
||||
Type type = new TypeToken<ArrayList<MyHomequEntity>>() {
|
||||
}.getType();
|
||||
final ArrayList<MyHomequEntity> list = new Gson().fromJson(s, type);
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getHome_name());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
mQu = list.get(position);
|
||||
tvQu.setText(mQu.getHome_name());
|
||||
mLou = null;
|
||||
tvLou.setText("请选择楼号");
|
||||
mDan = null;
|
||||
tvDan.setText("请选择单元");
|
||||
mFang = null;
|
||||
tvFang.setText("请选择房号");
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(getRootView(), Gravity.BOTTOM, 0, 0);
|
||||
|
||||
} else if (requstecode == 2) {
|
||||
//选择楼
|
||||
Gson gs = new Gson();
|
||||
ArrayList<LinkedTreeMap> adta = (ArrayList<LinkedTreeMap>) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
//final ArrayList<MyHomequEntity> list = null;
|
||||
Type type = new TypeToken<ArrayList<MyHomequEntity>>() {
|
||||
}.getType();
|
||||
final ArrayList<MyHomequEntity> list = new Gson().fromJson(s, type);
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getHome_name());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
mLou = list.get(position);
|
||||
tvLou.setText(mLou.getHome_name());
|
||||
|
||||
mDan = null;
|
||||
tvDan.setText("请选择单元");
|
||||
mFang = null;
|
||||
tvFang.setText("请选择房号");
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(getRootView(), Gravity.BOTTOM, 0, 0);
|
||||
} else if (requstecode == 3) {
|
||||
//选择单元
|
||||
Gson gs = new Gson();
|
||||
ArrayList<LinkedTreeMap> adta = (ArrayList<LinkedTreeMap>) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
//final ArrayList<MyHomequEntity> list = null;
|
||||
Type type = new TypeToken<ArrayList<MyHomequEntity>>() {
|
||||
}.getType();
|
||||
final ArrayList<MyHomequEntity> list = new Gson().fromJson(s, type);
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getHome_name());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
mDan = list.get(position);
|
||||
tvDan.setText(mDan.getHome_name());
|
||||
|
||||
mFang = null;
|
||||
tvFang.setText("请选择房号");
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(getRootView(), Gravity.BOTTOM, 0, 0);
|
||||
} else if (requstecode == 4) {
|
||||
//选择房号
|
||||
Gson gs = new Gson();
|
||||
ArrayList<LinkedTreeMap> adta = (ArrayList<LinkedTreeMap>) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
//final ArrayList<MyHomequEntity> list = null;
|
||||
Type type = new TypeToken<ArrayList<MyHomequEntity>>() {
|
||||
}.getType();
|
||||
final ArrayList<MyHomequEntity> list = new Gson().fromJson(s, type);
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getHome_name());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
mFang = list.get(position);
|
||||
tvFang.setText(mFang.getHome_name());
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(getRootView(), Gravity.BOTTOM, 0, 0);
|
||||
} else if (requstecode == 5) {
|
||||
if (listener != null) {
|
||||
listener.onSubmit();
|
||||
dismiss();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
Toast.makeText(getContext(), getContext().getString(R.string.getdatafailure), Toast.LENGTH_SHORT).show();
|
||||
// setToast(getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public void setOnBindHouseListener(OnBindHouseListener listener) {
|
||||
this.listener = listener;
|
||||
}
|
||||
|
||||
interface OnBindHouseListener {
|
||||
void onSubmit();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -71,18 +71,18 @@ public class EntranceguardControl2Activity extends BaseActivity<ActivityEntrance
|
||||
}
|
||||
},0,null,0,null,0,null,"");
|
||||
list= (ArrayList<HomelistitemEntity>) getIntent().getSerializableExtra("list");
|
||||
for (int i = 0; i <list.size() ; i++) {
|
||||
RadioButton radioButton= (RadioButton) LayoutInflater.from(this).inflate(R.layout.radiort_item_for_entrangurdcontrol1,null);
|
||||
radioButton.setText(" "+list.get(i).getAddress());
|
||||
mDataBinding.myradio.addView(radioButton);
|
||||
radioButton.setId(1000+i); }
|
||||
mDataBinding.myradio.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
||||
aposition=i-1000;
|
||||
nowstringhiuse=list.get(aposition).getAddress();
|
||||
}
|
||||
});
|
||||
// for (int i = 0; i <list.size() ; i++) {
|
||||
// RadioButton radioButton= (RadioButton) LayoutInflater.from(this).inflate(R.layout.radiort_item_for_entrangurdcontrol1,null);
|
||||
// radioButton.setText(" "+list.get(i).getAddress());
|
||||
// mDataBinding.myradio.addView(radioButton);
|
||||
// radioButton.setId(1000+i); }
|
||||
// mDataBinding.myradio.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
// @Override
|
||||
// public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
||||
// aposition=i-1000;
|
||||
// nowstringhiuse=list.get(aposition).getAddress();
|
||||
// }
|
||||
// });
|
||||
final int[] timeday = {0};
|
||||
mDataBinding.myradio2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
|
||||
@@ -8,29 +8,36 @@ import android.os.Bundle;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.support.v4.app.Fragment;
|
||||
import android.text.TextPaint;
|
||||
import android.view.Gravity;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.RadioButton;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.cutil.ScreenUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.scwang.smartrefresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshListener;
|
||||
import com.scwang.smartrefresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.sl.house_property.user.MyMarketShopActivity;
|
||||
import com.selectpicker.OptionsPopupWindow;
|
||||
import com.sl.house_property.databinding.FragmentMainBinding;
|
||||
import com.sl.house_property.databinding.FragmentRecyclerviewHorizationItemBinding;
|
||||
import com.sl.house_property.databinding.FragmentRecyclerviewVorizationItemBinding;
|
||||
import com.sl.house_property.discovery.ShareCodeActivity;
|
||||
import com.sl.house_property.user.MyMarketShopActivity;
|
||||
import com.squareup.picasso.Picasso;
|
||||
import com.youth.banner.Banner;
|
||||
import com.youth.banner.BannerConfig;
|
||||
import com.youth.banner.Transformer;
|
||||
import com.youth.banner.listener.OnBannerClickListener;
|
||||
import com.youth.banner.loader.ImageLoader;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -39,17 +46,18 @@ import java.util.Map;
|
||||
import adapter.BaseRecycleViewAdapter;
|
||||
import entity.Advert_carouseleEntity;
|
||||
import entity.Advertorial_listEntity;
|
||||
import entity.HomelistitemEntity;
|
||||
import entity.MainF1Entity;
|
||||
import entity.Message_listEntity;
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import my_view.tao_bao_refresh.FullyGridLayoutManager;
|
||||
import tools.Config;
|
||||
import tools.PicassoRoundTransform;
|
||||
import http.ApiConfig;
|
||||
import rx.Subscription;
|
||||
import rx.functions.Action1;
|
||||
import tools.Config;
|
||||
import tools.PicassoRoundTransform;
|
||||
import utils.Md5;
|
||||
|
||||
|
||||
@@ -131,6 +139,8 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
}
|
||||
}
|
||||
|
||||
private ArrayList<HomelistitemEntity> list;
|
||||
|
||||
@Override
|
||||
public void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
@@ -139,6 +149,92 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
mParam2 = getArguments().getString(ARG_PARAM2);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void getGankList(final String myurl, Map<String, String> map, String string, final int getcode1) {
|
||||
progressDialog = new ProgressDialog(getContext());
|
||||
progressDialog.setMessage(string);
|
||||
|
||||
//map.put("")
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
mDataBinding.getRoot().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressDialog.dismiss();
|
||||
//setToast(1, getString(R.string.timeout));
|
||||
}
|
||||
}, 13000);
|
||||
mGankLoader = new Loader();
|
||||
/* Map<String,String> map=new HashMap<String,String>();
|
||||
map.put("phone");*/
|
||||
mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
//setToast(0,resultcode.status);
|
||||
if ((!(resultcode.status == 0))) {
|
||||
Toast.makeText(getContext(), resultcode.msg, Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
}
|
||||
switch (getcode1) {
|
||||
|
||||
case 0:
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(s);
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("home");
|
||||
Type type = new TypeToken<ArrayList<HomelistitemEntity>>() {
|
||||
}.getType();
|
||||
list = new Gson().fromJson(jsonArray.toString(), type);
|
||||
if (list == null || list.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getAddress());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
if (list.size() > 0) {
|
||||
mDataBinding.tv1Address.setText(list.get(position).getAddress());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(mDataBinding.getRoot(), Gravity.BOTTOM, 0, 0);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
//
|
||||
Toast.makeText(getContext(), getString(R.string.getdatafailure), Toast.LENGTH_SHORT).show();
|
||||
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -180,6 +276,45 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
bannerLP.width = ScreenUtils.getScreenWidth();
|
||||
banner.setLayoutParams(bannerLP);
|
||||
mDataBinding.taobaoRefreshLayout.autoRefresh();
|
||||
mDataBinding.tv1Address.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(getContext()).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Cas" + "GetMyAddress" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "GetMyAddress");
|
||||
getGankList(ApiConfig.BASE_URL, map, "", 0);
|
||||
return;
|
||||
}
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getAddress());
|
||||
}
|
||||
OptionsPopupWindow alarmOptionPop = new OptionsPopupWindow(getContext());
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
if (list.size() > 0) {
|
||||
mDataBinding.tv1Address.setText(list.get(position).getAddress());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(mDataBinding.getRoot(), Gravity.BOTTOM, 0, 0);
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// TODO: Rename method, update argument and hook method into UI event
|
||||
@@ -232,7 +367,7 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
if ((Config.getInstance(MainFragment.this.getContext()).getUser() == null)) {
|
||||
intent = new Intent(MainFragment.this.getContext(), LoginActivity.class);
|
||||
} else {
|
||||
intent = new Intent(getActivity(), EntranceguardActivity.class);
|
||||
intent = new Intent(getActivity(), ShareCodeActivity.class);
|
||||
}
|
||||
startActivity(intent);
|
||||
break;
|
||||
@@ -440,7 +575,6 @@ public class MainFragment extends BaseFragment<FragmentMainBinding> implements V
|
||||
}
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -5,11 +5,12 @@ import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.os.Handler;
|
||||
import android.os.Message;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.cutil.RegexUtils;
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.sl.house_property.databinding.ActivityRegisterBinding;
|
||||
|
||||
import java.util.HashMap;
|
||||
@@ -17,9 +18,10 @@ import java.util.Map;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import http.ApiConfig;
|
||||
import rx.Subscription;
|
||||
import rx.functions.Action1;
|
||||
import utils.Md5;
|
||||
@@ -30,7 +32,6 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
private Loader mGankLoader;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_register;
|
||||
@@ -39,14 +40,14 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
progressDialog=new ProgressDialog(RegisterActivity.this);
|
||||
progressDialog = new ProgressDialog(RegisterActivity.this);
|
||||
|
||||
setAbr(getString(R.string.register), new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
},0,null,0,null,0,null,"");
|
||||
}, 0, null, 0, null, 0, null, "");
|
||||
mDataBinding.getcode.setOnClickListener(this);
|
||||
|
||||
mDataBinding.register.setOnClickListener(this);
|
||||
@@ -54,37 +55,37 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
switch (view.getId()){
|
||||
switch (view.getId()) {
|
||||
|
||||
|
||||
case R.id.getcode:
|
||||
if(mDataBinding.registerphone.getText().toString().length()<1){
|
||||
case R.id.getcode:
|
||||
if (mDataBinding.registerphone.getText().toString().length() < 1) {
|
||||
setToast(getString(R.string.me_input_phone_tip));
|
||||
return;
|
||||
}
|
||||
if(!RegexUtils.isMobileExact(mDataBinding.registerphone.getText().toString())){
|
||||
if (!RegexUtils.isMobileExact(mDataBinding.registerphone.getText().toString())) {
|
||||
setToast(getString(R.string.me_input_phone_error_tip));
|
||||
return;
|
||||
}
|
||||
getMesgCode(R.id.getcode);
|
||||
break;
|
||||
case R.id.register:
|
||||
if(mDataBinding.registerphone.getText().toString().length()==0){
|
||||
case R.id.register:
|
||||
if (mDataBinding.registerphone.getText().toString().length() == 0) {
|
||||
setToast(getString(R.string.me_input_phone_tip));
|
||||
return;
|
||||
}
|
||||
if(!RegexUtils.isMobileExact(mDataBinding.registerphone.getText().toString())){
|
||||
if (!RegexUtils.isMobileExact(mDataBinding.registerphone.getText().toString())) {
|
||||
setToast(getString(R.string.me_input_phone_error_tip));
|
||||
return;
|
||||
}
|
||||
|
||||
if(mDataBinding.logincode.getText().toString().length()<1){
|
||||
if (mDataBinding.logincode.getText().toString().length() < 1) {
|
||||
setToast(getString(R.string.me_input_verification_tip));
|
||||
return;
|
||||
}
|
||||
|
||||
String password = mDataBinding.editpaw.getText().toString();
|
||||
if(password.length()<1){
|
||||
String password = mDataBinding.editpaw.getText().toString();
|
||||
if (password.length() < 1) {
|
||||
setToast(getString(R.string.me_input_password_tip));
|
||||
return;
|
||||
}
|
||||
@@ -93,24 +94,24 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
if(!tools.RegexUtils.checkPassword(password)){
|
||||
if (!tools.RegexUtils.checkPassword(password)) {
|
||||
setToast(getString(R.string.me_input_password_fail_tip));
|
||||
return;
|
||||
}
|
||||
|
||||
String againPassword = mDataBinding.editagainpaw.getText().toString().trim();
|
||||
if(againPassword.length()<1){
|
||||
if (againPassword.length() < 1) {
|
||||
setToast(getString(R.string.me_input_again_password_tip));
|
||||
return;
|
||||
}
|
||||
|
||||
if(!mDataBinding.editpaw.getText().toString().trim().equals(mDataBinding.editagainpaw.getText().toString().trim())){
|
||||
if (!mDataBinding.editpaw.getText().toString().trim().equals(mDataBinding.editagainpaw.getText().toString().trim())) {
|
||||
setToast(getString(R.string.me_password_Inconsistent_tip));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if(!mDataBinding.agreewhitemeg.isChecked()){
|
||||
if (!mDataBinding.agreewhitemeg.isChecked()) {
|
||||
setToast("请先同意注册协议");
|
||||
|
||||
return;
|
||||
@@ -122,14 +123,14 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
}
|
||||
|
||||
private void register(int id) {
|
||||
Map<String,String> map=new HashMap<>();
|
||||
map.put("phone",mDataBinding.registerphone.getText().toString().trim());
|
||||
map.put("password",mDataBinding.editpaw.getText().toString().trim());
|
||||
map.put("code",mDataBinding.logincode.getText().toString().trim());
|
||||
map.put("sign", Md5.md5("Cas"+"UserReg"+Md5.secret));
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("phone", mDataBinding.registerphone.getText().toString().trim());
|
||||
map.put("password", mDataBinding.editpaw.getText().toString().trim());
|
||||
map.put("code", mDataBinding.logincode.getText().toString().trim());
|
||||
map.put("sign", Md5.md5("Cas" + "UserReg" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "UserReg");
|
||||
getGankList(ApiConfig.BASE_URL,map, getResources().getString(R.string.registering),id);
|
||||
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.registering), id);
|
||||
}
|
||||
|
||||
|
||||
@@ -139,13 +140,13 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
/* getRegisterCode.setTextColor(getResources().getColor(R.color.regitergrey));*/
|
||||
|
||||
mDataBinding.getcode.setClickable(false);
|
||||
Map<String,String> map=new HashMap<>();
|
||||
map.put("sendto",mDataBinding.registerphone.getText().toString().trim());
|
||||
map.put("action","register");
|
||||
map.put("sign", Md5.md5("Cas"+"SendCode"+Md5.secret));
|
||||
Map<String, String> map = new HashMap<>();
|
||||
map.put("sendto", mDataBinding.registerphone.getText().toString().trim());
|
||||
map.put("action", "register");
|
||||
map.put("sign", Md5.md5("Cas" + "SendCode" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "SendCode");
|
||||
getGankList(ApiConfig.BASE_URL,map, getResources().getString(R.string.getthecodenow),id);
|
||||
getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.getthecodenow), id);
|
||||
// map = new HashMap<String, Object>();
|
||||
// map.put("telephone", editPhoneNo.getText().toString().trim());
|
||||
// getAsyTask(1, map, HttpUrl.registerUser(), "正在获取验证码", HttpNet.PROGRESSVISIBLE, HttpNet.POSTTYPE);//联网
|
||||
@@ -164,34 +165,43 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
progressDialog.dismiss();
|
||||
//setToast(1, getString(R.string.timeout));
|
||||
}
|
||||
},13000);
|
||||
mGankLoader = new Loader();
|
||||
}, 13000);
|
||||
mGankLoader = new Loader();
|
||||
/* Map<String,String> map=new HashMap<String,String>();
|
||||
map.put("phone");*/
|
||||
Subscription subscription = mGankLoader.getMovie(myurl,map).subscribe(new Action1<Resultcode>() {
|
||||
Subscription subscription = mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
//setToast(0,resultcode.status);
|
||||
if((!(resultcode.status==0))){
|
||||
setToast( resultcode.msg);
|
||||
if ((!(resultcode.status == 0))) {
|
||||
setToast(resultcode.msg);
|
||||
mDataBinding.getcode.setClickable(true);
|
||||
return;
|
||||
}
|
||||
switch (getcode1) {
|
||||
case R.id.getcode:
|
||||
setToast( getString(R.string.megissucess));
|
||||
startTimer();
|
||||
case R.id.getcode:
|
||||
setToast(getString(R.string.megissucess));
|
||||
startTimer();
|
||||
break;
|
||||
|
||||
case R.id.register:
|
||||
setToast( getString(R.string.registersucess));
|
||||
mDataBinding.getRoot().postDelayed(new Runnable() {
|
||||
setToast(getString(R.string.registersucess));
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
RegisterUser user = gs.fromJson(s, RegisterUser.class);//把JSON字符串转为对象
|
||||
BindHouseDialog bindHouseDialog = new BindHouseDialog(RegisterActivity.this);
|
||||
bindHouseDialog.setUserId(user.getUserid());
|
||||
bindHouseDialog.setOnBindHouseListener(new BindHouseDialog.OnBindHouseListener() {
|
||||
@Override
|
||||
public void run() {
|
||||
public void onSubmit() {
|
||||
|
||||
setToast("提交成功");
|
||||
finish();
|
||||
}
|
||||
},1500);
|
||||
});
|
||||
new XPopup.Builder(RegisterActivity.this).asCustom(bindHouseDialog).show();
|
||||
|
||||
break;
|
||||
|
||||
@@ -213,7 +223,7 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
addSubscription(subscription);
|
||||
}
|
||||
|
||||
private void startTimer(){
|
||||
private void startTimer() {
|
||||
final Timer timer = new Timer();
|
||||
final Handler handler = new Handler() {
|
||||
@Override
|
||||
@@ -249,9 +259,10 @@ public class RegisterActivity extends BaseActivity<ActivityRegisterBinding> impl
|
||||
|
||||
/**
|
||||
* 用户协议
|
||||
*
|
||||
* @param v v
|
||||
*/
|
||||
public void agreementEvent(View v){
|
||||
public void agreementEvent(View v) {
|
||||
Intent intent = new Intent(this, RegisterAgreementActivity.class);
|
||||
startActivity(intent);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,319 @@
|
||||
package com.sl.house_property.discovery;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.annotation.Nullable;
|
||||
import android.text.TextUtils;
|
||||
import android.view.Gravity;
|
||||
import android.view.View;
|
||||
import android.widget.RadioGroup;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.internal.LinkedTreeMap;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.lxj.xpopup.XPopup;
|
||||
import com.selectpicker.OptionsPopupWindow;
|
||||
import com.sl.house_property.BaseActivity;
|
||||
import com.sl.house_property.R;
|
||||
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import entity.HomelistitemEntity;
|
||||
import entity.RegisterUser;
|
||||
import http.ApiConfig;
|
||||
import my_loader.Loader;
|
||||
import my_loader.Resultcode;
|
||||
import rx.Subscription;
|
||||
import rx.functions.Action1;
|
||||
import tools.Config;
|
||||
import utils.Md5;
|
||||
|
||||
public class ShareCodeActivity extends BaseActivity<com.sl.house_property.databinding.ActivityEntranceguardControl2Binding> {
|
||||
|
||||
private String user_home_id;
|
||||
|
||||
@Override
|
||||
protected int getLayoutResId() {
|
||||
return R.layout.activity_entranceguard_control2;
|
||||
}
|
||||
|
||||
private int timeday = 7;
|
||||
private OptionsPopupWindow alarmOptionPop;
|
||||
|
||||
@Override
|
||||
protected void onCreate(@Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
setAbr("授权访客临时门禁", new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View view) {
|
||||
finish();
|
||||
}
|
||||
}, 0, null, 0, null, 0, null, "");
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(ShareCodeActivity.this).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Cas" + "GetMyAddress" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "GetMyAddress");
|
||||
getGankList(ApiConfig.BASE_URL, map, "", 0);
|
||||
|
||||
|
||||
mDataBinding.myradio2.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
|
||||
@Override
|
||||
public void onCheckedChanged(RadioGroup radioGroup, int i) {
|
||||
if (i == R.id.myradio21) {
|
||||
timeday = 7;
|
||||
}
|
||||
if (i == R.id.myradio22) {
|
||||
timeday = 30;
|
||||
}
|
||||
if (i == R.id.myradio23) {
|
||||
timeday = 90;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
mDataBinding.llAddress.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (list==null||list.isEmpty()){
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(ShareCodeActivity.this).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Cas" + "GetMyAddress" + Md5.secret));
|
||||
map.put("app", "Cas");
|
||||
map.put("class", "GetMyAddress");
|
||||
getGankList(ApiConfig.BASE_URL, map, "", 0);
|
||||
return;
|
||||
}
|
||||
final ArrayList<String> strings = new ArrayList<>();
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
strings.add(list.get(i).getAddress());
|
||||
}
|
||||
alarmOptionPop = new OptionsPopupWindow(ShareCodeActivity.this);
|
||||
alarmOptionPop.setPicker(strings);
|
||||
|
||||
alarmOptionPop.setOnoptionsSelectListener(new OptionsPopupWindow.OnOptionsSelectListener() {
|
||||
@Override
|
||||
public void onOptionsSelect(int position, int option2, int options3) {
|
||||
user_home_id = list.get(position).getUser_home_id();
|
||||
if (list.size() > 0) {
|
||||
mDataBinding.tvAddress.setText(list.get(position).getAddress());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
alarmOptionPop.showAtLocation(mDataBinding.getRoot(), Gravity.BOTTOM, 0, 0);
|
||||
}
|
||||
});
|
||||
mDataBinding.confirm.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
if (list == null || list.isEmpty()) {
|
||||
setToast("还没有房间");
|
||||
return;
|
||||
}
|
||||
|
||||
String phone = mDataBinding.telephone.getText().toString().trim();
|
||||
if (TextUtils.isEmpty(phone)) {
|
||||
setToast("请输入访客手机号");
|
||||
return;
|
||||
}
|
||||
hideKeyboard(mDataBinding.telephone);
|
||||
|
||||
getPwd();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
private ArrayList<HomelistitemEntity> list;
|
||||
private Loader mGankLoader;
|
||||
|
||||
private void getGankList(final String myurl, Map<String, String> map, String string, final int getcode1) {
|
||||
progressDialog.setMessage(string);
|
||||
|
||||
//map.put("")
|
||||
progressDialog.setCancelable(false);
|
||||
progressDialog.show();
|
||||
mDataBinding.getRoot().postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
progressDialog.dismiss();
|
||||
//setToast(1, getString(R.string.timeout));
|
||||
}
|
||||
}, 13000);
|
||||
mGankLoader = new Loader();
|
||||
/* Map<String,String> map=new HashMap<String,String>();
|
||||
map.put("phone");*/
|
||||
Subscription subscription = mGankLoader.getMovie(myurl, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
//setToast(0,resultcode.status);
|
||||
if ((!(resultcode.status == 0))) {
|
||||
setToast(1, resultcode.msg);
|
||||
return;
|
||||
}
|
||||
switch (getcode1) {
|
||||
|
||||
case 0:
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
try {
|
||||
JSONObject jsonObject = new JSONObject(s);
|
||||
JSONArray jsonArray = jsonObject.getJSONArray("home");
|
||||
Type type = new TypeToken<ArrayList<HomelistitemEntity>>() {
|
||||
}.getType();
|
||||
list = new Gson().fromJson(jsonArray.toString(), type);
|
||||
if (list != null && !list.isEmpty()) {
|
||||
mDataBinding.tvAddress.setText(list.get(0).getAddress());
|
||||
user_home_id = list.get(0).getUser_home_id();
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast(2, getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
|
||||
addSubscription(subscription);
|
||||
}
|
||||
|
||||
private void getPwd() {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(ShareCodeActivity.this).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
|
||||
map.put("sign", Md5.md5("Door" + "SendCustomerCode" + Md5.secret));
|
||||
map.put("app", "Door");
|
||||
map.put("class", "SendCustomerCode");
|
||||
map.put("type", "qrcode");
|
||||
map.put("validity_time", timeday + "");
|
||||
|
||||
//map.put("phone", mDataBinding.telephone.getText().toString().trim());
|
||||
// map.put("validity_time", mDataBinding.daytiems.getText().toString().trim());
|
||||
map.put("user_home_id", user_home_id);
|
||||
progressDialog.show();
|
||||
Subscription subscribe = mGankLoader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
if ((!(resultcode.status == 0))) {
|
||||
setToast(1, resultcode.msg);
|
||||
return;
|
||||
}
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
try {
|
||||
JSONObject jsonArray = new JSONObject(s);
|
||||
String qrcode = jsonArray.optString("qrcode", "");
|
||||
getCode(qrcode);
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast(2, getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
addSubscription(subscribe);
|
||||
// getGankList(ApiConfig.BASE_URL, map, getResources().getString(R.string.requsting), 0);
|
||||
}
|
||||
|
||||
private void getCode(final String code) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
RegisterUser registerUser = Config.getInstance(ShareCodeActivity.this).getUser();
|
||||
if (registerUser != null) {
|
||||
map.put("userid", registerUser.getUserid());
|
||||
} else {
|
||||
map.put("userid", 0 + "");
|
||||
}
|
||||
map.put("sign", Md5.md5("Door" + "SendCustomerCode" + Md5.secret));
|
||||
map.put("app", "Door");
|
||||
map.put("class", "SendCustomerCode");
|
||||
map.put("type", "password");
|
||||
map.put("phone", mDataBinding.telephone.getText().toString().trim());
|
||||
// map.put("validity_time", mDataBinding.daytiems.getText().toString().trim());
|
||||
map.put("user_home_id", user_home_id);
|
||||
Subscription subscribe = mGankLoader.getMovie(ApiConfig.BASE_URL, map).subscribe(new Action1<Resultcode>() {
|
||||
@Override
|
||||
public void call(Resultcode resultcode) {
|
||||
progressDialog.dismiss();
|
||||
if ((!(resultcode.status == 0))) {
|
||||
setToast(1, resultcode.msg);
|
||||
return;
|
||||
}
|
||||
setToast(0, resultcode.msg);
|
||||
Gson gs = new Gson();
|
||||
LinkedTreeMap adta = (LinkedTreeMap) resultcode.data;
|
||||
String s = gs.toJson(adta);
|
||||
try {
|
||||
JSONObject jsonArray = new JSONObject(s);
|
||||
String pwd = jsonArray.optString("code", "");
|
||||
|
||||
ShareCodeDialog shareCodeDialog = new ShareCodeDialog(ShareCodeActivity.this);
|
||||
shareCodeDialog.setCode(code);
|
||||
shareCodeDialog.setPwd(pwd);
|
||||
new XPopup.Builder(ShareCodeActivity.this).asCustom(shareCodeDialog).show();
|
||||
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
}
|
||||
}, new Action1<Throwable>() {
|
||||
@Override
|
||||
public void call(Throwable throwable) {
|
||||
progressDialog.dismiss();
|
||||
setToast(2, getString(R.string.getdatafailure));
|
||||
throwable.printStackTrace();
|
||||
}
|
||||
});
|
||||
addSubscription(subscribe);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.sl.house_property.discovery;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.support.annotation.NonNull;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.lxj.xpopup.core.CenterPopupView;
|
||||
import com.sl.house_property.R;
|
||||
|
||||
import utils.QRCodeUtil;
|
||||
|
||||
public class ShareCodeDialog extends CenterPopupView {
|
||||
private String pwd;
|
||||
private String code;
|
||||
private TextView tvPwd;
|
||||
private ImageView ivCode;
|
||||
private TextView tvShare;
|
||||
private TextView tvCancel;
|
||||
|
||||
public ShareCodeDialog(@NonNull Context context) {
|
||||
super(context);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getImplLayoutId() {
|
||||
return R.layout.dialog_share_cede;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onCreate() {
|
||||
super.onCreate();
|
||||
tvPwd = findViewById(R.id.title2);
|
||||
ivCode = findViewById(R.id.myImage);
|
||||
tvShare = findViewById(R.id.tv_share);
|
||||
tvCancel = findViewById(R.id.tv_cancel);
|
||||
tvCancel.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
tvShare.setOnClickListener(new OnClickListener() {
|
||||
@Override
|
||||
public void onClick(View v) {
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
tvPwd.setText("密码:" + pwd);
|
||||
Bitmap qrCodeBitmap = QRCodeUtil.createQRCodeBitmap(code, QRCodeUtil.dip2px(getContext(),220), QRCodeUtil.dip2px(getContext(),220));
|
||||
ivCode.setImageBitmap(qrCodeBitmap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setPwd(String pwd) {
|
||||
this.pwd = pwd;
|
||||
}
|
||||
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
}
|
||||
@@ -75,4 +75,7 @@ public class MyPhoneValue {
|
||||
|
||||
return sbar;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package utils;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.support.annotation.ColorInt;
|
||||
@@ -28,7 +29,13 @@ public class QRCodeUtil {
|
||||
public static Bitmap createQRCodeBitmap(String content, int width, int height){
|
||||
return createQRCodeBitmap(content, width, height, "UTF-8", "H", "2", Color.BLACK, Color.WHITE);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机的分辨率从 dp 的单位 转成为 px(像素)
|
||||
*/
|
||||
public static int dip2px(Context context, float dpValue) {
|
||||
final float scale = context.getResources().getDisplayMetrics().density;
|
||||
return (int) (dpValue * scale + 0.5f);
|
||||
}
|
||||
/**
|
||||
* 创建二维码位图 (支持自定义配置和自定义样式)
|
||||
*
|
||||
|
||||
@@ -1,120 +1,180 @@
|
||||
<?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"
|
||||
|
||||
tools:context=".EntranceguardControl1Activity">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f7f7f7"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_height="match_parent">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<ScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:fitsSystemWindows="true"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f7f7f7"
|
||||
android:layout_height="match_parent">
|
||||
android:fitsSystemWindows="true">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:background="#f7f7f7"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f7f7f7">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="match_parent"
|
||||
android:background="#f7f7f7"
|
||||
|
||||
android:layout_height="match_parent">
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_address"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="35dp"
|
||||
android:background="@color/LightGraydddddd"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_address"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="16dp"
|
||||
android:layout_weight="1"
|
||||
/>
|
||||
|
||||
<ImageView
|
||||
android:layout_width="14dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginRight="16dp"
|
||||
android:src="@mipmap/returnme"
|
||||
|
||||
/>
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/retacal_background"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dip"
|
||||
android:background="@drawable/retacal_background"
|
||||
android:orientation="vertical"
|
||||
android:paddingLeft="15dip"
|
||||
android:paddingRight="15dip"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingRight="15dip">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:text="时间"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center"
|
||||
|
||||
android:layout_margin="20dip"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
android:gravity="center"
|
||||
android:text="时间" />
|
||||
|
||||
<RadioGroup
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/myradio2"
|
||||
android:layout_height="wrap_content">
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:text="7天"
|
||||
android:button="@null" android:background="@drawable/drawableforitemnormal"
|
||||
android:padding="20dip"
|
||||
android:id="@+id/myradio21"
|
||||
android:layout_margin="3dip"
|
||||
android:layout_height="wrap_content" />
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:text="1月"
|
||||
android:button="@null" android:background="@drawable/drawableforitemnormal"
|
||||
android:padding="20dip"
|
||||
android:id="@+id/myradio22"
|
||||
android:layout_margin="3dip"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
android:layout_height="wrap_content" />
|
||||
<RadioButton
|
||||
android:layout_width="wrap_content"
|
||||
android:text="3月"
|
||||
android:id="@+id/myradio23"
|
||||
android:padding="20dip"
|
||||
android:button="@null" android:background="@drawable/drawableforitemnormal"
|
||||
android:layout_margin="3dip"
|
||||
<RadioButton
|
||||
android:id="@+id/myradio21"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="3dip"
|
||||
android:background="@drawable/drawableforitemnormal"
|
||||
android:button="@null"
|
||||
android:padding="20dip"
|
||||
android:checked="true"
|
||||
android:text="7天" />
|
||||
|
||||
android:layout_height="wrap_content" />
|
||||
<RadioButton
|
||||
android:id="@+id/myradio22"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="3dip"
|
||||
android:background="@drawable/drawableforitemnormal"
|
||||
android:button="@null"
|
||||
android:padding="20dip"
|
||||
|
||||
android:text="1月" />
|
||||
|
||||
<RadioButton
|
||||
android:id="@+id/myradio23"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="3dip"
|
||||
android:background="@drawable/drawableforitemnormal"
|
||||
android:button="@null"
|
||||
android:padding="20dip"
|
||||
|
||||
android:text="3月" />
|
||||
</RadioGroup>
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/lightlittleGrey"
|
||||
android:layout_height="0.5dip"/>
|
||||
android:layout_height="0.5dip"
|
||||
android:background="@color/lightlittleGrey" />
|
||||
<!-- <LinearLayout-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:orientation="vertical"-->
|
||||
<!-- android:layout_height="wrap_content">-->
|
||||
<!-- <TextView-->
|
||||
<!-- android:layout_width="wrap_content"-->
|
||||
<!-- android:text="地址"-->
|
||||
<!-- android:layout_marginLeft="20dip"-->
|
||||
<!-- android:layout_marginRight="20dp"-->
|
||||
<!-- android:layout_marginTop="20dp"-->
|
||||
<!-- android:layout_height="wrap_content" />-->
|
||||
<!-- <RadioGroup-->
|
||||
<!-- android:layout_width="match_parent"-->
|
||||
<!-- android:id="@+id/myradio"-->
|
||||
<!-- android:layout_margin="18dip"-->
|
||||
<!-- android:layout_height="match_parent">-->
|
||||
|
||||
<!-- </RadioGroup>-->
|
||||
<!-- </LinearLayout>-->
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:text="地址"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_marginRight="20dp"
|
||||
android:layout_marginTop="20dp"
|
||||
android:layout_height="wrap_content" />
|
||||
<RadioGroup
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="20dip"
|
||||
android:text="访客手机号" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/telephone"
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/myradio"
|
||||
android:layout_margin="18dip"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
</RadioGroup>
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="20dip"
|
||||
android:background="@null"
|
||||
android:hint="访客手机号"
|
||||
android:textSize="@dimen/textedit" />
|
||||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
|
||||
android:background="@drawable/selector_common_btn"
|
||||
android:text="确认授权"
|
||||
<TextView
|
||||
android:id="@+id/confirm"
|
||||
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginTop="20dip"
|
||||
android:padding="15dip"
|
||||
android:gravity="center"
|
||||
android:layout_marginRight="15dip"
|
||||
android:textColor="@color/white"
|
||||
android:layout_marginBottom="50dip"
|
||||
android:layout_height="wrap_content" />
|
||||
android:background="@drawable/selector_common_btn"
|
||||
android:gravity="center"
|
||||
android:padding="15dip"
|
||||
android:text="确认授权"
|
||||
android:textColor="@color/white" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
</ScrollView>
|
||||
|
||||
244
app/src/main/res/layout/dialog_bind_house.xml
Normal file
244
app/src/main/res/layout/dialog_bind_house.xml
Normal file
@@ -0,0 +1,244 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@drawable/_xpopup_round3_bg"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="5dp"
|
||||
android:gravity="center_horizontal"
|
||||
android:text="绑定房屋"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="16sp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_qu"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="小区"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_qu"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请选择小区"
|
||||
android:text="@{myentity.string1}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:background="@mipmap/returnme" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dip"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip"
|
||||
android:background="@color/lighteeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_lou"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="楼号"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/lou"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请选择楼号"
|
||||
android:text="@{myentity.string2}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:background="@mipmap/returnme" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dip"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip"
|
||||
android:background="@color/lighteeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_dan"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="单元"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/dan"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请选择单元"
|
||||
android:text="@{myentity.string3}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:background="@mipmap/returnme" />
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dip"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip"
|
||||
android:background="@color/lighteeeeee" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/ll_fang"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="40dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center_vertical"
|
||||
android:text="房号"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/fang"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:layout_weight="1"
|
||||
android:background="@null"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请选择房号"
|
||||
android:text="@{myentity.string4}"
|
||||
android:textColor="#333333"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<ImageView
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="14dp"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:layout_marginLeft="20dip"
|
||||
android:background="@mipmap/returnme"
|
||||
android:paddingBottom="7dp" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_name"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:digits="0123456789xX"
|
||||
android:hint="请输入户主姓名"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<EditText
|
||||
android:id="@+id/et_cardNumber"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dp"
|
||||
android:layout_marginStart="15dip"
|
||||
android:layout_marginEnd="15dip"
|
||||
android:hint="请输入身份证号"
|
||||
android:inputType="number"
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
android:background="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_submit"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="提交"
|
||||
android:textColor="@color/colorPrimary" />
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
89
app/src/main/res/layout/dialog_share_cede.xml
Normal file
89
app/src/main/res/layout/dialog_share_cede.xml
Normal file
@@ -0,0 +1,89 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="300dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="@drawable/retacal_background"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="17dip"
|
||||
android:gravity="center"
|
||||
android:text="授权临时门禁"
|
||||
android:textSize="17sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dip"
|
||||
android:layout_marginLeft="15dip"
|
||||
android:layout_marginRight="15dip"
|
||||
android:background="@color/lightlittleGrey" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title2"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
android:layout_margin="17dip"
|
||||
android:gravity="center"
|
||||
android:text="密码"
|
||||
android:textSize="15sp" />
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/myImage"
|
||||
android:layout_width="220dp"
|
||||
android:layout_height="220dp"
|
||||
android:layout_gravity="center"
|
||||
android:src="@mipmap/qrcode" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/title3"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginLeft="50dip"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginRight="50dip"
|
||||
android:gravity="center"
|
||||
android:text="注:分享临时门禁给访客,扫描二维码或输入密码开门"
|
||||
|
||||
android:textSize="14sp" />
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0.5dp"
|
||||
android:layout_marginTop="8dp"
|
||||
|
||||
android:background="@color/gray" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="45dp"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_share"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="微信分享"
|
||||
android:textColor="@color/colorPrimary" />
|
||||
|
||||
<View
|
||||
android:layout_width="0.5dp"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/gray" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_cancel"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_weight="1"
|
||||
android:gravity="center"
|
||||
android:text="取消"
|
||||
android:textColor="@color/black" />
|
||||
</LinearLayout>
|
||||
</LinearLayout>
|
||||
@@ -22,7 +22,8 @@
|
||||
android:layout_marginTop="@dimen/mystatusbar"
|
||||
android:orientation="vertical">
|
||||
|
||||
<RelativeLayout
|
||||
<LinearLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@+id/l1"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="50dip"
|
||||
@@ -31,7 +32,9 @@
|
||||
android:theme="@style/AppTheme.AppBarOverlay">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:id="@+id/tv1_address"
|
||||
android:layout_weight="1"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="match_parent"
|
||||
android:gravity="center"
|
||||
android:text="@string/app_name"
|
||||
@@ -42,12 +45,11 @@
|
||||
android:id="@+id/scan"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="match_parent"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_marginRight="15dip"
|
||||
android:src="@mipmap/shaomiao" />
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
||||
|
||||
<RelativeLayout
|
||||
android:layout_width="match_parent"
|
||||
|
||||
Reference in New Issue
Block a user