Explorar o código

Merge branch 'feature' of https://gitlab.com/Arisono/SkWeiChat-Baidu into feature_fanglh

FANGLH %!s(int64=8) %!d(string=hai) anos
pai
achega
f971eedee8
Modificáronse 20 ficheiros con 1146 adicións e 415 borrados
  1. 128 79
      app_core/common/src/main/java/com/core/widget/view/Activity/SearchLocationActivity.java
  2. 178 171
      app_core/common/src/main/java/com/core/widget/view/imp/SearchPresenter.java
  3. 6 3
      app_modular/applogin/src/main/assets/profession.json
  4. 297 55
      app_modular/applogin/src/main/java/com/modular/login/activity/AdminRegisterActivity.java
  5. 19 0
      app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseCompleteActivity.java
  6. 267 49
      app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseRegisterActivity.java
  7. 4 5
      app_modular/applogin/src/main/java/com/modular/login/activity/RegisterSelectActivity.java
  8. 30 1
      app_modular/applogin/src/main/java/com/modular/login/adapter/IndustryAdapter.java
  9. BIN=BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_drop_down.png
  10. BIN=BIN
      app_modular/applogin/src/main/res/drawable-hdpi/ic_menu_spread.png
  11. BIN=BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_drop_down.png
  12. BIN=BIN
      app_modular/applogin/src/main/res/drawable-xhdpi/ic_menu_spread.png
  13. BIN=BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_drop_down.png
  14. BIN=BIN
      app_modular/applogin/src/main/res/drawable-xxhdpi/ic_menu_spread.png
  15. 8 0
      app_modular/applogin/src/main/res/drawable/selector_industry_sub_item_bg.xml
  16. 85 23
      app_modular/applogin/src/main/res/layout/activity_admin_register.xml
  17. 105 22
      app_modular/applogin/src/main/res/layout/activity_enterprise_register.xml
  18. 13 6
      app_modular/applogin/src/main/res/layout/item_group_layout.xml
  19. 1 1
      app_modular/applogin/src/main/res/layout/item_sub_layout.xml
  20. 5 0
      app_modular/applogin/src/main/res/values/colors.xml

+ 128 - 79
app_core/common/src/main/java/com/core/widget/view/Activity/SearchLocationActivity.java

@@ -1,6 +1,14 @@
 package com.core.widget.view.Activity;
 
+import android.Manifest;
+import android.content.BroadcastReceiver;
+import android.content.Context;
+import android.content.Intent;
+import android.content.IntentFilter;
+import android.content.pm.PackageManager;
 import android.os.Bundle;
+import android.support.annotation.NonNull;
+import android.support.v4.content.LocalBroadcastManager;
 import android.text.Editable;
 import android.view.View;
 import android.widget.AdapterView;
@@ -10,14 +18,19 @@ import android.widget.TextView;
 
 import com.baidu.mapapi.map.MapView;
 import com.baidu.mapapi.model.LatLng;
+import com.common.LogUtil;
+import com.common.config.BaseConfig;
 import com.common.data.ListUtils;
+import com.common.system.PermissionUtil;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
 import com.core.app.R;
 import com.core.base.OABaseActivity;
 import com.core.utils.BaiduMapUtil;
 import com.core.utils.ToastUtil;
+import com.core.widget.listener.EditChangeListener;
 import com.core.widget.view.EmptyLayout;
 import com.core.widget.view.adapter.SearchLocationAdapter;
-import com.core.widget.listener.EditChangeListener;
 import com.core.widget.view.imp.ISearchView;
 import com.core.widget.view.imp.SearchPresenter;
 import com.core.widget.view.model.SearchLocationModel;
@@ -28,45 +41,48 @@ import java.util.List;
 
 
 public class SearchLocationActivity extends OABaseActivity implements ISearchView {
-    private EditText search_edit;
-    private MapView bmapView;
-    private PullToRefreshListView listview;
-    private RelativeLayout search_rl;
-
-    private SearchPresenter presenter;
-    private SearchLocationAdapter mAdapter;
-    private EmptyLayout mEmptyLayout;
-    private TextView messageTv;
-
-    @Override
-    protected void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_search_location);
-        ViewUtils.inject(this);
-        initView();
-
-    }
-
-    private void initView() {
-        search_edit = (EditText) findViewById(R.id.search_edit);
-        bmapView = (MapView) findViewById(R.id.bmapView);
-        listview = (PullToRefreshListView) findViewById(R.id.listview);
-        search_rl = (RelativeLayout) findViewById(R.id.search_rl);
-
-        mEmptyLayout = new EmptyLayout(this, listview.getRefreshableView());
-        mEmptyLayout.setShowLoadingButton(false);
-        mEmptyLayout.setShowEmptyButton(false);
-        mEmptyLayout.setShowErrorButton(false);
-        mEmptyLayout.setEmptyViewRes(R.layout.empty_locayion);
-        messageTv = (TextView) mEmptyLayout.getEmptyView().findViewById(R.id.messageTv);
-
-        presenter = new SearchPresenter(this);
-        presenter.init(getIntent());
-        search_edit.addTextChangedListener(new EditChangeListener() {
-            @Override
-            public void afterTextChanged(Editable s) {
-                listview.setVisibility(View.VISIBLE);
-                presenter.search(s.toString());
+	private EditText search_edit;
+	private MapView bmapView;
+	private PullToRefreshListView listview;
+	private RelativeLayout search_rl;
+
+	private SearchPresenter presenter;
+	private SearchLocationAdapter mAdapter;
+	private EmptyLayout mEmptyLayout;
+	private TextView messageTv;
+
+	private BroadcastReceiver locationRceiver = new BroadcastReceiver() {
+		@Override
+		public void onReceive(Context context, Intent intent) {
+			if (intent!=null&&intent.getBooleanExtra(Constants.ACTION_LOCATION_CHANGE,false)){
+				LogUtil.i("onReceive");
+				presenter.init(getIntent());
+			}
+		}
+	};
+
+	@Override
+	protected void onDestroy() {
+		super.onDestroy();
+		LocalBroadcastManager.getInstance(BaseConfig.getContext()).unregisterReceiver(locationRceiver);
+	}
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_search_location);
+		ViewUtils.inject(this);
+		initView();
+		initEvent();
+
+	}
+
+	private void initEvent() {
+		search_edit.addTextChangedListener(new EditChangeListener() {
+			@Override
+			public void afterTextChanged(Editable s) {
+				listview.setVisibility(View.VISIBLE);
+				presenter.search(s.toString());
 //                if (s.toString().length() > 0){
 //                    listview.setVisibility(View.VISIBLE);
 //                    presenter.search(s.toString());
@@ -74,45 +90,78 @@ public class SearchLocationActivity extends OABaseActivity implements ISearchVie
 //                    listview.setVisibility(View.INVISIBLE);
 //                }
 
-            }
-        });
-        listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
-            @Override
-            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
-                List<SearchLocationModel> chche = mAdapter.getListData();
-                int item = (position - 1) <= 0 ? 0 : (position - 1);
-                if (ListUtils.isEmpty(chche) || chche.size() <= item) return;
-                presenter.endActivity(SearchLocationActivity.this, chche.get(item).getPoiInfo());
-            }
-        });
-    }
-
-
-    @Override
-    public void showPoiList(List<SearchLocationModel> models, String distanceTag) {
-        if (ListUtils.isEmpty(models)) {
-            mEmptyLayout.showEmpty();
-           if(messageTv!=null&& presenter.isHineOutSize()){
-               messageTv.setText("当前没有找到符合打卡的位置,请移步至打卡位置进行打卡!!");
-           }
-        }
-        if (mAdapter == null) {
-            mAdapter = new SearchLocationAdapter(ct, models, distanceTag);
-            listview.setAdapter(mAdapter);
-        } else {
-            mAdapter.setListData(models, distanceTag);
-            mAdapter.notifyDataSetChanged();
-        }
-    }
-
-    @Override
-    public void showPoiPoint(LatLng location) {
-        BaiduMapUtil.getInstence().setMapViewPoint(bmapView, location, true);
-    }
-
-    public void showNotNetWork() {
-        ToastUtil.showToast(this, R.string.networks_out);
-    }
+			}
+		});
+		listview.setOnItemClickListener(new AdapterView.OnItemClickListener() {
+			@Override
+			public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+				List<SearchLocationModel> chche = mAdapter.getListData();
+				int item = (position - 1) <= 0 ? 0 : (position - 1);
+				if (ListUtils.isEmpty(chche) || chche.size() <= item) return;
+				presenter.endActivity(SearchLocationActivity.this, chche.get(item).getPoiInfo());
+			}
+		});
+	}
+
+	private void initView() {
+
+		LocalBroadcastManager.getInstance(BaseConfig.getContext()).registerReceiver(locationRceiver, new IntentFilter(Constants.ACTION_LOCATION_CHANGE));
+		search_edit = (EditText) findViewById(R.id.search_edit);
+		bmapView = (MapView) findViewById(R.id.bmapView);
+		listview = (PullToRefreshListView) findViewById(R.id.listview);
+		search_rl = (RelativeLayout) findViewById(R.id.search_rl);
+		mEmptyLayout = new EmptyLayout(this, listview.getRefreshableView());
+		mEmptyLayout.setShowLoadingButton(false);
+		mEmptyLayout.setShowEmptyButton(false);
+		mEmptyLayout.setShowErrorButton(false);
+		mEmptyLayout.setEmptyViewRes(R.layout.empty_locayion);
+		messageTv = (TextView) mEmptyLayout.getEmptyView().findViewById(R.id.messageTv);
+		presenter = new SearchPresenter(this);
+		if (PermissionUtil.lacksPermissions(ct, Manifest.permission.ACCESS_FINE_LOCATION)) {
+			PermissionUtil.requestPermission(this, PermissionUtil.DEFAULT_REQUEST, Manifest.permission.ACCESS_FINE_LOCATION);
+		} else {
+			presenter.init(getIntent());
+		}
+
+	}
+
+	@Override
+	public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
+		super.onRequestPermissionsResult(requestCode, permissions, grantResults);
+		if (requestCode == PermissionUtil.DEFAULT_REQUEST) {
+			if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
+				ToastUtil.showToast(ct, R.string.not_system_permission);
+			} else {
+				MyApplication.getInstance().getBdLocationHelper().requestLocation();
+			}
+		}
+	}
+
+	@Override
+	public void showPoiList(List<SearchLocationModel> models, String distanceTag) {
+		if (ListUtils.isEmpty(models)) {
+			mEmptyLayout.showEmpty();
+			if (messageTv != null && presenter.isHineOutSize()) {
+				messageTv.setText("当前没有找到符合打卡的位置,请移步至打卡位置进行打卡!!");
+			}
+		}
+		if (mAdapter == null) {
+			mAdapter = new SearchLocationAdapter(ct, models, distanceTag);
+			listview.setAdapter(mAdapter);
+		} else {
+			mAdapter.setListData(models, distanceTag);
+			mAdapter.notifyDataSetChanged();
+		}
+	}
+
+	@Override
+	public void showPoiPoint(LatLng location) {
+		BaiduMapUtil.getInstence().setMapViewPoint(bmapView, location, true);
+	}
+
+	public void showNotNetWork() {
+		ToastUtil.showToast(this, R.string.networks_out);
+	}
 
 
 }

