diff --git a/app/build.gradle b/app/build.gradle index a72b55b..8d136a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,6 +9,7 @@ android { versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" + multiDexEnabled true //突破应用方法数65535的一个限制 } buildTypes { release { @@ -56,7 +57,7 @@ dependencies { implementation 'com.j256.ormlite:ormlite-android:5.1' implementation files('libs/eventbus-2.4.0.jar') //三级联动选择 - // implementation 'com.contrarywind:Android-PickerView:3.2.6' + // implementation 'com.contrarywind:Android-PickerView:3.2.6' implementation 'com.contrarywind:Android-PickerView:4.1.9' - + implementation files('libs/fastjson-1.1.43.android.jar') } diff --git a/app/libs/fastjson-1.1.43.android.jar b/app/libs/fastjson-1.1.43.android.jar new file mode 100644 index 0000000..483fd1e Binary files /dev/null and b/app/libs/fastjson-1.1.43.android.jar differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 73df552..d0e51eb 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -15,11 +15,11 @@ android:supportsRtl="true" android:theme="@style/AppTheme"> - - + + - - + + @@ -30,10 +30,10 @@ android:screenOrientation="portrait" android:theme="@style/SplashTheme"> - - - - + + + + + + diff --git a/app/src/main/java/com/example/administrator/seven/BaseApplication.java b/app/src/main/java/com/example/administrator/seven/BaseApplication.java index c0ce0e8..ff1c085 100644 --- a/app/src/main/java/com/example/administrator/seven/BaseApplication.java +++ b/app/src/main/java/com/example/administrator/seven/BaseApplication.java @@ -39,7 +39,11 @@ import okhttp3.OkHttpClient; public class BaseApplication extends Application { private static Context mContext; + private static BaseApplication baseApplication; + public static BaseApplication getInstance() { + return baseApplication; + } private String str; @@ -52,6 +56,7 @@ public class BaseApplication extends Application { @Override public void onCreate() { super.onCreate(); + baseApplication = this; mContext = this; //用户资料存储工具 ProfileSpUtils.init(this); diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/CommitDesignModel.java b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/CommitDesignModel.java index d382827..f7b66c8 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/CommitDesignModel.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/CommitDesignModel.java @@ -4,32 +4,6 @@ import com.example.administrator.seven.test.BaseModel; public class CommitDesignModel extends BaseModel { - - /** - * result : {"msg":"提交成功","success":0} - * status : 0 - */ - - private ResultBean result; - private int status; - - public ResultBean getResult() { - return result; - } - - public void setResult(ResultBean result) { - this.result = result; - } - - public int getStatus() { - return status; - } - - public void setStatus(int status) { - this.status = status; - } - - public static class ResultBean { /** * msg : 提交成功 * success : 0 @@ -53,5 +27,5 @@ public class CommitDesignModel extends BaseModel { public void setSuccess(int success) { this.success = success; } - } + } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/JsonBeantwo.java b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/JsonBeantwo.java index 16eeb6a..2f07d17 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/JsonBeantwo.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/JsonBeantwo.java @@ -52,7 +52,7 @@ public class JsonBeantwo implements IPickerViewData { @Override public String getPickerViewText() { - return this.areaName+","+this.areaId; + return this.areaName; } public static class CitiesBean { diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/industryBean.java b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/industryBean.java new file mode 100644 index 0000000..09816d4 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/Bean/industryBean.java @@ -0,0 +1,99 @@ +package com.example.administrator.seven.main.kehu.Bean; + +import com.example.administrator.seven.test.BaseModel; + +import java.util.List; + +/** + * Time: 2020/8/20 + * Author: jianbo + * Description: + */ +public class industryBean extends BaseModel { + + /** + * result : {"msg":"成功","data":[{"industry_id":"1","industry":"家具"}],"success":0} + * status : 0 + */ + + private ResultBean result; + private int status; + + public ResultBean getResult() { + return result; + } + + public void setResult(ResultBean result) { + this.result = result; + } + + public int getStatus() { + return status; + } + + public void setStatus(int status) { + this.status = status; + } + + public static class ResultBean { + /** + * msg : 成功 + * data : [{"industry_id":"1","industry":"家具"}] + * success : 0 + */ + + private String msg; + private int success; + private List data; + + public String getMsg() { + return msg; + } + + public void setMsg(String msg) { + this.msg = msg; + } + + public int getSuccess() { + return success; + } + + public void setSuccess(int success) { + this.success = success; + } + + public List getData() { + return data; + } + + public void setData(List data) { + this.data = data; + } + + public static class DataBean { + /** + * industry_id : 1 + * industry : 家具 + */ + + private String industry_id; + private String industry; + + public String getIndustry_id() { + return industry_id; + } + + public void setIndustry_id(String industry_id) { + this.industry_id = industry_id; + } + + public String getIndustry() { + return industry; + } + + public void setIndustry(String industry) { + this.industry = industry; + } + } + } +} diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/TraceFragment.java b/app/src/main/java/com/example/administrator/seven/main/kehu/TraceFragment.java index 8899868..03b99bc 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/TraceFragment.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/TraceFragment.java @@ -151,6 +151,7 @@ public class TraceFragment extends BaseFragment implements View.OnClickListener default: break; case R.id.bt_sousuo_ditu: + ShowAty.SearchActivity(getActivity()); break; case R.id.enter_shop_shai: break; diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/CustomerDetailActivity.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/CustomerDetailActivity.java index 8525300..0a8c891 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/CustomerDetailActivity.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/CustomerDetailActivity.java @@ -1,12 +1,36 @@ package com.example.administrator.seven.main.kehu.activity; import android.os.Bundle; +import android.text.TextUtils; +import android.util.Log; import android.widget.TextView; +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.TypeReference; +import com.bumptech.glide.Glide; +import com.bumptech.glide.Priority; +import com.bumptech.glide.request.RequestOptions; +import com.example.administrator.seven.JsonUtils; import com.example.administrator.seven.R; import com.example.administrator.seven.base.BaseActivity; +import com.example.administrator.seven.db.DbRecordBeanData; +import com.example.administrator.seven.main.kehu.Bean.customerFPListBean; +import com.example.administrator.seven.okgonet.NetApi; +import com.example.administrator.seven.okgonet.Observer; +import com.example.administrator.seven.utils.GlideTools; +import com.example.administrator.seven.utils.ToastUtils; +import com.example.administrator.seven.utils.ToolsText; +import com.example.administrator.seven.utils.WidgetTools; +import com.example.administrator.seven.utils.checkVersionsUtils.ProfileSpUtils; import com.example.administrator.seven.widget.CircleImageView; import com.example.administrator.seven.widget.TitleBar; +import com.lzy.okgo.model.Response; + +import org.json.JSONException; +import org.json.JSONObject; + +import java.util.List; +import java.util.Map; /** * 客户详情 @@ -15,61 +39,83 @@ public class CustomerDetailActivity extends BaseActivity { private TitleBar mTitleBar; private CircleImageView mIvDraUserHeads; - /** - * 姓名:-- - */ private TextView mTvDraUserName; - /** - * 电话:— — - */ private TextView mTvDarUserPhone; - /** - * 家装阶段: - */ - private TextView mTvDraInfo01; - /** - * 毛胚 - */ private TextView mTvDraInfo02; - /** - * 风格 - */ - private TextView mTvDraInfo03; - /** - * 美式 - */ private TextView mTvDraInfo04; - /** - * 预算 - */ - private TextView mTvDraInfo05; - /** - * 10万 - */ private TextView mTvDraInfo06; - private String namephone; + private String customer_id; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_customer_detail); - namephone = getIntent().getStringExtra("namephone"); + customer_id = getIntent().getStringExtra("customer_id"); initView(); initNormalBack(); + getData(customer_id); } - private void initView() { mTitleBar = (TitleBar) findViewById(R.id.title_bar); - mTitleBar.setTitle(namephone); mIvDraUserHeads = (CircleImageView) findViewById(R.id.iv_dra_user_heads); mTvDraUserName = (TextView) findViewById(R.id.tv_dra_user_name); mTvDarUserPhone = (TextView) findViewById(R.id.tv_dar_user_phone); - mTvDraInfo01 = (TextView) findViewById(R.id.tv_dra_info01); mTvDraInfo02 = (TextView) findViewById(R.id.tv_dra_info02); - mTvDraInfo03 = (TextView) findViewById(R.id.tv_dra_info03); mTvDraInfo04 = (TextView) findViewById(R.id.tv_dra_info04); - mTvDraInfo05 = (TextView) findViewById(R.id.tv_dra_info05); mTvDraInfo06 = (TextView) findViewById(R.id.tv_dra_info06); } + public void getData(String customer_id) { + new NetApi().customerDetail(customer_id).subscribe(new Observer() { + @Override + public void onNext(Response response) { + String body = (String) response.body(); + try { + JSONObject jsonObject = new JSONObject(body); + String result = jsonObject.optString("result"); + Log.d("okgo的返回结果result", result); + JSONObject result1 = jsonObject.getJSONObject("result"); + String success = result1.getString("success"); + String msg = result1.getString("msg"); + if (success.equals("0")) { + String data1 = result1.getString("data"); + Map data = JSON.parseObject(data1, new TypeReference>() { + }); + GlideTools.init(CustomerDetailActivity.this).displaypic(mIvDraUserHeads, ToolsText.getValue(data, "customer_head"), R.mipmap.icon_default_head); + String name = ToolsText.getValue(data, "name"); + String phone = ToolsText.getValue(data, "phone"); + mTitleBar.setTitle(name+phone); + WidgetTools.setTextfive(mTvDraUserName, "", ToolsText.getValue(data, "wechat")); + WidgetTools.setTextfive(mTvDarUserPhone, "", ToolsText.getValue(data, "address")); + //1:毛坯,2:精装,3:旧房改造 + switch (ToolsText.getValue(data, "decoration")){ + case "1": + WidgetTools.setTextfive(mTvDraInfo02, "", ToolsText.getValue(data, "毛坯")); + break; + case "2": + WidgetTools.setTextfive(mTvDraInfo02, "", ToolsText.getValue(data, "精装")); + break; + case "3": + WidgetTools.setTextfive(mTvDraInfo02, "", ToolsText.getValue(data, "旧房改造")); + break; + } + + WidgetTools.setTextfive(mTvDraInfo04, "4.户型面积:", ToolsText.getValue(data, "style_name")); + WidgetTools.setTextfive(mTvDraInfo06, "6.备 注:", ToolsText.getValue(data, "budget")); + + }else { + ToastUtils.showToast(CustomerDetailActivity.this, msg); + } + } catch (JSONException e) { + e.printStackTrace(); + } + } + + @Override + public void onError(Exception e) { + e.printStackTrace(); + + } + }); + } } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/DesignActivity.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/DesignActivity.java index 051a966..c514dab 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/DesignActivity.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/DesignActivity.java @@ -1,13 +1,19 @@ package com.example.administrator.seven.main.kehu.activity;//package com.example.administrator.seven.main.kehu.activity; import android.annotation.SuppressLint; +import android.app.ActionBar; import android.app.Activity; import android.content.Context; import android.graphics.Color; import android.os.Handler; import android.os.Message; -import android.text.TextUtils; +import android.util.Log; import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.ListView; +import android.widget.PopupWindow; +import android.widget.RelativeLayout; import android.widget.TextView; import android.widget.Toast; @@ -15,18 +21,23 @@ import com.bigkoo.pickerview.builder.OptionsPickerBuilder; import com.bigkoo.pickerview.listener.OnOptionsSelectListener; import com.bigkoo.pickerview.view.OptionsPickerView; import com.example.administrator.seven.GetJsonDataUtil; +import com.example.administrator.seven.JsonUtils; import com.example.administrator.seven.R; import com.example.administrator.seven.base.BaseTreeActivity; import com.example.administrator.seven.db.DbRecordBeanData; -import com.example.administrator.seven.main.kehu.Bean.CommitDesignModel; import com.example.administrator.seven.main.kehu.Bean.JsonBeantwo; import com.example.administrator.seven.main.kehu.Bean.PhotoeditorBean; +import com.example.administrator.seven.main.kehu.Bean.industryBean; import com.example.administrator.seven.main.kehu.activity.mvp.contract.CommitDesignContract; import com.example.administrator.seven.main.kehu.activity.mvp.presenter.CommitDesignPresenter; import com.example.administrator.seven.main.kehu.adapter.DesignAdapter; +import com.example.administrator.seven.okgonet.NetApi; +import com.example.administrator.seven.okgonet.Observer; +import com.example.administrator.seven.utils.StringUtils; import com.example.administrator.seven.utils.ToastUtils; import com.example.administrator.seven.widget.TitleBar; import com.google.gson.Gson; +import com.lzy.okgo.model.Response; import org.json.JSONArray; @@ -50,16 +61,16 @@ public class DesignActivity extends BaseTreeActivity dingdanTypeAdapter; + private ListView dingdanTypeLv; + private PopupWindow dingdanTypePw; private List dataBean; - - private TextView btn_add; + private TextView btn_add,btn_commit; private RecyclerView mLabelRvList; private DesignAdapter adapter; - private List photoeditor=new ArrayList<>(); + private List photoeditor = new ArrayList<>(); + private List industryData; + private ArrayList dingdanTypeList = new ArrayList<>(); @Override protected int getLayoutId() { @@ -71,10 +82,28 @@ public class DesignActivity extends BaseTreeActivity() { + @Override + public void onNext(Response response) { + String body = (String) response.body(); + industryBean.ResultBean result = JsonUtils.fromJson(body, industryBean.class).getResult(); + if (result != null && String.valueOf(result.getSuccess()).equals("0")) { + industryData = result.getData(); + } + } + @Override + public void onError(Exception e) { + e.printStackTrace(); + + } + }); } @@ -100,30 +129,28 @@ public class DesignActivity extends BaseTreeActivity contents = new ArrayList<>(); + for (int i = 0; i < dataBean.size(); i++) { + String customer_id = dataBean.get(i).getCustomer_id(); + for (int j = 0; j < photoeditor.size(); j++) { + PhotoeditorBean photoeditorBean = photoeditor.get(j); + photoeditorBean.setCustomer_id(customer_id); + contents.add(photoeditorBean); + } } Gson gson = new Gson(); - String strtext = gson.toJson(photoeditor); + String strtext = gson.toJson(contents); getPresenter().commitdesign(strtext); break; case R.id.btn_add://添加图文编辑 @@ -168,6 +212,45 @@ public class DesignActivity extends BaseTreeActivity(this, R.layout.order_type_dialog_view, dingdanTypeList); + + dingdanTypeLv.setAdapter(dingdanTypeAdapter); + + dingdanTypeLv.setOnItemClickListener(new AdapterView.OnItemClickListener() { + @Override + public void onItemClick(AdapterView adapterView, View view, int position, long id) { + String industry = industryData.get(position).getIndustry(); + String industry_id = industryData.get(position).getIndustry_id(); + tv_dingdan_type.setText(industry); + photoeditor.get(position).setIndustry_id(industry_id); + dingdanTypePw.dismiss(); + } + }); + dingdanTypePw = new PopupWindow(dingdanTypeLv, rl_dingdan_type.getWidth(), ActionBar.LayoutParams.WRAP_CONTENT, true); + dingdanTypePw.setBackgroundDrawable(getResources().getDrawable(R.drawable.window_po_bg)); + dingdanTypePw.setFocusable(true); + dingdanTypePw.setOutsideTouchable(true); + dingdanTypePw.setOnDismissListener(new PopupWindow.OnDismissListener() { + @Override + public void onDismiss() { + // 关闭popup窗口 + dingdanTypePw.dismiss(); + } + }); + } + + @Override public Context getContext() { return DesignActivity.this; @@ -178,11 +261,6 @@ public class DesignActivity extends BaseTreeActivity 0 && options2Itemids.get(options1).size() > 0 ? options2Itemids.get(options1).get(options2) : ""; - String tx = opt1tx + opt2tx +opt1txx+","+opt2idtx ; - Toast.makeText(DesignActivity.this, tx, Toast.LENGTH_SHORT).show(); + String tx = opt1tx + opt2tx + opt1txx + "," + opt2idtx; + //Toast.makeText(DesignActivity.this, tx, Toast.LENGTH_SHORT).show(); + et_area01.setText(opt1tx); + et_area02.setText(opt2tx); + photoeditor.get(position).setProvince(opt1txx); + photoeditor.get(position).setCity(opt2idtx); + Log.e("选择的城市", tx); } }) @@ -313,12 +396,10 @@ public class DesignActivity extends BaseTreeActivity parseData(String result) {//Gson 解析 ArrayList detail = new ArrayList<>(); try { @@ -335,7 +416,6 @@ public class DesignActivity extends BaseTreeActivity()); + break; + default: + break; + + } + } +} diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/ShowAty.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/ShowAty.java index d20fdb1..2d44b29 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/ShowAty.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/ShowAty.java @@ -32,6 +32,14 @@ public class ShowAty { ctx.startActivity(i); } + /** + * 搜索 + */ + public static void SearchActivity(Context ctx) { + Intent i = new Intent(ctx, SearchActivity.class); + ctx.startActivity(i); + } + /** * 客户详情 @@ -39,6 +47,7 @@ public class ShowAty { public static void CustomerDetailActivity(Context ctx, CustomerListBean.ResultBean.DataBean item) { Intent i = new Intent(ctx, CustomerDetailActivity.class); i.putExtra("namephone",item.getName()+item.getPhone()); + i.putExtra("customer_id",item.getCustomer_id()); ctx.startActivity(i); } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/contract/CommitDesignContract.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/contract/CommitDesignContract.java index 692c0fa..9eb2fc3 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/contract/CommitDesignContract.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/contract/CommitDesignContract.java @@ -5,6 +5,7 @@ import android.content.Context; import com.example.administrator.seven.main.kehu.Bean.CommitDesignModel; import com.example.administrator.seven.main.kehu.Bean.PhotoeditorBean; +import com.example.administrator.seven.main.kehu.Bean.industryBean; import com.example.administrator.seven.main.kehu.activity.mvp.BaseMenDianView; import com.example.administrator.seven.network.ApiCallBack; @@ -12,14 +13,10 @@ import com.example.administrator.seven.network.ApiCallBack; public interface CommitDesignContract { interface Model { - //详细信息 + //提交信息 void commitdesign(String content, final ApiCallBack callBack); - - - void worksReedit(String uid, String workid, String project_id, final ApiCallBack callBack);//重新编辑 - } interface View extends BaseMenDianView { @@ -28,19 +25,15 @@ public interface CommitDesignContract { Activity getActivity(); - void commitdesign(CommitDesignModel commitDesignModel); - void progress(); void hideProgress(); - void onsuccress(); } interface Presenter { void commitdesign(String uid);//提交方案设计 - } } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/model/CommitDesignModeltwo.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/model/CommitDesignModeltwo.java index 7ecdae4..963bb01 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/model/CommitDesignModeltwo.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/model/CommitDesignModeltwo.java @@ -2,6 +2,7 @@ package com.example.administrator.seven.main.kehu.activity.mvp.model; import com.example.administrator.seven.main.kehu.Bean.CommitDesignModel; import com.example.administrator.seven.main.kehu.Bean.PhotoeditorBean; +import com.example.administrator.seven.main.kehu.Bean.industryBean; import com.example.administrator.seven.main.kehu.activity.mvp.contract.CommitDesignContract; import com.example.administrator.seven.network.ApiCallBack; import com.example.administrator.seven.network.http.ApiUtils; @@ -35,11 +36,4 @@ public class CommitDesignModeltwo implements CommitDesignContract.Model { }); } - - @Override - public void worksReedit(String uid, String workid, String project_id, final ApiCallBack callBack) { - - PhotoeditorBean worksReeditBean = new PhotoeditorBean(); - //callBack.onResponse(worksReeditBean); - } } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/presenter/CommitDesignPresenter.java b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/presenter/CommitDesignPresenter.java index 9944015..60fad24 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/presenter/CommitDesignPresenter.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/activity/mvp/presenter/CommitDesignPresenter.java @@ -1,6 +1,7 @@ package com.example.administrator.seven.main.kehu.activity.mvp.presenter; import com.example.administrator.seven.main.kehu.Bean.CommitDesignModel; +import com.example.administrator.seven.main.kehu.Bean.industryBean; import com.example.administrator.seven.main.kehu.activity.mvp.contract.CommitDesignContract; import com.example.administrator.seven.main.kehu.activity.mvp.model.CommitDesignModeltwo; import com.example.administrator.seven.network.ApiCallBack; @@ -21,8 +22,8 @@ public class CommitDesignPresenter extends MvpBasePresenter() { @Override protected void onSuccess(CommitDesignModel responseData, String message) { - if (responseData.getResult().getSuccess() == 0) { - ToastUtils.showToast(getView().getContext(), responseData.getResult().getMsg()); + if (responseData.getSuccess() == 0) { + ToastUtils.showToast(getView().getContext(), responseData.getMsg()); getView().getActivity().finish(); } } diff --git a/app/src/main/java/com/example/administrator/seven/main/kehu/adapter/DesignAdapter.java b/app/src/main/java/com/example/administrator/seven/main/kehu/adapter/DesignAdapter.java index ab8fc92..d7ca066 100644 --- a/app/src/main/java/com/example/administrator/seven/main/kehu/adapter/DesignAdapter.java +++ b/app/src/main/java/com/example/administrator/seven/main/kehu/adapter/DesignAdapter.java @@ -2,6 +2,7 @@ package com.example.administrator.seven.main.kehu.adapter; import android.content.Context; import android.view.View; +import android.widget.LinearLayout; import android.widget.RelativeLayout; import android.widget.TextView; @@ -22,23 +23,27 @@ public class DesignAdapter extends BaseQuickAdapter { + + public SearchAdapter(SearchActivity context) { + super(context); + } + + @Override + protected View getConvertView(final int position, View convertView, ViewGroup parent) { + if(convertView == null) + convertView = mInflater.inflate(R.layout.it_search, null); + TextView tvItem = Get(convertView, R.id.tvItem); + setText(tvItem, mList.get(position)); + + convertView.setOnClickListener(new OnClickListener() { + + @Override + public void onClick(View v) { + if(null!=mListener) + mListener.onItemEvent(mList.get(position), 0, position); +// if("0".equals(poFrom)) { //搜索商品 +// JumpUtils.gotoActivity((Activity) mContext, MallListActivity.class, false, "mSearchStr", "开心"); +// }else { //搜索帖子 +// JumpUtils.gotoActivity((Activity) mContext, SearchResultActivity.class, false, "mSearchStr", "开心"); +// } + } + }); + return convertView; + } + +} diff --git a/app/src/main/java/com/example/administrator/seven/network/http/MyApi.java b/app/src/main/java/com/example/administrator/seven/network/http/MyApi.java index c57f427..6390022 100644 --- a/app/src/main/java/com/example/administrator/seven/network/http/MyApi.java +++ b/app/src/main/java/com/example/administrator/seven/network/http/MyApi.java @@ -3,10 +3,13 @@ package com.example.administrator.seven.network.http; import com.example.administrator.seven.main.entity.LoginBean; import com.example.administrator.seven.main.entity.mine.TreeUserEntity; +import com.example.administrator.seven.main.kehu.Bean.CommitDesignModel; +import com.example.administrator.seven.main.kehu.Bean.industryBean; import io.reactivex.Observable; import retrofit2.http.Field; import retrofit2.http.FormUrlEncoded; +import retrofit2.http.GET; import retrofit2.http.POST; /** @@ -117,18 +120,18 @@ public class MyApi { /** - * 账号密码登录 + * 确认分配 * * @param uid 登录员工的uid * @param content 分配内容[{"customer_id":"客户1","industry_id":"家具id","province":"610000","city":"610100"},{"customer_id":"客户1","industry_id":"建材id","province":"610000","city":"610100"},{"customer_id":"客户2","industry_id":"家具id","province":"610000","city":"610100"},{"customer_id":"客户2","industry_id":"建材id","province":"610000","city":"610100"}] * @return */ @POST("AppCustomer/sureFP") - // @POST("/device/DevLogin/accountPwd") @FormUrlEncoded - Observable> sureFP(@Field("uid") String uid + Observable> sureFP(@Field("uid") String uid , @Field("content") String content); + } } diff --git a/app/src/main/java/com/example/administrator/seven/okgonet/HttpConstants.java b/app/src/main/java/com/example/administrator/seven/okgonet/HttpConstants.java index 4a59e5c..7e5ceb1 100644 --- a/app/src/main/java/com/example/administrator/seven/okgonet/HttpConstants.java +++ b/app/src/main/java/com/example/administrator/seven/okgonet/HttpConstants.java @@ -421,6 +421,14 @@ public class HttpConstants { * 确认分配 */ public static String URi_device_AppCustomer_sureFP = URiBase + "/device/AppCustomer/sureFP"; + + /** + * 行业 + */ + public static String URi_device_AppCustomer_industry = URiBase + "/device/AppCustomer/industry"; + + + } diff --git a/app/src/main/java/com/example/administrator/seven/okgonet/NetApi.java b/app/src/main/java/com/example/administrator/seven/okgonet/NetApi.java index 6af397a..5d3d4d4 100644 --- a/app/src/main/java/com/example/administrator/seven/okgonet/NetApi.java +++ b/app/src/main/java/com/example/administrator/seven/okgonet/NetApi.java @@ -328,4 +328,48 @@ public class NetApi { } + + /** + * 行业 + */ + public Observable industry() { + + return new Observable() { + @Override + public void subscribe(final Observer observer) { + + OkGo.post(HttpConstants.URi_device_AppCustomer_industry)// + .converter(new StringConvert())// + .cacheMode(CacheMode.NO_CACHE) //无缓存模式 CacheMode.NO_CACHE + .adapt(new ObservableResponse())// + .subscribeOn(Schedulers.io())// + .observeOn(AndroidSchedulers.mainThread())// + .subscribe(new io.reactivex.Observer>() { + + @Override + public void onSubscribe(@NonNull Disposable d) { + // addDisposable(d); + } + + @Override + public void onNext(@NonNull Response response) { + observer.onNext(response); + } + + @Override + public void onError(@NonNull Throwable e) { + e.printStackTrace(); + + } + + @Override + public void onComplete() { + + } + }); + } + }; + + } + } \ No newline at end of file diff --git a/app/src/main/java/com/example/administrator/seven/utils/BaseAdapter.java b/app/src/main/java/com/example/administrator/seven/utils/BaseAdapter.java new file mode 100644 index 0000000..9a16904 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/utils/BaseAdapter.java @@ -0,0 +1,177 @@ +package com.example.administrator.seven.utils; + +import android.content.Context; +import android.text.TextUtils; +import android.util.SparseArray; +import android.view.LayoutInflater; +import android.view.View; +import android.view.ViewGroup; +import android.widget.Button; +import android.widget.CheckBox; +import android.widget.EditText; +import android.widget.RadioButton; +import android.widget.TextView; + +import java.util.ArrayList; +import java.util.List; + +public abstract class BaseAdapter extends android.widget.BaseAdapter { + protected LayoutInflater mInflater; + protected Context mContext; + protected SparseArray viewHolder; + protected IAdpListener mListener; + protected final List mList = new ArrayList(); + + /** + * @param context + * @param dataList + */ + public BaseAdapter(Context context) { + // TODO Auto-generated constructor stub + this.mContext = context; + this.mInflater = LayoutInflater.from(mContext); + } + + public void setAdpListener(IAdpListener listener) { + this.mListener = listener; + } + + public List getList() { + return mList; + } + + public void setList(List list) { + mList.clear(); + mList.addAll(list); + notifyDataSetChanged(); + } + + public void appendToList(List list) { + if (list == null) { + return; + } + mList.addAll(list); + notifyDataSetChanged(); + } + + public void appendToTopList(List list) { + if (list == null) { + return; + } + mList.addAll(0, list); + notifyDataSetChanged(); + } + + public void clear() { + mList.clear(); + notifyDataSetChanged(); + } + + @Override + public int getCount() { + return mList == null ? 0 : mList.size(); + } + + @Override + public T getItem(int position) { + return mList.get(position); + } + + @Override + public long getItemId(int position) { + return position; + } + + @Override + public View getView(int position, View convertView, ViewGroup parent) { + return getConvertView(position, convertView, parent); + } + + /** + * getConvertView + * + * @param position + * @param convertView + * @param parent + * @return + */ + protected abstract View getConvertView(int position, View convertView, + ViewGroup parent); + + /** + * + * @param view + * @param id + * @return + */ + @SuppressWarnings({ "unchecked", "hiding" }) + protected T Get(View view, int id) { + viewHolder = (SparseArray) view.getTag(); + if (viewHolder == null) { + viewHolder = new SparseArray(); + view.setTag(viewHolder); + } + View childView = viewHolder.get(id); + if (childView == null) { + childView = view.findViewById(id); + viewHolder.put(id, childView); + } + return (T) childView; + } + + /** + * + * @param view + * @param id + * @param text + */ + protected void setText(View v, String text) { + if(v==null) + return ; + if (TextUtils.isEmpty(text)) + text = ""; + if (v instanceof TextView) {// TextView + ((TextView) v).setText(text); + return; + } + if (v instanceof Button) {// Button + ((Button) v).setText(text); + return; + } + if (v instanceof CheckBox) {// CheckBox + ((CheckBox) v).setText(text); + return; + } + if (v instanceof RadioButton) {// RadioButton + ((RadioButton) v).setText(text); + return; + } + if (v instanceof EditText) {// EditText + ((EditText) v).setText(text); + return; + } + } + + /** + * + * @ClassName: IAdpListener + * @Description: TODO(描述: ) + * @author Lijc + * @Company: BlueMobi + * @date 2015�?5�?5�? 上午10:00:15 + * @version V1.0 + */ + public interface IAdpListener { + /** + * Item点击事件 + * + * @param data + * 数据 + * @param flag + * 事件标志 + * @param position + * 位置 + */ + public void onItemEvent(Object data, int flag, int position); + } +} diff --git a/app/src/main/java/com/example/administrator/seven/utils/LocatData.java b/app/src/main/java/com/example/administrator/seven/utils/LocatData.java new file mode 100644 index 0000000..b1bb342 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/utils/LocatData.java @@ -0,0 +1,172 @@ +package com.example.administrator.seven.utils; + +import com.example.administrator.seven.BaseApplication; + +import java.util.ArrayList; +import java.util.List; + +public class LocatData { + /** Shared */ + public static final String APP_SHARED_NAME = "svojcll.shared"; + /** */ + public static final String APP_SOSO_HISTORY_POST = "data.soso.history.post"; + /** */ + public static final String APP_SOSO_HISTORY_GOOD = "data.soso.history.good"; + /** */ + public static final String APP_LOGIN = "data.login.infor"; + /** */ + public static final String APP_USER = "data.user.infor"; + // 单例模式 + private static LocatData instance; + + + /** */ + public static final String AD_IMG_URL = "data.ad.img.urls"; + /** */ + public static final String AD_IMG_PATH = "data.ad.img.path"; + + public void putAdPath(String path) { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(AD_IMG_PATH, path); + } + + public String getAdPath() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + return sharedTools.getObject(AD_IMG_PATH, String.class); + } + + public void putAdUrl(String path) { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(AD_IMG_URL, path); + } + + public String getAdUrl() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + return sharedTools.getObject(AD_IMG_URL, String.class); + } + + + + private LocatData() { + } + + public static LocatData Init() { + // mContext = ctx; + // TODO 双重校验锁 + if (null == instance) { + synchronized (LocatData.class) { + if (null == instance) { + instance = new LocatData(); + } + } + } + return instance; + } + + /** 清空本地历史搜索 */ + public void clearPost() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(APP_SOSO_HISTORY_POST, ""); + } + + /** 添加搜索KEY合集 */ + public void addPost(String sosoKey) { + List tempList = getPosts(); + + if (tempList.contains(sosoKey)) { + tempList.remove(sosoKey); + } + tempList.add(0, sosoKey); + StringBuffer sb = new StringBuffer(""); + for (int i = 0; i < tempList.size(); i++) { + sb.append(tempList.get(i)); + if (i < tempList.size() - 1) { + sb.append(","); + } + } + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(APP_SOSO_HISTORY_POST, sb.toString()); + + } + + /** 获取搜索KEY合集 */ + private String getPostStr() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + String temp = sharedTools + .getObject(APP_SOSO_HISTORY_POST, String.class); + return (null == temp || "".equals(temp) ? "" : temp); + } + + /** 获取搜索KEY合集 */ + public List getPosts() { + String temp = getPostStr(); + if ("".equals(temp)) { + return new ArrayList(); + } + List tempList = new ArrayList(); + String[] str = temp.split(","); + for (int i = 0; i < str.length; i++) { + tempList.add(str[i]); + } + return tempList; + + } + + /** 清空本地历史搜索 */ + public void clearGood() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(APP_SOSO_HISTORY_GOOD, ""); + } + + /** 添加搜索KEY合集 */ + public void addGood(String sosoKey) { + List tempList = getGoods(); + + if (tempList.contains(sosoKey)) { + tempList.remove(sosoKey); + } + tempList.add(0, sosoKey); + StringBuffer sb = new StringBuffer(""); + for (int i = 0; i < tempList.size(); i++) { + sb.append(tempList.get(i)); + if (i < tempList.size() - 1) { + sb.append(","); + } + } + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + sharedTools.setObject(APP_SOSO_HISTORY_GOOD, sb.toString()); + } + + /** 获取搜索KEY合集 */ + private String getGoodStr() { + SharedTools sharedTools = new SharedTools( + BaseApplication.getInstance(), APP_SHARED_NAME); + String temp = sharedTools + .getObject(APP_SOSO_HISTORY_GOOD, String.class); + return (null == temp || "".equals(temp) ? "" : temp); + } + + /** 获取搜索KEY合集 */ + public List getGoods() { + String temp = getGoodStr(); + if ("".equals(temp)) { + return new ArrayList(); + } + List tempList = new ArrayList(); + String[] str = temp.split(","); + for (int i = 0; i < str.length; i++) { + tempList.add(str[i]); + } + return tempList; + } + +} diff --git a/app/src/main/java/com/example/administrator/seven/utils/SharedTools.java b/app/src/main/java/com/example/administrator/seven/utils/SharedTools.java new file mode 100644 index 0000000..1c49949 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/utils/SharedTools.java @@ -0,0 +1,189 @@ +package com.example.administrator.seven.utils; + +import android.content.Context; +import android.content.SharedPreferences; +import android.content.SharedPreferences.Editor; +import android.util.Base64; +import android.util.Log; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.StreamCorruptedException; + +/** + * + * @ClassName: LShared + * @Description: TODO(描述: SharedPreferences 工具类) + * @author Lee + * @date 2016年4月11日 上午10:00:27 + * @version V1.0 + */ +public class SharedTools { + + Context context; + String name; + public static final String SP_NAME = "tsxn"; + SharedPreferences sp; + Editor editor; + + public SharedTools(Context context) { + this.context = context; + sp = context.getSharedPreferences(SP_NAME, Context.MODE_PRIVATE); + editor = sp.edit(); + } + + public SharedTools(Context context, String name) { + this.context = context; + this.name = name; + sp = context.getSharedPreferences(name, Context.MODE_PRIVATE); + editor = sp.edit(); + } + + public void setBoolean(String key, boolean bool) { + editor.putBoolean(key, bool); + editor.commit(); + } + + public boolean getBoolean(String key) { + return sp.getBoolean(key, false); + } + + public void setString(String key, String val) { + editor.putString(key, val); + editor.commit(); + } + + public String getString(String key) { + return sp.getString(key, ""); + } + + /** + * 根据key和预期的value类型获取value的值 + * + * @param key + * @param clazz + * @return + */ + public T getValue(String key, Class clazz) { + if (context == null) { + throw new RuntimeException("请先调用带有context,name参数的构造!"); + } + + SharedPreferences sp = this.context.getSharedPreferences(this.name, + Context.MODE_PRIVATE); + return getValue(key, clazz, sp); + } + + /** + * 针对复杂类型存储<对象> + * + * @param key + * @param val + */ + public void setObject(String key, Object object) { + SharedPreferences sp = this.context.getSharedPreferences(this.name, + Context.MODE_PRIVATE); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + ObjectOutputStream out = null; + try { + + out = new ObjectOutputStream(baos); + out.writeObject(object); + String objectVal = new String(Base64.encode(baos.toByteArray(), + Base64.DEFAULT)); + Editor editor = sp.edit(); + editor.putString(key, objectVal); + editor.commit(); + + } catch (IOException e) { + e.printStackTrace(); + } finally { + try { + if (baos != null) { + baos.close(); + } + if (out != null) { + out.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + @SuppressWarnings("unchecked") + public T getObject(String key, Class clazz) { + SharedPreferences sp = this.context.getSharedPreferences(this.name, + Context.MODE_PRIVATE); + if (sp.contains(key)) { + String objectVal = sp.getString(key, null); + byte[] buffer = Base64.decode(objectVal, Base64.DEFAULT); + ByteArrayInputStream bais = new ByteArrayInputStream(buffer); + ObjectInputStream ois = null; + try { + ois = new ObjectInputStream(bais); + T t = (T) ois.readObject(); + return t; + } catch (StreamCorruptedException e) { + e.printStackTrace(); + } catch (IOException e) { + e.printStackTrace(); + } catch (ClassNotFoundException e) { + e.printStackTrace(); + } finally { + try { + if (bais != null) { + bais.close(); + } + if (ois != null) { + ois.close(); + } + } catch (IOException e) { + e.printStackTrace(); + } + } + } + return null; + } + + /** + * 对于外部不可见的过渡方法 + * + * @param key + * @param clazz + * @param sp + * @return + */ + @SuppressWarnings("unchecked") + private T getValue(String key, Class clazz, SharedPreferences sp) { + T t; + try { + + t = clazz.newInstance(); + + if (t instanceof Integer) { + return (T) Integer.valueOf(sp.getInt(key, 0)); + } else if (t instanceof String) { + return (T) sp.getString(key, ""); + } else if (t instanceof Boolean) { + return (T) Boolean.valueOf(sp.getBoolean(key, false)); + } else if (t instanceof Long) { + return (T) Long.valueOf(sp.getLong(key, 0L)); + } else if (t instanceof Float) { + return (T) Float.valueOf(sp.getFloat(key, 0L)); + } + } catch (InstantiationException e) { + e.printStackTrace(); + Log.e("system", "类型输入错误或者复杂类型无法解析[" + e.getMessage() + "]"); + } catch (IllegalAccessException e) { + e.printStackTrace(); + Log.e("system", "类型输入错误或者复杂类型无法解析[" + e.getMessage() + "]"); + } + Log.e("system", "无法找到" + key + "对应的值"); + return null; + } +} diff --git a/app/src/main/java/com/example/administrator/seven/utils/StringUtils.java b/app/src/main/java/com/example/administrator/seven/utils/StringUtils.java new file mode 100644 index 0000000..679336b --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/utils/StringUtils.java @@ -0,0 +1,264 @@ +/* + * Copyright (C) 2016 android@19code.com + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.example.administrator.seven.utils; + +import android.app.Activity; +import android.content.ClipboardManager; +import android.content.Context; +import android.text.TextUtils; +import android.widget.TextView; + +import java.text.DecimalFormat; + +/** + * 字符串工具 + * Created by Gh0st on 2016/6/2 002. + */ +public class StringUtils { + /** + * The pyvalue. + */ + private static int[] pyvalue = new int[]{-20319, -20317, -20304, -20295, -20292, -20283, -20265, -20257, -20242, -20230, -20051, -20036, -20032, + -20026, -20002, -19990, -19986, -19982, -19976, -19805, -19784, -19775, -19774, -19763, -19756, -19751, -19746, -19741, -19739, -19728, + -19725, -19715, -19540, -19531, -19525, -19515, -19500, -19484, -19479, -19467, -19289, -19288, -19281, -19275, -19270, -19263, -19261, + -19249, -19243, -19242, -19238, -19235, -19227, -19224, -19218, -19212, -19038, -19023, -19018, -19006, -19003, -18996, -18977, -18961, + -18952, -18783, -18774, -18773, -18763, -18756, -18741, -18735, -18731, -18722, -18710, -18697, -18696, -18526, -18518, -18501, -18490, + -18478, -18463, -18448, -18447, -18446, -18239, -18237, -18231, -18220, -18211, -18201, -18184, -18183, -18181, -18012, -17997, -17988, + -17970, -17964, -17961, -17950, -17947, -17931, -17928, -17922, -17759, -17752, -17733, -17730, -17721, -17703, -17701, -17697, -17692, + -17683, -17676, -17496, -17487, -17482, -17468, -17454, -17433, -17427, -17417, -17202, -17185, -16983, -16970, -16942, -16915, -16733, + -16708, -16706, -16689, -16664, -16657, -16647, -16474, -16470, -16465, -16459, -16452, -16448, -16433, -16429, -16427, -16423, -16419, + -16412, -16407, -16403, -16401, -16393, -16220, -16216, -16212, -16205, -16202, -16187, -16180, -16171, -16169, -16158, -16155, -15959, + -15958, -15944, -15933, -15920, -15915, -15903, -15889, -15878, -15707, -15701, -15681, -15667, -15661, -15659, -15652, -15640, -15631, + -15625, -15454, -15448, -15436, -15435, -15419, -15416, -15408, -15394, -15385, -15377, -15375, -15369, -15363, -15362, -15183, -15180, + -15165, -15158, -15153, -15150, -15149, -15144, -15143, -15141, -15140, -15139, -15128, -15121, -15119, -15117, -15110, -15109, -14941, + -14937, -14933, -14930, -14929, -14928, -14926, -14922, -14921, -14914, -14908, -14902, -14894, -14889, -14882, -14873, -14871, -14857, + -14678, -14674, -14670, -14668, -14663, -14654, -14645, -14630, -14594, -14429, -14407, -14399, -14384, -14379, -14368, -14355, -14353, + -14345, -14170, -14159, -14151, -14149, -14145, -14140, -14137, -14135, -14125, -14123, -14122, -14112, -14109, -14099, -14097, -14094, + -14092, -14090, -14087, -14083, -13917, -13914, -13910, -13907, -13906, -13905, -13896, -13894, -13878, -13870, -13859, -13847, -13831, + -13658, -13611, -13601, -13406, -13404, -13400, -13398, -13395, -13391, -13387, -13383, -13367, -13359, -13356, -13343, -13340, -13329, + -13326, -13318, -13147, -13138, -13120, -13107, -13096, -13095, -13091, -13076, -13068, -13063, -13060, -12888, -12875, -12871, -12860, + -12858, -12852, -12849, -12838, -12831, -12829, -12812, -12802, -12607, -12597, -12594, -12585, -12556, -12359, -12346, -12320, -12300, + -12120, -12099, -12089, -12074, -12067, -12058, -12039, -11867, -11861, -11847, -11831, -11798, -11781, -11604, -11589, -11536, -11358, + -11340, -11339, -11324, -11303, -11097, -11077, -11067, -11055, -11052, -11045, -11041, -11038, -11024, -11020, -11019, -11018, -11014, + -10838, -10832, -10815, -10800, -10790, -10780, -10764, -10587, -10544, -10533, -10519, -10331, -10329, -10328, -10322, -10315, -10309, + -10307, -10296, -10281, -10274, -10270, -10262, -10260, -10256, -10254}; + + /** + * The pystr. + */ + public static String[] pystr = new String[]{"a", "ai", "an", "ang", "ao", "ba", "bai", "ban", "bang", "bao", "bei", "ben", "beng", "bi", "bian", + "biao", "bie", "bin", "bing", "bo", "bu", "ca", "cai", "can", "cang", "cao", "ce", "ceng", "cha", "chai", "chan", "chang", "chao", "che", + "chen", "cheng", "chi", "chong", "chou", "chu", "chuai", "chuan", "chuang", "chui", "chun", "chuo", "ci", "cong", "cou", "cu", "cuan", + "cui", "cun", "cuo", "da", "dai", "dan", "dang", "dao", "de", "deng", "di", "dian", "diao", "die", "ding", "diu", "dong", "dou", "du", + "duan", "dui", "dun", "duo", "e", "en", "er", "fa", "fan", "fang", "fei", "fen", "feng", "fo", "fou", "fu", "ga", "gai", "gan", "gang", + "gao", "ge", "gei", "gen", "geng", "gong", "gou", "gu", "gua", "guai", "guan", "guang", "gui", "gun", "guo", "ha", "hai", "han", "hang", + "hao", "he", "hei", "hen", "heng", "hong", "hou", "hu", "hua", "huai", "huan", "huang", "hui", "hun", "huo", "ji", "jia", "jian", + "jiang", "jiao", "jie", "jin", "jing", "jiong", "jiu", "ju", "juan", "jue", "jun", "ka", "kai", "kan", "kang", "kao", "ke", "ken", + "keng", "kong", "kou", "ku", "kua", "kuai", "kuan", "kuang", "kui", "kun", "kuo", "la", "lai", "lan", "lang", "lao", "le", "lei", "leng", + "li", "lia", "lian", "liang", "liao", "lie", "lin", "ling", "liu", "long", "lou", "lu", "lv", "luan", "lue", "lun", "luo", "ma", "mai", + "man", "mang", "mao", "me", "mei", "men", "meng", "mi", "mian", "miao", "mie", "min", "ming", "miu", "mo", "mou", "mu", "na", "nai", + "nan", "nang", "nao", "ne", "nei", "nen", "neng", "ni", "nian", "niang", "niao", "nie", "nin", "ning", "niu", "nong", "nu", "nv", "nuan", + "nue", "nuo", "o", "ou", "pa", "pai", "pan", "pang", "pao", "pei", "pen", "peng", "pi", "pian", "piao", "pie", "pin", "ping", "po", "pu", + "qi", "qia", "qian", "qiang", "qiao", "qie", "qin", "qing", "qiong", "qiu", "qu", "quan", "que", "qun", "ran", "rang", "rao", "re", + "ren", "reng", "ri", "rong", "rou", "ru", "ruan", "rui", "run", "ruo", "sa", "sai", "san", "sang", "sao", "se", "sen", "seng", "sha", + "shai", "shan", "shang", "shao", "she", "shen", "sheng", "shi", "shou", "shu", "shua", "shuai", "shuan", "shuang", "shui", "shun", + "shuo", "si", "song", "sou", "su", "suan", "sui", "sun", "suo", "ta", "tai", "tan", "tang", "tao", "te", "teng", "ti", "tian", "tiao", + "tie", "ting", "tong", "tou", "tu", "tuan", "tui", "tun", "tuo", "wa", "wai", "wan", "wang", "wei", "wen", "weng", "wo", "wu", "xi", + "xia", "xian", "xiang", "xiao", "xie", "xin", "xing", "xiong", "xiu", "xu", "xuan", "xue", "xun", "ya", "yan", "yang", "yao", "ye", "yi", + "yin", "ying", "yo", "yong", "you", "yu", "yuan", "yue", "yun", "za", "zai", "zan", "zang", "zao", "ze", "zei", "zen", "zeng", "zha", + "zhai", "zhan", "zhang", "zhao", "zhe", "zhen", "zheng", "zhi", "zhong", "zhou", "zhu", "zhua", "zhuai", "zhuan", "zhuang", "zhui", + "zhun", "zhuo", "zi", "zong", "zou", "zu", "zuan", "zui", "zun", "zuo"}; + + + public static int getChsAscii(String chs) { + int asc = 0; + try { + byte[] bytes = chs.getBytes("gb2312"); + /*if (bytes == null || bytes.length > 2 || bytes.length <= 0) { + throw new RuntimeException("illegal resource string"); + }*/ + if (bytes.length == 1) { + asc = bytes[0]; + } + if (bytes.length == 2) { + int hightByte = 256 + bytes[0]; + int lowByte = 256 + bytes[1]; + asc = (256 * hightByte + lowByte) - 256 * 256; + } + } catch (Exception e) { + System.out.println("ERROR:ChineseSpelling.class-getChsAscii(String chs)" + e); + } + return asc; + } + + public static String convert(String str) { + String result = null; + int ascii = getChsAscii(str); + if (ascii > 0 && ascii < 160) { + result = String.valueOf((char) ascii); + } else { + for (int i = (pyvalue.length - 1); i >= 0; i--) { + if (pyvalue[i] <= ascii) { + result = pystr[i]; + break; + } + } + } + return result; + } + + public String getSelling(String chs) { + String key, value; + StringBuilder buffer = new StringBuilder(); + for (int i = 0; i < chs.length(); i++) { + key = chs.substring(i, i + 1); + if (key.getBytes().length >= 2) { + value = convert(key); + if (value == null) { + value = "unknown"; + } + } else { + value = key; + } + buffer.append(value); + } + return buffer.toString(); + } + + public static String parseEmpty(String str) { + if (str == null || "null".equals(str.trim())) { + str = ""; + } + return str.trim(); + } + + public static boolean isEmpty(String str) { + return str == null || str.trim().length() == 0; + } + + public static int chineseLength(String str) { + int valueLength = 0; + String chinese = "[\u0391-\uFFE5]"; + if (!isEmpty(str)) { + for (int i = 0; i < str.length(); i++) { + String temp = str.substring(i, i + 1); + if (temp.matches(chinese)) { + valueLength += 2; + } + } + } + return valueLength; + } + + public static int strLength(String str) { + int valueLength = 0; + String chinese = "[\u0391-\uFFE5]"; + if (!isEmpty(str)) { + for (int i = 0; i < str.length(); i++) { + String temp = str.substring(i, i + 1); + if (temp.matches(chinese)) { + valueLength += 2; + } else { + valueLength += 1; + } + } + } + return valueLength; + } + + public static int subStringLength(String str, int maxL) { + int currentIndex = 0; + int valueLength = 0; + String chinese = "[\u0391-\uFFE5]"; + for (int i = 0; i < str.length(); i++) { + String temp = str.substring(i, i + 1); + if (temp.matches(chinese)) { + valueLength += 2; + } else { + valueLength += 1; + } + if (valueLength >= maxL) { + currentIndex = i; + break; + } + } + return currentIndex; + } + + public static Boolean isChinese(String str) { + Boolean isChinese = true; + String chinese = "[\u0391-\uFFE5]"; + if (!isEmpty(str)) { + for (int i = 0; i < str.length(); i++) { + String temp = str.substring(i, i + 1); + isChinese = temp.matches(chinese); + } + } + return isChinese; + } + + public static Boolean isContainChinese(String str) { + Boolean isChinese = false; + String chinese = "[\u0391-\uFFE5]"; + if (!isEmpty(str)) { + for (int i = 0; i < str.length(); i++) { + String temp = str.substring(i, i + 1); + isChinese = temp.matches(chinese); + } + } + return isChinese; + } + + public static String strFormat2(String str) { + try { + if (str.length() <= 1) { + str = "0" + str; + } + } catch (Exception e) { + e.printStackTrace(); + } + return str; + } + + public static int convert2Int(Object value, int defaultValue) { + if (value == null || "".equals(value.toString().trim())) { + return defaultValue; + } + try { + return Double.valueOf(value.toString()).intValue(); + } catch (Exception e) { + e.printStackTrace(); + return defaultValue; + } + } + + public static String decimalFormat(float s, String format) { + DecimalFormat decimalFormat = new DecimalFormat(format); + return decimalFormat.format(s); + } + + + public static void copy(TextView mTvWechat, Activity activity) { + String dataa = mTvWechat.getText().toString().substring(0); + if (!TextUtils.isEmpty(dataa)) { + ClipboardManager cm = (ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE); + // 将文本内容放到系统剪贴板里。 + cm.setText(dataa); + ToastUtils.showToast(activity, "复制成功"); + } + } +} diff --git a/app/src/main/java/com/example/administrator/seven/utils/ToolsText.java b/app/src/main/java/com/example/administrator/seven/utils/ToolsText.java new file mode 100644 index 0000000..326466c --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/utils/ToolsText.java @@ -0,0 +1,1338 @@ +package com.example.administrator.seven.utils; + +import android.annotation.SuppressLint; +import android.app.Activity; +import android.content.ContentResolver; +import android.content.Context; +import android.content.pm.PackageManager.NameNotFoundException; +import android.database.Cursor; +import android.graphics.Bitmap; +import android.graphics.Bitmap.Config; +import android.graphics.Canvas; +import android.graphics.Matrix; +import android.graphics.Paint; +import android.graphics.PorterDuff.Mode; +import android.graphics.PorterDuffXfermode; +import android.graphics.Rect; +import android.graphics.RectF; +import android.net.Uri; +import android.os.Environment; +import android.text.Editable; +import android.text.Html; +import android.text.Spanned; +import android.text.TextWatcher; +import android.text.format.DateFormat; +import android.util.Base64; +import android.util.DisplayMetrics; +import android.util.Log; +import android.view.View; +import android.view.WindowManager; +import android.view.animation.Animation; +import android.view.animation.AnimationSet; +import android.view.animation.ScaleAnimation; +import android.view.inputmethod.InputMethodManager; +import android.widget.EditText; +import android.widget.ImageView; +import android.widget.TextView; +import android.widget.Toast; + +import java.io.File; +import java.io.FileNotFoundException; +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.NumberFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Timer; +import java.util.TimerTask; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +/** + * @author TangWei 2013-10-24上午10:38:01 + */ +public class ToolsText { + + //将 s 进行 BASE64 编码 + public static String getBASE64(String s) { + String encodedString = Base64.encodeToString(s.getBytes(), Base64.DEFAULT); + Log.d("Base64", "Base64---->" + encodedString); + if (s == null) return null; + return encodedString; + } + + //将 BASE64 编码的字符串 s 进行解码 + public static String getFromBASE64(String s) { + String decodedString = null; + try { + decodedString = new String(Base64.decode(s,Base64.DEFAULT)); + if (s == null) return null; + Log.d("Base64", "Base64---->" + decodedString); + } catch (Exception e) { + e.printStackTrace(); + } + return decodedString; + } + + + + /** + * 取得日期是某年的第几周 + */ + @SuppressLint("SimpleDateFormat") + public static int getWeekOfYear(Date date) { + Calendar cal = Calendar.getInstance(); + cal.setTime(date); + int week_of_year = cal.get(Calendar.WEEK_OF_YEAR); + return week_of_year; + } + + /** + * 压缩图片 + * + * @param bm + * @param newWidth + * @param newHeight + * @return + */ + public static Bitmap scaleImg(Bitmap bm, int newWidth, int newHeight) { + // 获得图片的宽高 + int width = bm.getWidth(); + int height = bm.getHeight(); + // 设置想要的大小 + int newWidth1 = newWidth; + int newHeight1 = newHeight; + // 计算缩放比例 + float scaleWidth = ((float) newWidth1) / width; + float scaleHeight = ((float) newHeight1) / height; + // 取得想要缩放的matrix参数 + Matrix matrix = new Matrix(); + matrix.postScale(scaleWidth, scaleHeight); + matrix.postRotate(0); + + return Bitmap.createScaledBitmap(bm, newWidth, newHeight, false); + } + + public static void Log(String s) { + if (s == null) { + s = "传进来的是null"; + } + + Log.i("logs", s); + } + + public static String MapGetString(Map map, String key) { + if (map.containsKey(key)) { + if (map.get(key) != null && !"".equals(map.get(key))) { + return ((String) map.get(key)).trim(); + } else { + return ""; + } + } else { + return ""; + } + } + + public static String ListToString(@SuppressWarnings("rawtypes") List list) { + String s = Pattern + .compile("\\b([\\w\\W])\\b") + .matcher( + list.toString().substring(1, + list.toString().length() - 1)).replaceAll("$1") + .replaceAll(",", " "); + return s; + + } + + public static Spanned setErrorTextBlack(String s) { + return Html.fromHtml("" + s + ""); + + } + + public static void Toast(Context context, String s) { + // if (context == null) + // context = ShiQiangApplication.getInstance().getApplicationContext(); + if (s != null) { + Toast.makeText(context, s, + Toast.LENGTH_SHORT).show(); + } + } + + public static void Toast(Context context, int res) { + if (context != null) { + Toast(context, context.getString(res)); + } + } + + // 得到versionName + public static String getVerName(Context context) { + String verName = ""; + try { + verName = context.getPackageManager().getPackageInfo( + context.getPackageName(), 0).versionName; + } catch (NameNotFoundException e) { + e.printStackTrace(); + } + return verName; + + } + + public static String millisToString(long millis) { + boolean negative = millis < 0; + millis = Math.abs(millis); + + millis /= 1000; + int sec = (int) (millis % 60); + millis /= 60; + int min = (int) (millis % 60); + millis /= 60; + int hours = (int) millis; + + String time; + DecimalFormat format = (DecimalFormat) NumberFormat + .getInstance(Locale.US); + format.applyPattern("00"); + if (millis > 0) { + time = (negative ? "-" : "") + + (hours == 0 ? 00 : hours < 10 ? "0" + hours : hours) + + ":" + (min == 0 ? 00 : min < 10 ? "0" + min : min) + ":" + + (sec == 0 ? 00 : sec < 10 ? "0" + sec : sec); + } else { + time = (negative ? "-" : "") + min + ":" + format.format(sec); + } + return time; + } + + // 得到versionName + public static int getVerCode(Context context) { + int verCode = 0; + try { + verCode = context.getPackageManager().getPackageInfo( + context.getPackageName(), 0).versionCode; + } catch (NameNotFoundException e) { + e.printStackTrace(); + } + return verCode; + + } + + /** + * 判断 多个字段的值否为空 + * + * @return true为null或空; false不null或空 + * @author Michael.Zhang 2013-08-02 13:34:43 + */ + public static boolean isNull(String... ss) { + for (int i = 0; i < ss.length; i++) { + if (null == ss[i] || ss[i].equals("") + || ss[i].equalsIgnoreCase("null")) { + return true; + } + } + + return false; + } + + /** + * 判断 一个字段的值否为空 + * + * @param s + * @return + * @author Michael.Zhang 2013-9-7 下午4:39:00 + */ + public static boolean isNull(String s) { + return null == s || s.equals("") || s.equalsIgnoreCase("null"); + + } +/** + * 判断 一个字段的值否为空 + * + * @param s + * @return + * @author Michael.Zhang 2013-9-7 下午4:39:00 + */ + public static boolean isNull2(String s) { + return null == s || s.equals(""); + + } + + /** + * 判断 一个集合的值否为空 + * + * @return true为null或空; false不null或空 + * @author Michael.Zhang 2013-08-02 13:34:43 + */ + public static boolean isNull(List list) { + for (int i = 0; i < list.size(); i++) { + if (null == list.get(i) || isNull(list.get(i))) { + return true; + } + } + + return false; + } + + /** + * 判断 多个字段的值否为空 + * + * @return true为null或空; false不null或空 + * @author Michael.Zhang 2013-08-02 13:34:43 + */ + public static boolean isNull(TextView... vv) { + for (int i = 0; i < vv.length; i++) { + if (null == vv[i] || isNull(getText(vv[i]))) { + return true; + } + } + + return false; + } + + /** + * 判断 一个字段的值否为空 + * + * @param v + * @return + * @author Michael.Zhang 2013-9-7 下午4:39:00 + */ + public static boolean isNull(TextView v) { + return null == v || isNull(getText(v)); + + } + + /** + * 判断 一个字段的值否为空 + * + * @param v + * @return + * @author Michael.Zhang 2013-9-7 下午4:39:00 + */ + public static boolean isNull(EditText v) { + return null == v || isNull(getText(v)); + + } + + /** + * 判断两个字段是否一样 + * + * @author Michael.Zhang 2013-08-02 13:32:51 + */ + public static boolean judgeStringEquals(String s0, String s1) { + return s0 != null && s0.equals(s1); + } + + /** + * 将dp类型的尺寸转换成px类型的尺寸 + * + * @param size + * @param context + * @return + */ + public static int DPtoPX(int size, Context context) { + DisplayMetrics metrics = new DisplayMetrics(); + ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay().getMetrics(metrics); + return (int) ((float) size * metrics.density + 0.5); + } + + /** + * 屏幕宽高 + * + * @param context + * @return 0:width,1:height + * @author TangWei 2013-11-5上午10:27:54 + */ + public static int[] ScreenSize(Context context) { + DisplayMetrics metrics = new DisplayMetrics(); + ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay().getMetrics(metrics); + return new int[]{metrics.widthPixels, metrics.heightPixels}; + } + + /** + * double 整理 + * + * @return + */ + public static Double roundDouble(double val, int scale) { + if (scale < 0) { + throw new IllegalArgumentException( + "The scale must be a positive integer or zero"); + } + BigDecimal b = ((0 == val) ? new BigDecimal("0.0") : new BigDecimal( + Double.toString(val))); + BigDecimal one = new BigDecimal("1"); + return b.divide(one, scale, BigDecimal.ROUND_HALF_UP).doubleValue(); + } + + /** + * 判断 列表是否为空 + * + * @return true为null或空; false不null或空 + */ + @SuppressWarnings("rawtypes") + public static boolean isEmptyList(List list) { + return list == null || list.size() == 0; + } + + /** + * 判断 列表是否为空 + * + * @return true为null或空; false不null或空 + */ + @SuppressWarnings("rawtypes") + public static boolean isEmptyList(List... list) { + for (int i = 0; i < list.length; i++) { + if (isEmptyList(list[i])) { + return true; + } + } + + return false; + } + + /** + * 判断 列表是否为空 + * + * @return true为null或空; false不null或空 + */ + public static boolean isEmptyList(Object[] list) { + return list == null || list.length == 0; + } + + /** + * 判断 列表是否为空 + * + * @return true为null或空; false不null或空 + */ + public static boolean isEmptyList(Object[]... list) { + for (int i = 0; i < list.length; i++) { + if (isEmptyList(list[i])) { + return true; + } + } + + return false; + } + + /** + * 判断sd卡是否存在 + * + * @return + * @author Michael.Zhang 2013-07-04 11:30:54 + */ + public static boolean judgeSDCard() { + String status = Environment.getExternalStorageState(); + return status.equals(Environment.MEDIA_MOUNTED); + } + + /** + * 判断 http 链接 + * + * @param url + * @return + * @author Michael.Zhang + */ + public static boolean isUrl(String url) { + return url != null && url.startsWith("http://"); + } + + /** + * 获取保存到View的Tag中的字符串 + * + * @param v + * @return + */ + public static String getTagString(View v) { + try { + return v.getTag().toString(); + } catch (Exception e) { + return ""; + } + } + + /** + * 获取文本控件上显示的文字 + * + * @param tv + * @return + * @author TangWei 2013-9-29下午2:40:52 + */ + public static String getText(TextView tv) { + if (tv != null) + return tv.getText().toString().trim(); + return ""; + } + + /** + * 获取文本控件上显示的文字 + * + * @param tv + * @return + * @author TangWei 2013-9-29下午2:40:52 + */ + public static String getText(EditText tv) { + if (tv != null) + return tv.getText().toString().trim(); + return ""; + } + + /** + * 隐藏键盘 + * + * @author TangWei 2013-9-13下午7:51:32 + */ + public static void hideKeyboard(Activity activity) { + ((InputMethodManager) activity + .getSystemService(Context.INPUT_METHOD_SERVICE)) + .hideSoftInputFromWindow(activity.getCurrentFocus() + .getWindowToken(), InputMethodManager.HIDE_NOT_ALWAYS); + } + + // public static void playSound(int raw, Context context) { + // SoundPool sp; + // sp = new SoundPool(1000, AudioManager.STREAM_SYSTEM, 5); + // int task = sp.load(context, raw, 1); + // sp.play(task, 1, 1, 0, 0, 1); + // } + + /** + * 显示纯汉字的星期名称 + * + * @param i 星期:1,2,3,4,5,6,7 + * @return + * @author TangWei 2013-10-25上午11:31:51 + */ + public static String changeWeekToHanzi(int i) { + switch (i) { + case 1: + return "星期一"; + case 2: + return "星期二"; + case 3: + return "星期三"; + case 4: + return "星期四"; + case 5: + return "星期五"; + case 6: + return "星期六"; + case 7: + return "星期日"; + default: + return ""; + } + } + + /** + * 验证身份证号码 + * + * @param idCard + * @return + * @author TangWei + */ + public static boolean validateIdCard(String idCard) { + if (isNull(idCard)) + return false; + String pattern = "^[0-9]{17}[0-9|xX]{1}$"; + return idCard.matches(pattern); + } + + /** + * 验证推荐人编码 + * + * @param code + * @return + * @author TangWei + */ + public static boolean validateCode(String code) { + if (isNull(code)) + return false; + String pattern = "^\\d{6}$"; + return code.matches(pattern); + } /** + * 验证推荐人编码 + * + * @param lelephone + * @return 区号-号码 ------------------- + String regex1 = "\\(?(010|021|022|023|024|025|026|027|028|029|852)?\\)?-?\\d{8}";//3位区号,8位号码 + String regex2 = "\\(?(0[3-9][0-9]{2})?\\)?-?\\d{7,8}";//4位区号 + String regex3 = "(\\(?(010|021|022|023|024|025|026|027|028|029|852)?\\)?-?\\d{8})|(\\(?(0[3-9][0-9]{2})?\\)?-?\\d{7,8})"; + * @author TangWei + */ + public static boolean validateTelePhone(String lelephone) { + if (isNull(lelephone)) + return false; + String pattern = "^(\\d{11})$|^(\\d{3,5}[-]?\\d{6,8})$"; + return lelephone.matches(pattern); + } + + /** + * 验证手机号码 + * + * @param phone + * @return + * @author TangWei + */ + public static boolean validatePhone(String phone) { + if (isNull(phone)) + return false; + String pattern = "^1[3,4,5,6,7,8]+\\d{9}$"; + return phone.matches(pattern); + } + + /** + * 验证微信号 + * + * @param wx + * @return + * @author TangWei + */ + public static boolean validateWX(String wx) { + if (isNull(wx)) + return false; + String pattern = "^[a-zA-Z\\d_]+$"; + return wx.matches(pattern); + } + + /** + * 验证中文名 + * + * @param name + * @return + * @author TangWei + */ + public static boolean validateName(String name) { + if (isNull(name)) + return false; + String pattern = "[\\u4E00-\\u9FA5]{2,4}"; + return name.matches(pattern); + } + + public static boolean isContainsChinese(String str) { + if (isNull(str)) + return false; + String regEx = "[\u4e00-\u9fa5]"; + Pattern pat = Pattern.compile(regEx); + Matcher matcher = pat.matcher(str); + boolean flg = false; + if (matcher.find()) { + flg = true; + } + return flg; + } + + public static boolean validatePassWord(String password) { + if (isContainsChinese(password)) { + return false; + } else { + return password.trim().length() >= 6 && password.trim().length() <= 16; + } + + } + + /** + * 简单的验证一下银行卡号 + * + * @param bankCard 信用卡是16位,其他的是13-19位 + * @return + */ + public static boolean validateBankCard(String bankCard) { + if (isNull(bankCard)) + return false; + String pattern = "^\\d{13,19}$"; + return bankCard.matches(pattern); + } + + /** + * 验证邮箱 + * + * @param email + * @return + * @author TangWei 2013-12-13下午2:33:16 + */ + public static boolean validateEmail(String email) { + if (isNull(email)) + return false; + String pattern = "^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$"; + return email.matches(pattern); + } + + public static boolean isEmail(String email) { + String str = "^([a-zA-Z0-9_\\-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$"; + Pattern p = Pattern.compile(str); + Matcher m = p.matcher(email); + + return m.matches(); + } + + // public static boolean validateArtBeianAnName(String email) { +// String str = "/\\s+|^c:\\\\con\\\\con|[%,\\*\\\"\\s\\<\\>\\&]|\\xA1\\xA1|\\xAC\\xA3|^Guest|^\\xD3\\xCE\\xBF\\xCD|\\xB9\\x43\\xAB\\xC8/is"; +// Pattern p = Pattern.compile(str); +// Matcher m = p.matcher(email); +// +// return m.matches(); +// } + public static boolean validateArtBeianAnEmail(String email) { + String str = "/^([a-z0-9\\-_.+]+)@([a-z0-9\\-]+[.][a-z0-9\\-.]+)$/"; + Pattern p = Pattern.compile(str); + Matcher m = p.matcher(email); + + return m.matches(); + } + + public static String trimString(String str) { + if (!isNull(str)) { + return str.trim(); + } + return ""; + } + + public static int StringToInt(String str) { + try { + return Integer.parseInt(str); + } catch (Exception e) { + return 0; + } + } + + public static float StringToFloat(String str) { + try { + return Float.parseFloat(str); + } catch (Exception e) { + return 0.00f; + } + } + + public static String formatString(Object obj) { + try { + if (!isNull(obj.toString())) { + return obj.toString(); + } else { + return ""; + } + } catch (Exception e) { + return ""; + } + } + + /** + * 格式化money,当返回数据为空时,返回0.00 + * + * @param obj + * @return + * @author TangWei 2013-11-23上午11:42:33 + */ + public static String formatMoney(Object obj) { + String money = formatString(obj); + if (money.length() == 0) { + money = "0.00"; + } + return money; + } + + /** + * 计算某天后的多少天 + * + * @param startDay + * @param days + * @return + */ + public static Date calculateDate(Date startDay, int days) { + Calendar cal = Calendar.getInstance(); + cal.setTime(startDay); + cal.add(Calendar.DAY_OF_YEAR, days); + return cal.getTime(); + } + + /** + * 格式化日期,针对于传过来的日期是毫秒数 + * + * @param date 日期毫秒数 + * @param format 格式化样式 示例:yyyy-MM-dd HH:mm:ss + * @return + * @author TangWei 2013-11-29上午11:31:49 + */ + @SuppressLint("SimpleDateFormat") + public static String formatDate(Object date, String format) { + try { + return new SimpleDateFormat(format).format(new Date(Long + .parseLong(formatString(date)) * 1000)); + } catch (Exception e) { + return ""; + } + } + + /** + * 格式化日期,针对于传过来的日期是毫秒数
+ * 转换样式:2013-11-12 11:12:13 + * + * @param date 日期毫秒数 + * @return + * @author TangWei 2013-11-22上午11:38:13 + */ + public static String formatTime(Object date) { + return formatDate(date, "yyyy-MM-dd HH:mm:ss"); + } + + /** + * 格式化日期,针对于传过来的日期是毫秒数
+ * 转换样式:2013-11-12 11:12:13 + * + * @param date 日期毫秒数 + * @return + * @author TangWei 2013-11-22上午11:38:13 + */ + @SuppressLint("SimpleDateFormat") + public static String formatAddTime(String date) { + SimpleDateFormat sdf = new SimpleDateFormat("MM-dd HH:mm"); + + try { + return sdf.format((sdf.parse(date))); + } catch (ParseException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return date; + } + + /** + * 格式化日期,针对于传过来的日期是毫秒数
+ * 转换样式:2013-11-12 + * + * @param date 日期毫秒数 + * @return + * @author TangWei 2013-11-22上午11:38:13 + */ + public static String formatDate(Object date) { + return formatDate(date, "yyyy-MM-dd"); + } + + public static String getFormatedYear(long longTime) { + return DateFormat.format("yy-MM-dd HH:mm", longTime * 1000).toString(); + } + public static String getFormatedNotYear(long longTime) { + return DateFormat.format("MM-dd", longTime * 1000).toString(); + } + + public static String getFormatedDate(long longTime) { + return DateFormat.format("MM月dd日", longTime * 1000).toString(); + } + + public static String getOrderDate(long longTime) { + return DateFormat.format("yyyyMMddHHmmss", longTime).toString(); + } + + public static String getFormatedTime(long longTime) { + return DateFormat.format("kk:mm", longTime * 1000).toString(); + } + + public static String getFormatedMiao(long longTime) { + return DateFormat.format("kk:mm:ss", longTime * 1000).toString(); + } + + /** + * 获取屏幕像素尺寸 + * + * @return 数组:0-宽,1-高 + * @author TangWei 2013-10-31下午1:08:22 + */ + public static int[] getScreenSize(Context context) { + int[] size = new int[2]; + DisplayMetrics metrics = new DisplayMetrics(); + ((WindowManager) context.getSystemService(Context.WINDOW_SERVICE)) + .getDefaultDisplay().getMetrics(metrics); + size[0] = metrics.widthPixels; + size[1] = metrics.heightPixels; + return size; + } + + public static String formatMoney(String money) { + if (money.contains(".")) { + String[] ss = money.split("\\."); + if (ss[1].length() == 0) { + return ss[0] + ".00"; + } else if (ss[1].length() == 1) { + return ss[0] +"."+ ss[1] + "0"; + } else if (ss[1].length() == 2) { + return money; + } else { + return money; + } + } else { + return money + ".00"; + + } + } + + /** + * 设置圆角的图片 + * + * @param bitmap 图片 + * @param pixels 角度 + * @return + * @author TangWei 2013-12-10下午4:43:33 + */ + public static Bitmap toRoundCorner(Bitmap bitmap, int pixels) { + try { + if (bitmap != null) { + Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), + bitmap.getHeight(), Config.ARGB_8888); + Canvas canvas = new Canvas(output); + + final int color = 0xff424242; + final Paint paint = new Paint(); + final Rect rect = new Rect(0, 0, bitmap.getWidth(), + bitmap.getHeight()); + final RectF rectF = new RectF(rect); + final float roundPx = pixels; + + paint.setAntiAlias(true); + canvas.drawARGB(0, 0, 0, 0); + paint.setColor(color); + canvas.drawRoundRect(rectF, roundPx, roundPx, paint); + + paint.setXfermode(new PorterDuffXfermode(Mode.SRC_IN)); + canvas.drawBitmap(bitmap, rect, rect, paint); + + return output; + } + } catch (Exception e) { + } + + return bitmap; + } + + /** + * 将图片转换为圆形的 + * + * @param bitmap + * @return + * @author TangWei 2013-12-10下午4:45:47 + */ + public static Bitmap toRoundBitmap(Bitmap bitmap) { + if (bitmap != null) { + bitmap = cutSquareBitmap(bitmap); + return toRoundCorner(bitmap, bitmap.getWidth() / 2); + } + return bitmap; + } + + /** + * 把图片切成正方形的 + * + * @param bitmap + * @return + * @author TangWei 2013-12-10下午5:16:18 + */ + public static Bitmap cutSquareBitmap(Bitmap bitmap) { + try { + if (bitmap != null) { + Bitmap result; + int w = bitmap.getWidth();// 输入长方形宽 + int h = bitmap.getHeight();// 输入长方形高 + int nw;// 输出正方形宽 + if (w > h) { + // 宽大于高 + nw = h; + result = Bitmap.createBitmap(bitmap, (w - nw) / 2, 0, nw, + nw); + } else { + // 高大于宽 + nw = w; + result = Bitmap.createBitmap(bitmap, 0, (h - nw) / 2, nw, + nw); + } + return result; + } + } catch (Exception e) { + } + return bitmap; + } + + /** + * 获取在GridView中一行中一张正方形图片的尺寸大小 + * + * @param context 上下文,用于计算屏幕的宽度 + * @param offset 界面上左右两边的偏移量,dp值 + * @param spac 水平方向,图片之间的间距,dp值 + * @param count 一行中图片的个数 + * @return + * @author TangWei 2013-12-12下午1:15:49 + */ + public static int getImageSize(Context context, int offset, int spac, + int count) { + int width = getScreenSize(context)[0] - DPtoPX(offset, context) + - (DPtoPX(spac, context) * (count - 1)); + return width / count; + } + + /** + * 获取一个圆弧上等分点的坐标列表 + * + * @param radius 半径 + * @param count 等分点个数 + * @param start_angle 开始角度 + * @param end_angle 结束角度 + * @return + * @author TangWei 2013-12-16下午5:06:31 + */ + public static ArrayList getDividePoints(double radius, int count, + double start_angle, double end_angle) { + ArrayList list = new ArrayList(); + double sub_angle = (start_angle - end_angle) / ((double) (count - 1)); + for (int i = 0; i < count; i++) { + double angle = (start_angle - sub_angle * i) * Math.PI / 180; + double x = radius * Math.cos(angle); + double y = radius * Math.sin(angle); + list.add(new String[]{x + "", y + ""}); + } + return list; + } + + /** + * 判断字符串是邮箱还是手机号码 + * + * @param str + * @return 1-手机号码,2-邮箱,如果都不是则返回0 + * @author TangWei 2013-12-19下午1:59:16 + */ + public static int validatePhoneOrEmail(String str) { + if (validatePhone(str)) + return 1; + if (validateEmail(str)) + return 2; + return 0; + } + + /** + * 播放动画 + * @param layout + * @param img + * @param drawableBefore + * @param drawableClick + * @param isClicked + */ + public static void startAnimation(final View layout, ImageView img, + int drawableBefore, int drawableClick, boolean isClicked) { + if (isClicked) { + img.setBackgroundResource(drawableClick); + } else { + img.setBackgroundResource(drawableBefore); + } + + // 播放动画 + AnimationSet animationSet = new AnimationSet(true); + ScaleAnimation scaleAnimation1 = new ScaleAnimation(1, 1.2f, 1, 1.2f, + Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, + 0.5f); + ScaleAnimation scaleAnimation2 = new ScaleAnimation(1.2f, 1, 1.2f, 1, + Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, + 0.5f); + scaleAnimation1.setStartOffset(0); + scaleAnimation1.setDuration(50); + scaleAnimation2.setStartOffset(50); + scaleAnimation2.setDuration(50); + animationSet.addAnimation(scaleAnimation1); + animationSet.addAnimation(scaleAnimation2); + animationSet.setFillAfter(true); + img.startAnimation(animationSet); + animationSet.setAnimationListener(new Animation.AnimationListener() { + @Override + public void onAnimationStart(Animation animation) { + layout.setEnabled(false); + } + + @Override + public void onAnimationEnd(Animation animation) { + layout.setEnabled(true); + } + + @Override + public void onAnimationRepeat(Animation animation) { + } + }); + } + +// /** +// * bitmap转为base64 +// * +// * @param bitmap +// * @return +// */ +// public static String bitmapToBase64(Bitmap bitmap) { +// +// String result = null; +// ByteArrayOutputStream baos = null; +// try { +// if (bitmap != null) { +// baos = new ByteArrayOutputStream(); +// bitmap.compress(Bitmap.CompressFormat.JPEG, 100, baos); +// +// baos.flush(); +// baos.close(); +// +// byte[] bitmapBytes = baos.toByteArray(); +// result = Base64.encode(bitmapBytes); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } finally { +// try { +// if (baos != null) { +// baos.flush(); +// baos.close(); +// } +// } catch (IOException e) { +// e.printStackTrace(); +// } +// } +// return result; +// } + + /** + * SD卡是否存在 + */ + public static boolean existSDCard() { + return Environment.getExternalStorageState().equals( + Environment.MEDIA_MOUNTED); + } + + /** + * 创建文件夹 + */ + public static void makeDir(String path) { + File rootFile = new File(path); + if (!rootFile.exists()) { + rootFile.mkdir(); + } + } + + /** + * 根据Uri返回文件路径 + * + * @param mUri + * @return String + * @author gdpancheng@gmail.com 2013-3-18 上午10:17:55 + */ + public static String getFilePath(ContentResolver mContentResolver, Uri mUri) { + try { + if (mUri.getScheme().equals("file")) { + return mUri.getPath(); + } else { + return getFilePathByUri(mContentResolver, mUri); + } + } catch (FileNotFoundException ex) { + return null; + } + } + + /** + * 将100以内的阿拉伯数字转换成中文汉字(15变成十五) + * + * @param round 最大值50 + * @return 大于99的,返回“” + */ + public static String getHanZi1(int round) { + if (round > 99 || round == 0) { + return ""; + } + int ge = round % 10; + int shi = (round - ge) / 10; + String value = ""; + if (shi != 0) { + if (shi == 1) { + value = "十"; + } else { + value = getHanZi2(shi) + "十"; + } + + } + value = value + getHanZi2(ge); + return value; + } + + /** + * 将0-9 转换为 汉字( _一二三四五六七八九) + * + * @param round + * @return + */ + public static String getHanZi2(int round) { + String[] value = {"", "一", "二", "三", "四", "五", "六", "七", "八", "九"}; + return value[round]; + } + + /** + * 将content: 开通的系统uri转换成绝对路径 + * + * @param mContentResolver + * @param mUri + * @return + * @throws FileNotFoundException + */ + public static String getFilePathByUri(ContentResolver mContentResolver, + Uri mUri) throws FileNotFoundException { + + String imgPath; + Cursor cursor = mContentResolver.query(mUri, null, null, null, null); + cursor.moveToFirst(); + imgPath = cursor.getString(1); // 图片文件路径 + return imgPath; + } + + /** + * 去除字符串中的 ":" + * + * @param str + * @return + */ + public static String deleteColon(String str) { + if (str == null) { + return null; + } else { + return str.replace(":", ""); + } + } + + /** + * 将 1800 加个":",变成 18:00 + * + * @param str + * @return + */ + public static String addColon(String str) { + if (str == null || str.length() != 4) { + return null; + } + return str.substring(0, 2) + ":" + str.substring(2, 4); + } + + /** + * 获取map中的值 + * @param map map + * @param key map的key + * @return map的值 + */ + public static String getValue(Map map, String key) { + if (map == null || map.size() == 0) { + return ""; + } else if (isNull(key)) { + return ""; + } else if (map.containsKey(key)) { + Object data = map.get(key); + if (data instanceof String) { + if (isNull2((String) map.get(key))) { + return ""; + } else { + return map.get(key).toString(); + } + } else { + return String.valueOf(map.get(key)); + } + + } else { + return ""; + } + } + + static Toast toast; + + public static void show(Context context, CharSequence message, int duration) { + if (null == toast) { + toast = Toast.makeText(context, message, duration); + // toast.setGravity(Gravity.CENTER, 0, 0); + } else { + toast.setText(message); + } + toast.show(); + } + //强制显示或者关闭系统键盘 + public static void KeyBoard(final EditText txtSearchKey, final String status) + { + + Timer timer = new Timer(); + timer.schedule(new TimerTask(){ + @Override + public void run() + { + InputMethodManager m = (InputMethodManager) + txtSearchKey.getContext().getSystemService(Context.INPUT_METHOD_SERVICE); + if(status.equals("open")) + { + m.showSoftInput(txtSearchKey, InputMethodManager.SHOW_FORCED); + } + else + { + m.hideSoftInputFromWindow(txtSearchKey.getWindowToken(), 0); + } + } + }, 300); + } + //显示虚拟键盘 + public static void showKeyboard(View v) + { + InputMethodManager imm = (InputMethodManager) v.getContext( ).getSystemService( Context.INPUT_METHOD_SERVICE ); + + imm.showSoftInput(v, InputMethodManager.SHOW_FORCED); + + } + /** + * 验证用户只能输入小数点后后两位并且第一位输入.的时候前面自动补0; + * + * @param editText + */ + public void setPricePoint(final EditText editText, final int pointCount) {// + editText.addTextChangedListener(new TextWatcher() { + + @Override + public void onTextChanged(CharSequence s, int start, int before, + int count) { + + } + + @Override + public void beforeTextChanged(CharSequence s, int start, int count, + int after) { + + } + + @Override + public void afterTextChanged(Editable editable) { + String s=editText.getText().toString(); + // TODO Auto-generated method stub + if (s.contains(".")) { + if (s.length() - 1 - s.toString().indexOf(".") > pointCount) { + s = s.substring(0, + s.indexOf(".") + pointCount+1); + editText.setText(s); + editText.setSelection(s.length()); + } + } + if (s.toString().trim().substring(0).equals(".")) { + s = "0" + s; + editText.setText(s); + editText.setSelection(2); + } + + if (s.toString().startsWith("0") + && s.toString().trim().length() > 1) { + if (!s.toString().substring(1, 2).equals(".")) { + editText.setText(s.subSequence(0, 1)); + editText.setSelection(1); + return; + } + } + } + + }); + + } + +} diff --git a/app/src/main/java/com/example/administrator/seven/widget/ListViewForScrollView.java b/app/src/main/java/com/example/administrator/seven/widget/ListViewForScrollView.java new file mode 100644 index 0000000..93ffad5 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/widget/ListViewForScrollView.java @@ -0,0 +1,27 @@ +package com.example.administrator.seven.widget; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.ListView; + +public class ListViewForScrollView extends ListView { + public ListViewForScrollView(Context context) { + super(context); + } + public ListViewForScrollView(Context context, AttributeSet attrs) { + super(context, attrs); + } + public ListViewForScrollView(Context context, AttributeSet attrs, + int defStyle) { + super(context, attrs, defStyle); + } + @Override + /** + * 重写该方法,达到使ListView适应ScrollView的效果 + */ + protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) { + int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, + MeasureSpec.AT_MOST); + super.onMeasure(widthMeasureSpec, expandSpec); + } +} diff --git a/app/src/main/java/com/example/administrator/seven/widget/TagView.java b/app/src/main/java/com/example/administrator/seven/widget/TagView.java new file mode 100644 index 0000000..4690a14 --- /dev/null +++ b/app/src/main/java/com/example/administrator/seven/widget/TagView.java @@ -0,0 +1,52 @@ +package com.example.administrator.seven.widget; + +import android.content.Context; +import android.util.AttributeSet; +import android.widget.ToggleButton; + +import com.example.administrator.seven.R; + +/** + * 标签 + * @author lin04 + * + */ +public class TagView extends ToggleButton { + private boolean mCheckEnable = true; + + public TagView(Context paramContext) { + super (paramContext); + init(); + } + + public TagView(Context paramContext, AttributeSet paramAttributeSet) { + super (paramContext, paramAttributeSet); + init(); + } + + public TagView(Context paramContext, AttributeSet paramAttributeSet, + int paramInt) { + super (paramContext, paramAttributeSet, 0); + init(); + } + + private void init() { + setTextOn( null ); + setTextOff( null ); + setText( "" ); + setBackgroundResource(R.drawable.ic_launcher); + } + + public void setCheckEnable( boolean paramBoolean) { + this .mCheckEnable = paramBoolean; + if (!this .mCheckEnable ) { + super .setChecked( false); + } + } + + public void setChecked( boolean paramBoolean) { + if (this .mCheckEnable ) { + super .setChecked(paramBoolean); + } + } +} diff --git a/app/src/main/res/drawable/ic_line_gray.png b/app/src/main/res/drawable/ic_line_gray.png new file mode 100644 index 0000000..d8d894c Binary files /dev/null and b/app/src/main/res/drawable/ic_line_gray.png differ diff --git a/app/src/main/res/drawable/ic_search_empty.png b/app/src/main/res/drawable/ic_search_empty.png new file mode 100644 index 0000000..e24efc0 Binary files /dev/null and b/app/src/main/res/drawable/ic_search_empty.png differ diff --git a/app/src/main/res/drawable/ic_search_orange.png b/app/src/main/res/drawable/ic_search_orange.png new file mode 100644 index 0000000..bfc6703 Binary files /dev/null and b/app/src/main/res/drawable/ic_search_orange.png differ diff --git a/app/src/main/res/drawable/shape_clear_history.xml b/app/src/main/res/drawable/shape_clear_history.xml new file mode 100644 index 0000000..9c278af --- /dev/null +++ b/app/src/main/res/drawable/shape_clear_history.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_sousuo.xml b/app/src/main/res/drawable/shape_sousuo.xml new file mode 100644 index 0000000..12d9626 --- /dev/null +++ b/app/src/main/res/drawable/shape_sousuo.xml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/window_po_bg.xml b/app/src/main/res/drawable/window_po_bg.xml new file mode 100644 index 0000000..acd5234 --- /dev/null +++ b/app/src/main/res/drawable/window_po_bg.xml @@ -0,0 +1,12 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/ac_search.xml b/app/src/main/res/layout/ac_search.xml new file mode 100644 index 0000000..91d3865 --- /dev/null +++ b/app/src/main/res/layout/ac_search.xml @@ -0,0 +1,164 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/it_search.xml b/app/src/main/res/layout/it_search.xml new file mode 100644 index 0000000..e8c7343 --- /dev/null +++ b/app/src/main/res/layout/it_search.xml @@ -0,0 +1,22 @@ + + + + + + + diff --git a/app/src/main/res/layout/activity_design_two.xml b/app/src/main/res/layout/item_design_two.xml similarity index 69% rename from app/src/main/res/layout/activity_design_two.xml rename to app/src/main/res/layout/item_design_two.xml index 026ea3b..3df8271 100644 --- a/app/src/main/res/layout/activity_design_two.xml +++ b/app/src/main/res/layout/item_design_two.xml @@ -9,8 +9,7 @@ + android:text="分配行业" + android:textColor="#ff333333" + android:textSize="@dimen/design_size"/> + + android:textColor="#ffd1d1d1" + android:textSize="@dimen/design_size" /> @@ -55,7 +54,7 @@ android:layout_alignParentRight="true" android:layout_centerVertical="true" android:layout_marginRight="10dp" - android:src="@drawable/marking_zhaikai" /> + android:src="@mipmap/icon_down" /> @@ -65,8 +64,9 @@ + android:layout_height="52dp" + android:gravity="center" + > + android:text="分配城市" + android:textColor="#ff333333" + android:textSize="@dimen/design_size" /> + + android:textSize="@dimen/design_size" /> + + + diff --git a/app/src/main/res/layout/view_tag.xml b/app/src/main/res/layout/view_tag.xml new file mode 100644 index 0000000..07c4f98 --- /dev/null +++ b/app/src/main/res/layout/view_tag.xml @@ -0,0 +1,8 @@ + + diff --git a/app/src/main/res/mipmap-hdpi/icon_clear.png b/app/src/main/res/mipmap-hdpi/icon_clear.png new file mode 100644 index 0000000..0f456b6 Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/icon_clear.png differ diff --git a/app/src/main/res/mipmap-hdpi/icon_delete.png b/app/src/main/res/mipmap-hdpi/icon_delete.png new file mode 100644 index 0000000..22988cc Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/icon_delete.png differ diff --git a/app/src/main/res/mipmap-hdpi/icon_down.png b/app/src/main/res/mipmap-hdpi/icon_down.png new file mode 100644 index 0000000..4e3aaed Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/icon_down.png differ diff --git a/app/src/main/res/mipmap-hdpi/icon_historytime.png b/app/src/main/res/mipmap-hdpi/icon_historytime.png new file mode 100644 index 0000000..62b282f Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/icon_historytime.png differ diff --git a/app/src/main/res/mipmap-mdpi/icon_clear.png b/app/src/main/res/mipmap-mdpi/icon_clear.png new file mode 100644 index 0000000..4e530dc Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_clear.png differ diff --git a/app/src/main/res/mipmap-mdpi/icon_delete.png b/app/src/main/res/mipmap-mdpi/icon_delete.png new file mode 100644 index 0000000..33b517a Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_delete.png differ diff --git a/app/src/main/res/mipmap-mdpi/icon_down.png b/app/src/main/res/mipmap-mdpi/icon_down.png new file mode 100644 index 0000000..446ea61 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_down.png differ diff --git a/app/src/main/res/mipmap-mdpi/icon_historytime.png b/app/src/main/res/mipmap-mdpi/icon_historytime.png new file mode 100644 index 0000000..5b62004 Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/icon_historytime.png differ diff --git a/app/src/main/res/mipmap-xhdpi/icon_clear.png b/app/src/main/res/mipmap-xhdpi/icon_clear.png new file mode 100644 index 0000000..56caed4 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/icon_clear.png differ diff --git a/app/src/main/res/mipmap-xhdpi/icon_delete.png b/app/src/main/res/mipmap-xhdpi/icon_delete.png new file mode 100644 index 0000000..58a8824 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/icon_delete.png differ diff --git a/app/src/main/res/mipmap-xhdpi/icon_down.png b/app/src/main/res/mipmap-xhdpi/icon_down.png new file mode 100644 index 0000000..7f16dc5 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/icon_down.png differ diff --git a/app/src/main/res/mipmap-xhdpi/icon_historytime.png b/app/src/main/res/mipmap-xhdpi/icon_historytime.png new file mode 100644 index 0000000..eaab333 Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/icon_historytime.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/icon_clear.png b/app/src/main/res/mipmap-xxhdpi/icon_clear.png new file mode 100644 index 0000000..d805150 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/icon_clear.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/icon_delete.png b/app/src/main/res/mipmap-xxhdpi/icon_delete.png new file mode 100644 index 0000000..6f856bc Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/icon_delete.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/icon_down.png b/app/src/main/res/mipmap-xxhdpi/icon_down.png new file mode 100644 index 0000000..b4bfbbe Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/icon_down.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/icon_historytime.png b/app/src/main/res/mipmap-xxhdpi/icon_historytime.png new file mode 100644 index 0000000..90884e1 Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/icon_historytime.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/icon_clear.png b/app/src/main/res/mipmap-xxxhdpi/icon_clear.png new file mode 100644 index 0000000..001179b Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/icon_clear.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/icon_delete.png b/app/src/main/res/mipmap-xxxhdpi/icon_delete.png new file mode 100644 index 0000000..83e2f9f Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/icon_delete.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/icon_down.png b/app/src/main/res/mipmap-xxxhdpi/icon_down.png new file mode 100644 index 0000000..3d75b1d Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/icon_down.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/icon_historytime.png b/app/src/main/res/mipmap-xxxhdpi/icon_historytime.png new file mode 100644 index 0000000..b873ae6 Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/icon_historytime.png differ diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 31d63a1..9dfb05c 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -43,5 +43,7 @@ 12sp 13sp 15sp + 14sp + 10dp diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 905b73b..09afb3c 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -27,7 +27,7 @@ 地图 配送 我的 - + 搜索帖子名称 仓储功能 diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 998abc9..a748e81 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -44,8 +44,16 @@ - + + +