android - 房源登记模版
[1] 实现顺序
房源登记-》房源预审核-》
房屋信息house_regist01 (首页改为模版)-》
选择模版(添加模版+模版列表)-》
编辑模版
[2] 具体图片
[3] 实现代码
house_regist01 Layout
<com.cnhct.hechen.View.Titlebar
android:id="@+id/titlebar_house_regist01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red"
android:padding="10sp"
custom:leftButtonText="返回"
custom:leftButtonTextColor="@color/white"
custom:leftButtonTextSize="8sp"
custom:rightButtonText="模版"
custom:rightButtonTextSize="8sp"
custom:rightButtonTextColor="@color/white"
custom:titleColor="@color/colorWhite"
custom:titleSize="8sp"
custom:titleText="房屋信息">
house_regist01 Activity
public void initDate() {
tb = (Titlebar) findViewById(R.id.titlebar_house_regist01);
tb.setOnButtonClickListener(new Titlebar.OnButtonClickListener() {
@Override
public void onLeftClick() {
final WarningDialog dialog = SmartisanDialog.createWarningDialog(house_regist01.this);
dialog.setTitle("您信息尚未填写完整,确定退出吗")
.setConfirmText("退出")
.show();
dialog.setOnConfirmListener(new WarningDialog.OnConfirmListener() {
@Override
public void onConfirm() {
EventBus.getDefault().post("FLAG_FINISH_ALL");
dialog.dismiss();
}
});
}
@Override
public void onRightClick() {
//选择模版
Intent intent = new Intent(house_regist01.this, TemplateListActivity.class);
startActivity(intent);
finish();
}
});
TemplateListActivity 选择模版(添加模版+模版列表)
Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:custom="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.cnhct.hechen.activity.TemplateListActivity">
<com.cnhct.hechen.View.Titlebar
android:id="@+id/titlebar_template"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red"
android:padding="10sp"
custom:leftButtonText="返回"
custom:leftButtonTextColor="@color/white"
custom:leftButtonTextSize="8sp"
custom:rightButtonText="首页"
custom:rightButtonTextColor="@color/white"
custom:rightButtonTextSize="8sp"
custom:titleColor="@color/colorWhite"
custom:titleSize="8sp"
custom:titleText="选择模版">
</com.cnhct.hechen.View.Titlebar>
<TextView
android:layout_width="match_parent"
android:layout_height="3dp"/>
<Button
android:id="@+id/btn_add"
android:layout_width="match_parent"
android:layout_height="45dp"
android:text="@string/add"
android:layout_marginLeft="2dp"
android:layout_marginRight="2dp"
android:background="@drawable/btn_shape"
android:textColor="@android:color/holo_red_light"
android:textSize="18sp" />
<TextView
android:layout_width="match_parent"
android:layout_height="3dp"/>
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/layout_swipe_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp">
<android.support.v7.widget.RecyclerView
android:id="@+id/new_recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
template_item
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="@color/gray"/>
<TextView
android:id="@+id/tv_template_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/template_one"
android:textColor="@color/black"
android:textSize="20sp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_template_time"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="10"
android:text="@string/time"
android:textColor="@color/wgray"
android:textSize="16sp" />
<Button
android:id="@+id/btn_template_use"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/shape"
android:text="@string/user"
android:textColor="@color/red"
android:textSize="12sp" />
</LinearLayout>
<TextView
android:layout_height="1dp"
android:layout_width="match_parent"
android:background="@color/gray"/>
</LinearLayout>
btn_shape
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 边框颜色值 -->
<item>
<shape>
<solid android:color="@android:color/holo_red_dark" />
<!-- android:radius 弧形的半径 -->
<corners android:radius="5dip" />
</shape>
</item>
<!-- 主体背景颜色值,控件间的间距 -->
<item
android:bottom="1dp"
android:top="1dp"
android:left="1dp"
android:right="1dp">
<shape>
<solid android:color="@android:color/white" />
</shape>
</item>
</layer-list>
TemplateListActivity
package com.cnhct.hechen.activity;
import android.content.Intent;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.KeyEvent;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;
import com.cnhct.hechen.R;
import com.cnhct.hechen.View.Titlebar;
import com.cnhct.hechen.adapter.TemplateRecyclerViewAdapter;
import cc.duduhuo.dialog.smartisan.SmartisanDialog;
import cc.duduhuo.dialog.smartisan.WarningDialog;
public class TemplateListActivity extends AppCompatActivity {
private RecyclerView mRecyclerView;
private SwipeRefreshLayout mSwipeRefreshLayout;
private LinearLayoutManager mLinearLayoutManager;
private TemplateRecyclerViewAdapter mTemplateRecyclerViewAdapter;
private Button btn_add;
private Titlebar tb;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_template_list);
initView();
mLinearLayoutManager = new LinearLayoutManager(this);
mTemplateRecyclerViewAdapter = new TemplateRecyclerViewAdapter(TemplateListActivity.this);
mRecyclerView.setLayoutManager(mLinearLayoutManager);
mRecyclerView.setAdapter(mTemplateRecyclerViewAdapter);
mTemplateRecyclerViewAdapter.setOnItemClickListener(new TemplateRecyclerViewAdapter.OnItemClickListener()
{
@Override
public void OnItemClick(View view, int position) {
int i = position +1;
Toast.makeText(TemplateListActivity.this,"选择模版"+i,Toast.LENGTH_SHORT).show();
}
});
mSwipeRefreshLayout.setOnRefreshListener(new SwipeRefreshLayout.OnRefreshListener() {
public void onRefresh() {
mTemplateRecyclerViewAdapter.notifyDataSetChanged();
mSwipeRefreshLayout.setRefreshing(false);
}
});
btn_add.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Intent intent = new Intent(TemplateListActivity.this, template.class);
startActivity(intent);
finish();
}
});
}
private void initView(){
mRecyclerView = (RecyclerView)findViewById(R.id.new_recyclerView);
mSwipeRefreshLayout = (SwipeRefreshLayout)findViewById(R.id.layout_swipe_refresh);
btn_add = (Button)findViewById(R.id.btn_add);
tb = (Titlebar) findViewById(R.id.titlebar_template);
tb.setOnButtonClickListener(new Titlebar.OnButtonClickListener() {
@Override
public void onLeftClick() {
final WarningDialog dialog = SmartisanDialog.createWarningDialog(TemplateListActivity.this);
dialog.setTitle("您信息尚未填写完整,确定退出吗")
.setConfirmText("退出")
.show();
dialog.setOnConfirmListener(new WarningDialog.OnConfirmListener() {
@Override
public void onConfirm() {
//EventBus.getDefault().post("FLAG_FINISH_ALL");
Intent intent1 =new Intent(TemplateListActivity.this,house_regist01.class);
startActivity(intent1);
finish();
dialog.dismiss();
}
});
}
@Override
public void onRightClick() {
//返回首页
Intent intent2 = new Intent(TemplateListActivity.this, home.class);
startActivity(intent2);
finish();
}
});
}
/**
* 监听返回键
* @param keyCode 键
* @param event 事件
* @return
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
final WarningDialog dialog = SmartisanDialog.createWarningDialog(TemplateListActivity.this);
dialog.setTitle("您信息尚未填写完整,确定退出吗")
.setConfirmText("退出")
.show();
dialog.setOnConfirmListener(new WarningDialog.OnConfirmListener() {
@Override
public void onConfirm() {
//EventBus.getDefault().post("FLAG_FINISH_ALL");
Intent intent =new Intent(TemplateListActivity.this,house_regist01.class);
startActivity(intent);
finish();
dialog.dismiss();
}
});
}
return super.onKeyDown(keyCode, event);
}
}
TemplateRecyclerViewAdapter
package com.cnhct.hechen.adapter;
import android.content.Context;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;
import com.cnhct.hechen.R;
public class TemplateRecyclerViewAdapter extends RecyclerView.Adapter<TemplateRecyclerViewAdapter.ViewHolder>{
private LayoutInflater layoutInflater;
private Context mContext;
public TemplateRecyclerViewAdapter(Context context){
this.mContext = context;
layoutInflater = LayoutInflater.from(context);
}
@Override
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType){
View itemView=layoutInflater.inflate(R.layout.template_item, parent,false);
ViewHolder viewHolder=new ViewHolder(itemView);
return viewHolder;
}
@Override
public void onBindViewHolder(ViewHolder holder, int position){
holder.itemView.setTag(position);
}
@Override
public int getItemCount(){
return 1;
}
class ViewHolder extends RecyclerView.ViewHolder{
private TextView tv_template_title;
private TextView tv_template_time;
private Button btn_template_use;
public ViewHolder(View itemView){
super(itemView);
tv_template_title = (TextView)itemView.findViewById(R.id.tv_template_title);
tv_template_time = (TextView)itemView.findViewById(R.id.tv_template_time);
btn_template_use = (Button)itemView.findViewById(R.id.btn_template_use);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
if (onItemClickListener!=null){
onItemClickListener.OnItemClick(v,(int)v.getTag());
}
}
});
}
}
public interface OnItemClickListener{
void OnItemClick(View view, int position);
}
private OnItemClickListener onItemClickListener;
public void setOnItemClickListener(OnItemClickListener onItemClickListener){
this.onItemClickListener=onItemClickListener;
}
}
编辑模版
activity_template_layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
xmlns:custom="http://schemas.android.com/apk/res-auto"
android:id="@+id/activity_template"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.cnhct.hechen.activity.template">
<com.cnhct.hechen.View.Titlebar
android:id="@+id/title_bar_template"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/red"
android:padding="10sp"
custom:leftButtonText="返回"
custom:leftButtonTextColor="@android:color/white"
custom:leftButtonTextSize="8sp"
custom:rightButtonText="首页"
custom:rightButtonTextColor="@android:color/white"
custom:rightButtonTextSize="8sp"
custom:titleColor="@color/colorWhite"
custom:titleSize="8sp"
custom:titleText="编辑模版">
</com.cnhct.hechen.View.Titlebar>
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="none"
tools:ignore="UselessParent">
<LinearLayout
android:id="@+id/linear_page"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="10dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/administrative"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/sp_xzq_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:hint="@string/choose"
android:spinnerMode="dialog"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/town"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/sp_jd_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:spinnerMode="dialog"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/street"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<AutoCompleteTextView
android:id="@+id/auto_tv_house01_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:hint="@string/keywords"
android:spinnerMode="dialog"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/gatehouse"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/sp_mlp_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:inputType=""
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/adress"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_Address_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/roomNU"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/wordTrack"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_house_reg01_zg_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/caseNumber"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_ah_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="TextFields" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/blank"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/license"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_hnum_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:inputType="number"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/propertyArea"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_house_regist_cqmj_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/squareMeter"
android:inputType="number"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/propertyOwner"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_name_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="TextFields" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:id="@+id/layout_hreg01_gjdq"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/region"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_hreg01_nation_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:id="@+id/layout_hreg01_zjlx"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/typeOfCertificate"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/tv_hreg01_zjlx_template"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/IDnumber"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content"
tools:ignore="TooManyViews" />
<EditText
android:id="@+id/et_cardnum_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:inputType="number"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="TooManyViews" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/mobilePhone"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_call_template"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:inputType="number"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/publishTitle"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_reg_title"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:focusable="true"
android:focusableInTouchMode="true"
android:maxLength="20"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="TextFields" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/propertyAddress"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_housesaddress"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:textColor="@color/black"
android:textSize="15sp"
tools:ignore="TextFields" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/use"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/sp_fwyt"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/toward"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_oritation"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/buildingProperties"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_house_info"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/totalFloors"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_house_gylc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/fllor"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_storey"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/decoration"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_fixinfo"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rentalArea"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_acreage"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:focusable="true"
android:focusableInTouchMode="true"
android:hint="@string/meter"
android:inputType="number"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/HUxing"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_shi"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<EditText
android:id="@+id/et_describe"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:background="@drawable/shape_gray_square_bg"
android:gravity="top"
android:hint="@string/description"
android:lines="5"
android:maxLength="200"
android:textSize="13sp" />
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/paymentMethod"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_paymethod"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/asterisk"
android:textColor="@color/red" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/rent"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/et_rent"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@null"
android:ems="10"
android:inputType="number"
android:maxLines="1"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/gray"
android:paddingTop="10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/leasingMethods"
android:textSize="15sp" />
<TextView
android:layout_width="5dp"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/et_Leasemode"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ems="10"
android:hint="@string/choose"
android:textColor="@color/black"
android:textSize="15sp" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/shui_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/waterl" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/dian_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/electricitying" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/lanqi_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/heat" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/kuandai_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/broadband" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/dianti_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/elevatoring" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/dianshi_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/TV" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/meiqi_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/gasing" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/lutai_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/terrace" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/chewei_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/ParkingSpace" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/ccroom_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/storageRoom" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="0.2" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/chuang_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/bed" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/dianhua_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/phone" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/kongtiao_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/conditioning" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/bingxiang_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/refrigerator" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/chuju_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/kitchenware" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/jiaju_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/furniture" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/weibolu_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/MicrowaveOven" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<CheckBox
android:id="@+id/xiyiji_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/washingMachine" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingBottom="10dp"
android:paddingLeft="5dp"
android:paddingRight="5dp"
android:paddingTop="10dp">
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
<CheckBox
android:id="@+id/reshuiqi_reg"
android:layout_width="0dp"
android:layout_height="30dp"
android:layout_weight="1"
android:background="@drawable/zf_ck__bg"
android:button="@null"
android:checked="false"
android:gravity="center"
android:text="@string/WaterHeater" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.2" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.1" />
</LinearLayout>
</LinearLayout>
<include layout="@layout/horizontal_divider_10dp" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:paddingRight="5dp">
<Button
android:id="@+id/btn_save_template"
android:layout_width="match_parent"
android:layout_height="35dp"
android:background="@color/main_color"
android:text="@string/saveTemplate"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
template_activity
package com.cnhct.hechen.activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.Gravity;
import android.view.KeyEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.AutoCompleteTextView;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.AuthFailureError;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.Response;
import com.android.volley.VolleyError;
import com.android.volley.toolbox.StringRequest;
import com.android.volley.toolbox.Volley;
import com.cnhct.hechen.R;
import com.cnhct.hechen.View.SelectPicPopupWindow;
import com.cnhct.hechen.View.Titlebar;
import com.cnhct.hechen.adapter.GvUpdatePicAdapter;
import com.cnhct.hechen.entity.Address;
import com.cnhct.hechen.entity.CodeDetail;
import com.cnhct.hechen.entity.HouseInfo;
import com.cnhct.hechen.utils.CheckIdCard;
import com.cnhct.hechen.utils.HttpUtils;
import com.cnhct.hechen.utils.PhoneFormatCheckUtils;
import com.cnhct.hechen.utils.ProgressHUD;
import com.cnhct.hechen.utils.ToastUtil;
import com.cnhct.hechen.utils.getJsonUtils;
import com.cnhct.hechen.utils.getListUtils;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonSyntaxException;
import com.google.gson.reflect.TypeToken;
import net.tsz.afinal.FinalHttp;
import net.tsz.afinal.http.AjaxCallBack;
import net.tsz.afinal.http.AjaxParams;
import org.greenrobot.eventbus.EventBus;
import org.greenrobot.eventbus.Subscribe;
import org.greenrobot.eventbus.ThreadMode;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import butterknife.BindView;
import butterknife.ButterKnife;
import cc.duduhuo.dialog.smartisan.OptionListDialog;
import cc.duduhuo.dialog.smartisan.SmartisanDialog;
import cc.duduhuo.dialog.smartisan.WarningDialog;
import cc.duduhuo.dialog.smartisan.listener.OnOptionItemSelectListener;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.RequestBody;
/**
* 1. ButterKnife 获取组件
* 2. 定义组件对应的变量
*/
public class template extends AppCompatActivity implements View.OnClickListener{
@BindView(R.id.title_bar_template) Titlebar title_bar_template;
@BindView(R.id.sp_xzq_template) TextView sp_xzq_template;
@BindView(R.id.sp_jd_template) TextView sp_jd_template;
@BindView(R.id.auto_tv_house01_template) AutoCompleteTextView auto_tv_house01_template;
@BindView(R.id.sp_mlp_template) EditText sp_mlp_template;
@BindView(R.id.et_Address_template) EditText et_Address_template;
@BindView(R.id.tv_house_reg01_zg_template) TextView tv_house_reg01_zg_template;
@BindView(R.id.et_ah_template) EditText et_ah_template;
@BindView(R.id.et_hnum_template) EditText et_hnum_template;
@BindView(R.id.et_house_regist_cqmj_template) EditText et_house_regist_cqmj_template;
@BindView(R.id.et_name_template) EditText et_name_template;
@BindView(R.id.tv_hreg01_nation_template) TextView tv_hreg01_nation_template;
@BindView(R.id.tv_hreg01_zjlx_template) TextView tv_hreg01_zjlx_template;
@BindView(R.id.et_cardnum_template) EditText et_cardnum_template;
@BindView(R.id.et_call_template) EditText et_call_template;
@BindView(R.id.et_reg_title) EditText et_reg_title;
@BindView(R.id.et_housesaddress) EditText et_housesaddress;
@BindView(R.id.sp_fwyt) TextView sp_fwyt;
@BindView(R.id.et_oritation) TextView et_oritation;
@BindView(R.id.et_house_info) TextView et_house_info;
@BindView(R.id.et_house_gylc) TextView et_house_gylc;
@BindView(R.id.et_storey) TextView et_storey;
@BindView(R.id.et_fixinfo) TextView et_fixinfo;
@BindView(R.id.et_acreage) EditText et_acreage;
@BindView(R.id.et_shi) TextView et_shi;
@BindView(R.id.et_describe) EditText et_describe;
@BindView(R.id.et_paymethod) TextView et_paymethod;
@BindView(R.id.et_rent) EditText et_rent;
@BindView(R.id.et_Leasemode) TextView et_Leasemode;
@BindView(R.id.shui_reg) CheckBox shui_reg;
@BindView(R.id.dian_reg) CheckBox dian_reg;
@BindView(R.id.lanqi_reg) CheckBox lanqi_reg;
@BindView(R.id.kuandai_reg) CheckBox kuandai_reg;
@BindView(R.id.dianti_reg) CheckBox dianti_reg;
@BindView(R.id.dianshi_reg) CheckBox dianshi_reg;
@BindView(R.id.meiqi_reg) CheckBox meiqi_reg;
@BindView(R.id.lutai_reg) CheckBox lutai_reg;
@BindView(R.id.chewei_reg) CheckBox chewei_reg;
@BindView(R.id.ccroom_reg) CheckBox ccroom_reg;
@BindView(R.id.chuang_reg) CheckBox chuang_reg;
@BindView(R.id.dianhua_reg) CheckBox dianhua_reg;
@BindView(R.id.kongtiao_reg) CheckBox kongtiao_reg;
@BindView(R.id.bingxiang_reg) CheckBox bingxiang_reg;
@BindView(R.id.chuju_reg) CheckBox chuju_reg;
@BindView(R.id.jiaju_reg) CheckBox jiaju_reg;
@BindView(R.id.weibolu_reg) CheckBox weibolu_reg;
@BindView(R.id.xiyiji_reg) CheckBox xiyiji_reg;
@BindView(R.id.reshuiqi_reg) CheckBox reshuiqi_reg;
@BindView(R.id.btn_save_template) Button btn_save_template;
private List<String> xzq_list;
private String code;
private List<Address> list_jz;
private List<String> mList_jz;
private String jzCode;
private RequestQueue queue;
private ProgressHUD mProgressHUD;
private List<Address> list_jlx;
private List<String> mList_jlx;
private String jlxCode;
private List<CodeDetail> listCodeDetail;
private List<CodeDetail> listCodeDetailZg;
private List<String> mListNation;
private List<String> mListCode;
private String nationCode;
private List<String> mListZgName;
private List<String> mListZgCode;
private String zgCode;
private List<String> cardtype_list;
private List<String> mlistZjlxCode;
private List<String> mListLdxz;
private List<String> mListFwyt;
private List<String> mListGylc;
private List<String> mListOritation;
private List<String> mListFixInfo;
private List<String> mListPayMethod;
private List<String> mListLeaseMode;
private String gylc;
private String shi;
private String ting;
private String chu;
private String wei;
SelectPicPopupWindow menuWindow;//厅室选择器
private String HZQ = "天河区"; //行政区名称
private String JZ; //街镇名称
private String JLX; //街路巷名称
private String MLP; //门楼牌
private String XZ; //详址
private String ZG; //字轨
private String AH; //案号
private String CQZH ;//产权证号
private String CQMJ ;//产权面积
private double areaValue = 1.0;
private String YZXM ;//业主姓名
private String GJDQ ;//国籍地区
private String ZJLX ;//证件类型
private String SFZH ;//身份证号
private String YZDH ; //业主电话
private String FBBT ;//发布标题
private String LPDZ ;//楼盘地址
private String FWYT ;//房屋用途
private String CX ;//朝向
private String LDXZ ;//楼栋性质
private String ZLC ;//总楼层
private String floor; //所属楼层
private String ZXCD; //装修程度
private String CZMJ ;//出租面积
private String HXS ; //户型(室)
private String FYMS; //房源描述
private String ZJZFFS; //租金支付方式
private String ZJ; //租金
private String ZLFS ;//租赁方式
private String PZS ;//配置水
private String PZD ;//配置电
private String PZNQ ;//配置暖气
private String PZKD ;//配置宽带
private String PZDT ;//配置电梯
private String PZDS ;//配置电视
private String PZMQ ;//配置煤气
private String PZLTHY ;//配置露台花园
private String PZCWCK ;//配置车位车库
private String PZCCSDXS ;//配置储藏室地下室
private String PZC ;//配置床
private String PZDH ;//配置电话
private String PZKT ;//配置空调
private String PZBX ;//配置冰箱
private String PZCJ ;//配置厨具
private String PZJJ ;//配置家具
private String PZWBL ;//配置微波炉
private String PZXYJ ;//配置洗衣机
private String PZRSQ ;//配置热水器
private HouseInfo houseInfo;
private String userId;
private SharedPreferences pref;
private GvUpdatePicAdapter adapter_old;
private String path;
private Button buttonSubmit;
private String type;
private double latitude, longitude;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_template);
Log.i("执行","这里");
ButterKnife.bind(this);
EventBus.getDefault().register(this);
houseInfo = new HouseInfo();
initEvent();
queue = Volley.newRequestQueue(this);
mProgressHUD = ProgressHUD.show(template.this, "请稍等", true, true, null);
mProgressHUD.dismiss();
initData();
queryZg(); //请求字轨
selectNationalityArea(); //选择国籍地区
pref = PreferenceManager.getDefaultSharedPreferences(this);
userId = pref.getString("userId", "");
type = pref.getString("type", "");
Log.i("userId"+userId,"type"+type);
}
private void initEvent(){
//标题栏
title_bar_template.setOnButtonClickListener(new Titlebar.OnButtonClickListener() {
@Override
public void onLeftClick() {
//返回模版列表
final WarningDialog dialog = SmartisanDialog.createWarningDialog(template.this);
dialog.setTitle("您信息尚未填写完整,确定退出吗")
.setConfirmText("退出")
.show();
dialog.setOnConfirmListener(new WarningDialog.OnConfirmListener() {
@Override
public void onConfirm() {
//EventBus.getDefault().post("FLAG_FINISH_ALL");
Intent intent = new Intent(template.this,TemplateListActivity.class);
startActivity(intent);
finish();
dialog.dismiss();
}
});
}
@Override
public void onRightClick() {
//首页
Intent intent = new Intent(template.this, home.class);
startActivity(intent);
finish();
}
});
sp_xzq_template.setOnClickListener(this); //选择行政区
sp_jd_template.setOnClickListener(this); //街道
auto_tv_house01_template.setOnClickListener(this); //查询关键字
tv_hreg01_nation_template.setOnClickListener(this); //国籍地区
tv_hreg01_zjlx_template.setOnClickListener(this); //证件类型
sp_fwyt.setOnClickListener(this); //房屋用途
et_oritation.setOnClickListener(this); //朝向
et_house_info.setOnClickListener(this); //楼栋性质
et_house_gylc.setOnClickListener(this); //总楼层
et_storey.setOnClickListener(this); //所属楼层
et_fixinfo.setOnClickListener(this); //装修程度
et_shi.setOnClickListener(this); //户型
et_paymethod.setOnClickListener(this); //支付方式
et_Leasemode.setOnClickListener(this); //租赁方式
btn_save_template.setOnClickListener(this); //保存
}
//得到所有选择了的cb的值
public void getCbData() {
if (shui_reg.isChecked()) {
houseInfo.setPZS(1 + "");
}
if (dian_reg.isChecked()) {
houseInfo.setPZD(1 + "");
}
if (lanqi_reg.isChecked()) {
houseInfo.setPZNQ(1);
}
if (kuandai_reg.isChecked()) {
houseInfo.setPZKD(1);
}
if (dianti_reg.isChecked()) {
houseInfo.setPZDT(1 + "");
}
if (dianshi_reg.isChecked()) {
houseInfo.setPZDS(1);
}
if (meiqi_reg.isChecked()) {
houseInfo.setPZMQ(1);
}
if (lutai_reg.isChecked()) {
houseInfo.setPZLTHY(1 + "");
}
if (chewei_reg.isChecked()) {
houseInfo.setPZCWCK(1 + "");
}
if (ccroom_reg.isChecked()) {
houseInfo.setPZCCSDXS(1 + "");
}
if (chuang_reg.isChecked()) {
houseInfo.setPZC(1);
}
if (dianhua_reg.isChecked()) {
houseInfo.setPZDH(1 + "");
}
if (kongtiao_reg.isChecked()) {
houseInfo.setPZKT(1);
}
if (bingxiang_reg.isChecked()) {
houseInfo.setPZBX(1);
}
if (chuju_reg.isChecked()) {
houseInfo.setPZCJ(1 + "");
}
if (jiaju_reg.isChecked()) {
houseInfo.setPZJJ(1);
}
if (weibolu_reg.isChecked()) {
houseInfo.setPZWBL(1);
}
if (xiyiji_reg.isChecked()) {
houseInfo.setPZXYJ(1);
}
if (reshuiqi_reg.isChecked()) {
houseInfo.setPZXYJ(1);
}
Log.d("test", "===============" + houseInfo.getPZXYJ() + "=========");
}
private void initData() {
mListGylc = new ArrayList<>();
for (int i = 1; i < 100; i++) {
mListGylc.add(i + "");
}
cardtype_list = getListUtils.getListZjlx();
mlistZjlxCode = new ArrayList<>();
mlistZjlxCode.add("01");
mlistZjlxCode.add("02");
mlistZjlxCode.add("03");
mlistZjlxCode.add("05");
mlistZjlxCode.add("04");
mlistZjlxCode.add("06");
mlistZjlxCode.add("11");
mlistZjlxCode.add("12");
mlistZjlxCode.add("13");
mlistZjlxCode.add("14");
mlistZjlxCode.add("15");
mListFwyt = new ArrayList<>();
mListFwyt.add("住宅");
mListFwyt.add("商业");
mListFwyt.add("办公");
mListFwyt.add("仓库");
mListFwyt.add("其他");
mListFwyt.add("工厂");
mListLdxz = new ArrayList<>();
mListLdxz.add("电梯房");
mListLdxz.add("楼梯房");
mListOritation = new ArrayList<>();
mListOritation.add("东");
mListOritation.add("南");
mListOritation.add("西");
mListOritation.add("北");
mListOritation.add("东南");
mListOritation.add("西南");
mListOritation.add("东北");
mListOritation.add("西北");
mListOritation.add("东西");
mListOritation.add("南北");
mListOritation.add("不知朝向");
mListFixInfo = new ArrayList<>();
mListFixInfo.add("豪华装修");
mListFixInfo.add("精装修");
mListFixInfo.add("中等装修");
mListFixInfo.add("简装修");
mListFixInfo.add("毛坯");
mListFixInfo.add("普通装修");
mListPayMethod = new ArrayList<>();
mListPayMethod.add("押3付1");
mListPayMethod.add("押2付1");
mListPayMethod.add("押1付1");
mListPayMethod.add("押1付2");
mListPayMethod.add("年付不押");
mListPayMethod.add("半年付不押");
mListPayMethod.add("面议");
mListLeaseMode = new ArrayList<>();
mListLeaseMode.add("合租");
mListLeaseMode.add("整租");
}
@Override
public void onClick(View view){
switch (view.getId()){
case R.id.sp_xzq_template:
selectAdministrative();
break;
case R.id.sp_jd_template:
break;
case R.id.auto_tv_house01_template:
break;
case R.id.tv_hreg01_nation_template:
break;
case R.id.tv_hreg01_zjlx_template:
selectDocumentType(); //选择证件类型
break;
case R.id.sp_fwyt:
selectHousingPurposes(); //房屋用途
break;
case R.id.et_oritation:
selectToward(); //选择朝向
break;
case R.id.et_house_info:
selectBuildingProperties(); //楼栋性质
break;
case R.id.et_house_gylc:
selectBuildFloor(); //楼栋楼层
break;
case R.id.et_storey:
selectFloor(); //所属楼层
break;
case R.id.et_fixinfo:
selectDegreeOfDecoration(); //装修程度
break;
case R.id.et_shi:
selectHuxing(); //户型
break;
case R.id.btn_save_template:
Log.i("btn_save_template","onclick");
JudgeUserInputData(); //对数据进行判断
break;
case R.id.et_paymethod:
selectPaymentMethod(); //选择支付方式
break;
case R.id.et_Leasemode:
selectLeasingMethod(); //选择租赁方式
break;
}
}
/**
* 选择行政区
*/
private void selectAdministrative(){
xzq_list = getListUtils.getXZQWithNoTitle();
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择行政区")
.setOptionList(xzq_list)
.setItemGravity(Gravity.CENTER) // Item是居左、居中还是居右
.setLastColor(0xFF40B64A) // 上次选择的选项显示的颜色,用于区分
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
HZQ = xzq_list.get(position);
sp_xzq_template.setText(HZQ);
Map<String, String> map = new HashMap<String, String>();
map.put("海珠区", "440105");
map.put("天河区", "440106");
map.put("白云区", "440111");
map.put("黄埔区", "440112");
map.put("番禺区", "440113");
map.put("花都区", "440114");
map.put("南沙区", "440115");
map.put("从化区", "440117");
map.put("荔湾区", "440103");
map.put("越秀区", "440104");
map.put("增城区", "440118");
code = map.get(HZQ);
if (HZQ != null) {
queryPostJZ();
auto_tv_house01_template.addTextChangedListener(new TextWatcher() {
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
String text = auto_tv_house01_template.getText().toString().trim();
queryPostJLX(text);
}
@Override
public void afterTextChanged(Editable s) {
String text = auto_tv_house01_template.getText().toString();
queryPostJLX(text);
}
});
}
dialog.dismiss();
}
});
}
/**
* 发送网络请求街镇,Post 行政区代码过去
*/
private void queryPostJZ() {
AjaxParams params = new AjaxParams();
params.put("code", code);
FinalHttp http = new FinalHttp();
http.get(HttpUtils.ADDRESS_URL_JZ, params, new AjaxCallBack<Object>() {
@Override
public void onLoading(long count, long current) {
}
@Override
public void onSuccess(Object o) {
if (o != null) {
String json = o.toString();
System.out.println("---" + json);
try {
Gson gson = new Gson();
list_jz = gson.fromJson(json, new TypeToken<List<Address>>() {
}.getType());
if (list_jz.size() > 0 && list_jz != null) {
mList_jz = new ArrayList<>();
for (int i = 0; i < list_jz.size(); i++) {
mList_jz.add(list_jz.get(i).getName());
}
}
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
sp_jd_template.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择街道")
.setOptionList(mList_jz)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
JZ = mList_jz.get(position);
jzCode = list_jz.get(position).getCode();
sp_jd_template.setText(JZ);
dialog.dismiss();
}
});
}
});
}
}
@Override
public void onFailure(Throwable t, int errorNo, String strMsg) {
}
});
}
/**
* 发送网络请求街路巷,Post 街路巷的输入值
* @param text
*/
private void queryPostJLX(final String text) {
final Response.Listener<String> listener = new Response.Listener<String>() {
public void onResponse(String json) {
mProgressHUD.dismiss();
if (json != null) {
try {
Gson gson = new Gson();
list_jlx = gson.fromJson(json, new TypeToken<List<Address>>() {
}.getType());//街路巷集合(包括名称和编码)
if (list_jlx != null) {
if (list_jlx.size() > 0 && list_jlx != null) {
mList_jlx = new ArrayList<>();//街路巷的名称集合
for (int i = 0; i < list_jlx.size(); i++) {
mList_jlx.add(list_jlx.get(i).getName());
}
ArrayAdapter<String> adapter = new ArrayAdapter<String>(
template.this,
android.R.layout.simple_dropdown_item_1line,
mList_jlx);
auto_tv_house01_template.setThreshold(1);//从第一个字符开始
auto_tv_house01_template.setAdapter(adapter);
adapter.notifyDataSetChanged();
auto_tv_house01_template.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
JLX = auto_tv_house01_template.getText().toString();
if (!JLX.equals("")) {
int p = 0;
for (int i = 0; i < mList_jlx.size(); i++) {
if (JLX.equals(mList_jlx.get(i))) {
p = i;
}
}
if (list_jlx != null && list_jlx.size() != 0) {
jlxCode = list_jlx.get(p).getCode();//从服务器获得的集合list_jlx
mProgressHUD.show();
}
}
}
});
}
}
} catch (JsonSyntaxException e) {
e.printStackTrace();
}
} else {
ToastUtil.ToastDemo(template.this, "暂无信息");
}
}
};
Response.ErrorListener errlistener = new Response.ErrorListener() {
public void onErrorResponse(VolleyError error) {
}
};
Request request = new StringRequest(Request.Method.POST, HttpUtils.URL_JLX_NEW, listener, errlistener) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map map = new HashMap();
map.put("code", code);//行政区的code
map.put("key", text);//发送输入框的值
return map;
}
};
queue.add(request);
queue.start();
}
/**
* 选择国籍地区
*/
private void selectNationalityArea(){
String json = getJsonUtils.getJson(this, "country.txt");
Gson gson = new Gson();
listCodeDetail = gson.fromJson(json, new TypeToken<List<CodeDetail>>() {
}.getType());
mListNation = new ArrayList<>();
mListCode = new ArrayList<>();
for (int i = 0; i < listCodeDetail.size(); i++) {
mListNation.add(listCodeDetail.get(i).getNAME());//国籍地区名称
mListCode.add(listCodeDetail.get(i).getCODE());//国籍地区代码
}
tv_hreg01_nation_template.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择国籍")
.setOptionList(mListNation)
.setItemGravity(Gravity.CENTER) // Item是居左、居中还是居右
.setLastColor(0xFF40B64A) // 上次选择的选项显示的颜色,用于区分
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
tv_hreg01_nation_template.setText(mListNation.get(position));
//国家的code
nationCode = mListCode.get(position);
dialog.dismiss();
}
});
}
});
}
//请求字轨
private void queryZg() {
final RequestQueue queue3 = Volley.newRequestQueue(template.this);
final Response.Listener<String> listener = new Response.Listener<String>() {
public void onResponse(String json) {
Gson gson = new Gson();
listCodeDetailZg = gson.fromJson(json, new TypeToken<List<CodeDetail>>() {
}.getType());
mListZgName = new ArrayList<>();
mListZgCode = new ArrayList<>();
for (int i = 0; i < listCodeDetailZg.size(); i++) {
mListZgName.add(listCodeDetailZg.get(i).getNAME());//字轨名称
mListZgCode.add(listCodeDetailZg.get(i).getCODE());//字轨代码
}
tv_house_reg01_zg_template.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择字轨")
.setOptionList(mListZgName)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
tv_house_reg01_zg_template.setText(mListZgName.get(position));
//字轨Code
zgCode = mListZgCode.get(position);
dialog.dismiss();
}
});
}
});
}
};
Response.ErrorListener errlistener = new Response.ErrorListener() {
public void onErrorResponse(VolleyError error) {
}
};
Request request = new StringRequest(Request.Method.POST, HttpUtils.URL_GETZG, listener, errlistener) {
@Override
protected Map<String, String> getParams() throws AuthFailureError {
Map map = new HashMap();
return map;
}
};
queue3.add(request);
queue3.start();
}
/**
* 选择证件类型
*/
private void selectDocumentType(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择证件类型")
.setOptionList(cardtype_list)
.setItemGravity(Gravity.CENTER) // Item是居左、居中还是居右
.setLastColor(0xFF40B64A) // 上次选择的选项显示的颜色,用于区分
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
tv_hreg01_zjlx_template.setText(cardtype_list.get(position));
ZJLX = mlistZjlxCode.get(position);
dialog.dismiss();
}
});
}
/**
* 选择房屋用途
*/
private void selectHousingPurposes(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择房屋用途")
.setOptionList(mListFwyt)
.setItemGravity(Gravity.CENTER) // Item是居左、居中还是居右
.setLastColor(0xFF40B64A) // 上次选择的选项显示的颜色,用于区分
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
sp_fwyt.setText(mListFwyt.get(position));
switch (position) {
case 0:
FWYT = "01";
break;
case 1:
FWYT = "11";
break;
case 2:
FWYT = "12";
break;
case 3:
FWYT = "13";
break;
case 4:
FWYT = "14";
break;
case 5:
FWYT = "20";
break;
}
dialog.dismiss();
}
});
}
/**
* 选择朝向
*/
private void selectToward(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择朝向")
.setOptionList(mListOritation)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_oritation.setText(mListOritation.get(position));
switch (position) {
case 0:
CX = "1";
break;
case 1:
CX = "3";
break;
case 2:
CX = "2";
break;
case 3:
CX = "4";
break;
case 4:
CX = "5";
break;
case 5:
CX = "6";
break;
case 6:
CX = "7";
break;
case 7:
CX = "8";
break;
case 8:
CX = "9";
break;
case 9:
CX = "10";
break;
case 10:
CX = "11";
break;
}
dialog.dismiss();
}
});
}
/**
* 选择楼栋性质
*/
private void selectBuildingProperties(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择楼栋性质")
.setOptionList(mListLdxz)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_house_info.setText(mListLdxz.get(position));
switch (position) {
case 0:
LDXZ = "01";
break;
case 1:
LDXZ = "02";
break;
}
dialog.dismiss();
}
});
}
/**
* 选择总楼层数
*/
private void selectBuildFloor(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择总楼层")
.setOptionList(mListGylc)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_house_gylc.setText(mListGylc.get(position));
gylc = mListGylc.get(position);
dialog.dismiss();
}
});
}
/**
* 选择所属楼层
*/
private void selectFloor(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择所在楼层")
.setOptionList(mListGylc)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_storey.setText(mListGylc.get(position));
floor = mListGylc.get(position);
dialog.dismiss();
}
});
}
/**
* 选择装修程度
*/
private void selectDegreeOfDecoration(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择装修程度")
.setOptionList(mListFixInfo)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_fixinfo.setText(mListFixInfo.get(position));
switch (position) {
case 0:
ZXCD = "6";
break;
case 1:
ZXCD = "4";
break;
case 2:
ZXCD = "3";
break;
case 3:
ZXCD = "5";
break;
case 4:
ZXCD = "1";
break;
case 5:
ZXCD = "2";
break;
}
dialog.dismiss();
}
});
}
/**
* 选择户型
*/
private void selectHuxing(){
//实例化SelectPicPopupWindow
menuWindow = new SelectPicPopupWindow(template.this, itemsOnClick);
//显示窗口
menuWindow.showAtLocation(template.this.findViewById(R.id.linear_page), Gravity.BOTTOM|Gravity.CENTER_HORIZONTAL, 0, 0);
}
//获得eventbus的通知后,重新刷新数据
@Subscribe(threadMode = ThreadMode.MAIN)
public void updateEventBus(String message) {
if (message.equals("FLAG_FINISH_ALL")) {
template.this.finish();
}else {
if (message != null) {
et_shi.setText(message);
shi = message.substring(0,1);
ting = message.substring(2,3);
chu = message.substring(4,5);
wei = message.substring(6,7);
}
}
}
//为弹出窗口实现监听类
private View.OnClickListener itemsOnClick = new View.OnClickListener(){
public void onClick(View v) {
menuWindow.dismiss();
switch (v.getId()) {
case R.id.t_picker:
break;
case R.id.s_picker:
break;
case R.id.c_picker:
break;
case R.id.w_picker:
break;
default:
break;
}
}
};
/**
* 选择支付方式
*/
private void selectPaymentMethod(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择支付方式")
.setOptionList(mListPayMethod)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_paymethod.setText(mListPayMethod.get(position));
switch (position) {
case 0:
ZJZFFS = "1";
break;
case 1:
ZJZFFS = "2";
break;
case 2:
ZJZFFS = "3";
break;
case 3:
ZJZFFS = "4";
break;
case 4:
ZJZFFS = "5";
break;
case 5:
ZJZFFS = "6";
break;
case 6:
ZJZFFS = "7";
break;
default:
ZJZFFS = "";
break;
}
dialog.dismiss();
}
});
}
/**
* 租赁方式
*/
private void selectLeasingMethod(){
final OptionListDialog dialog = SmartisanDialog.createOptionListDialog(template.this);
dialog.setTitle("请选择租赁方式")
.setOptionList(mListLeaseMode)
.setItemGravity(Gravity.CENTER)
.setLastColor(0xFF40B64A)
.show();
dialog.setOnOptionItemSelectListener(new OnOptionItemSelectListener() {
@Override
public void onSelect(int position, CharSequence option) {
et_Leasemode.setText(mListLeaseMode.get(position));
switch (position) {
case 0:
ZLFS = "02";
break;
case 1:
ZLFS = "01";
break;
}
dialog.dismiss();
}
});
}
public void getData(){
Log.i("TAG","getData");
HZQ = sp_xzq_template.getText().toString();
JZ = sp_jd_template.getText().toString();
JLX = auto_tv_house01_template.getText().toString();
MLP = sp_mlp_template.getText().toString();
XZ = et_Address_template.getText().toString();
ZG = tv_house_reg01_zg_template.getText().toString();
AH = et_ah_template.getText().toString();
CQZH = et_hnum_template.getText().toString();
CQMJ = et_house_regist_cqmj_template.getText().toString();
Log.i("TAG","getData"+HZQ+JZ+MLP+XZ+ZG+AH+CQZH+CQMJ);
YZXM = et_name_template.getText().toString();
GJDQ = tv_hreg01_nation_template.getText().toString();
ZJLX = tv_hreg01_zjlx_template.getText().toString();
SFZH = et_cardnum_template.getText().toString();
YZDH = et_call_template.getText().toString();
Log.i("TAG","getData"+YZXM+GJDQ+ZJLX+SFZH+YZDH);
FBBT = et_reg_title.getText().toString();
LPDZ = et_housesaddress.getText().toString();
FWYT = sp_fwyt.getText().toString();
CX = et_oritation.getText().toString();
LDXZ = et_house_info.getText().toString();
ZLC = et_house_gylc.getText().toString();
floor = et_storey.getText().toString();
ZXCD = et_fixinfo.getText().toString();
CZMJ = et_acreage.getText().toString();
HXS = et_shi.getText().toString();
Log.i("TAG","getData"+FBBT+LPDZ+FWYT+CX+LDXZ+ZLC+floor+PZLTHY+ZXCD+HXS);
FYMS = et_describe.getText().toString();
ZJZFFS = et_paymethod.getText().toString();
ZJ = et_rent.getText().toString();
ZLFS = et_Leasemode.getText().toString();
Log.i("TAG","getData"+FYMS+ZJZFFS+ZJ+ZLFS);
PZS = shui_reg.getText().toString();
PZD = dian_reg.getText().toString();
PZNQ =lanqi_reg.getText().toString();
PZKD = kuandai_reg.getText().toString();
PZDT = dianti_reg.getText().toString();
PZDS = dianshi_reg.getText().toString();
PZMQ = meiqi_reg.getText().toString();
PZLTHY = lutai_reg.getText().toString();
PZCWCK = chewei_reg.getText().toString();
PZCCSDXS = ccroom_reg.getText().toString();
Log.i("TAG","getData"+PZS+PZD+PZNQ+PZKD+PZDT+PZDS+PZMQ+PZLTHY+PZCWCK+PZCCSDXS);
PZC = chuang_reg.getText().toString();
PZDH = dianhua_reg.getText().toString();
PZKT = kongtiao_reg.getText().toString();
PZBX = bingxiang_reg.getText().toString();
PZCJ = chuju_reg.getText().toString();
PZJJ = jiaju_reg.getText().toString();
PZWBL = weibolu_reg.getText().toString();
PZXYJ = xiyiji_reg.getText().toString();
PZRSQ = reshuiqi_reg.getText().toString();
Log.i("TAG","getData"+PZC+PZDH+PZKT+PZKT+PZBX+PZCJ+PZJJ+PZWBL+PZXYJ+PZRSQ);
}
private void JudgeUserInputData(){
getData();
getCbData();
if (isNotEmpty(HZQ) && isNotEmpty(ZJ) && isNotEmpty(ZLC) && isNotEmpty(JLX) && isNotEmpty(MLP) && isNotEmpty(XZ) && isNotEmpty(FBBT) && isNotEmpty(YZDH)){
houseInfo.setUSERID(userId);
houseInfo.setSJLY(type);
Log.i("JudgeUserInputData","JudgeUserInputData"+HZQ+JZ+MLP+XZ+ZG+AH+CQZH+CQMJ);
Log.i("JudgeUserInputData","JudgeUserInputData"+PZC+PZDH+PZKT+PZKT+PZBX+PZCJ+PZJJ+PZWBL+PZXYJ+PZRSQ);
houseInfo.setHZQ(HZQ); //行政区
houseInfo.setJZ(JZ); //街镇
houseInfo.setJLX(JLX); //街道
houseInfo.setMLP(MLP);//门楼牌
houseInfo.setXZ(XZ);//详细地址
houseInfo.setZG(ZG);//字轨
houseInfo.setAH(AH);//案号
houseInfo.setCQZH(CQZH);//产权证号
houseInfo.setCQMJ(Double.valueOf(CQMJ));//产权面积
houseInfo.setYZXM(YZXM); //产权人姓名
houseInfo.setGJDQ(GJDQ);//国籍地区
houseInfo.setZJLX(ZJLX); //证件类型
houseInfo.setSFZH(SFZH); //证件号码
houseInfo.setYZDH(Long.valueOf(YZDH)); //手机号码
houseInfo.setFBBT(FBBT); //标题
houseInfo.setLPDZ(LPDZ); //楼盘地址
houseInfo.setFWYT(FWYT); //房屋用途
houseInfo.setCX(CX); //朝向
houseInfo.setLDXZ(LDXZ); //楼栋性质
houseInfo.setZLC(Integer.valueOf(ZLC)); //楼层总数
houseInfo.setZXCD(ZXCD);//装修程度
houseInfo.setCZMJ(Double.valueOf(CZMJ)); //租住面积
//houseInfo.setHXS(); //户型
houseInfo.setHXT(Integer.valueOf(ting)); //厅
houseInfo.setHXS(Integer.valueOf(shi)); //室
houseInfo.setHXC(Integer.valueOf(chu)); //厨
houseInfo.setHXW(Integer.valueOf(wei)); //卫
houseInfo.setJZ(ZJ); //租金
houseInfo.setFYMS(FYMS); //房源描述
houseInfo.setZJZFFS(ZJZFFS); //支付方式
houseInfo.setZLFS(ZLFS);//租赁方式
AnalysisIntoJson(); //将houseInfo解析成json数据,发送到后台
//StartAction(); //保存模版后,返回模版列表
}
else
{
if (isEmpty(HZQ)) {
ToastUtil.ToastDemo(template.this, "请选择行政区");
return;
}
if (isEmpty(JZ)) {
ToastUtil.ToastDemo(template.this, "请选择街道");
return;
}
if (isEmpty(JLX)) {
ToastUtil.ToastDemo(template.this, "请选择街路巷");
return;
}
if (isEmpty(MLP)) {
ToastUtil.ToastDemo(template.this, "请填写门楼牌");
return;
}
if (isEmpty(XZ)) {
ToastUtil.ToastDemo(template.this, "请填写详细地址");
return;
}
if (isEmpty(CQMJ)) {
ToastUtil.ToastDemo(template.this, "请填写产权面积");
return;
}
if (isEmpty(YZXM)) {
ToastUtil.ToastDemo(template.this, "请填写产权人姓名");
return;
}
if (nationCode == null) {
ToastUtil.ToastDemo(template.this, "请选择国籍地区");
return;
}
if (isEmpty(ZJLX)) {
ToastUtil.ToastDemo(template.this, "请选择证件类型");
return;
}
if (isEmpty(SFZH)) {
ToastUtil.ToastDemo(template.this, "请填写证件号码");
return;
}
if ( isEmpty(YZDH)) {
ToastUtil.ToastDemo(template.this, "请填写移动手机号码");
return;
}
if (isEmpty(FBBT)) {
ToastUtil.ToastDemo(template.this, "请填写发布标题");
return;
}
if (isEmpty(LPDZ)) {
ToastUtil.ToastDemo(template.this, "请填写楼盘地址");
return;
}
if (isEmpty(FWYT)) {
ToastUtil.ToastDemo(template.this, "请填写房屋用途");
return;
}
if (isEmpty(CX)) {
ToastUtil.ToastDemo(template.this, "请填写朝向");
return;
}
if (isEmpty(LDXZ)) {
ToastUtil.ToastDemo(template.this, "请填写楼栋性质");
return;
}
if (isEmpty(ZLC)) {
ToastUtil.ToastDemo(template.this, "请填写共有楼层");
return;
}
if (isEmpty(floor)) {
ToastUtil.ToastDemo(template.this, "请填写所属楼层");
return;
}
if (isEmpty(ZXCD)) {
ToastUtil.ToastDemo(template.this, "请填写装修程度");
return;
}
if (isEmpty(CZMJ)) {
ToastUtil.ToastDemo(template.this, "请填写出租面积");
return;
}
if (isEmpty(HXS)) {
ToastUtil.ToastDemo(template.this, "请填写户型");
return;
}
if (isEmpty(ZJ)) {
ToastUtil.ToastDemo(template.this, "请填写租金");
return;
}
if (!PhoneFormatCheckUtils.isPhoneLegal(SFZH)) {
ToastUtil.ToastDemo(template.this, "请填写正确的移动手机");
return;
}
if (ZJ.equals("01")) {
if (!CheckIdCard.isValidatedAllIdcard(SFZH)) {
ToastUtil.ToastDemo(template.this, "请填写正确的身份证号");
return;
}
}
}
}
/**
* 将houseInfo解析成json数据,发送到后台
*/
private void AnalysisIntoJson(){
mProgressHUD = ProgressHUD.show(template.this, "请稍等", false, false, null);
MultipartBody.Builder mbody = new MultipartBody.Builder().setType(MultipartBody.FORM);
Gson gson = new GsonBuilder()
.setDateFormat("yyyy-MM-dd")
.create();
String json = gson.toJson(houseInfo);
mbody.addFormDataPart("house", json);
System.out.println("房屋的json===" + json);
RequestBody requestBody = mbody.build();
okhttp3.Request request = new okhttp3.Request.Builder()
.header("Authorization", "Client-ID " + "...")
.url(HttpUtils.TEMPLATE_URL)
.post(requestBody)
.build();
new OkHttpClient().newCall(request).enqueue(new Callback() {
@Override
public void onFailure(Call call, IOException e) {
mProgressHUD.dismiss();
}
@Override
public void onResponse(Call call, okhttp3.Response response) throws IOException {
mProgressHUD.dismiss();
runOnUiThread(new Runnable() {
@Override
public void run() {
Toast.makeText(template.this,"新增一个模板!",Toast.LENGTH_SHORT).show();
}
});
Intent intent = new Intent(template.this, TemplateListActivity.class);
startActivity(intent);
EventBus.getDefault().post("FLAG_FINISH_ALL");
finish();
}
});
}
/**
* 保存模版后,返回模版列表
*/
private void StartAction(){
Intent intent = new Intent(template.this, TemplateListActivity.class);
intent.putExtra("houseInfo", houseInfo);
startActivity(intent);
}
/**
* is not null
* @param s
* @return
*/
private boolean isNotEmpty(String s) {
if (s != null && !s.equals("") || s.length() > 0) {
return true;
}
else {
return false;
}
}
private boolean isEmpty(String s) {
if (isNotEmpty(s)) {
return false;
}
else {
return true;
}
}
/**
* 监听返回键
* @param keyCode 键
* @param event 事件
* @return
*/
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK) {
final WarningDialog dialog = SmartisanDialog.createWarningDialog(template.this);
dialog.setTitle("您信息尚未填写完整,确定退出吗?")
.setConfirmText("退出")
.show();
dialog.setOnConfirmListener(new WarningDialog.OnConfirmListener() {
@Override
public void onConfirm() {
Intent intent = new Intent(template.this,TemplateListActivity.class);
startActivity(intent);
finish();
dialog.dismiss();
}
});
}
return super.onKeyDown(keyCode, event);
}
@Override
protected void onDestroy() {
super.onDestroy();
EventBus.getDefault().unregister(this);
}
}




浙公网安备 33010602011771号