+ 178 - 171
app_core/common/src/main/java/com/core/widget/view/imp/SearchPresenter.java

@@ -6,6 +6,7 @@ import com.baidu.mapapi.model.LatLng;
 import com.baidu.mapapi.search.core.PoiInfo;
 import com.baidu.mapapi.search.core.SearchResult;
 import com.baidu.mapapi.search.poi.PoiResult;
+import com.common.LogUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.core.app.MyApplication;
@@ -38,175 +39,181 @@ import java.util.List;
  */
 
 public class SearchPresenter {
-    private final int PAGESIZE = 20;
-    private List<SearchLocationModel> neerList;  //周围地址主体;列表,只有在搜索周围的时候存在
-    private BdLocationHelper locationHelper;
-    private int pageNum = 0;
-
-
-    private ISearchView iSearchView;
-
-    private int radius = 200;//范围 默认200米
-    private SearchPoiParam param;
-    private LatLng location;//所在的位置
-    private boolean isLoadChina;//当前搜索为搜索全国
-
-
-    public SearchPresenter(ISearchView iSearchView) {
-        if (iSearchView == null)//防止传入一个为空的isearchview
-            new NullPointerException("ISearchView 不能为null");
-        this.iSearchView = iSearchView;
-    }
-
-
-    /**
-     * 监听数据返回
-     */
-    private BaiduMapUtil.OnSearchPoiListener listener = new BaiduMapUtil.OnSearchPoiListener() {
-        @Override
-        public void result(SearchResult result) {
-            List<SearchLocationModel> listData = new ArrayList<>();
-            if (result == null || ListUtils.isEmpty(((PoiResult) result).getAllPoi())) {
-                if (isLoadChina) {
-                    isLoadChina = false;
-                    BaiduMapUtil.getInstence().searchByInput(param.getKeyWork(), pageNum, listener);
-                }
-            } else {
-                PoiResult poiResult = (PoiResult) result;
-                List<PoiInfo> chches = poiResult.getAllPoi();
-                iSearchView.showPoiPoint(chches.get(0).location);
-                for (int i = 0; i < chches.size(); i++) {
-                    if (StringUtil.isEmpty(chches.get(i).name) || StringUtil.isEmpty(chches.get(i).address)) {
-                        chches.remove(i);
-                        i--;
-                    } else
-                        listData.add(new SearchLocationModel(chches.get(i)));
-                }
-            }
-            if (param.getType() == 1) {
-                if (neerList == null) neerList = new ArrayList<>();
-                neerList.addAll(listData);
-            }
-            showData(listData);
-        }
-    };
-
-
-    /**
-     * 初始化数据
-     *
-     * @param intent 转入的控制参数
-     */
-    public void init(Intent intent) {
-        locationHelper = MyApplication.getInstance().getBdLocationHelper();
-        if (intent == null) return;
-        param = intent.getParcelableExtra("data");
-        if (param == null)
-            new NullPointerException("param is Null");
-        if (!StringUtil.isEmpty(param.getTitle())) {
-            iSearchView.setTitle(param.getTitle());
-        }
-        initData();
-    }
-
-    public void search(String keyWork) {
-        if (StringUtil.isEmpty(keyWork)) {
-            if (param.getType() == 2 || ListUtils.isEmpty(neerList))
-                loadDataByNeer();
-            else
-                showData(neerList);
-            return;
-        }
-        param.setKeyWork(keyWork);
-        if (param.getType() == 1) {//附近搜索
-            List<SearchLocationModel> chche = new ArrayList<>();
-            if (!ListUtils.isEmpty(neerList)) {
-                for (SearchLocationModel e : neerList) {
-                    String text = e.getPoiInfo().city + e.getPoiInfo().name + e.getPoiInfo().address;
-                    boolean isOK = StringUtil.isInclude(text, param.getKeyWork());
-                    if (isOK)
-                        chche.add(e);
-                }
-            }
-            showData(chche);
-        } else {
-            loadDataByChina();
-        }
-    }
-
-    public void endActivity(BaseActivity ct, PoiInfo poi) {
-        Intent intent = new Intent();
-        intent.putExtra(param.getResultKey(), poi);
-        ct.setResult(param.getResultCode(), intent);
-        ct.finish();
-    }
-
-
-    private void initData() {
-        if (!MyApplication.getInstance().isNetworkActive()) {
-            iSearchView.showNotNetWork();
-            return;
-        }
-        switch (param.getType()) {
-            case 1:
-                loadDataByNeer();
-                break;
-            case 2:
-                if (StringUtil.isEmpty(param.getKeyWork())) {
-                    loadDataByNeer();
-                } else
-                    loadDataByChina();
-                break;
-            default:
-                break;
-        }
-    }
-
-    private void loadDataByChina() {
-        isLoadChina = true;
-        BaiduMapUtil.getInstence().searchByInputOnChina(StringUtil.isEmpty(param.getKeyWork()) ? "" : param.getKeyWork(), pageNum, listener);
-    }
-
-    private void loadDataByNeer() {
-        neerList = new ArrayList<>();
-        location = new LatLng(locationHelper.getLatitude(), locationHelper.getLongitude());
-        PoiInfo thisInfo = new PoiInfo();
-        thisInfo.location = location;
-        thisInfo.name = locationHelper.getName();
-        thisInfo.city = locationHelper.getCityName();
-        thisInfo.address = locationHelper.getAddress();
-        neerList.add(new SearchLocationModel(thisInfo));
-        BaiduMapUtil.getInstence().getNearInfo(radius, pageNum, location, listener);
-    }
-
-
-    /**
-     * 获取完数据后进入显示,先进行排序
-     *
-     * @param chche
-     */
-    private void showData(List<SearchLocationModel> chche) {
-        List<SearchLocationModel> showModels = new ArrayList<>();
-        if (!ListUtils.isEmpty(chche)) {
-            for (int i = 0; i < chche.size(); i++) {
-                float distance = Float.valueOf(BaiduMapUtil.getInstence().getDistance(chche.get(i).getPoiInfo().location, param.getContrastLatLng()));
-
-                chche.get(i).setDistance(distance);
-                if (!param.isHineOutSize() || param.getShowRange() > distance) {
-                    showModels.add(chche.get(i));
-                }
-            }
-            Comparator<SearchLocationModel> comparator = new Comparator<SearchLocationModel>() {
-                public int compare(SearchLocationModel s1, SearchLocationModel s2) {
-                    if (s1.getDistance() == s2.getDistance()) return 0;
-                    return s1.getDistance() > s2.getDistance() ? 1 : -1;
-                }
-            };
-            Collections.sort(showModels, comparator);
-        }
-        iSearchView.showPoiList(showModels, param.getDistanceTag());
-    }
-    public boolean isHineOutSize(){
-        return param.isHineOutSize();
-    }
+	private final int PAGESIZE = 20;
+	private List<SearchLocationModel> neerList;  //周围地址主体;列表,只有在搜索周围的时候存在
+	private BdLocationHelper locationHelper;
+	private int pageNum = 0;
+
+
+	private ISearchView iSearchView;
+
+	private int radius = 200;//范围 默认200米
+	private SearchPoiParam param;
+	private LatLng location;//所在的位置
+	private boolean isLoadChina;//当前搜索为搜索全国
+
+
+	public SearchPresenter(ISearchView iSearchView) {
+		if (iSearchView == null)//防止传入一个为空的isearchview
+			new NullPointerException("ISearchView 不能为null");
+		this.iSearchView = iSearchView;
+	}
+
+
+	/**
+	 * 监听数据返回
+	 */
+	private BaiduMapUtil.OnSearchPoiListener listener = new BaiduMapUtil.OnSearchPoiListener() {
+		@Override
+		public void result(SearchResult result) {
+			List<SearchLocationModel> listData = new ArrayList<>();
+			if (result == null || ListUtils.isEmpty(((PoiResult) result).getAllPoi())) {
+				if (isLoadChina) {
+					isLoadChina = false;
+					BaiduMapUtil.getInstence().searchByInput(param.getKeyWork(), pageNum, listener);
+				}
+			} else {
+				PoiResult poiResult = (PoiResult) result;
+				List<PoiInfo> chches = poiResult.getAllPoi();
+				iSearchView.showPoiPoint(chches.get(0).location);
+				for (int i = 0; i < chches.size(); i++) {
+					if (StringUtil.isEmpty(chches.get(i).name) || StringUtil.isEmpty(chches.get(i).address)) {
+						chches.remove(i);
+						i--;
+					} else
+						listData.add(new SearchLocationModel(chches.get(i)));
+				}
+			}
+			if (param.getType() == 1) {
+				if (neerList == null) neerList = new ArrayList<>();
+				neerList.addAll(listData);
+			}
+			showData(listData);
+		}
+	};
+
+
+	/**
+	 * 初始化数据
+	 *
+	 * @param intent 转入的控制参数
+	 */
+	public void init(Intent intent) {
+		if (locationHelper != null) {
+			LogUtil.i("locationHelper != null");
+			return;
+		}
+		LogUtil.i("init");
+		locationHelper = MyApplication.getInstance().getBdLocationHelper();
+		if (intent == null) return;
+		param = intent.getParcelableExtra("data");
+		if (param == null)
+			new NullPointerException("param is Null");
+		if (!StringUtil.isEmpty(param.getTitle())) {
+			iSearchView.setTitle(param.getTitle());
+		}
+		initData();
+	}
+
+	public void search(String keyWork) {
+		if (StringUtil.isEmpty(keyWork)) {
+			if (param.getType() == 2 || ListUtils.isEmpty(neerList))
+				loadDataByNeer();
+			else
+				showData(neerList);
+			return;
+		}
+		param.setKeyWork(keyWork);
+		if (param.getType() == 1) {//附近搜索
+			List<SearchLocationModel> chche = new ArrayList<>();
+			if (!ListUtils.isEmpty(neerList)) {
+				for (SearchLocationModel e : neerList) {
+					String text = e.getPoiInfo().city + e.getPoiInfo().name + e.getPoiInfo().address;
+					boolean isOK = StringUtil.isInclude(text, param.getKeyWork());
+					if (isOK)
+						chche.add(e);
+				}
+			}
+			showData(chche);
+		} else {
+			loadDataByChina();
+		}
+	}
+
+	public void endActivity(BaseActivity ct, PoiInfo poi) {
+		Intent intent = new Intent();
+		intent.putExtra(param.getResultKey(), poi);
+		ct.setResult(param.getResultCode(), intent);
+		ct.finish();
+	}
+
+
+	private void initData() {
+		if (!MyApplication.getInstance().isNetworkActive()) {
+			iSearchView.showNotNetWork();
+			return;
+		}
+		switch (param.getType()) {
+			case 1:
+				loadDataByNeer();
+				break;
+			case 2:
+				if (StringUtil.isEmpty(param.getKeyWork())) {
+					loadDataByNeer();
+				} else
+					loadDataByChina();
+				break;
+			default:
+				break;
+		}
+	}
+
+	private void loadDataByChina() {
+		isLoadChina = true;
+		BaiduMapUtil.getInstence().searchByInputOnChina(StringUtil.isEmpty(param.getKeyWork()) ? "" : param.getKeyWork(), pageNum, listener);
+	}
+
+	private void loadDataByNeer() {
+		neerList = new ArrayList<>();
+		location = new LatLng(locationHelper.getLatitude(), locationHelper.getLongitude());
+		PoiInfo thisInfo = new PoiInfo();
+		thisInfo.location = location;
+		thisInfo.name = locationHelper.getName();
+		thisInfo.city = locationHelper.getCityName();
+		thisInfo.address = locationHelper.getAddress();
+		neerList.add(new SearchLocationModel(thisInfo));
+		BaiduMapUtil.getInstence().getNearInfo(radius, pageNum, location, listener);
+	}
+
+
+	/**
+	 * 获取完数据后进入显示,先进行排序
+	 *
+	 * @param chche
+	 */
+	private void showData(List<SearchLocationModel> chche) {
+		List<SearchLocationModel> showModels = new ArrayList<>();
+		if (!ListUtils.isEmpty(chche)) {
+			for (int i = 0; i < chche.size(); i++) {
+				float distance = Float.valueOf(BaiduMapUtil.getInstence().getDistance(chche.get(i).getPoiInfo().location, param.getContrastLatLng()));
+
+				chche.get(i).setDistance(distance);
+				if (!param.isHineOutSize() || param.getShowRange() > distance) {
+					showModels.add(chche.get(i));
+				}
+			}
+			Comparator<SearchLocationModel> comparator = new Comparator<SearchLocationModel>() {
+				public int compare(SearchLocationModel s1, SearchLocationModel s2) {
+					if (s1.getDistance() == s2.getDistance()) return 0;
+					return s1.getDistance() > s2.getDistance() ? 1 : -1;
+				}
+			};
+			Collections.sort(showModels, comparator);
+		}
+		iSearchView.showPoiList(showModels, param.getDistanceTag());
+	}
+
+	public boolean isHineOutSize() {
+		return param.isHineOutSize();
+	}
 }

+ 6 - 3
app_modular/applogin/src/main/assets/profession.json

@@ -1,8 +1,11 @@
 {
   "服务业": [
-    "医疗/护理/美容/保健/卫生服务",
-    "酒店/餐饮",
-    "旅游/度假"
+    "医疗",
+    "运动健身",
+    "餐饮",
+    "美容美发",
+    "会所",
+    "KTV"
   ],
   "IT|通信|电子|互联网": [
     "互联网/电子商务",

+ 297 - 55
app_modular/applogin/src/main/java/com/modular/login/activity/AdminRegisterActivity.java

@@ -5,7 +5,9 @@ import android.graphics.Typeface;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
+import android.text.Editable;
 import android.text.TextUtils;
+import android.text.TextWatcher;
 import android.text.method.HideReturnsTransformationMethod;
 import android.text.method.PasswordTransformationMethod;
 import android.util.Log;
@@ -15,13 +17,14 @@ import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.alibaba.fastjson.JSON;
-import com.andreabaccega.widget.FormEditText;
+import com.common.data.RegexUtil;
 import com.common.hmac.Md5Util;
 import com.core.app.Constants;
 import com.core.base.BaseActivity;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
 import com.core.utils.ToastUtil;
+import com.core.widget.ClearEditText;
 import com.modular.login.R;
 
 import org.json.JSONException;
@@ -35,6 +38,7 @@ import java.util.TimerTask;
 
 /**
  * Created by RaoMeng on 2017/9/21.
+ * 管理员信息注册页面
  */
 
 public class AdminRegisterActivity extends BaseActivity implements View.OnClickListener {
@@ -44,20 +48,21 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
     private final int UPLOAD_REGISTER_MESSAGE = 0x04;
 
     private Button mNextStepButton;
-    private FormEditText mAdminNameEt;
-    private FormEditText mAdminPhoneEt;
-    private FormEditText mAdminEmailEt;
-    private FormEditText mAdminVerificationEt;
+    private ClearEditText mAdminNameEt;
+    private ClearEditText mAdminPhoneEt;
+    private ClearEditText mAdminEmailEt;
+    private ClearEditText mAdminVerificationEt;
     private TextView mAdminObtainCodeTv;
-    private FormEditText mAdminPasswordEt;
+    private ClearEditText mAdminPasswordEt;
     private ImageView mAdminPasswordVisiableIv;
+    private TextView mNameErrorTextView, mPhoneErrorTextView, mEmailErrorTextView, mCodeErrorTextView, mPasswordErrorTextView;
     private boolean isPasswordVisiable = false;
     private String mCheckcodeToken, mCompanyName = "", mIndustry = "", mAddress = "", mLatitude = "", mLongitude;
+    private boolean isNameAdopt = false, isPhoneAdopt = false, isEmailAdopt = false, isCodeAdopt = false, isPasswordAdopt = false;
 
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
-            progressDialog.dismiss();
             String result = null;
             if (msg.what != VERIFICATION_TIME_TASK) {
                 result = msg.getData().getString("result");
@@ -65,15 +70,31 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
             }
             switch (msg.what) {
                 case OBTAIN_VERIFICATION_CODE:
+                    progressDialog.dismiss();
                     if (result != null) {
                         try {
                             JSONObject resultObject = new JSONObject(result);
                             if (resultObject.optBoolean("success")) {
                                 JSONObject contentObject = resultObject.optJSONObject("content");
                                 if (contentObject != null) {
+                                    mFlag = 60;
+                                    mTimer = new Timer();
+                                    mTimer.schedule(new TimerTask() {
+                                        @Override
+                                        public void run() {
+                                            Message message = Message.obtain();
+                                            message.what = VERIFICATION_TIME_TASK;
+                                            mHandler.sendMessage(message);
+                                        }
+                                    }, 0, 1000);
+
+                                    ToastUtil.showToast(AdminRegisterActivity.this
+                                            , "验证码已发送,请注意接收");
                                     mCheckcodeToken = contentObject.optString("token");
                                 } else {
                                     progressDialog.dismiss();
+                                    mAdminObtainCodeTv.setEnabled(true);
+                                    mAdminObtainCodeTv.setText("获取验证码");
                                     ToastUtil.showToast(AdminRegisterActivity.this
                                             , "验证码获取失败,请重试");
                                 }
@@ -82,10 +103,17 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
                                 String errMsg = resultObject.optString("errMsg");
                                 ToastUtil.showToast(AdminRegisterActivity.this
                                         , TextUtils.isEmpty(errMsg) ? "验证码获取失败,请重试" : errMsg);
+                                mAdminObtainCodeTv.setEnabled(true);
+                                mAdminObtainCodeTv.setText("获取验证码");
                             }
                         } catch (JSONException e) {
                             e.printStackTrace();
                         }
+                    } else {
+                        mAdminObtainCodeTv.setEnabled(true);
+                        mAdminObtainCodeTv.setText("获取验证码");
+                        ToastUtil.showToast(AdminRegisterActivity.this
+                                , "验证码获取失败,请重试");
                     }
                     break;
                 case ADMIN_REGISTER:
@@ -98,8 +126,16 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
 //                                intent.setClass(AdminRegisterActivity.this, EnterpriseCompleteActivity.class);
 //                                startActivity(intent);
 //                                finish();*/
-                                uploadMsg();
+                                JSONObject content = resultObject.optJSONObject("content");
+                                String enUU = "";
+                                String imid = "";
+                                if (content != null) {
+                                    enUU = content.optString("enUU");
+                                    imid = content.optString("imid");
+                                }
+                                uploadMsg(enUU, imid);
                             } else {
+                                progressDialog.dismiss();
                                 String errMsg = resultObject.optString("errMsg");
                                 ToastUtil.showToast(AdminRegisterActivity.this, errMsg);
                             }
@@ -118,6 +154,9 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
                                 intent.setClass(AdminRegisterActivity.this, EnterpriseCompleteActivity.class);
                                 startActivity(intent);
                                 finish();
+                            } else {
+                                String resultMsg = resultObject.optString("resultMsg");
+                                ToastUtil.showToast(AdminRegisterActivity.this, resultMsg);
                             }
                         } catch (JSONException e) {
                             e.printStackTrace();
@@ -147,6 +186,98 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
     private int mFlag;
     private Timer mTimer;
 
+    private TextWatcher mNameTextWatcher = 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) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            String text = s.toString();
+            nameAdopt(text);
+        }
+    };
+
+    private TextWatcher mPhoneTextWatcher = 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) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            String text = s.toString();
+            phoneAdopt(text);
+        }
+    };
+
+    private TextWatcher mEmailTextWatcher = 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) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            String text = s.toString();
+            emailAdopt(text);
+        }
+    };
+
+
+    private TextWatcher mCodeTextWatcher = 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) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            String text = s.toString();
+            codeAdopt(text);
+        }
+    };
+
+
+    private TextWatcher mPasswordTextWatcher = 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) {
+
+        }
+
+        @Override
+        public void afterTextChanged(Editable s) {
+            String text = s.toString();
+            passwordAdopt(text);
+        }
+    };
+
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
@@ -160,15 +291,20 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
 
     private void initViews() {
         mNextStepButton = (Button) findViewById(R.id.admin_register_next_step_btn);
-        mAdminNameEt = (FormEditText) findViewById(R.id.admin_register_name_et);
-        mAdminPhoneEt = (FormEditText) findViewById(R.id.admin_register_phone_et);
-        mAdminEmailEt = (FormEditText) findViewById(R.id.admin_register_email_et);
-        mAdminVerificationEt = (FormEditText) findViewById(R.id.admin_register_verification_et);
+        mAdminNameEt = (ClearEditText) findViewById(R.id.admin_register_name_et);
+        mAdminPhoneEt = (ClearEditText) findViewById(R.id.admin_register_phone_et);
+        mAdminEmailEt = (ClearEditText) findViewById(R.id.admin_register_email_et);
+        mAdminVerificationEt = (ClearEditText) findViewById(R.id.admin_register_verification_et);
         mAdminObtainCodeTv = (TextView) findViewById(R.id.admin_register_obtain_code_tv);
-        mAdminPasswordEt = (FormEditText) findViewById(R.id.admin_register_password_et);
+        mAdminPasswordEt = (ClearEditText) findViewById(R.id.admin_register_password_et);
         mAdminPasswordEt.setTypeface(Typeface.DEFAULT);
         mAdminPasswordEt.setTransformationMethod(new PasswordTransformationMethod());
         mAdminPasswordVisiableIv = (ImageView) findViewById(R.id.admin_register_password_visiable_iv);
+        mNameErrorTextView = (TextView) findViewById(R.id.admin_register_name_error_tv);
+        mPhoneErrorTextView = (TextView) findViewById(R.id.admin_register_phone_error_tv);
+        mEmailErrorTextView = (TextView) findViewById(R.id.admin_register_email_error_tv);
+        mCodeErrorTextView = (TextView) findViewById(R.id.admin_register_code_error_tv);
+        mPasswordErrorTextView = (TextView) findViewById(R.id.admin_register_password_error_tv);
 
         Intent intent = getIntent();
         if (intent != null) {
@@ -184,28 +320,89 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
         mNextStepButton.setOnClickListener(this);
         mAdminObtainCodeTv.setOnClickListener(this);
         mAdminPasswordVisiableIv.setOnClickListener(this);
+
+        mAdminNameEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                nameAdopt(mAdminNameEt.getText().toString());
+            }
+        });
+
+        mAdminPhoneEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                phoneAdopt(mAdminPhoneEt.getText().toString());
+            }
+        });
+
+        mAdminEmailEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                emailAdopt(mAdminEmailEt.getText().toString());
+            }
+        });
+
+        mAdminVerificationEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                codeAdopt(mAdminVerificationEt.getText().toString());
+            }
+        });
+
+        mAdminPasswordEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                passwordAdopt(mAdminPasswordEt.getText().toString());
+            }
+        });
+
+        mAdminNameEt.addTextChangedListener(mNameTextWatcher);
+        mAdminPhoneEt.addTextChangedListener(mPhoneTextWatcher);
+        mAdminEmailEt.addTextChangedListener(mEmailTextWatcher);
+        mAdminObtainCodeTv.addTextChangedListener(mCodeTextWatcher);
+        mAdminPasswordEt.addTextChangedListener(mPasswordTextWatcher);
     }
 
-    private void uploadMsg() {
+    private void uploadMsg(String enUU, String imid) {
         String url = "http://113.105.74.140:8092/user/appSaveCompany";
+//        String url = "http://192.168.253.136:8092/user/appSaveCompany";
 
         Map<String, String> map = new HashMap<>();
-        map.put("sc_company", mCompanyName);
+        map.put("sc_uu", enUU);
+        map.put("sc_companyname", mCompanyName);
         map.put("sc_industry", mIndustry);
         map.put("sc_address", mAddress);
         map.put("sc_adminname", mAdminNameEt.getText().toString());
         map.put("sc_telephone", mAdminPhoneEt.getText().toString());
         map.put("sc_longitude", mLongitude);
         map.put("sc_latitude", mLatitude);
+        String industrycode = "0";
+        if ("医疗".equals(mIndustry)) {
+            industrycode = "10001";
+        } else if ("运动健身".equals(mIndustry)) {
+            industrycode = "10002";
+        } else if ("餐饮".equals(mIndustry)) {
+            industrycode = "10003";
+        } else if ("美容美发".equals(mIndustry)) {
+            industrycode = "10004";
+        } else if ("会所".equals(mIndustry)) {
+            industrycode = "10005";
+        } else if ("KTV".equals(mIndustry)) {
+            industrycode = "10006";
+        }
+        map.put("sc_industrycode", industrycode);
 
         Map<String, Object> params = new HashMap<>();
         params.put("map", JSON.toJSON(map).toString());
+        params.put("imid", TextUtils.isEmpty(imid) ? "0" : imid);
         params.put("telephone", mAdminPhoneEt.getText().toString());
         params.put("password", Md5Util.toMD5(mAdminPasswordEt.getText().toString()));
         params.put("nickname", mAdminNameEt.getText().toString());
         params.put("description", "UU互联");
         params.put("sex", "0");
         params.put("birthday", "946656000");
+
+        Log.d("uploadparams", params.toString());
         LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
         headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
         ViewUtil.httpSendRequest(this, url, params, mHandler, headers, UPLOAD_REGISTER_MESSAGE, null, null, "post");
@@ -215,18 +412,10 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
     public void onClick(View v) {
         int id = v.getId();
         if (id == R.id.admin_register_next_step_btn) {
-            FormEditText[] allFields = {mAdminNameEt, mAdminPhoneEt
-                    , mAdminEmailEt, mAdminVerificationEt, mAdminPasswordEt};
-
-            boolean allValid = true;
-            for (FormEditText field : allFields) {
-                allValid = field.testValidity() && allValid;
-            }
-
-            if (allValid) {
+            if (isNameAdopt && isPhoneAdopt && isEmailAdopt && isCodeAdopt && isPasswordAdopt) {
                 progressDialog.show();
 
-                String url = "http://192.168.253.66:8082/sso/mobile/userspace/setAdmin";
+                String url = "https://account.ubtob.com/sso/mobile/userspace/setAdmin";
 
                 Map<String, Object> params = new HashMap<>();
                 params.put("adminName", mAdminNameEt.getText().toString());
@@ -241,41 +430,30 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
                 ViewUtil.httpSendRequest(this, url, params, mHandler, headers, ADMIN_REGISTER, null, null, "post");
 
             } else {
-                // EditText are going to appear with an exclamation mark and an explicative message.
+                ToastUtil.showToast(this, "请完善管理员注册信息");
             }
 
-
         } else if (id == R.id.admin_register_obtain_code_tv) {
-            FormEditText[] allFields = {mAdminPhoneEt, mAdminEmailEt};
+            if (isPhoneAdopt && isEmailAdopt) {
+                if (CommonUtil.isNetWorkConnected(this)) {
+                    mAdminObtainCodeTv.setEnabled(false);
+                    mAdminObtainCodeTv.setText("验证码获取中...");
 
-            boolean allValid = true;
-            for (FormEditText field : allFields) {
-                allValid = field.testValidity() && allValid;
-            }
-
-            if (allValid) {
-                mFlag = 10;
-                mTimer = new Timer();
-                mTimer.schedule(new TimerTask() {
-                    @Override
-                    public void run() {
-                        Message message = Message.obtain();
-                        message.what = VERIFICATION_TIME_TASK;
-                        mHandler.sendMessage(message);
-                    }
-                }, 0, 1000);
-
-
-                progressDialog.show();
-                String url = "http://192.168.253.66:8082/sso/userspace/checkcode";
-                Map<String, Object> params = new HashMap<>();
-                params.put("tel", mAdminPhoneEt.getText().toString());
-                params.put("email", mAdminEmailEt.getText().toString());
-                params.put("pageToken", CommonUtil.getSharedPreferences(ct, "pageToken"));
-                LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
-                headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
-                ViewUtil.httpSendRequest(this, url, params, mHandler, headers, OBTAIN_VERIFICATION_CODE, null, null, "get");
+                    progressDialog.show();
+                    String url = "https://account.ubtob.com/sso/userspace/checkcode";
+                    Map<String, Object> params = new HashMap<>();
+                    params.put("tel", mAdminPhoneEt.getText().toString());
+                    params.put("email", mAdminEmailEt.getText().toString());
+                    params.put("pageToken", CommonUtil.getSharedPreferences(ct, "pageToken"));
+                    LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+                    headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+                    ViewUtil.httpSendRequest(this, url, params, mHandler, headers, OBTAIN_VERIFICATION_CODE, null, null, "get");
+                } else {
+                    ToastUtil.showToast(this, R.string.networks_out);
+                }
 
+            } else {
+                ToastUtil.showToast(this, "请填写正确的手机号和邮箱");
             }
         } else if (id == R.id.admin_register_password_visiable_iv) {
             isPasswordVisiable = !isPasswordVisiable;
@@ -290,4 +468,68 @@ public class AdminRegisterActivity extends BaseActivity implements View.OnClickL
             mAdminPasswordEt.setSelection(mAdminPasswordEt.getText().length());
         }
     }
+
+
+    private void passwordAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mPasswordErrorTextView.setVisibility(View.VISIBLE);
+            isPasswordAdopt = false;
+        } else {
+            mPasswordErrorTextView.setVisibility(View.INVISIBLE);
+            isPasswordAdopt = true;
+        }
+        isRegButtonEnable();
+    }
+
+    private void nameAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mNameErrorTextView.setVisibility(View.VISIBLE);
+            isNameAdopt = false;
+        } else {
+            mNameErrorTextView.setVisibility(View.INVISIBLE);
+            isNameAdopt = true;
+        }
+        isRegButtonEnable();
+    }
+
+    private void phoneAdopt(String text) {
+        if (TextUtils.isEmpty(text) || !RegexUtil.checkRegex(text, RegexUtil.REGEX_MOBILE)) {
+            mPhoneErrorTextView.setVisibility(View.VISIBLE);
+            isPhoneAdopt = false;
+        } else {
+            mPhoneErrorTextView.setVisibility(View.INVISIBLE);
+            isPhoneAdopt = true;
+        }
+        isRegButtonEnable();
+    }
+
+    private void emailAdopt(String text) {
+        if (TextUtils.isEmpty(text) || !RegexUtil.checkRegex(text, RegexUtil.REGEX_EMAIL)) {
+            mEmailErrorTextView.setVisibility(View.VISIBLE);
+            isEmailAdopt = false;
+        } else {
+            mEmailErrorTextView.setVisibility(View.INVISIBLE);
+            isEmailAdopt = true;
+        }
+        isRegButtonEnable();
+    }
+
+    private void codeAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mCodeErrorTextView.setVisibility(View.VISIBLE);
+            isCodeAdopt = false;
+        } else {
+            mCodeErrorTextView.setVisibility(View.INVISIBLE);
+            isCodeAdopt = true;
+        }
+        isRegButtonEnable();
+    }
+
+    private void isRegButtonEnable() {
+        if (isNameAdopt && isPhoneAdopt && isEmailAdopt && isCodeAdopt && isPasswordAdopt) {
+            mNextStepButton.setEnabled(true);
+        } else {
+            mNextStepButton.setEnabled(false);
+        }
+    }
 }

+ 19 - 0
app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseCompleteActivity.java

@@ -10,6 +10,7 @@ import com.modular.login.R;
 
 /**
  * Created by RaoMeng on 2017/9/21.
+ * 企业注册完成页面
  */
 
 public class EnterpriseCompleteActivity extends BaseActivity {
@@ -33,4 +34,22 @@ public class EnterpriseCompleteActivity extends BaseActivity {
             }
         });
     }
+
+    @Override
+    protected boolean onHomeAsUp() {
+        Intent intent = new Intent();
+        intent.setClass(EnterpriseCompleteActivity.this, LoginActivity.class);
+        startActivity(intent);
+        finish();
+        return true;
+    }
+
+    @Override
+    public void onBackPressed() {
+        super.onBackPressed();
+        Intent intent = new Intent();
+        intent.setClass(EnterpriseCompleteActivity.this, LoginActivity.class);
+        startActivity(intent);
+        finish();
+    }
 }

+ 267 - 49
app_modular/applogin/src/main/java/com/modular/login/activity/EnterpriseRegisterActivity.java

@@ -11,9 +11,11 @@ import android.os.Bundle;
 import android.os.Handler;
 import android.os.Message;
 import android.support.annotation.NonNull;
+import android.text.Editable;
 import android.text.SpannableString;
 import android.text.Spanned;
 import android.text.TextUtils;
+import android.text.TextWatcher;
 import android.text.method.LinkMovementMethod;
 import android.text.style.ClickableSpan;
 import android.text.style.ForegroundColorSpan;
@@ -30,7 +32,6 @@ import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.TextView;
 
-import com.andreabaccega.widget.FormEditText;
 import com.baidu.mapapi.search.core.PoiInfo;
 import com.common.LogUtil;
 import com.common.data.StringUtil;
@@ -46,6 +47,7 @@ import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
 import com.core.utils.IntentUtils;
 import com.core.utils.ToastUtil;
+import com.core.widget.ClearEditText;
 import com.core.widget.view.Activity.SearchLocationActivity;
 import com.core.widget.view.model.SearchPoiParam;
 import com.me.network.app.http.HttpClient;
@@ -69,6 +71,7 @@ import java.util.Map;
 
 /**
  * Created by RaoMeng on 2017/9/21.
+ * 企业信息注册页面
  */
 
 public class EnterpriseRegisterActivity extends BaseActivity implements View.OnClickListener {
@@ -78,16 +81,18 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
     private final int SELECT_ADDRESS_RESULT = 0x14;
 
     private Button mNextStepButton;
-    private FormEditText mEnterpriseCompanyEt;
-    private FormEditText mEnterpriseLicenseEt;
-    private FormEditText mEnterpriseRepresentEt;
-    private FormEditText mEnterpriseAddressEt;
+    private ClearEditText mEnterpriseCompanyEt;
+    private ClearEditText mEnterpriseLicenseEt;
+    private ClearEditText mEnterpriseRepresentEt;
+    private ClearEditText mEnterpriseAddressEt;
     private TextView mEnterpriseIndustryEt;
-    private FormEditText mEnterpriseBusinessEt;
+    private ClearEditText mEnterpriseBusinessEt;
     private ImageView mEnterpriseLicenseIv;
     private ImageView mTakePicImageView;
     private TextView mEnterpriseClauseTv;
     private CheckBox mClauseCheckBox;
+    private TextView mCompanyErrorTextView, mLicenseErrorTextView, mRepresentErrorTextView, mAddressErrorTextView, mIndustryErrorTextView;
+
     private PopupWindow mPopupWindow;
     private Uri mNewPhotoUri;
     private static final int REQUEST_CODE_CAPTURE_PHOTO = 1;// 拍照
@@ -95,6 +100,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
     private static final int REQUEST_CODE_CROP_PHOTO = 3;//裁剪
     private String path = null;
     private File mLicenseFile;
+    private boolean isCompanyAdopt = false, isLicenseAdopt = false, isRepresentAdopt = false, isAddressAdopt = false, isIndustryAdopt = false;
 
     private Handler mHandler = new Handler() {
         @Override
@@ -152,42 +158,238 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
         initViews();
 //        initProfession();
 
+        initEvents();
+    }
+
+    private void initEvents() {
         mNextStepButton.setOnClickListener(this);
         mEnterpriseLicenseIv.setOnClickListener(this);
         mTakePicImageView.setOnClickListener(this);
+
         mClauseCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
-                if (isChecked) {
-                    mNextStepButton.setEnabled(true);
-                } else {
-                    mNextStepButton.setEnabled(false);
-                }
+                isRegButtonEnable(isChecked);
             }
         });
         mEnterpriseIndustryEt.setOnClickListener(this);
         mEnterpriseAddressEt.setOnClickListener(this);
+        mEnterpriseCompanyEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                companyAdopt(mEnterpriseCompanyEt.getText().toString());
+            }
+        });
+
+        mEnterpriseLicenseEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                licenseAdopt(mEnterpriseLicenseEt.getText().toString());
+            }
+        });
+
+        mEnterpriseRepresentEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                representAdopt(mEnterpriseRepresentEt.getText().toString());
+            }
+        });
+
+        mEnterpriseAddressEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                addressAdopt(mEnterpriseAddressEt.getText().toString());
+            }
+        });
+
+        mEnterpriseIndustryEt.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+            @Override
+            public void onFocusChange(View v, boolean hasFocus) {
+                industryAdopt(mEnterpriseIndustryEt.getText().toString());
+            }
+        });
+
+        mEnterpriseCompanyEt.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) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                String text = s.toString();
+                companyAdopt(text);
+            }
+        });
+
+        mEnterpriseLicenseEt.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) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                String text = s.toString();
+                licenseAdopt(text);
+            }
+        });
+
+        mEnterpriseRepresentEt.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) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                String text = s.toString();
+                representAdopt(text);
+            }
+        });
+
+        mEnterpriseAddressEt.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) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                String text = s.toString();
+                addressAdopt(text);
+            }
+        });
+
+        mEnterpriseIndustryEt.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) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                String text = s.toString();
+                industryAdopt(text);
+            }
+        });
+    }
+
+    private void industryAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mIndustryErrorTextView.setVisibility(View.VISIBLE);
+            isIndustryAdopt = false;
+        } else {
+            mIndustryErrorTextView.setVisibility(View.INVISIBLE);
+            isIndustryAdopt = true;
+        }
+        isRegButtonEnable(mClauseCheckBox.isChecked());
+    }
+
+    private void addressAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mAddressErrorTextView.setVisibility(View.VISIBLE);
+            isAddressAdopt = false;
+        } else {
+            mAddressErrorTextView.setVisibility(View.INVISIBLE);
+            isAddressAdopt = true;
+        }
+        isRegButtonEnable(mClauseCheckBox.isChecked());
+    }
+
+    private void representAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mRepresentErrorTextView.setVisibility(View.VISIBLE);
+            isRepresentAdopt = false;
+        } else {
+            mRepresentErrorTextView.setVisibility(View.INVISIBLE);
+            isRepresentAdopt = true;
+        }
+        isRegButtonEnable(mClauseCheckBox.isChecked());
+    }
+
+    private void licenseAdopt(String text) {
+        if (TextUtils.isEmpty(text)) {
+            mLicenseErrorTextView.setVisibility(View.VISIBLE);
+            isLicenseAdopt = false;
+        } else {
+            mLicenseErrorTextView.setVisibility(View.INVISIBLE);
+            isLicenseAdopt = true;
+        }
+        isRegButtonEnable(mClauseCheckBox.isChecked());
+    }
+
+    private void companyAdopt(String text) {
+        if (TextUtils.isEmpty(text) || text.length() < 2 || text.length() > 99) {
+            mCompanyErrorTextView.setVisibility(View.VISIBLE);
+            isCompanyAdopt = false;
+        } else {
+            mCompanyErrorTextView.setVisibility(View.INVISIBLE);
+            isCompanyAdopt = true;
+        }
+        isRegButtonEnable(mClauseCheckBox.isChecked());
+    }
+
+    private void isRegButtonEnable(boolean isChecked) {
+        if (isChecked && isCompanyAdopt && isLicenseAdopt
+                && isRepresentAdopt && isAddressAdopt && isIndustryAdopt && mLicenseFile != null) {
+            mNextStepButton.setEnabled(true);
+        } else {
+            mNextStepButton.setEnabled(false);
+        }
     }
 
     private void initViews() {
 
         mNextStepButton = (Button) findViewById(R.id.enterprise_register_next_step_btn);
-        mEnterpriseCompanyEt = (FormEditText) findViewById(R.id.enterprise_register_company_et);
-        mEnterpriseLicenseEt = (FormEditText) findViewById(R.id.enterprise_register_license_et);
-        mEnterpriseRepresentEt = (FormEditText) findViewById(R.id.enterprise_register_represent_et);
-        mEnterpriseAddressEt = (FormEditText) findViewById(R.id.enterprise_register_address_et);
+        mEnterpriseCompanyEt = (ClearEditText) findViewById(R.id.enterprise_register_company_et);
+        mEnterpriseLicenseEt = (ClearEditText) findViewById(R.id.enterprise_register_license_et);
+        mEnterpriseRepresentEt = (ClearEditText) findViewById(R.id.enterprise_register_represent_et);
+        mEnterpriseAddressEt = (ClearEditText) findViewById(R.id.enterprise_register_address_et);
         mEnterpriseIndustryEt = (TextView) findViewById(R.id.enterprise_register_industry_et);
-        mEnterpriseBusinessEt = (FormEditText) findViewById(R.id.enterprise_register_business_et);
+        mEnterpriseBusinessEt = (ClearEditText) findViewById(R.id.enterprise_register_business_et);
         mEnterpriseLicenseIv = (ImageView) findViewById(R.id.enterprise_register_license_iv);
         mTakePicImageView = (ImageView) findViewById(R.id.enterprise_register_picture_iv);
         mEnterpriseClauseTv = (TextView) findViewById(R.id.enterprise_register_clause_tv);
+        mCompanyErrorTextView = (TextView) findViewById(R.id.enterprise_register_company_error_tv);
+        mLicenseErrorTextView = (TextView) findViewById(R.id.enterprise_register_license_error_tv);
+        mRepresentErrorTextView = (TextView) findViewById(R.id.enterprise_register_represent_error_tv);
+        mAddressErrorTextView = (TextView) findViewById(R.id.enterprise_register_address_error_tv);
+        mIndustryErrorTextView = (TextView) findViewById(R.id.enterprise_register_industry_error_tv);
+
         mEnterpriseClauseTv.setText(getClickableSpan());
         mEnterpriseClauseTv.setMovementMethod(LinkMovementMethod.getInstance());
 
         mClauseCheckBox = (CheckBox) findViewById(R.id.enterprise_register_clause_cb);
         mHttpClient = new
-//                HttpClient.Builder("https://account.ubtob.com/sso")
-                HttpClient.Builder("http://192.168.253.66:8082")
+                HttpClient.Builder("https://account.ubtob.com")
+//                HttpClient.Builder("http://113.105.74.140:8092")
+//                HttpClient.Builder("http://192.168.253.66:8082")
 //                HttpClient.Builder("http://192.168.253.200:8080")
                 .build();
     }
@@ -196,26 +398,14 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
     public void onClick(View v) {
         int i = v.getId();
         if (i == R.id.enterprise_register_next_step_btn) {
-
             if (mClauseCheckBox.isChecked()) {
-                FormEditText[] allFields = {mEnterpriseAddressEt, mEnterpriseRepresentEt
-                        , mEnterpriseCompanyEt, mEnterpriseLicenseEt};
-
-                boolean allValid = true;
-                for (FormEditText field : allFields) {
-                    allValid = field.testValidity() && allValid;
-                }
-
-                if (allValid) {
-                    if (mLicenseFile == null) {
-                        ToastUtil.showToast(this, "请选择您的营业执照");
-                    } else {
-                        progressDialog.show();
-                        obtainPageToken();
-                    }
+                if (mLicenseFile == null) {
+                    ToastUtil.showToast(this, "请选择您的营业执照");
                 } else {
-                    // EditText are going to appear with an exclamation mark and an explicative message.
+                    progressDialog.show();
+                    obtainPageToken();
                 }
+
             } else {
                 ToastUtil.showToast(this, "请阅读并同意必读协议");
             }
@@ -238,17 +428,23 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
             intent.setClass(this, IndustryChooseActivity.class);
             startActivityForResult(intent, INDUSTRY_CHOOSE);
         } else if (i == R.id.enterprise_register_address_et) {
-            Intent intent = new Intent(ct, SearchLocationActivity.class);
-            SearchPoiParam poiParam = new SearchPoiParam();
-            poiParam.setType(2);
-            poiParam.setTitle("地图搜索");
-            poiParam.setRadius(1000);
-            //poiParam.setContrastLatLng(new LatLng(companyLocation.getLocation().mLongitude, companyLocation.getLocation().mLatitude));
-            poiParam.setResultCode(SELECT_ADDRESS_RESULT);
-            poiParam.setDistanceTag(MyApplication.getInstance().getResources().getString(R.string.rice));
-            intent.putExtra("data", poiParam);
-            startActivityForResult(intent, SELECT_ADDRESS_REQUEST);
-
+            String[] permissions = new String[]{Manifest.permission.ACCESS_FINE_LOCATION};
+            if (PermissionUtil.lacksPermissions(ct, permissions)) {
+                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
+                    requestPermissions(permissions, 222);
+                }
+            } else {
+                Intent intent = new Intent(ct, SearchLocationActivity.class);
+                SearchPoiParam poiParam = new SearchPoiParam();
+                poiParam.setType(2);
+                poiParam.setTitle("地图搜索");
+                poiParam.setRadius(1000);
+                //poiParam.setContrastLatLng(new LatLng(companyLocation.getLocation().mLongitude, companyLocation.getLocation().mLatitude));
+                poiParam.setResultCode(SELECT_ADDRESS_RESULT);
+                poiParam.setDistanceTag(MyApplication.getInstance().getResources().getString(R.string.rice));
+                intent.putExtra("data", poiParam);
+                startActivityForResult(intent, SELECT_ADDRESS_REQUEST);
+            }
         }
     }
 
@@ -261,6 +457,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
             public void onResponse(Object s) {
                 if (s != null) {
                     try {
+                        Log.d("pagetokens", s.toString());
                         JSONObject resultObject = new JSONObject(s.toString());
                         if (resultObject.optBoolean("success")) {
                             JSONObject contentObject = resultObject.optJSONObject("content");
@@ -296,7 +493,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
 
     private void enterpriseRegister(String pageToken, String sessionId) {
 
-        String url = "http://192.168.253.66:8082/sso/mobile/userspace/register";
+        String url = "https://account.ubtob.com/sso/mobile/userspace/register";
 
         String fileBytes = getFileBytes(mLicenseFile);
         Map<String, Object> params = new HashMap<>();
@@ -431,7 +628,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
         super.onRequestPermissionsResult(requestCode, permissions, grantResults);
         if (requestCode == PermissionUtil.DEFAULT_REQUEST) {
             if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
-                LogUtil.i("没有获取到权限");
+                ToastUtil.showToast(this, "相机权限获取失败,请进入设置页面获取相机权限");
             } else {
                 mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
                 CameraUtil.captureImage(EnterpriseRegisterActivity.this, mNewPhotoUri, REQUEST_CODE_CAPTURE_PHOTO);
@@ -439,12 +636,30 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
             }
         } else if (requestCode == 111) {
             if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
-                LogUtil.i("没有获取到权限");
+                ToastUtil.showToast(this, "存储权限获取失败,请进入设置页面获取存储权限");
             } else {
                 mNewPhotoUri = CameraUtil.getOutputMediaFileUri(EnterpriseRegisterActivity.this, MyApplication.getInstance().mLoginUser.getUserId(), CameraUtil.MEDIA_TYPE_IMAGE);
                 CameraUtil.pickImageSimple(EnterpriseRegisterActivity.this, REQUEST_CODE_PICK_PHOTO);
                 closePopupWindow();
             }
+        } else if (requestCode == 222) {
+            if (grantResults.length != 1 || grantResults[0] != PackageManager.PERMISSION_GRANTED) {
+                LogUtil.i("没有获取到权限");
+                ToastUtil.showToast(this, "定位权限获取失败,请进入设置页面获取定位权限");
+            } else {
+                Intent intent = new Intent(ct, SearchLocationActivity.class);
+                SearchPoiParam poiParam = new SearchPoiParam();
+                poiParam.setType(2);
+                poiParam.setTitle("地图搜索");
+                poiParam.setRadius(1000);
+                //poiParam.setContrastLatLng(new LatLng(companyLocation.getLocation().mLongitude, companyLocation.getLocation().mLatitude));
+                poiParam.setResultCode(SELECT_ADDRESS_RESULT);
+                poiParam.setDistanceTag(MyApplication.getInstance().getResources().getString(R.string.rice));
+                intent.putExtra("data", poiParam);
+                startActivityForResult(intent, SELECT_ADDRESS_REQUEST);
+            }
+
+
         }
     }
 
@@ -465,6 +680,7 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
                     ToastUtil.showToast(this, R.string.c_take_picture_failed);
                 }
             }
+            isRegButtonEnable(mClauseCheckBox.isChecked());
         }
         /*else if (requestCode == REQUEST_CODE_PICK_PHOTO) {// 选择一张图片,然后立即调用裁减
             if (resultCode == Activity.RESULT_OK) {
@@ -493,10 +709,12 @@ public class EnterpriseRegisterActivity extends BaseActivity implements View.OnC
                     ToastUtil.showToast(this, R.string.c_photo_album_failed);
                 }
             }
+            isRegButtonEnable(mClauseCheckBox.isChecked());
         } else if (requestCode == INDUSTRY_CHOOSE) {
             if (resultCode == Activity.RESULT_OK) {
                 String industry = data.getStringExtra("industry");
                 mEnterpriseIndustryEt.setText(industry);
+                isRegButtonEnable(mClauseCheckBox.isChecked());
             }
         } else if (requestCode == SELECT_ADDRESS_REQUEST) {
             if (data != null && resultCode == SELECT_ADDRESS_RESULT) {

+ 4 - 5
app_modular/applogin/src/main/java/com/modular/login/activity/RegisterSelectActivity.java

@@ -5,7 +5,6 @@ import android.os.Bundle;
 import android.view.View;
 
 import com.core.base.BaseActivity;
-import com.core.utils.IntentUtils;
 import com.modular.login.R;
 
 import de.hdodenhof.circleimageview.CircleImageView;
@@ -30,10 +29,10 @@ public class RegisterSelectActivity extends BaseActivity implements View.OnClick
         findViewById(R.id.company_btn).setOnClickListener(new View.OnClickListener() {
             @Override
             public void onClick(View v) {
-                IntentUtils.webLinks(mContext,
-                        "https://account.ubtob.com/sso/register",
-                        "企业注册");
-//                startActivity(new Intent(mContext, EnterpriseRegisterActivity.class));
+//                IntentUtils.webLinks(mContext,
+//                        "https://account.ubtob.com/sso/register",
+//                        "企业注册");
+                startActivity(new Intent(mContext, EnterpriseRegisterActivity.class));
 //                finish();
             }
         });

+ 30 - 1
app_modular/applogin/src/main/java/com/modular/login/adapter/IndustryAdapter.java

@@ -5,11 +5,13 @@ import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
+import android.widget.ImageView;
 import android.widget.TextView;
 
 import com.core.widget.view.adapter.SecondaryListAdapter;
 import com.modular.login.R;
 
+import java.util.ArrayList;
 import java.util.List;
 
 /**
@@ -20,9 +22,11 @@ public class IndustryAdapter extends SecondaryListAdapter<IndustryAdapter.GroupI
     private Context mContext;
     private List<SecondaryListBean<String, String>> mDatas;
     private OnSubItemClickListener mOnSubItemClickListener;
+    private List<Integer> mFlags;
 
     public IndustryAdapter(Context context) {
         mContext = context;
+        mFlags = new ArrayList<>();
     }
 
     public List<SecondaryListBean<String, String>> getDatas() {
@@ -33,6 +37,13 @@ public class IndustryAdapter extends SecondaryListAdapter<IndustryAdapter.GroupI
         mDatas = datas;
         initSecondaryList(mDatas);
         setGroupItemStatu(0, true);
+        for (int i = 0; i < mDatas.size(); i++) {
+            if (i == 0) {
+                mFlags.add(1);
+            } else {
+                mFlags.add(0);
+            }
+        }
     }
 
     public void setOnSubItemClickListener(OnSubItemClickListener onSubItemClickListener) {
@@ -54,6 +65,13 @@ public class IndustryAdapter extends SecondaryListAdapter<IndustryAdapter.GroupI
     @Override
     public void onBindGroupViewHolder(RecyclerView.ViewHolder holder, int groupItemIndex) {
         ((GroupItemViewHolder) holder).groupTextView.setText(mDatas.get(groupItemIndex).getGroupItem());
+
+        Integer flag = mFlags.get(groupItemIndex);
+        if (flag % 2 == 0) {
+            ((GroupItemViewHolder) holder).groupImageView.setImageResource(R.drawable.ic_drop_down);
+        } else {
+            ((GroupItemViewHolder) holder).groupImageView.setImageResource(R.drawable.ic_menu_spread);
+        }
     }
 
     @Override
@@ -64,6 +82,15 @@ public class IndustryAdapter extends SecondaryListAdapter<IndustryAdapter.GroupI
     @Override
     public void onGroupItemClick(boolean isExpand, GroupItemViewHolder holder, int groupItemIndex) {
 //        Toast.makeText(mContext, mDatas.get(groupItemIndex).getGroupItem(), Toast.LENGTH_SHORT).show();
+        Integer flag = mFlags.get(groupItemIndex);
+        if (flag % 2 == 0) {
+            holder.groupImageView.setImageResource(R.drawable.ic_menu_spread);
+        } else {
+            holder.groupImageView.setImageResource(R.drawable.ic_drop_down);
+        }
+        flag++;
+        mFlags.remove(groupItemIndex);
+        mFlags.add(groupItemIndex, flag);
     }
 
     @Override
@@ -71,18 +98,20 @@ public class IndustryAdapter extends SecondaryListAdapter<IndustryAdapter.GroupI
 //        Toast.makeText(mContext, mDatas.get(groupItemIndex).getGroupItem()
 //                + "->" + mDatas.get(groupItemIndex).getSubItems().get(subItemIndex), Toast.LENGTH_SHORT).show();
         if (mOnSubItemClickListener != null) {
-            String message = mDatas.get(groupItemIndex).getGroupItem() + "/" + mDatas.get(groupItemIndex).getSubItems().get(subItemIndex);
+            String message = mDatas.get(groupItemIndex).getSubItems().get(subItemIndex);
             mOnSubItemClickListener.onSubItemClick(message);
         }
     }
 
     public class GroupItemViewHolder extends RecyclerView.ViewHolder {
         TextView groupTextView;
+        ImageView groupImageView;
 
         public GroupItemViewHolder(View itemView) {
             super(itemView);
 
             groupTextView = (TextView) itemView.findViewById(R.id.group_tv);
+            groupImageView = (ImageView) itemView.findViewById(R.id.group_iv);
         }
     }
 

BIN=BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_drop_down.png


BIN=BIN
app_modular/applogin/src/main/res/drawable-hdpi/ic_menu_spread.png


BIN=BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_drop_down.png


BIN=BIN
app_modular/applogin/src/main/res/drawable-xhdpi/ic_menu_spread.png


BIN=BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_drop_down.png


BIN=BIN
app_modular/applogin/src/main/res/drawable-xxhdpi/ic_menu_spread.png


+ 8 - 0
app_modular/applogin/src/main/res/drawable/selector_industry_sub_item_bg.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:drawable="@color/industry_sub_pressed" android:state_checked="true" />
+    <item android:drawable="@color/industry_sub_pressed" android:state_pressed="true" />
+    <item android:drawable="@color/industry_sub_pressed" android:state_selected="true" />
+
+    <item android:drawable="@color/industry_sub_unpressed" />
+</selector>

+ 85 - 23
app_modular/applogin/src/main/res/layout/activity_admin_register.xml

@@ -44,12 +44,11 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/admin_register_name_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_reg_name"
-                    android:hint="姓名(例如:张三)"
-                    editTextFormExample:testType="nocheck" />
+                    android:hint="姓名(例如:张三)" />
             </LinearLayout>
 
             <View
@@ -57,10 +56,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/admin_register_name_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写管理员姓名"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -70,15 +82,12 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/admin_register_phone_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_reg_phone"
                     android:hint="手机号(例如:15855555555)"
-                    android:inputType="number"
-                    editTextFormExample:customRegexp="^[1][3,4,5,7,8][0-9]{9}$"
-                    editTextFormExample:testErrorString="请输入正确的手机号"
-                    editTextFormExample:testType="regexp" />
+                    android:inputType="number" />
             </LinearLayout>
 
             <View
@@ -86,10 +95,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/admin_register_phone_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写正确的手机号码"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -99,15 +121,12 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/admin_register_email_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_reg_email"
                     android:drawablePadding="16dp"
-                    android:hint="邮箱(例如:zhangsan@example.com)"
-                    editTextFormExample:customRegexp="^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"
-                    editTextFormExample:testErrorString="请输入正确的邮箱地址"
-                    editTextFormExample:testType="regexp" />
+                    android:hint="邮箱(例如:zhangsan@example.com)" />
             </LinearLayout>
 
             <View
@@ -115,10 +134,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/admin_register_email_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写正确的邮箱"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -128,7 +160,7 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/admin_register_verification_et"
                     android:layout_width="0dp"
                     android:layout_height="40dp"
@@ -139,8 +171,7 @@
                     android:drawablePadding="16dp"
                     android:hint="验证码(例如:123456)"
                     android:inputType="number"
-                    android:textSize="14sp"
-                    editTextFormExample:testType="nocheck" />
+                    android:textSize="14sp" />
 
                 <TextView
                     android:id="@+id/admin_register_obtain_code_tv"
@@ -158,10 +189,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/admin_register_code_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写验证码"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -171,7 +215,7 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/admin_register_password_et"
                     android:layout_width="0dp"
                     android:layout_height="40dp"
@@ -180,8 +224,7 @@
                     android:drawableLeft="@drawable/ic_admin_password"
                     android:drawablePadding="16dp"
                     android:hint="密码(例如:Ab12345)"
-                    android:textSize="14sp"
-                    editTextFormExample:testType="nocheck" />
+                    android:textSize="14sp" />
 
                 <ImageView
                     android:id="@+id/admin_register_password_visiable_iv"
@@ -192,6 +235,25 @@
                     android:src="@drawable/ic_password_invisible" />
             </LinearLayout>
 
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="2px"
+                android:background="@color/item_line" />
+
+            <TextView
+                android:id="@+id/admin_register_password_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写管理员的密码"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
         </LinearLayout>
     </ScrollView>
 

+ 105 - 22
app_modular/applogin/src/main/res/layout/activity_enterprise_register.xml

@@ -49,13 +49,12 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/enterprise_register_company_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_company_name"
                     android:hint="企业名称"
-                    android:textColor="@color/black"
-                    editTextFormExample:testType="nocheck" />
+                    android:textColor="@color/black" />
             </LinearLayout>
 
             <View
@@ -63,10 +62,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/enterprise_register_company_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写正确的企业名称,2-99个字符"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible"/>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -76,25 +88,46 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/enterprise_register_license_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_business_license"
                     android:hint="营业执照号(例如:1234567890)"
                     android:inputType="number"
-                    android:textColor="@color/black"
-                    editTextFormExample:testType="nocheck" />
+                    android:textColor="@color/black" />
+
+                <TextView
+                    style="@style/form_relative_left_text"
+                    android:layout_marginLeft="0dp"
+                    android:layout_marginRight="10dp"
+                    android:text="*"
+                    android:textColor="@color/red" />
+
             </LinearLayout>
 
+
             <View
                 android:layout_width="match_parent"
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/enterprise_register_license_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写营业执照上的注册号"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible"/>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -104,13 +137,12 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/enterprise_register_represent_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_reg_name"
                     android:hint="法定代表人(例如:张三)"
-                    android:textColor="@color/black"
-                    editTextFormExample:testType="nocheck" />
+                    android:textColor="@color/black" />
             </LinearLayout>
 
             <View
@@ -118,10 +150,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/enterprise_register_represent_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写营业执照上的法定代表人"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -131,14 +176,13 @@
                     android:text="*"
                     android:textColor="@color/red" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/enterprise_register_address_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_reg_address"
+                    android:focusable="false"
                     android:hint="企业地址(例如:xx省xx市xx区xx路xx号)"
-                    android:textColor="@color/black"
-                    editTextFormExample:testType="nocheck"
-                    android:focusable="false"/>
+                    android:textColor="@color/black" />
 
             </LinearLayout>
 
@@ -147,10 +191,23 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:id="@+id/enterprise_register_address_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写正确的企业地址"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible" />
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -158,8 +215,7 @@
                     android:layout_marginLeft="0dp"
                     android:layout_marginRight="10dp"
                     android:text="*"
-                    android:textColor="@color/red"
-                    android:visibility="invisible" />
+                    android:textColor="@color/red" />
 
                 <TextView
                     android:id="@+id/enterprise_register_industry_et"
@@ -180,10 +236,24 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+
+            <TextView
+                android:id="@+id/enterprise_register_industry_error_tv"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请选择所在行业"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible"/>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -194,7 +264,7 @@
                     android:textColor="@color/red"
                     android:visibility="invisible" />
 
-                <com.andreabaccega.widget.FormEditText
+                <com.core.widget.ClearEditText
                     android:id="@+id/enterprise_register_business_et"
                     style="@style/register_edittext_style"
                     android:drawableLeft="@drawable/ic_business_scope"
@@ -207,10 +277,22 @@
                 android:layout_height="2px"
                 android:background="@color/item_line" />
 
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="40dp"
+                android:background="#e9e9e9"
+                android:drawableLeft="@drawable/ic_reg_notice"
+                android:drawablePadding="4dp"
+                android:padding="2dp"
+                android:text="请填写营业执照上的注册号"
+                android:textColor="@color/red"
+                android:textSize="10sp"
+                android:visibility="invisible"/>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginTop="10dp"
                 android:orientation="horizontal">
 
                 <TextView
@@ -221,6 +303,7 @@
                     android:textColor="@color/red" />
 
                 <com.andreabaccega.widget.FormEditText
+                    android:id="@+id/formEditText"
                     style="@style/register_edittext_style"
                     android:layout_width="0dp"
                     android:layout_weight="1"

+ 13 - 6
app_modular/applogin/src/main/res/layout/item_group_layout.xml

@@ -1,9 +1,8 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
-              android:layout_width="match_parent"
-              android:layout_height="wrap_content"
-              android:background="#beb8b8"
-              android:orientation="vertical">
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="#faf9f9">
 
     <TextView
         android:id="@+id/group_tv"
@@ -12,4 +11,12 @@
         android:padding="10dp"
         android:textSize="16sp" />
 
-</LinearLayout>
+    <ImageView
+        android:id="@+id/group_iv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="10dp"
+        android:src="@drawable/ic_drop_down" />
+</RelativeLayout>

+ 1 - 1
app_modular/applogin/src/main/res/layout/item_sub_layout.xml

@@ -8,7 +8,7 @@
         android:id="@+id/sub_tv"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:background="@drawable/selector_me_menu_item_bg"
+        android:background="@drawable/selector_industry_sub_item_bg"
         android:padding="10dp"
         android:paddingLeft="20dp"
         android:textSize="16sp" />

+ 5 - 0
app_modular/applogin/src/main/res/values/colors.xml

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<resources>
+    <color name="industry_sub_pressed">#dadada</color>
+    <color name="industry_sub_unpressed">#ebe9e9</color>
+</resources>