10 Commits
Author SHA1 Message Date
lijia db021d9353 1.1.6 2022-05-05 08:44:29 +08:00
lijia cb179b6b4b 1.1.5 2022-04-06 17:39:22 +08:00
lijia f63c1f931e 1.1.4 2022-04-04 13:19:46 +08:00
lijia c208e99376 1.1.3 2022-04-04 12:47:34 +08:00
lijia 51c9f0e187 1.1.2 2022-04-04 12:17:21 +08:00
lijia 8d549ed082 1.1.1 2022-04-03 18:31:32 +08:00
lijia 2c12943daf 1.1.0 2022-04-03 18:17:37 +08:00
lijia e1cdff0d5b 1.0.9 2022-04-03 14:55:15 +08:00
lijia d5120120c9 1.0.7text 2022-03-25 10:07:52 +08:00
lijia d8e382f06a 1.0.6 2022-03-11 09:48:46 +08:00
96 changed files with 8574 additions and 949 deletions
+1
View File
@@ -11,6 +11,7 @@
<set>
<option value="$PROJECT_DIR$" />
<option value="$PROJECT_DIR$/app" />
<option value="$PROJECT_DIR$/keybordlib" />
<option value="$PROJECT_DIR$/mylibrary" />
</set>
</option>
+3 -2
View File
@@ -55,7 +55,7 @@ android {
applicationId rootProject.ext.android.applicationId
manifestPlaceholders = [CHANNEL_VALUE: "企业端(测试)"]
buildConfigField "String", "BASE_URL", "\"http://pass.dahehuoyun.com:8091/\""
buildConfigField "String", "BASE_URL", "\"http://192.168.1.129:8091/\""
buildConfigField "String", "BASE_HEAD_URL", "\"http://47.104.167.116:8080/guns/gunsApi/kaptcha/\""
buildConfigField "boolean", "isTest", "true"
//APP名称,可以在androidMainfest中引用
@@ -64,7 +64,7 @@ android {
sign_product {
applicationId rootProject.ext.android.applicationId
manifestPlaceholders = [CHANNEL_VALUE: "企业端"]
buildConfigField "String", "BASE_URL", "\"http://pass.dahehuoyun.com:8091/\""
buildConfigField "String", "BASE_URL", "\"http://pass.test.dahehuoyun.com:8091/\""
buildConfigField "String", "BASE_HEAD_URL", "\"http://47.104.167.116:8080/guns/gunsApi/kaptcha/\""
buildConfigField "boolean", "isTest", "false"
// resValue "string", "appName", "审核"
@@ -114,4 +114,5 @@ dependencies {
implementation project(path: ':mylibrary')
implementation project(path: ':keybordlib')
}
@@ -10,9 +10,9 @@
{
"type": "SINGLE",
"filters": [],
"versionCode": 4,
"versionName": "1.0.4",
"outputFile": "企业端正式_release_1.0.4_202201240930.apk"
"versionCode": 12,
"versionName": "1.1.2",
"outputFile": "企业端正式_release_1.1.2_202204251458.apk"
}
]
}
+5
View File
@@ -2367,6 +2367,11 @@
"area": [
"中原区",
"金水区",
"高新区",
"航空港区",
"国际物流园区",
"经开区",
"郑东新区",
"二七区",
"管城回族区",
"上街区",
@@ -25,6 +25,7 @@ class GoneAdapter(layoutResId: Int) : BaseQuickAdapter<PassBean, BaseViewHolder>
.setText(R.id.tvStartSj,item.startTime)
.setText(R.id.tvEndTime,item.endTime)
.setText(R.id.tvBz,item.remarks)
.setText(R.id.tvSfzh,item.driverIdcard)
.setText(R.id.tvType,"""(${item.chargeType})""")
.setTextColorRes(R.id.tvType,if (item.chargeType.contains("收费")) R.color.color_down_time else R.color.color_green)
}
@@ -30,6 +30,8 @@ public class App extends Application {
@Override
public void onCreate() {
super.onCreate();
System.out.println("测试分支合并");
System.out.println("测试分支合并1.0.6");
mApplication = this;
CommonBaseLibrary.getInstance().init(this, Api.BASE_URL);
// if (BuildConfig.DEBUG){
@@ -11,5 +11,8 @@ public class AppConfig {
public static final String BEAN= "DA_HE_BEAN";
public static String START_TIME= "DA_HE_START_TIME";
public static String END_TIME= "DA_HE_END_TIME";
public static String PHONE= "DA_HE_PHONE";
public static String PWD= "DA_HE_PWD";
public static String REISTER= "DA_HE_REISTER";
public static final String CODE= "DA_HE_PHONE";
}
@@ -14,6 +14,8 @@ public class BusInfoBean implements Serializable {
private String code;
private String enterpriseName;
private String pwd;
private String approvedBy;
private String unifiedSocialCreditCode;//统一社会信用代码
private String nationalClassA;//国家A级
private String businessType;//业务类型
private String avatarUrl;
@@ -25,6 +27,22 @@ public class BusInfoBean implements Serializable {
private String name;//厂区地址
private ParamsDao params;
public String getApprovedBy() {
return approvedBy;
}
public void setApprovedBy(String approvedBy) {
this.approvedBy = approvedBy;
}
public String getUnifiedSocialCreditCode() {
return unifiedSocialCreditCode;
}
public void setUnifiedSocialCreditCode(String unifiedSocialCreditCode) {
this.unifiedSocialCreditCode = unifiedSocialCreditCode;
}
public String getName() {
return name;
}
@@ -0,0 +1,100 @@
package com.dahe.pass.bean;
import com.contrarywind.interfaces.IPickerViewData;
import java.util.jar.Attributes;
/**
* @ClassName ComFirstBean
* @Author 用户
* @Date 2022/4/12 10:25
* @Description TODO
*/
public class ComFirstBean implements IPickerViewData {
private String searchValue;
private String createTime;
private String deptName;
private String phone;
private String parentId;
private String deptId;
private String signName;
private String sign;
private String startWith;
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getDeptName() {
return deptName;
}
public void setDeptName(String deptName) {
this.deptName = deptName;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
public String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getDeptId() {
return deptId;
}
public void setDeptId(String deptId) {
this.deptId = deptId;
}
public String getSignName() {
return signName;
}
public void setSignName(String signName) {
this.signName = signName;
}
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getStartWith() {
return startWith;
}
public void setStartWith(String startWith) {
this.startWith = startWith;
}
@Override
public String getPickerViewText() {
return signName;
}
}
@@ -0,0 +1,56 @@
package com.dahe.pass.bean;
import com.contrarywind.interfaces.IPickerViewData;
import java.io.Serializable;
/**
* @ClassName ComSecondBean
* @Author 用户
* @Date 2022/4/12 9:39
* @Description TODO
*/
public class ComSecondBean implements Serializable , IPickerViewData {
private String childSignId;
private String childSign;
private String childSignName;
private String childStartWith;
public String getChildSignId() {
return childSignId;
}
public void setChildSignId(String childSignId) {
this.childSignId = childSignId;
}
public String getChildSign() {
return childSign;
}
public void setChildSign(String childSign) {
this.childSign = childSign;
}
public String getChildSignName() {
return childSignName;
}
public void setChildSignName(String childSignName) {
this.childSignName = childSignName;
}
public String getChildStartWith() {
return childStartWith;
}
public void setChildStartWith(String childStartWith) {
this.childStartWith = childStartWith;
}
@Override
public String getPickerViewText() {
return childSignName;
}
}
@@ -3,6 +3,7 @@ package com.dahe.pass.bean;
import com.contrarywind.interfaces.IPickerViewData;
import java.io.Serializable;
import java.util.ArrayList;
/**
* @ClassName CompanyBean
@@ -10,7 +11,7 @@ import java.io.Serializable;
* @Date 2022/1/15 9:05
* @Description TODO
*/
public class CompanyBean implements Serializable , IPickerViewData {
public class CompanyBean implements IPickerViewData {
private String searchValue;
private String createTime;
private String deptName;
@@ -19,7 +20,25 @@ public class CompanyBean implements Serializable , IPickerViewData {
private String deptId;
private String signName;
private String sign;
private String startWith;
private ArrayList<ComSecondBean> appleInfoVos;
public ArrayList<ComSecondBean> getAppleInfoVos() {
return appleInfoVos;
}
public void setAppleInfoVos(ArrayList<ComSecondBean> appleInfoVos) {
this.appleInfoVos = appleInfoVos;
}
public String getStartWith() {
return startWith;
}
public void setStartWith(String startWith) {
this.startWith = startWith;
}
public String getSignName() {
return signName;
@@ -22,10 +22,12 @@ public class PassBean implements Serializable {
private String driverPhone;
private String startPoint;
private String endPoint;
private String driverIdcard;
private String createTime;
private String startTime;
private String endTime;
private String remarks;
private String useDate;
private int passNoNumber;
private int numberOfPasses;
private int numberOfPassesRequired;
@@ -45,6 +47,22 @@ public class PassBean implements Serializable {
private String notUsedNumMF;
private String notUsedNumSF;
public String getUseDate() {
return useDate;
}
public void setUseDate(String useDate) {
this.useDate = useDate;
}
public String getDriverIdcard() {
return driverIdcard;
}
public void setDriverIdcard(String driverIdcard) {
this.driverIdcard = driverIdcard;
}
public String getNotUsedNumMF() {
return notUsedNumMF;
}
@@ -87,6 +87,24 @@ public class UserBean implements Serializable {
private String name;
private String userId;
private String phone;
private String contacts;
private String contactsPhone;
public String getContacts() {
return contacts;
}
public void setContacts(String contacts) {
this.contacts = contacts;
}
public String getContactsPhone() {
return contactsPhone;
}
public void setContactsPhone(String contactsPhone) {
this.contactsPhone = contactsPhone;
}
public String getEnterpriseName() {
return enterpriseName;
@@ -67,6 +67,12 @@ public interface Api {
@POST(BASE_URL+"apply/approval/company/list")
Observable<CommonResponseBean<List<CompanyBean>>> companyLst();
@POST(BASE_URL+"apply/approval/company/list")
Observable<CommonResponseBean<List<CompanyBean>>> companyLst(@Query("sign") String sign);
@POST(BASE_URL+"apply/approval/pid/list")
Observable<CommonResponseBean<List<CompanyBean>>> pidList();
@POST(BASE_URL+"apply/enterprise/type/list")
Observable<CommonResponseBean<List<CompanyTypeBean>>> typeLst(@Query("sign") String sign);
@@ -81,6 +87,17 @@ public interface Api {
@POST(BASE_URL+"use/of/pass/count")
Observable<CommonResponseBean<PassBean>> passCount(@Query("useDate") String usedate);
@GET(BASE_URL+"use/notReport/getTodayInfo")
Observable<CommonResponseBean<ApplyBean>> getTodayInfo(@Query("useDate") String usedate);
@POST(BASE_URL+"apply/approval/pid/all")
Observable<CommonResponseBean<ArrayList<CompanyBean>>> pidAll();
//新增用户不上报信息
@POST(BASE_URL+"use/notReport/add")
Observable<CommonResponseBean> notReportadd(@Query("useDate") String useDate);
@POST(BASE_URL+"apply/count")
Observable<CommonResponseBean<PassBean>> applyCount(@Query("updateStartTime") String createTime,@Query("updateEndTime") String updateEndTime);
@@ -104,5 +121,11 @@ public interface Api {
@POST(BASE_URL+"use/of/pass/importData")
Observable<CommonResponseBean> importData(@Body PassBean passBean);
@POST(BASE_URL+"user/lookSmsCode")
Observable<CommonResponseBean> lookSmsCode(@Query("phone") String phone,@Query("code") String code);
@GET(BASE_URL+"use/of/pass/getPassNoInfo")
Observable<CommonResponseBean> getPassNoInfo(@Query("passNo") String passNo);
}
@@ -0,0 +1,10 @@
package com.dahe.pass.textkotlin
/**
* @ClassName TextKotlin
* @Author 用户
* @Date 2022/3/16 9:08
* @Description TODO
*/
class TextKotlin constructor(firstName : String) {
}
@@ -1,6 +1,9 @@
package com.dahe.pass.ui.account
import android.Manifest
import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.text.method.HideReturnsTransformationMethod
@@ -11,6 +14,7 @@ import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.net.JsonUtils
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.pass.R
import com.dahe.pass.base.AppConfig
import com.dahe.pass.bean.UserBean
import com.dahe.pass.net.BaseObserver
import com.dahe.pass.net.DataManager
@@ -19,6 +23,7 @@ import com.dahe.pass.ui.HomeActivity
import com.dahe.pass.ui.account.activity.RegisterActivity
import com.dahe.pass.utils.AppActivityUtils
import com.dahe.pass.utils.SPUtils
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_login.*
import pub.devrel.easypermissions.AppSettingsDialog
import pub.devrel.easypermissions.EasyPermissions
@@ -86,7 +91,9 @@ class LoginActivity : BaseActivity(), EasyPermissions.PermissionCallbacks, View.
R.id.tv_yszc -> AppActivityUtils.openWebViewActivity(this, "隐私政策",
"https://downtest.dahehuodongbao.com/passcheck/user-privacy.html")
R.id.tvZc, R.id.tvXyh -> ActivityUtils.startActivity(this, RegisterActivity::class.java)
R.id.tvZc, R.id.tvXyh -> ActivityUtils.startActivityForResult(this,
RegisterActivity::class.java,
0)
}
}
@@ -106,6 +113,7 @@ class LoginActivity : BaseActivity(), EasyPermissions.PermissionCallbacks, View.
* 密码登录
*/
private fun logByPass() {
KeyboardUtils.hideSoftInput(et_phone)
val s: String = et_phone.getText().toString().trim()
val s1: String = et_pass.getText().toString().trim()
if (TextUtils.isEmpty(s) || TextUtils.isEmpty(s1)) {
@@ -188,4 +196,13 @@ class LoginActivity : BaseActivity(), EasyPermissions.PermissionCallbacks, View.
.setRationale("如果没有请求的权限,此应用可能无法正常工作。 打开应用程序设置屏幕以修改应用程序权限").build().show()
}
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (data != null && resultCode == RESULT_OK) {
// val extras = data.extras
// et_phone.setText(extras?.getString(AppConfig.PHONE))
// et_pass.setText(extras?.getString(AppConfig.PWD))
}
}
}
@@ -1,19 +1,40 @@
package com.dahe.pass.ui.account.activity
import android.annotation.SuppressLint
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.view.View
import android.widget.Toast
import com.bigkoo.pickerview.builder.OptionsPickerBuilder
import com.bigkoo.pickerview.view.OptionsPickerView
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.pass.R
import com.dahe.pass.base.AppConfig
import com.dahe.pass.bean.BusInfoBean
import com.dahe.pass.bean.CompanyBean
import com.dahe.pass.bean.JsonBean
import com.dahe.pass.net.BaseObserver
import com.dahe.pass.net.DataManager
import com.dahe.pass.net.RxHttpCallBack
import com.dahe.pass.ui.account.LoginActivity
import com.dahe.pass.utils.AppActivityUtils
import com.dahe.pass.utils.GetJsonDataUtil
import com.dahe.pass.utils.SPUtils
import com.google.gson.Gson
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_add_go.*
import kotlinx.android.synthetic.main.activity_apply.*
import kotlinx.android.synthetic.main.activity_apply.etPhone
import kotlinx.android.synthetic.main.activity_business_info.*
import kotlinx.android.synthetic.main.activity_business_info.etQymc
import org.json.JSONArray
import java.util.ArrayList
/**
* @ClassName BusinessInfoActivity
@@ -22,6 +43,8 @@ import kotlinx.android.synthetic.main.activity_business_info.*
* @Description TODO
*/
class BusinessInfoActivity : BaseActivity(), View.OnClickListener {
lateinit var curCompanyBean: CompanyBean
override fun getLayout() = R.layout.activity_business_info
override fun initView(savedInstanceState: Bundle?) {
@@ -29,46 +52,154 @@ class BusinessInfoActivity : BaseActivity(), View.OnClickListener {
btnGo.setOnClickListener(this)
tv_yhxy.setOnClickListener(this)
tv_yszc.setOnClickListener(this)
etDj.setOnClickListener(this)
etDz.setOnClickListener(this)
etSpdw.setOnClickListener(this)
}
override fun initDate() {
val get = SPUtils.get(this, AppConfig.REISTER, "")
if (get is BusInfoBean){
etNsr.setText(get.unifiedSocialCreditCode)
etQymc.setText(get.enterpriseName)
etDj.setText(get.nationalClassA)
etDz.setText(get.placeOfRegistration)
etGsdz.setText(get.companyAddress)
etFzr.setText(get.contacts)
etFzrPhone.setText(get.contactsPhone)
etTbr.setText(get.name)
}
}
override fun onStop() {
super.onStop()
val busInfoBean = BusInfoBean()
busInfoBean.unifiedSocialCreditCode = etNsr.text.toString()
busInfoBean.enterpriseName = etQymc.text.toString()
busInfoBean.nationalClassA = etDj.text.toString()
busInfoBean.placeOfRegistration = etDz.text.toString()
busInfoBean.companyAddress = etGsdz.text.toString()
busInfoBean.contacts = etFzr.text.toString()
busInfoBean.contactsPhone = etFzrPhone.text.toString()
busInfoBean.name = etTbr.text.toString()
SPUtils.put(this,AppConfig.REISTER,busInfoBean)
}
override fun onClick(view: View) {
super.onClick(view)
when(view.id){
R.id.btnGo->go()
when (view.id) {
R.id.btnGo -> go()
R.id.etDz -> {
KeyboardUtils.hideSoftInput(etQymc)
if (isLoaded) {
setProText()
} else {
mHandler.sendEmptyMessage(MSG_LOAD_DATA)
}
}
R.id.tv_yhxy -> AppActivityUtils.openWebViewActivity(this,
"用户服务协议",
"https://downtest.dahehuodongbao.com/passcheck/user-agreement.html");
R.id.tv_yszc -> AppActivityUtils.openWebViewActivity(this, "隐私政策",
"https://downtest.dahehuodongbao.com/passcheck/user-privacy.html")
R.id.etDj -> {
XPopup.Builder(this).hasShadowBg(false).offsetY(50).atView(etDj)
.popupWidth(500)
.asAttachList(arrayOf("2A", "3A", "4A", "5A", "其他"),
null,
{ position, text -> etDj.text = text }).show()
}
R.id.etSpdw -> spdw()
}
}
fun go(){
fun spdw() {
KeyboardUtils.hideSoftInput(etQymc)
DataManager.getInstance().companyLst()
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<List<CompanyBean>>(this) {
override fun onSuccess(t: CommonResponseBean<List<CompanyBean>>) {
super.onSuccess(t)
val data = t.data
val mutableListOf = mutableListOf<CompanyBean>()
val build = OptionsPickerBuilder(mContext
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
curCompanyBean = mutableListOf.get(options1)
etSpdw.text = mutableListOf.get(options1).signName
}
.setTitleText("审批单位")
.setContentTextSize(20) //设置滚轮文字大小
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
.setSelectOptions(0, 1) //默认选中项
.setTitleColor(Color.BLACK)
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setBgColor(Color.parseColor("#F5F5F5"))
.setTextColorCenter(Color.LTGRAY)
.isRestoreItem(true) //切换时是否还原,设置默认选中第一项。
.isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
.setLabels("", "", "")
// .setOutSideColor(0x00000000) //设置外部遮罩颜色
.setOptionsSelectChangeListener { options1, options2, options3 ->
val str =
"options1: $options1\noptions2: $options2\noptions3: $options3"
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
}
.build<CompanyBean>()
data.forEach {
mutableListOf.add(it)
}
build.setPicker(mutableListOf)
build.show()
}
}))
}
fun go() {
val qymc = etQymc.text.toString()
val ywlx = etYwlx.text.toString()
// val ywlx = etYwlx.text.toString()
val etDz = etDz.text.toString()
val etTbr = etTbr.text.toString()
if (qymc.isNullOrEmpty()){
if (qymc.isNullOrEmpty()) {
showToast("请输入企业名称")
return
}
if (ywlx.isNullOrEmpty()){
showToast("请输入业务类型")
return
}
if (etDz.isNullOrEmpty()){
if (etDz.isNullOrEmpty()) {
showToast("请输入注册地址")
return
}
// if (!::curCompanyBean.isInitialized) {
// showToast("请完善审批单位")
// return
// }
if (etNsr.text.toString().isNullOrEmpty() || etFzr.text.toString().isNullOrEmpty() ||
etFzrPhone.text.toString().isNullOrEmpty() || etDj.text.toString().isNullOrEmpty() ||
etGsdz.text.toString().isNullOrEmpty()
) {
showToast("请完善信息")
return
}
val extras = intent.extras
val bean : BusInfoBean= extras?.getSerializable(AppConfig.BEAN) as BusInfoBean
val bean: BusInfoBean = extras?.getSerializable(AppConfig.BEAN) as BusInfoBean
val busInfoBean = BusInfoBean()
val paramsDao = BusInfoBean.ParamsDao()
@@ -76,12 +207,14 @@ class BusinessInfoActivity : BaseActivity(), View.OnClickListener {
busInfoBean.phone = bean.phone
busInfoBean.params = paramsDao
busInfoBean.pwd = bean.pwd
busInfoBean.unifiedSocialCreditCode = etNsr.text.toString()
busInfoBean.enterpriseName = qymc
busInfoBean.nationalClassA = etDj.text.toString()
busInfoBean.businessType = ywlx
// busInfoBean.approvedBy = curCompanyBean.sign
// busInfoBean.businessType = ywlx
busInfoBean.placeOfRegistration = etDz
busInfoBean.companyAddress = etGsdz.text.toString()
busInfoBean.plantAddress = etCqdz.text.toString()
// busInfoBean.plantAddress = etCqdz.text.toString()
busInfoBean.contacts = etFzr.text.toString()
busInfoBean.contactsPhone = etFzrPhone.text.toString()
busInfoBean.name = etTbr
@@ -90,11 +223,140 @@ class BusinessInfoActivity : BaseActivity(), View.OnClickListener {
DataManager.getInstance().register(busInfoBean)
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>?) {
super.onSuccess(t)
// val intent = Intent("com.dahehaoyun.log.info")
// intent.putExtra(AppConfig.PHONE,bean.phone)
// intent.putExtra(AppConfig.PWD,bean.pwd)
// sendBroadcast(intent)
ActivityUtils.finishOtherActivities(LoginActivity::class.java)
}
}))
}
private var options1Items = ArrayList<JsonBean>()
private val options2Items = ArrayList<ArrayList<String>>()
private val options3Items = ArrayList<ArrayList<ArrayList<String>>>()
private val MSG_LOAD_DATA = 0x0001
private val MSG_LOAD_SUCCESS = 0x0002
private val MSG_LOAD_FAILED = 0x0003
private var thread: Thread? = null
private var isLoaded = false
private fun setProText() {
val pvOptions: OptionsPickerView<*> = OptionsPickerBuilder(this
) { options1, options2, options3, v ->
//返回的分别是三个级别的选中位置
val opt1tx =
if (options1Items.size > 0) options1Items.get(options1).getPickerViewText() else ""
val opt2tx = if (options2Items.size > 0
&& options2Items.get(options1).size > 0
) options2Items.get(options1).get(options2) else ""
val opt3tx =
if (options2Items.size > 0 && options3Items.get(options1).size > 0 && options3Items.get(
options1).get(options2).size > 0
) options3Items.get(options1).get(options2).get(options3) else ""
val tx = "$opt1tx-$opt2tx-$opt3tx"
etDz.text = tx
}
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setBgColor(Color.parseColor("#F5F5F5"))
.setSelectOptions(15, 0, 0)
.setContentTextSize(20)
.build<Any>()
pvOptions.setPicker(options1Items as List<Nothing>?,
options2Items as List<Nothing>?, options3Items as List<Nothing>?) //三级选择器
pvOptions.show()
}
private fun initJsonData() { //解析数据
/**
* 注意:assets 目录下的Json文件仅供参考,实际使用可自行替换文件
* 关键逻辑在于循环体
*
*/
val JsonData: String =
GetJsonDataUtil().getJson(this, "province.json") //获取assets目录下的json文件数据
// String JsonData1 = new GetJsonDataUtil().getJson(this, "city.json");//获取assets目录下的json文件数据
val jsonBean: ArrayList<JsonBean> = parseData(JsonData) //用Gson 转成实体
// ArrayList<Province> data = getData(JsonData1);
/**
* 添加省份数据
*
* 注意:如果是添加的JavaBean实体,则实体类需要实现 IPickerViewData 接口,
* PickerView会通过getPickerViewText方法获取字符串显示出来。
*/
options1Items = jsonBean
for (i in jsonBean.indices) { //遍历省份
val cityList = ArrayList<String>() //该省的城市列表(第二级)
val province_AreaList = ArrayList<ArrayList<String>>() //该省的所有地区列表(第三极)
for (c in 0 until jsonBean[i].cityList.size) { //遍历该省份的所有城市
val cityName = jsonBean[i].cityList[c].name
cityList.add(cityName) //添加城市
val city_AreaList = ArrayList<String>() //该城市的所有地区列表
//如果无地区数据,建议添加空字符串,防止数据为null 导致三个选项长度不匹配造成崩溃
/*if (jsonBean.get(i).getCityList().get(c).getArea() == null
|| jsonBean.get(i).getCityList().get(c).getArea().size() == 0) {
city_AreaList.add("");
} else {
city_AreaList.addAll(jsonBean.get(i).getCityList().get(c).getArea());
}*/city_AreaList.addAll(jsonBean[i].cityList[c].area)
province_AreaList.add(city_AreaList) //添加该省所有地区数据
}
/**
* 添加城市数据
*/
options2Items.add(cityList)
/**
* 添加地区数据
*/
options3Items.add(province_AreaList)
}
mHandler.sendEmptyMessage(MSG_LOAD_SUCCESS)
}
fun parseData(result: String): ArrayList<JsonBean> { //Gson 解析
val detail = ArrayList<JsonBean>()
try {
val data = JSONArray(result)
val gson = Gson()
for (i in 0 until data.length()) {
val entity = gson.fromJson(data.optJSONObject(i).toString(), JsonBean::class.java)
detail.add(entity)
}
} catch (e: Exception) {
e.printStackTrace()
mHandler.sendEmptyMessage(MSG_LOAD_FAILED)
}
return detail
}
@SuppressLint("HandlerLeak")
private val mHandler: Handler = object : Handler() {
override fun handleMessage(msg: Message) {
when (msg.what) {
MSG_LOAD_DATA -> if (thread == null) { //如果已创建就不再重新创建子线程了
thread = Thread { // 子线程中解析省市区数据
initJsonData()
}
thread?.start()
}
MSG_LOAD_SUCCESS -> {
// Toast.makeText(MyInfoActivity.this, "Parse Succeed", Toast.LENGTH_SHORT).show();
setProText()
isLoaded = true
}
MSG_LOAD_FAILED -> Toast.makeText(this@BusinessInfoActivity,
"地区解析失败",
Toast.LENGTH_SHORT).show()
}
}
}
}
@@ -1,5 +1,6 @@
package com.dahe.pass.ui.account.activity
import android.content.Intent
import android.os.Bundle
import android.text.TextUtils
import android.text.method.HideReturnsTransformationMethod
@@ -18,6 +19,7 @@ import com.dahe.pass.net.DataManager
import com.dahe.pass.net.RxHttpCallBack
import com.dahe.pass.ui.HomeActivity
import com.dahe.pass.utils.AppActivityUtils
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_register.*
import java.util.*
@@ -89,6 +91,7 @@ class RegisterActivity : BaseActivity(), View.OnClickListener {
}
fun next() {
KeyboardUtils.hideSoftInput(etPhone)
val phone = etPhone.text.toString()
val code = etCode.text.toString()
val pwd = etPass.text.toString()
@@ -97,17 +100,38 @@ class RegisterActivity : BaseActivity(), View.OnClickListener {
showToast("请完善信息")
return
}
val busInfoBean = BusInfoBean()
busInfoBean.phone = phone
val paramsDao = BusInfoBean.ParamsDao()
paramsDao.code = code
busInfoBean.params = paramsDao
DataManager.getInstance().lookSmsCode(phone,code)
.compose(DataManager.setThread())
.subscribe(BaseObserver(this,object : RxHttpCallBack<Any>(){
override fun onSuccess(t: CommonResponseBean<Any>?) {
super.onSuccess(t)
val busInfoBean = BusInfoBean()
busInfoBean.phone = phone
busInfoBean.pwd = pwd
val bundle = Bundle()
bundle.putSerializable(AppConfig.BEAN, busInfoBean)
ActivityUtils.startActivity(mContext, BusinessInfoActivity::class.java, bundle)
val paramsDao = BusInfoBean.ParamsDao()
paramsDao.code = code
busInfoBean.params = paramsDao
busInfoBean.pwd = pwd
val bundle = Bundle()
bundle.putSerializable(AppConfig.BEAN, busInfoBean)
ActivityUtils.startActivity(mContext, BusinessInfoActivity::class.java, bundle)
}
}))
}
override fun onDestroy() {
super.onDestroy()
// val intent = Intent()
// val bundle = Bundle()
// bundle.putString(AppConfig.PHONE,etPhone.text.toString())
// bundle.putString(AppConfig.PHONE,etPass.text.toString())
// intent.putExtras(bundle)
// setResult(RESULT_OK,intent)
// finish()
}
}
@@ -20,6 +20,7 @@ import com.dahe.mylibrary.utils.TimeUtil
import com.dahe.pass.R
import com.dahe.pass.adapter.GoneAdapter
import com.dahe.pass.base.AppConfig
import com.dahe.pass.bean.ApplyBean
import com.dahe.pass.bean.PassBean
import com.dahe.pass.net.BaseObserver
import com.dahe.pass.net.DataManager
@@ -27,6 +28,7 @@ import com.dahe.pass.net.RxHttpCallBack
import com.dahe.pass.ui.gone.activity.AddGoActivity
import com.dahe.pass.ui.gone.activity.EditGoActivity
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.interfaces.OnConfirmListener
import kotlinx.android.synthetic.main.fragment_gone.*
import java.text.SimpleDateFormat
import java.util.*
@@ -71,6 +73,7 @@ class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
tvSearch.setOnClickListener(this)
llClear.setOnClickListener(this)
tvNoUse.setOnClickListener(this)
tvSearch.addTextChangedListener {
if (it.toString().length > 0) {
llClear.visibility = View.VISIBLE
@@ -82,7 +85,7 @@ class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (requestCode==10005){
if (requestCode == 10005) {
val data1 = data?.data
//文件名
val path = PickUtils.getPath(getContext(), data1)
@@ -94,6 +97,7 @@ class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
override fun onClick(v: View) {
when (v.id) {
R.id.tvSearch -> setBir(tvSearch)
R.id.tvNoUse -> noUse()
R.id.llClear -> {
tvSearch.text = ""
initData()
@@ -104,6 +108,45 @@ class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
}
fun isShowNoUse(){
DataManager.getInstance().getTodayInfo("")
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<ApplyBean>(){
override fun onSuccess(t: CommonResponseBean<ApplyBean>) {
super.onSuccess(t)
val data = t.data
if (null == data.enterpriseName){
tvNoUse.visibility = View.VISIBLE
}else{
tvNoUse.visibility = View.GONE
}
}
}))
}
fun noUse() {
XPopup.Builder(activity)
.dismissOnBackPressed(true)
.dismissOnTouchOutside(true)
// .hasNavigationBar(false)
.isDestroyOnDismiss(true)
.asConfirm("温馨提示", "当您提交当天未使用后,当天是不可以再上报了,你确认定要提交吗?",
"取消", "确定",
object : OnConfirmListener {
override fun onConfirm() {
DataManager.getInstance().notReportadd(TimeUtil.getNowString(SimpleDateFormat("yyyy-MM-dd",
Locale.getDefault())))
.compose(DataManager.setThread())
.subscribe(BaseObserver(activity,object : RxHttpCallBack<Any>(){
override fun onSuccess(t: CommonResponseBean<Any>?) {
super.onSuccess(t)
tvNoUse.visibility = View.GONE
}
}))
}
}, null, false).show()
}
fun initData() {
DataManager.getInstance().passCount(tvSearch.text.toString())
.compose(DataManager.setThread())
@@ -131,6 +174,8 @@ class GoneFragment : BaseFragment(), RefreshCallBack, View.OnClickListener {
applyAdapter.setList(t?.data?.rows)
}
}))
isShowNoUse()
// Observable.zip(DataManager.getInstance().passCount(),
// DataManager.getInstance().passList(tvSearch.text.toString()),
// { item1, item2 ->
@@ -5,6 +5,7 @@ import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.text.InputFilter
import android.text.TextUtils
import android.view.View
import android.widget.TextView
@@ -15,6 +16,7 @@ import com.bigkoo.pickerview.view.OptionsPickerView
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.TimeUtil
import com.dahe.mylibrary.weight.NumRangeInputFilter
import com.dahe.pass.R
import com.dahe.pass.base.AppConfig
import com.dahe.pass.bean.CompanyBean
@@ -26,12 +28,16 @@ import com.dahe.pass.net.RxHttpCallBack
import com.dahe.pass.utils.GetJsonDataUtil
import com.dahe.pass.utils.SPUtils
import com.google.gson.Gson
import com.king.keyboard.KingKeyboard
import com.lxj.xpopup.XPopup
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_add_go.*
import kotlinx.android.synthetic.main.activity_business_info.*
import org.json.JSONArray
import java.text.SimpleDateFormat
import java.util.*
/**
* @ClassName ApplyActivity
* @Author 用户
@@ -39,6 +45,10 @@ import java.util.*
* @Description TODO
*/
class AddGoActivity : BaseActivity(), View.OnClickListener {
private var pointType: Int = 0
private lateinit var kingKeyboard: KingKeyboard
override fun getLayout() = R.layout.activity_add_go
override fun initView(savedInstanceState: Bundle?) {
@@ -50,11 +60,34 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
tvStartTime.setOnClickListener(this)
tvEndTime.setOnClickListener(this)
tvSflx.setOnClickListener(this)
tvSTime.text = SPUtils.get(mContext,AppConfig.START_TIME, "").toString()
tvETime.text = SPUtils.get(mContext,AppConfig.END_TIME, "").toString()
etQd.setOnClickListener(this)
etZd.setOnClickListener(this)
tvUpTime.setOnClickListener(this)
tvType.setOnClickListener(this)
// tvTxbh.filters = arrayOf<InputFilter>(InputFilterMinMax(0,2455))
etDs.filters = arrayOf<InputFilter>(NumRangeInputFilter())
// tvSTime.text = SPUtils.get(mContext,AppConfig.START_TIME, "").toString()
// tvETime.text = SPUtils.get(mContext,AppConfig.END_TIME, "").toString()
kingKeyboard = KingKeyboard(this, keyboardParent)
kingKeyboard.register(etCarNum, KingKeyboard.KeyboardType.LICENSE_PLATE_PROVINCE)
}
override fun initDate() {
tvUpTime.text = TimeUtil.getNowString(SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
}
/**
* 在Activity或Fragment的生命周期中调用对应的方法
*/
override fun onResume() {
super.onResume()
kingKeyboard.onResume()
}
override fun onDestroy() {
super.onDestroy()
kingKeyboard.onDestroy()
}
override fun onClick(view: View) {
@@ -64,27 +97,87 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
R.id.tvSub -> sub()
R.id.tvSTime -> setBir(0, tvSTime)
R.id.tvETime -> setBir(1, tvETime)
R.id.tvUpTime -> setBir(2, tvUpTime)
R.id.tvStartTime -> setBir(2, tvStartTime)
R.id.tvEndTime -> setBir(3, tvEndTime)
R.id.tvSflx -> freeOrBuy()
R.id.tvType -> choiceType()
R.id.etQd -> {
KeyboardUtils.hideSoftInput(tvTxbh)
if (isLoaded) {
pointType = 0
setProText()
} else {
mHandler.sendEmptyMessage(MSG_LOAD_DATA)
}
}
R.id.etZd -> {
KeyboardUtils.hideSoftInput(tvTxbh)
if (isLoaded) {
pointType = 1
setProText()
} else {
mHandler.sendEmptyMessage(MSG_LOAD_DATA)
}
}
}
}
fun choiceType() {
XPopup.Builder(this).hasShadowBg(false).offsetY(50).atView(tvType)
// .popupWidth(500)
.asAttachList(arrayOf("FG", "SW"),
null,
{ position, text -> tvType.text = text+"-" }).show()
}
fun sub() {
KeyboardUtils.hideSoftInput(tvTxbh)
if (tvTxbh.text.toString().isNullOrEmpty() || tvSTime.text.toString().isNullOrEmpty() ||
val toString = tvTxbh.text.toString()
val substring = toString.substring(0, 1)
// if ("0" != substring) {
// showToast("通行证编号需 0 开头")
// return
// }
// val toDouble = tvTxbh.text.toString().toDouble()
// if (toDouble < 1101) {
// showToast("通行证编号不能小于1101")
// return
// }
//
// if (toDouble > 2455) {
// showToast("通行证编号不能大于2455")
// return
// }
DataManager.getInstance().getPassNoInfo("""${tvType.text.toString()}${tvTxbh.text.toString()}""")
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<Any>(){
override fun onSuccess(t: CommonResponseBean<Any>?) {
super.onSuccess(t)
}
}))
if (tvTxbh.text.toString().isNullOrEmpty() ||
etCarNum.text.toString().isNullOrEmpty() || etName.text.toString().isNullOrEmpty() ||
etPhone.text.toString().isNullOrEmpty() || etWpzl.text.toString().isNullOrEmpty() ||
etDs.text.toString().isNullOrEmpty() || etQd.text.toString().isNullOrEmpty()|| tvSflx.text.toString().isNullOrEmpty()
etDs.text.toString().isNullOrEmpty() || etQd.text.toString()
.isNullOrEmpty() || etCardId.text.toString().isNullOrEmpty()
) {
showToast("请完善信息")
return
}
val passBean = PassBean()
passBean.passNo = tvTxbh.text.toString()
passBean.passNo = """${tvType.text.toString()}${tvTxbh.text.toString()}"""
passBean.vehicle = etCarNum.text.toString()
passBean.driverName = etName.text.toString()
passBean.driverPhone = etPhone.text.toString()
@@ -92,12 +185,14 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
passBean.transportTonnage = etDs.text.toString()
passBean.startPoint = etQd.text.toString()
passBean.endPoint = etZd.text.toString()
passBean.driverIdcard = etCardId.text.toString()
passBean.useStartTime = tvSTime.text.toString()
passBean.useEndTime = tvETime.text.toString()
// passBean.useEndTime = tvETime.text.toString()
passBean.startTime = tvStartTime.text.toString()
passBean.endTime = tvEndTime.text.toString()
passBean.useDate = tvUpTime.text.toString()
passBean.remarks = tvBz.text.toString()
passBean.chargeType = tvSflx.text.toString()
// passBean.chargeType = tvSflx.text.toString()
DataManager.getInstance().addPass(passBean)
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
@@ -105,8 +200,8 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
super.onSuccess(t)
showToast("车辆添加成功")
finish()
SPUtils.put(mContext,AppConfig.START_TIME,passBean.useStartTime)
SPUtils.put(mContext,AppConfig.END_TIME,passBean.useStartTime)
SPUtils.put(mContext, AppConfig.START_TIME, passBean.useStartTime)
SPUtils.put(mContext, AppConfig.END_TIME, passBean.useStartTime)
}
}))
}
@@ -139,8 +234,8 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
}
.build<CompanyBean>()
mutableListOf.add(CompanyBean("免费","0"))
mutableListOf.add(CompanyBean("收费","1"))
mutableListOf.add(CompanyBean("免费", "0"))
mutableListOf.add(CompanyBean("收费", "1"))
@@ -172,12 +267,12 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
val data =
TimeUtil.date2String(date,
SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()))
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
view.text = data
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setType(booleanArrayOf(true, true, true, true, true, false))
.setType(booleanArrayOf(true, true, true, false, false, false))
.setTitleText("选择时间")
.setDate(currDate)
.setRangDate(startDate, endtDate)
@@ -213,12 +308,18 @@ class AddGoActivity : BaseActivity(), View.OnClickListener {
) options3Items.get(options1).get(options2).get(options3) else ""
val tx = "$opt1tx-$opt2tx-$opt3tx"
// tvDz.text = tx
if (0 == pointType) {
etQd.text = tx
} else {
etZd.text = tx
}
}
.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setBgColor(Color.parseColor("#F5F5F5"))
.setContentTextSize(20)
.setSelectOptions(15, 0, 0)
.build<Any>()
pvOptions.setPicker(options1Items as List<Nothing>?,
options2Items as List<Nothing>?, options3Items as List<Nothing>?) //三级选择器
@@ -5,6 +5,7 @@ import android.graphics.Color
import android.os.Bundle
import android.os.Handler
import android.os.Message
import android.text.InputFilter
import android.text.TextUtils
import android.view.View
import android.widget.TextView
@@ -15,6 +16,7 @@ import com.bigkoo.pickerview.view.OptionsPickerView
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.TimeUtil
import com.dahe.mylibrary.weight.NumRangeInputFilter
import com.dahe.pass.R
import com.dahe.pass.base.AppConfig
import com.dahe.pass.bean.JsonBean
@@ -26,7 +28,25 @@ import com.dahe.pass.utils.GetJsonDataUtil
import com.dahe.pass.utils.SPUtils
import com.google.gson.Gson
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_add_go.*
import kotlinx.android.synthetic.main.activity_edit_go.*
import kotlinx.android.synthetic.main.activity_edit_go.etCarNum
import kotlinx.android.synthetic.main.activity_edit_go.etCardId
import kotlinx.android.synthetic.main.activity_edit_go.etDs
import kotlinx.android.synthetic.main.activity_edit_go.etName
import kotlinx.android.synthetic.main.activity_edit_go.etPhone
import kotlinx.android.synthetic.main.activity_edit_go.etQd
import kotlinx.android.synthetic.main.activity_edit_go.etWpzl
import kotlinx.android.synthetic.main.activity_edit_go.etZd
import kotlinx.android.synthetic.main.activity_edit_go.tvBz
import kotlinx.android.synthetic.main.activity_edit_go.tvETime
import kotlinx.android.synthetic.main.activity_edit_go.tvEndTime
import kotlinx.android.synthetic.main.activity_edit_go.tvSTime
import kotlinx.android.synthetic.main.activity_edit_go.tvSflx
import kotlinx.android.synthetic.main.activity_edit_go.tvStartTime
import kotlinx.android.synthetic.main.activity_edit_go.tvSub
import kotlinx.android.synthetic.main.activity_edit_go.tvTxbh
import kotlinx.android.synthetic.main.activity_edit_go.tvUpTime
import org.json.JSONArray
import java.text.SimpleDateFormat
import java.util.*
@@ -46,6 +66,9 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
setStatusBarCancelLightColor()
setTitleBar("编辑车辆") { finish() }
tvSub.setOnClickListener(this)
tvUpTime.setOnClickListener(this)
etDs.filters = arrayOf<InputFilter>(NumRangeInputFilter())
}
override fun initDate() {
@@ -67,6 +90,7 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
tvStartTime.text = passBean.startTime
tvEndTime.text = passBean.endTime
tvSflx.text = passBean.chargeType
etCardId.text = passBean.driverIdcard
}
}
@@ -75,12 +99,13 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
when (view.id) {
// R.id.tvSpdw -> spdw()
R.id.tvSub -> sub()
R.id.tvUpTime -> setBir(2, tvUpTime)
}
}
fun sub() {
KeyboardUtils.hideSoftInput(tvTxbh)
if (tvTxbh.text.toString().isNullOrEmpty() || tvSTime.text.toString().isNullOrEmpty() ||
if (tvTxbh.text.toString().isNullOrEmpty() ||
etCarNum.text.toString().isNullOrEmpty() || etName.text.toString().isNullOrEmpty() ||
etPhone.text.toString().isNullOrEmpty() || etWpzl.text.toString().isNullOrEmpty() ||
etDs.text.toString().isNullOrEmpty() || etQd.text.toString().isNullOrEmpty()
@@ -97,6 +122,7 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
passBean.transportTonnage = etDs.text.toString()
passBean.startPoint = etQd.text.toString()
passBean.endPoint = etZd.text.toString()
passBean.useDate = tvUpTime.text.toString()
DataManager.getInstance().detailEdit(passBean)
.compose(DataManager.setThread())
@@ -132,12 +158,12 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
// TimeUtil.date2String(date,SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
val data =
TimeUtil.date2String(date,
SimpleDateFormat("yyyy-MM-dd HH:mm", Locale.getDefault()))
SimpleDateFormat("yyyy-MM-dd", Locale.getDefault()))
view.text = data
}.setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setType(booleanArrayOf(true, true, true, true, true, false))
.setType(booleanArrayOf(true, true, true, false, false, false))
.setTitleText("选择时间")
.setDate(currDate)
.setRangDate(startDate, endtDate)
@@ -179,6 +205,7 @@ class EditGoActivity : BaseActivity(), View.OnClickListener {
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setBgColor(Color.parseColor("#F5F5F5"))
.setContentTextSize(20)
.setSelectOptions(15, 0, 0)
.build<Any>()
pvOptions.setPicker(options1Items as List<Nothing>?,
options2Items as List<Nothing>?, options3Items as List<Nothing>?) //三级选择器
@@ -17,11 +17,14 @@ import com.dahe.pass.net.BaseObserver
import com.dahe.pass.net.DataManager
import com.dahe.pass.net.RxHttpCallBack
import com.dahe.pass.utils.GetJsonDataUtil
import com.dahe.pass.utils.SPUtils
import com.google.gson.Gson
import com.lxj.xpopup.util.KeyboardUtils
import kotlinx.android.synthetic.main.activity_apply.*
import kotlinx.android.synthetic.main.activity_apply.etQymc
import kotlinx.android.synthetic.main.activity_business_info.*
import org.json.JSONArray
import java.util.ArrayList
import java.util.*
/**
* @ClassName ApplyActivity
@@ -33,6 +36,7 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
lateinit var curCompanyBean: CompanyBean
lateinit var curCompanyType: CompanyTypeBean
lateinit var childSign: String
lateinit var jb: String
lateinit var sheng: String
lateinit var shi: String
@@ -50,12 +54,20 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
llQylx.setOnClickListener(this)
tvJb.setOnClickListener(this)
tvSflx.setOnClickListener(this)
val userInfo = SPUtils.getUserInfo(this).userInfo
if (null != userInfo) {
etLxr.text = userInfo.contacts
etPhone.text = userInfo.contactsPhone
}
}
override fun initDate() {
DataManager.getInstance().userInfo
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext,object :RxHttpCallBack<BusInfoBean>(){
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<BusInfoBean>() {
override fun onSuccess(t: CommonResponseBean<BusInfoBean>?) {
super.onSuccess(t)
etQymc.text = t?.data?.enterpriseName
@@ -112,8 +124,8 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
}
.build<CompanyBean>()
mutableListOf.add(CompanyBean("免费","0"))
mutableListOf.add(CompanyBean("收费","1"))
mutableListOf.add(CompanyBean("免费", "0"))
mutableListOf.add(CompanyBean("收费", "1"))
@@ -131,7 +143,7 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
jb = mutableListOf.get(options1).signName
tvJb.text = mutableListOf.get(options1).signName
}
.setTitleText("国家A")
.setTitleText("国家")
.setContentTextSize(20) //设置滚轮文字大小
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
.setSelectOptions(0, 1) //默认选中项
@@ -151,11 +163,11 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
}
.build<CompanyBean>()
mutableListOf.add(CompanyBean(""))
mutableListOf.add(CompanyBean("A"))
mutableListOf.add(CompanyBean("AA"))
mutableListOf.add(CompanyBean("AAA"))
mutableListOf.add(CompanyBean("AAAA"))
mutableListOf.add(CompanyBean("2A"))
mutableListOf.add(CompanyBean("3A"))
mutableListOf.add(CompanyBean("4A"))
mutableListOf.add(CompanyBean("5A"))
mutableListOf.add(CompanyBean("其他"))
@@ -164,25 +176,34 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
build.show()
}
private var opt1: MutableList<CompanyBean> = mutableListOf()
private var opt2: MutableList<MutableList<ComSecondBean>> = mutableListOf()
fun spdw() {
KeyboardUtils.hideSoftInput(etQymc)
DataManager.getInstance().companyLst()
opt1.clear()
opt2.clear()
DataManager.getInstance().pidAll()
.compose(DataManager.setThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<List<CompanyBean>>(this) {
override fun onSuccess(t: CommonResponseBean<List<CompanyBean>>) {
.subscribe(BaseObserver(this, object : RxHttpCallBack<ArrayList<CompanyBean>>() {
override fun onSuccess(t: CommonResponseBean<ArrayList<CompanyBean>>) {
super.onSuccess(t)
val data = t.data
data.forEach {
opt1.add(it)
opt2.add(it.appleInfoVos)
}
val mutableListOf = mutableListOf<CompanyBean>()
val build = OptionsPickerBuilder(mContext
val pvOptions: OptionsPickerView<*> = OptionsPickerBuilder(mContext
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
curCompanyBean = mutableListOf.get(options1)
tvSpdw.text = mutableListOf.get(options1).signName
// var tx =(opt1[options1].pickerViewText
// + opt2[options1][options2].pickerViewText)
tvSpdw.text = opt2[options1][options2].pickerViewText
childSign = opt2[options1][options2].childSign
}
.setTitleText("审批单位")
.setContentTextSize(20) //设置滚轮文字大小
.setContentTextSize(16) //设置滚轮文字大小
.setDividerColor(Color.LTGRAY) //设置分割线的颜色
.setSelectOptions(0, 1) //默认选中项
.setTitleColor(Color.BLACK)
@@ -200,21 +221,62 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
"options1: $options1\noptions2: $options2\noptions3: $options3"
// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
}
.build<CompanyBean>()
.build<Any>()
data.forEach {
mutableListOf.add(it)
}
build.setPicker(mutableListOf)
build.show()
pvOptions.setPicker(opt1 as List<Nothing>?,opt2 as List<Nothing>?)
pvOptions.show()
}
}))
// DataManager.getInstance().companyLst("YJ0007")
// .compose(DataManager.setThread())
// .subscribe(BaseObserver(mContext, object : RxHttpCallBack<List<CompanyBean>>(this) {
// override fun onSuccess(t: CommonResponseBean<List<CompanyBean>>) {
// super.onSuccess(t)
// val data = t.data
//
//
// val mutableListOf = mutableListOf<CompanyBean>()
// val build = OptionsPickerBuilder(mContext
// ) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
// curCompanyBean = mutableListOf.get(options1)
// tvSpdw.text = mutableListOf.get(options1).signName
// }
// .setTitleText("审批单位")
// .setContentTextSize(20) //设置滚轮文字大小
// .setDividerColor(Color.LTGRAY) //设置分割线的颜色
// .setSelectOptions(0, 1) //默认选中项
// .setTitleColor(Color.BLACK)
// .setSubmitColor(Color.parseColor("#F1474B")) //确定按钮文字颜色
// .setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
// .setTitleBgColor(Color.parseColor("#FFFFFF"))
// .setBgColor(Color.parseColor("#F5F5F5"))
// .setTextColorCenter(Color.LTGRAY)
// .isRestoreItem(true) //切换时是否还原,设置默认选中第一项。
// .isCenterLabel(false) //是否只显示中间选中项的label文字,false则每项item全部都带有label。
// .setLabels("", "", "")
//// .setOutSideColor(0x00000000) //设置外部遮罩颜色
// .setOptionsSelectChangeListener { options1, options2, options3 ->
// val str =
// "options1: $options1\noptions2: $options2\noptions3: $options3"
//// Toast.makeText(this@MainActivity, str, Toast.LENGTH_SHORT).show()
// }
// .build<CompanyBean>()
//
// data.forEach {
// mutableListOf.add(it)
// }
//
//
//
// build.setPicker(mutableListOf)
//
// build.show()
//
// }
// }))
}
@@ -235,7 +297,7 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
val mutableListOf = mutableListOf<CompanyTypeBean>()
val build = OptionsPickerBuilder(mContext
) { options1, options2, options3, v -> //返回的分别是三个级别的选中位置
if (options1>=mutableListOf.size)
if (options1 >= mutableListOf.size)
return@OptionsPickerBuilder
curCompanyType = mutableListOf.get(options1)
tvQylx.text = mutableListOf.get(options1).enterpriseTypeName
@@ -277,19 +339,19 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
fun sub() {
if (!::curCompanyBean.isInitialized || !::curCompanyType.isInitialized || !::jb.isInitialized ||
if (!::childSign.isInitialized || !::jb.isInitialized ||
!::shi.isInitialized || etQymc.text.toString().isNullOrEmpty() ||
etLxr.text.toString().isNullOrEmpty() || etPhone.text.toString().isNullOrEmpty() ||
etCl.text.toString().isNullOrEmpty() || etTxz.text.toString().isNullOrEmpty()|| tvSflx.text.toString().isNullOrEmpty()
etCl.text.toString().isNullOrEmpty() || etTxz.text.toString().isNullOrEmpty()
) {
showToast("请完善信息")
return
}
val applySendBean = ApplySendBean()
applySendBean.sign = curCompanyBean.sign
applySendBean.sign = childSign
applySendBean.enterpriseName = etQymc.text.toString()
applySendBean.typeId = curCompanyType.typeId
// applySendBean.typeId = curCompanyType.typeId
applySendBean.provinceName = sheng
applySendBean.cityName = shi
applySendBean.countyName = xian
@@ -298,7 +360,7 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
applySendBean.enterpriseContactPhone = etPhone.text.toString()
applySendBean.vehiclesNumber = etCl.text.toString()
applySendBean.numberOfPassesRequired = etTxz.text.toString()
applySendBean.chargeType = tvSflx.text.toString()
// applySendBean.chargeType = tvSflx.text.toString()
DataManager.getInstance().applySend(applySendBean)
.compose(DataManager.setThread())
@@ -361,7 +423,7 @@ class ApplyActivity : BaseActivity(), View.OnClickListener {
.setCancelColor(Color.parseColor("#F1474B")) //取消按钮文字颜色
.setTitleBgColor(Color.parseColor("#FFFFFF"))
.setBgColor(Color.parseColor("#F5F5F5"))
.setSelectOptions(15,0,0)
.setSelectOptions(15, 0, 0)
.setContentTextSize(20)
.build<Any>()
pvOptions.setPicker(options1Items as List<Nothing>?,
@@ -30,7 +30,7 @@ class MineFragment : BaseFragment(), View.OnClickListener {
rlYhys.setOnClickListener(this)
val userInfo = SPUtils.getUserInfo(mContext).userInfo
tvName.text = userInfo.name
tvName.text = userInfo.enterpriseName
tvPhone.text = userInfo.phone
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 716 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 90 KiB

+1 -1
View File
@@ -7,7 +7,7 @@
</item>
<item android:bottom="10dp">
<bitmap
android:gravity="bottom"
android:gravity="center"
android:src="@drawable/splash" />
</item>
</layer-list>
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#007AFF" />
<solid android:color="#E5F6EA" />
<corners
android:radius="20dp" />
</shape>
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_F5" />
<corners
android:bottomLeftRadius="6dp"
android:bottomRightRadius="6dp"
android:topLeftRadius="6dp"
android:topRightRadius="6dp" />
</shape>
@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
>
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash_big"
android:scaleType="centerCrop"></ImageView>
<LinearLayout
android:id="@+id/llCount"
android:layout_width="60dp"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginTop="50dp"
android:layout_marginRight="20dp"
android:background="@drawable/shape_count_downbg"
android:gravity="center"
android:alpha="0.8"
android:orientation="horizontal">
<TextView
android:id="@+id/tv_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="3"
android:textColor="@color/color_3"
android:textSize="18dp"></TextView>
<TextView
android:layout_marginLeft="3dp"
android:layout_marginTop="2dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="跳过"
android:textColor="@color/color_9"
android:textSize="12dp"></TextView>
</LinearLayout>
</RelativeLayout>
File diff suppressed because it is too large Load Diff
+315 -285
View File
@@ -7,342 +7,372 @@
<include layout="@layout/common_toolbar" />
<LinearLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
android:layout_height="match_parent"
android:fillViewport="true">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="审批单位"
android:textColor="@color/black"></TextView>
<LinearLayout
android:layout_marginBottom="20dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<TextView
android:id="@+id/tvSpdw"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:drawableRight="@drawable/right_black"
android:hint="选择审批单位"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="审批单位"
android:textSize="14dp"
android:textColor="@color/black"></TextView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<TextView
android:id="@+id/tvSpdw"
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/right_black"
android:gravity="right"
android:hint="选择审批单位"
android:textColor="@color/black"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="收费类型"
android:textColor="@color/black"></TextView>
<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<TextView
android:id="@+id/tvSflx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请选择是否收费"
android:textColor="@color/black"
android:drawableRight="@drawable/right_black"
android:textSize="14dp"></TextView>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
</LinearLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="收费类型"
android:textColor="@color/black"></TextView>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<TextView
android:id="@+id/tvSflx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:drawableRight="@drawable/right_black"
android:gravity="right"
android:hint="请选择是否收费"
android:textColor="@color/black"
android:textSize="14dp"></TextView>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="企业名称"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="企业名称"
android:textColor="@color/black"></TextView>
<TextView
android:textColor="@color/black"
android:id="@+id/etQymc"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:paddingRight="6dp"
android:textSize="14dp"></TextView>
<TextView
android:id="@+id/etQymc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:paddingRight="6dp"
android:textColor="@color/black"
android:textSize="14dp"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:id="@+id/llQylx"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:visibility="gone"
android:id="@+id/llQylx"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="企业类型"
android:textColor="@color/black"></TextView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="企业类型"
android:textColor="@color/black"></TextView>
<TextView
android:id="@+id/tvQylx"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:drawableRight="@drawable/right_black"
android:hint="选择企业类型"></TextView>
<TextView
android:id="@+id/tvQylx"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/right_black"
android:gravity="right"
android:hint="选择企业类型"
android:textColor="@color/black"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="市县区"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="市县区"
android:textColor="@color/black"></TextView>
<TextView
android:id="@+id/tvDz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="请选择地址"
android:paddingRight="6dp"
android:textColor="@color/black"
android:textSize="14dp"></TextView>
<TextView
android:id="@+id/tvDz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="请选择地址"
android:paddingRight="6dp"
android:textColor="@color/black"
android:textSize="14dp"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="国家A级"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="国家A级"
android:textColor="@color/black"></TextView>
<TextView
android:id="@+id/tvJb"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black"
android:drawableRight="@drawable/right_black"
android:hint="选择国家A级"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvJb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/right_black"
android:gravity="right"
android:hint="选择国家A级"
android:textColor="@color/black"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="联系人"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="通行证管理人"
android:textColor="@color/black"></TextView>
<EditText
android:id="@+id/etLxr"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入联系人"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
<TextView
android:textColor="@color/black"
android:id="@+id/etLxr"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请输入联系人"
android:paddingRight="6dp"
android:textSize="14dp"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="电话"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="管理人电话"
android:textColor="@color/black"></TextView>
<EditText
android:id="@+id/etPhone"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入电话"
android:maxLength="11"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
<TextView
android:textColor="@color/black"
android:id="@+id/etPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="管理人电话"
android:maxLength="11"
android:inputType="phone"
android:paddingRight="6dp"
android:textSize="14dp"></TextView>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="运输车辆数"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="运输车辆数"
android:textColor="@color/black"></TextView>
<EditText
android:id="@+id/etCl"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入运输车辆数"
android:paddingRight="6dp"
android:inputType="number"
android:textSize="14dp"></EditText>
<EditText
android:id="@+id/etCl"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请输入运输车辆数"
android:inputType="number"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
</LinearLayout>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="通行证需求数"
android:textColor="@color/black"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="通行证需求数"
android:textColor="@color/black"></TextView>
<EditText
android:id="@+id/etTxz"
android:gravity="right"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:hint="请输入通行证需求车辆"
android:paddingRight="6dp"
android:inputType="number"
android:textSize="14dp"></EditText>
<EditText
android:id="@+id/etTxz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请输入通行证需求车辆"
android:inputType="number"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tvSub"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:background="@drawable/shape_blue_bg8"
android:gravity="center"
android:text="提交"
android:textColor="@color/white"></TextView>
<TextView
android:id="@+id/tvSub"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="20dp"
android:layout_marginTop="10dp"
android:layout_marginRight="20dp"
android:background="@drawable/shape_blue_bg8"
android:gravity="center"
android:text="提交"
android:textColor="@color/white"></TextView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
@@ -54,8 +54,7 @@
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="企业名称,必填"
android:maxLength="11"
android:hint="企业名称"
android:maxLines="1"></EditText>
@@ -84,8 +83,37 @@
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="管理人姓名,必填"
android:maxLength="11"
android:hint="法人人姓名"
android:maxLines="1"></EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="26dp"
android:layout_marginTop="20dp"
android:layout_marginRight="26dp"
android:background="@drawable/shape_gray_bg25"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/nsr"></ImageView>
<EditText
android:id="@+id/etNsr"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="统一社会信用代码"
android:maxLines="1"></EditText>
@@ -115,11 +143,44 @@
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="负责人,必填"
android:maxLength="11"
android:hint="通行证管理人"
android:maxLines="1"></EditText>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="26dp"
android:layout_marginTop="20dp"
android:layout_marginRight="26dp"
android:background="@drawable/shape_gray_bg25"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingLeft="20dp"
android:paddingRight="20dp">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/spdw"></ImageView>
<TextView
android:textColor="@color/black"
android:textSize="16dp"
android:gravity="center_vertical"
android:id="@+id/etSpdw"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="请选择审批单位"
android:maxLines="1"></TextView>
</LinearLayout>
<LinearLayout
@@ -146,8 +207,9 @@
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="负责人电话,必填"
android:hint="管理人电话"
android:maxLength="11"
android:inputType="phone"
android:maxLines="1"></EditText>
@@ -173,7 +235,9 @@
android:layout_height="wrap_content"
android:background="@drawable/dj"></ImageView>
<EditText
<TextView
android:textSize="16dp"
android:gravity="center_vertical"
android:id="@+id/etDj"
android:layout_width="match_parent"
android:layout_height="40dp"
@@ -181,13 +245,15 @@
android:background="@null"
android:ellipsize="end"
android:hint="等级"
android:maxLength="11"
android:maxLines="1"></EditText>
android:textColor="@color/black"
android:textStyle=""
android:maxLines="1"></TextView>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_marginLeft="26dp"
@@ -211,7 +277,7 @@
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="业务类型,必填"
android:hint="业务类型"
android:maxLength="11"
android:maxLines="1"></EditText>
@@ -235,16 +301,18 @@
android:layout_height="wrap_content"
android:background="@drawable/dz"></ImageView>
<EditText
<TextView
android:gravity="center_vertical"
android:textSize="16dp"
android:id="@+id/etDz"
android:layout_width="match_parent"
android:layout_height="40dp"
android:layout_marginLeft="10dp"
android:background="@null"
android:ellipsize="end"
android:hint="注册地址,必填"
android:maxLength="11"
android:maxLines="1"></EditText>
android:hint="注册地址"
android:textColor="@color/black"
android:maxLines="1"></TextView>
</LinearLayout>
@@ -274,13 +342,14 @@
android:layout_weight="1"
android:background="@null"
android:ellipsize="end"
android:hint="公司地址"
android:hint="公司园区地址"
android:maxLines="1"></EditText>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:id="@+id/ll_pass"
android:layout_width="match_parent"
android:layout_height="50dp"
+94 -6
View File
@@ -28,7 +28,7 @@
android:text="通行证编号"
android:textColor="@color/black"></TextView>
<EditText
<TextView
android:id="@+id/tvTxbh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -36,11 +36,12 @@
android:gravity="right"
android:hint="请输入通行证编号"
android:textColor="@color/black"
android:textSize="14dp"></EditText>
android:textSize="14dp"></TextView>
</LinearLayout>
<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
@@ -48,6 +49,7 @@
android:background="@color/color_line"></View>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
@@ -73,6 +75,7 @@
</LinearLayout>
<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
@@ -81,6 +84,7 @@
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
@@ -106,6 +110,7 @@
</LinearLayout>
<View
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
@@ -114,6 +119,7 @@
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
@@ -166,6 +172,8 @@
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:maxLines="1"
android:singleLine="true"
android:hint="请输入车牌号"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
@@ -205,6 +213,78 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="司机身份证号"
android:textColor="@color/black"></TextView>
<TextView
android:textColor="@color/black"
android:id="@+id/etCardId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:paddingRight="6dp"
android:maxLength="18"
android:maxLines="1"
android:singleLine="true"
android:inputType="number"
android:digits="0123456789xyzXYZ"
android:textSize="14dp"></TextView>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:background="@color/color_line"></View>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="6dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="上报时间"
android:textColor="@color/black"></TextView>
<TextView
android:id="@+id/tvUpTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请选择上报时间"
android:paddingRight="6dp"
android:textColor="@color/black"
android:textSize="14dp"></TextView>
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
@@ -240,6 +320,8 @@
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
@@ -328,15 +410,18 @@
android:text="起点"
android:textColor="@color/black"></TextView>
<EditText
<TextView
android:textColor="@color/black"
android:id="@+id/etQd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请输入起点"
android:maxLines="1"
android:singleLine="true"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
android:textSize="14dp"></TextView>
</LinearLayout>
@@ -361,15 +446,18 @@
android:text="终点"
android:textColor="@color/black"></TextView>
<EditText
<TextView
android:textColor="@color/black"
android:id="@+id/etZd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="right"
android:hint="请输入运终点"
android:maxLines="1"
android:singleLine="true"
android:paddingRight="6dp"
android:textSize="14dp"></EditText>
android:textSize="14dp"></TextView>
</LinearLayout>
@@ -9,10 +9,11 @@
<ImageView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@drawable/splash"
android:scaleType="fitXY"></ImageView>
android:src="@drawable/splash"
android:scaleType="centerCrop"></ImageView>
<LinearLayout
android:visibility="gone"
android:id="@+id/llCount"
android:layout_width="60dp"
android:layout_height="30dp"
+16
View File
@@ -151,6 +151,7 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="20dp"
android:layout_marginTop="4dp"
@@ -275,6 +276,21 @@
</LinearLayout>
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/tvNoUse"
android:layout_marginTop="8dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="当天未使用"
android:textColor="@color/mine_top_bg"
android:gravity="center"
android:background="@drawable/shape_gray_bg20"
></TextView>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
@@ -126,6 +126,7 @@
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_marginTop="6dp"
android:layout_width="match_parent"
android:layout_height="20dp"
+4 -3
View File
@@ -134,7 +134,7 @@
android:paddingLeft="7dp"
android:text="修改登录密码"
android:textColor="@color/color_3"
android:textSize="@dimen/text_16sp" />
android:textSize="16dp"/>
</RelativeLayout>
@@ -177,7 +177,7 @@
android:paddingLeft="7dp"
android:text="修改手机号"
android:textColor="@color/color_3"
android:textSize="@dimen/text_16sp" />
android:textSize="16dp" />
</RelativeLayout>
@@ -219,7 +219,7 @@
android:paddingLeft="7dp"
android:text="隐私协议"
android:textColor="@color/color_3"
android:textSize="@dimen/text_16sp" />
android:textSize="16dp"/>
</RelativeLayout>
@@ -236,6 +236,7 @@
android:gravity="bottom">
<Button
android:textSize="14dp"
android:id="@+id/btnOut"
android:layout_width="match_parent"
android:layout_height="38dp"
+14
View File
@@ -28,6 +28,7 @@
android:textStyle="bold"></TextView>
<TextView
android:visibility="gone"
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -50,12 +51,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="申请数:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSqs"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -65,12 +68,14 @@
tools:text="2000000"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="审批数:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSps"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -88,12 +93,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="填报人:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvTbr"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -103,12 +110,14 @@
tools:text="2000000"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="电 话:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvDh"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -139,12 +148,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="申请时间:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSqsj"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -162,12 +173,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="审批时间:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSpsj"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -182,6 +195,7 @@
</LinearLayout>
<TextView
android:visibility="gone"
android:id="@+id/tvType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+38
View File
@@ -53,6 +53,7 @@
android:textSize="10dp"></TextView>
<TextView
android:visibility="gone"
android:id="@+id/tvType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -63,6 +64,7 @@
></TextView>
<TextView
android:visibility="gone"
android:layout_toRightOf="@+id/tvType"
android:layout_centerHorizontal="true"
android:id="@+id/tvSj"
@@ -152,12 +154,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运输吨数:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvDs"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -167,12 +171,14 @@
tools:text="2000000"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="物品种类:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvZl"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -189,12 +195,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="司 机:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSjName"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -204,12 +212,14 @@
tools:text="2000000"></TextView>
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="电 话:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvDh"
android:layout_width="0dp"
android:layout_height="wrap_content"
@@ -230,12 +240,36 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="身份证号:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvSfzh"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="6dp"
android:textColor="@color/black"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="开始时间:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvStartSj"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -251,12 +285,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="到达时间:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvEndTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -272,12 +308,14 @@
android:orientation="horizontal">
<TextView
android:textSize="14dp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="备注:"
android:textColor="@color/color_9"></TextView>
<TextView
android:textSize="14dp"
android:id="@+id/tvBz"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+2 -2
View File
@@ -40,8 +40,8 @@ project.ext {
applicationId : "com.dahe.pass",
minSdkVersion : 21,
targetSdkVersion : 30,
versionCode : 4,
versionName : "1.0.4",
versionCode : 12,
versionName : "1.1.2",
]
dependencies = [
"appcompat-v7" : "com.android.support:appcompat-v7:${SupportVersion}",
+1
View File
@@ -0,0 +1 @@
/build
+12
View File
@@ -0,0 +1,12 @@
apply plugin: 'com.novoda.bintray-release'
//添加
publish {
userOrg = 'jenly'//bintray.com用户名
groupId = 'com.king.keyboard'//jcenter上的路径
artifactId = 'kingkeyboard'//项目名称
publishVersion = app_version.versionName//版本号
desc = 'KingKeyboard for Android'//描述
website = 'https://github.com/jenly1314/KingKeyboard'//网站
licences = ['MIT']//开源协议
}
+42
View File
@@ -0,0 +1,42 @@
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
//apply from: 'bintray.gradle'
//apply plugin: "com.vanniktech.maven.publish"
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles 'consumer-rules.pro'
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
lintOptions {
abortOnError false
warning 'InvalidPackage'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.4.31"
compileOnly "androidx.appcompat:appcompat:1.1.0"
testImplementation "junit:junit:4.12"
androidTestImplementation "androidx.test:runner:1.2.0"
androidTestImplementation "androidx.test.espresso:espresso-core:3.3.0"
}
View File
+3
View File
@@ -0,0 +1,3 @@
POM_NAME=KingKeyboard
POM_ARTIFACT_ID=kingkeyboard
POM_PACKAGING=aar
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
@@ -0,0 +1,24 @@
package com.king.keyboard
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4
import org.junit.Test
import org.junit.runner.RunWith
import org.junit.Assert.*
/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.king.keyboard.test", appContext.packageName)
}
}
+5
View File
@@ -0,0 +1,5 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.king.keyboard" >
<!-- 震动权限 -->
<uses-permission android:name="android.permission.VIBRATE" />
</manifest>
@@ -0,0 +1,913 @@
package com.king.keyboard;
/*
* Copyright (C) 2008-2009 Google Inc.
*
* 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.
*/
import android.content.Context;
import android.content.res.Resources;
import android.content.res.TypedArray;
import android.content.res.XmlResourceParser;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
import android.util.DisplayMetrics;
import android.util.Log;
import android.util.TypedValue;
import android.util.Xml;
import androidx.annotation.XmlRes;
import org.xmlpull.v1.XmlPullParserException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
/**
* Loads an XML description of a keyboard and stores the attributes of the keys. A keyboard
* consists of rows of keys.
* <p>The layout file for a keyboard contains XML that looks like the following snippet:</p>
* <pre>
* &lt;Keyboard
* android:keyWidth="%10p"
* android:keyHeight="50px"
* android:horizontalGap="2px"
* android:verticalGap="2px" &gt;
* &lt;Row android:keyWidth="32px" &gt;
* &lt;Key android:keyLabel="A" /&gt;
* ...
* &lt;/Row&gt;
* ...
* &lt;/Keyboard&gt;
* </pre>
* @attr ref android.R.styleable#King_Keyboard_keyWidth
* @attr ref android.R.styleable#King_Keyboard_keyHeight
* @attr ref android.R.styleable#King_Keyboard_horizontalGap
* @attr ref android.R.styleable#King_Keyboard_verticalGap
* This class is deprecated because this is just a convenient UI widget class that
* application developers can re-implement on top of existing public APIs. If you have
* already depended on this class, consider copying the implementation from AOSP into
* your project or re-implementing a similar widget by yourselves
*/
public class Keyboard {
static final String TAG = "Keyboard";
// Keyboard XML Tags
private static final String TAG_KEYBOARD = "Keyboard";
private static final String TAG_ROW = "Row";
private static final String TAG_KEY = "Key";
public static final int EDGE_LEFT = 0x01;
public static final int EDGE_RIGHT = 0x02;
public static final int EDGE_TOP = 0x04;
public static final int EDGE_BOTTOM = 0x08;
public static final int KEYCODE_SHIFT = -1;
public static final int KEYCODE_MODE_CHANGE = -2;
public static final int KEYCODE_CANCEL = -3;
public static final int KEYCODE_DONE = -4;
public static final int KEYCODE_DELETE = -5;
public static final int KEYCODE_ALT = -6;
/** Keyboard label **/
private CharSequence mLabel;
/** Horizontal gap default for all rows */
private int mDefaultHorizontalGap;
/** Default key width */
private int mDefaultWidth;
/** Default key height */
private int mDefaultHeight;
/** Default gap between rows */
private int mDefaultVerticalGap;
/** Is the keyboard in the shifted state */
private boolean mShifted;
/** Key instance for the shift key, if present */
private Key[] mShiftKeys = { null, null };
/** Key index for the shift key, if present */
private int[] mShiftKeyIndices = {-1, -1};
/** Current key width, while loading the keyboard */
private int mKeyWidth;
/** Current key height, while loading the keyboard */
private int mKeyHeight;
/** Total height of the keyboard, including the padding and keys */
private int mTotalHeight;
/**
* Total width of the keyboard, including left side gaps and keys, but not any gaps on the
* right side.
*/
private int mTotalWidth;
/** List of keys in this keyboard */
private List<Key> mKeys;
/** List of modifier keys such as Shift & Alt, if any */
private List<Key> mModifierKeys;
/** Width of the screen available to fit the keyboard */
private int mDisplayWidth;
/** Height of the screen */
private int mDisplayHeight;
/** Keyboard mode, or zero, if none. */
private int mKeyboardMode;
// Variables for pre-computing nearest keys.
private static final int GRID_WIDTH = 10;
private static final int GRID_HEIGHT = 5;
private static final int GRID_SIZE = GRID_WIDTH * GRID_HEIGHT;
private int mCellWidth;
private int mCellHeight;
private int[][] mGridNeighbors;
private int mProximityThreshold;
/** Number of key widths from current touch point to search for nearest keys. */
private static float SEARCH_DISTANCE = 1.8f;
private ArrayList<Row> rows = new ArrayList<>();
/**
* Container for keys in the keyboard. All keys in a row are at the same Y-coordinate.
* Some of the key size defaults can be overridden per row from what the {@link Keyboard}
* defines.
* @attr ref android.R.styleable#King_Keyboard_keyWidth
* @attr ref android.R.styleable#King_Keyboard_keyHeight
* @attr ref android.R.styleable#King_Keyboard_horizontalGap
* @attr ref android.R.styleable#King_Keyboard_verticalGap
* @attr ref android.R.styleable#King_Keyboard_Row_rowEdgeFlags
* @attr ref android.R.styleable#King_Keyboard_Row_keyboardMode
*/
public static class Row {
/** Default width of a key in this row. */
public int defaultWidth;
/** Default height of a key in this row. */
public int defaultHeight;
/** Default horizontal gap between keys in this row. */
public int defaultHorizontalGap;
/** Vertical gap following this row. */
public int verticalGap;
ArrayList<Key> mKeys = new ArrayList<>();
/**
* Edge flags for this row of keys. Possible values that can be assigned are
* {@link Keyboard#EDGE_TOP EDGE_TOP} and {@link Keyboard#EDGE_BOTTOM EDGE_BOTTOM}
*/
public int rowEdgeFlags;
/** The keyboard mode for this row */
public int mode;
private Keyboard parent;
public Row(Keyboard parent) {
this.parent = parent;
}
public Row(Resources res, Keyboard parent, XmlResourceParser parser) {
this.parent = parent;
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.King_Keyboard);
defaultWidth = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyWidth,
parent.mDisplayWidth, parent.mDefaultWidth);
defaultHeight = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyHeight,
parent.mDisplayHeight, parent.mDefaultHeight);
defaultHorizontalGap = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_horizontalGap,
parent.mDisplayWidth, parent.mDefaultHorizontalGap);
verticalGap = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_verticalGap,
parent.mDisplayHeight, parent.mDefaultVerticalGap);
a.recycle();
a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.King_Keyboard_Row);
rowEdgeFlags = a.getInt(R.styleable.King_Keyboard_Row_android_rowEdgeFlags, 0);
mode = a.getResourceId(R.styleable.King_Keyboard_Row_android_keyboardMode,
0);
}
}
/**
* Class for describing the position and characteristics of a single key in the keyboard.
*
* @attr ref android.R.styleable#King_Keyboard_keyWidth
* @attr ref android.R.styleable#King_Keyboard_keyHeight
* @attr ref android.R.styleable#King_Keyboard_horizontalGap
* @attr ref android.R.styleable#King_Keyboard_Key_codes
* @attr ref android.R.styleable#King_Keyboard_Key_keyIcon
* @attr ref android.R.styleable#King_Keyboard_Key_keyLabel
* @attr ref android.R.styleable#King_Keyboard_Key_iconPreview
* @attr ref android.R.styleable#King_Keyboard_Key_isSticky
* @attr ref android.R.styleable#King_Keyboard_Key_isRepeatable
* @attr ref android.R.styleable#King_Keyboard_Key_isModifier
* @attr ref android.R.styleable#King_Keyboard_Key_popupKeyboard
* @attr ref android.R.styleable#King_Keyboard_Key_popupCharacters
* @attr ref android.R.styleable#King_Keyboard_Key_keyOutputText
* @attr ref android.R.styleable#King_Keyboard_Key_keyEdgeFlags
*/
public static class Key {
/**
* All the key codes (unicode or custom code) that this key could generate, zero'th
* being the most important.
*/
public int[] codes;
/** Label to display */
public CharSequence label;
/** Icon to display instead of a label. Icon takes precedence over a label */
public Drawable icon;
/** Preview version of the icon, for the preview popup */
public Drawable iconPreview;
/** Width of the key, not including the gap */
public int width;
/** Height of the key, not including the gap */
public int height;
/** The horizontal gap before this key */
public int gap;
/** Whether this key is sticky, i.e., a toggle key */
public boolean sticky;
/** X coordinate of the key in the keyboard layout */
public int x;
/** Y coordinate of the key in the keyboard layout */
public int y;
/** The current pressed state of this key */
public boolean pressed;
/** If this is a sticky key, is it on? */
public boolean on;
/** Text to output when pressed. This can be multiple characters, like ".com" */
public CharSequence text;
/** Popup characters */
public CharSequence popupCharacters;
/**
* Flags that specify the anchoring to edges of the keyboard for detecting touch events
* that are just out of the boundary of the key. This is a bit mask of
* {@link Keyboard#EDGE_LEFT}, {@link Keyboard#EDGE_RIGHT}, {@link Keyboard#EDGE_TOP} and
* {@link Keyboard#EDGE_BOTTOM}.
*/
public int edgeFlags;
/** Whether this is a modifier key, such as Shift or Alt */
public boolean modifier;
/** The keyboard that this key belongs to */
private Keyboard keyboard;
/**
* If this key pops up a mini keyboard, this is the resource id for the XML layout for that
* keyboard.
*/
public int popupResId;
/** Whether this key repeats itself when held down */
public boolean repeatable;
private final static int[] KEY_STATE_NORMAL_ON = {
android.R.attr.state_checkable,
android.R.attr.state_checked
};
private final static int[] KEY_STATE_PRESSED_ON = {
android.R.attr.state_pressed,
android.R.attr.state_checkable,
android.R.attr.state_checked
};
private final static int[] KEY_STATE_NORMAL_OFF = {
android.R.attr.state_checkable
};
private final static int[] KEY_STATE_PRESSED_OFF = {
android.R.attr.state_pressed,
android.R.attr.state_checkable
};
private final static int[] KEY_STATE_NORMAL = {
};
private final static int[] KEY_STATE_PRESSED = {
android.R.attr.state_pressed
};
/** Create an empty key with no attributes. */
public Key(Row parent) {
keyboard = parent.parent;
height = parent.defaultHeight;
width = parent.defaultWidth;
gap = parent.defaultHorizontalGap;
edgeFlags = parent.rowEdgeFlags;
}
/** Create a key with the given top-left coordinate and extract its attributes from
* the XML parser.
* @param res resources associated with the caller's context
* @param parent the row that this key belongs to. The row must already be attached to
* a {@link Keyboard}.
* @param x the x coordinate of the top-left
* @param y the y coordinate of the top-left
* @param parser the XML parser containing the attributes for this key
*/
public Key(Resources res, Row parent, int x, int y, XmlResourceParser parser) {
this(parent);
this.x = x;
this.y = y;
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.King_Keyboard);
width = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyWidth,
keyboard.mDisplayWidth, parent.defaultWidth);
height = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyHeight,
keyboard.mDisplayHeight, parent.defaultHeight);
gap = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_horizontalGap,
keyboard.mDisplayWidth, parent.defaultHorizontalGap);
a.recycle();
a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.King_Keyboard_Key);
this.x += gap;
TypedValue codesValue = new TypedValue();
a.getValue(R.styleable.King_Keyboard_Key_android_codes,
codesValue);
if (codesValue.type == TypedValue.TYPE_INT_DEC
|| codesValue.type == TypedValue.TYPE_INT_HEX) {
codes = new int[] { codesValue.data };
} else if (codesValue.type == TypedValue.TYPE_STRING) {
codes = parseCSV(codesValue.string.toString());
}
iconPreview = a.getDrawable(R.styleable.King_Keyboard_Key_android_iconPreview);
if (iconPreview != null) {
iconPreview.setBounds(0, 0, iconPreview.getIntrinsicWidth(),
iconPreview.getIntrinsicHeight());
}
popupCharacters = a.getText(
R.styleable.King_Keyboard_Key_android_popupCharacters);
popupResId = a.getResourceId(
R.styleable.King_Keyboard_Key_android_popupKeyboard, 0);
repeatable = a.getBoolean(
R.styleable.King_Keyboard_Key_android_isRepeatable, false);
modifier = a.getBoolean(
R.styleable.King_Keyboard_Key_android_isModifier, false);
sticky = a.getBoolean(
R.styleable.King_Keyboard_Key_android_isSticky, false);
edgeFlags = a.getInt(R.styleable.King_Keyboard_Key_android_keyEdgeFlags, 0);
edgeFlags |= parent.rowEdgeFlags;
icon = a.getDrawable(
R.styleable.King_Keyboard_Key_android_keyIcon);
if (icon != null) {
icon.setBounds(0, 0, icon.getIntrinsicWidth(), icon.getIntrinsicHeight());
}
label = a.getText(R.styleable.King_Keyboard_Key_android_keyLabel);
text = a.getText(R.styleable.King_Keyboard_Key_android_keyOutputText);
if (codes == null && !TextUtils.isEmpty(label)) {
codes = new int[] { label.charAt(0) };
}
a.recycle();
}
/**
* Informs the key that it has been pressed, in case it needs to change its appearance or
* state.
* @see #onReleased(boolean)
*/
public void onPressed() {
pressed = !pressed;
}
/**
* Changes the pressed state of the key.
*
* <p>Toggled state of the key will be flipped when all the following conditions are
* fulfilled:</p>
*
* <ul>
* <li>This is a sticky key, that is, {@link #sticky} is {@code true}.
* <li>The parameter {@code inside} is {@code true}.
* <li>{@link android.os.Build.VERSION#SDK_INT} is greater than
* {@link android.os.Build.VERSION_CODES#LOLLIPOP_MR1}.
* </ul>
*
* @param inside whether the finger was released inside the key. Works only on Android M and
* later. See the method document for details.
* @see #onPressed()
*/
public void onReleased(boolean inside) {
pressed = !pressed;
if (sticky && inside) {
on = !on;
}
}
int[] parseCSV(String value) {
int count = 0;
int lastIndex = 0;
if (value.length() > 0) {
count++;
while ((lastIndex = value.indexOf(",", lastIndex + 1)) > 0) {
count++;
}
}
int[] values = new int[count];
count = 0;
StringTokenizer st = new StringTokenizer(value, ",");
while (st.hasMoreTokens()) {
try {
values[count++] = Integer.parseInt(st.nextToken());
} catch (NumberFormatException nfe) {
Log.e(TAG, "Error parsing keycodes " + value);
}
}
return values;
}
/**
* Detects if a point falls inside this key.
* @param x the x-coordinate of the point
* @param y the y-coordinate of the point
* @return whether or not the point falls inside the key. If the key is attached to an edge,
* it will assume that all points between the key and the edge are considered to be inside
* the key.
*/
public boolean isInside(int x, int y) {
boolean leftEdge = (edgeFlags & EDGE_LEFT) > 0;
boolean rightEdge = (edgeFlags & EDGE_RIGHT) > 0;
boolean topEdge = (edgeFlags & EDGE_TOP) > 0;
boolean bottomEdge = (edgeFlags & EDGE_BOTTOM) > 0;
if ((x >= this.x || (leftEdge && x <= this.x + this.width))
&& (x < this.x + this.width || (rightEdge && x >= this.x))
&& (y >= this.y || (topEdge && y <= this.y + this.height))
&& (y < this.y + this.height || (bottomEdge && y >= this.y))) {
return true;
} else {
return false;
}
}
/**
* Returns the square of the distance between the center of the key and the given point.
* @param x the x-coordinate of the point
* @param y the y-coordinate of the point
* @return the square of the distance of the point from the center of the key
*/
public int squaredDistanceFrom(int x, int y) {
int xDist = this.x + width / 2 - x;
int yDist = this.y + height / 2 - y;
return xDist * xDist + yDist * yDist;
}
/**
* Returns the drawable state for the key, based on the current state and type of the key.
* @return the drawable state of the key.
* @see android.graphics.drawable.StateListDrawable#setState(int[])
*/
public int[] getCurrentDrawableState() {
int[] states = KEY_STATE_NORMAL;
if (on) {
if (pressed) {
states = KEY_STATE_PRESSED_ON;
} else {
states = KEY_STATE_NORMAL_ON;
}
} else {
if (sticky) {
if (pressed) {
states = KEY_STATE_PRESSED_OFF;
} else {
states = KEY_STATE_NORMAL_OFF;
}
} else {
if (pressed) {
states = KEY_STATE_PRESSED;
}
}
}
return states;
}
}
/**
* Creates a keyboard from the given xml key layout file.
* @param context the application or service context
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
*/
public Keyboard(Context context, int xmlLayoutResId) {
this(context, xmlLayoutResId, 0);
}
/**
* Creates a keyboard from the given xml key layout file. Weeds out rows
* that have a keyboard mode defined but don't match the specified mode.
* @param context the application or service context
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
* @param modeId keyboard mode identifier
* @param width sets width of keyboard
* @param height sets height of keyboard
*/
public Keyboard(Context context, @XmlRes int xmlLayoutResId, int modeId, int width,
int height) {
mDisplayWidth = width;
mDisplayHeight = height;
mDefaultHorizontalGap = 0;
mDefaultWidth = mDisplayWidth / 10;
mDefaultVerticalGap = 0;
mDefaultHeight = mDefaultWidth;
mKeys = new ArrayList<>();
mModifierKeys = new ArrayList<>();
mKeyboardMode = modeId;
loadKeyboard(context, context.getResources().getXml(xmlLayoutResId));
}
/**
* Creates a keyboard from the given xml key layout file. Weeds out rows
* that have a keyboard mode defined but don't match the specified mode.
* @param context the application or service context
* @param xmlLayoutResId the resource file that contains the keyboard layout and keys.
* @param modeId keyboard mode identifier
*/
public Keyboard(Context context, @XmlRes int xmlLayoutResId, int modeId) {
DisplayMetrics dm = context.getResources().getDisplayMetrics();
mDisplayWidth = dm.widthPixels;
mDisplayHeight = dm.heightPixels;
//Log.v(TAG, "keyboard's display metrics:" + dm);
mDefaultHorizontalGap = 0;
mDefaultWidth = mDisplayWidth / 10;
mDefaultVerticalGap = 0;
mDefaultHeight = mDefaultWidth;
mKeys = new ArrayList<>();
mModifierKeys = new ArrayList<>();
mKeyboardMode = modeId;
loadKeyboard(context, context.getResources().getXml(xmlLayoutResId));
}
/**
* <p>Creates a blank keyboard from the given resource file and populates it with the specified
* characters in left-to-right, top-to-bottom fashion, using the specified number of columns.
* </p>
* <p>If the specified number of columns is -1, then the keyboard will fit as many keys as
* possible in each row.</p>
* @param context the application or service context
* @param layoutTemplateResId the layout template file, containing no keys.
* @param characters the list of characters to display on the keyboard. One key will be created
* for each character.
* @param columns the number of columns of keys to display. If this number is greater than the
* number of keys that can fit in a row, it will be ignored. If this number is -1, the
* keyboard will fit as many keys as possible in each row.
*/
public Keyboard(Context context, int layoutTemplateResId,
CharSequence characters, int columns, int horizontalPadding) {
this(context, layoutTemplateResId);
int x = 0;
int y = 0;
int column = 0;
mTotalWidth = 0;
Row row = new Row(this);
row.defaultHeight = mDefaultHeight;
row.defaultWidth = mDefaultWidth;
row.defaultHorizontalGap = mDefaultHorizontalGap;
row.verticalGap = mDefaultVerticalGap;
row.rowEdgeFlags = EDGE_TOP | EDGE_BOTTOM;
final int maxColumns = columns == -1 ? Integer.MAX_VALUE : columns;
for (int i = 0; i < characters.length(); i++) {
char c = characters.charAt(i);
if (column >= maxColumns
|| x + mDefaultWidth + horizontalPadding > mDisplayWidth) {
x = 0;
y += mDefaultVerticalGap + mDefaultHeight;
column = 0;
}
final Key key = new Key(row);
key.x = x;
key.y = y;
key.label = String.valueOf(c);
key.codes = new int[] { c };
column++;
x += key.width + key.gap;
mKeys.add(key);
row.mKeys.add(key);
if (x > mTotalWidth) {
mTotalWidth = x;
}
}
mTotalHeight = y + mDefaultHeight;
rows.add(row);
}
final void resize(int newWidth, int newHeight) {
int numRows = rows.size();
for (int rowIndex = 0; rowIndex < numRows; ++rowIndex) {
Row row = rows.get(rowIndex);
int numKeys = row.mKeys.size();
int totalGap = 0;
int totalWidth = 0;
for (int keyIndex = 0; keyIndex < numKeys; ++keyIndex) {
Key key = row.mKeys.get(keyIndex);
if (keyIndex > 0) {
totalGap += key.gap;
}
totalWidth += key.width;
}
if (totalGap + totalWidth > newWidth) {
int x = 0;
float scaleFactor = (float)(newWidth - totalGap) / totalWidth;
for (int keyIndex = 0; keyIndex < numKeys; ++keyIndex) {
Key key = row.mKeys.get(keyIndex);
key.width *= scaleFactor;
key.x = x;
x += key.width + key.gap;
}
}
}
mTotalWidth = newWidth;
// TODO: This does not adjust the vertical placement according to the new size.
// The main problem in the previous code was horizontal placement/size, but we should
// also recalculate the vertical sizes/positions when we get this resize call.
}
public List<Key> getKeys() {
return mKeys;
}
public List<Key> getModifierKeys() {
return mModifierKeys;
}
protected int getHorizontalGap() {
return mDefaultHorizontalGap;
}
protected void setHorizontalGap(int gap) {
mDefaultHorizontalGap = gap;
}
protected int getVerticalGap() {
return mDefaultVerticalGap;
}
protected void setVerticalGap(int gap) {
mDefaultVerticalGap = gap;
}
protected int getKeyHeight() {
return mDefaultHeight;
}
protected void setKeyHeight(int height) {
mDefaultHeight = height;
}
protected int getKeyWidth() {
return mDefaultWidth;
}
protected void setKeyWidth(int width) {
mDefaultWidth = width;
}
/**
* Returns the total height of the keyboard
* @return the total height of the keyboard
*/
public int getHeight() {
return mTotalHeight;
}
public int getMinWidth() {
return mTotalWidth;
}
public boolean setShifted(boolean shiftState) {
for (Key shiftKey : mShiftKeys) {
if (shiftKey != null) {
shiftKey.on = shiftState;
}
}
if (mShifted != shiftState) {
mShifted = shiftState;
return true;
}
return false;
}
public boolean isShifted() {
return mShifted;
}
/**
* @hide
*/
public int[] getShiftKeyIndices() {
return mShiftKeyIndices;
}
public int getShiftKeyIndex() {
return mShiftKeyIndices[0];
}
private void computeNearestNeighbors() {
// Round-up so we don't have any pixels outside the grid
mCellWidth = (getMinWidth() + GRID_WIDTH - 1) / GRID_WIDTH;
mCellHeight = (getHeight() + GRID_HEIGHT - 1) / GRID_HEIGHT;
mGridNeighbors = new int[GRID_SIZE][];
int[] indices = new int[mKeys.size()];
final int gridWidth = GRID_WIDTH * mCellWidth;
final int gridHeight = GRID_HEIGHT * mCellHeight;
for (int x = 0; x < gridWidth; x += mCellWidth) {
for (int y = 0; y < gridHeight; y += mCellHeight) {
int count = 0;
for (int i = 0; i < mKeys.size(); i++) {
final Key key = mKeys.get(i);
if (key.squaredDistanceFrom(x, y) < mProximityThreshold ||
key.squaredDistanceFrom(x + mCellWidth - 1, y) < mProximityThreshold ||
key.squaredDistanceFrom(x + mCellWidth - 1, y + mCellHeight - 1)
< mProximityThreshold ||
key.squaredDistanceFrom(x, y + mCellHeight - 1) < mProximityThreshold) {
indices[count++] = i;
}
}
int [] cell = new int[count];
System.arraycopy(indices, 0, cell, 0, count);
mGridNeighbors[(y / mCellHeight) * GRID_WIDTH + (x / mCellWidth)] = cell;
}
}
}
/**
* Returns the indices of the keys that are closest to the given point.
* @param x the x-coordinate of the point
* @param y the y-coordinate of the point
* @return the array of integer indices for the nearest keys to the given point. If the given
* point is out of range, then an array of size zero is returned.
*/
public int[] getNearestKeys(int x, int y) {
if (mGridNeighbors == null) computeNearestNeighbors();
if (x >= 0 && x < getMinWidth() && y >= 0 && y < getHeight()) {
int index = (y / mCellHeight) * GRID_WIDTH + (x / mCellWidth);
if (index < GRID_SIZE) {
return mGridNeighbors[index];
}
}
return new int[0];
}
protected Row createRowFromXml(Resources res, XmlResourceParser parser) {
return new Row(res, this, parser);
}
protected Key createKeyFromXml(Resources res, Row parent, int x, int y,
XmlResourceParser parser) {
return new Key(res, parent, x, y, parser);
}
private void loadKeyboard(Context context, XmlResourceParser parser) {
boolean inKey = false;
boolean inRow = false;
boolean leftMostKey = false;
int row = 0;
int x = 0;
int y = 0;
Key key = null;
Row currentRow = null;
Resources res = context.getResources();
boolean skipRow = false;
try {
int event;
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
if (event == XmlResourceParser.START_TAG) {
String tag = parser.getName();
if (TAG_ROW.equals(tag)) {
inRow = true;
x = 0;
currentRow = createRowFromXml(res, parser);
rows.add(currentRow);
skipRow = currentRow.mode != 0 && currentRow.mode != mKeyboardMode;
if (skipRow) {
skipToEndOfRow(parser);
inRow = false;
}
} else if (TAG_KEY.equals(tag)) {
inKey = true;
key = createKeyFromXml(res, currentRow, x, y, parser);
mKeys.add(key);
if (key.codes[0] == KEYCODE_SHIFT) {
// Find available shift key slot and put this shift key in it
for (int i = 0; i < mShiftKeys.length; i++) {
if (mShiftKeys[i] == null) {
mShiftKeys[i] = key;
mShiftKeyIndices[i] = mKeys.size()-1;
break;
}
}
mModifierKeys.add(key);
} else if (key.codes[0] == KEYCODE_ALT) {
mModifierKeys.add(key);
}
currentRow.mKeys.add(key);
} else if (TAG_KEYBOARD.equals(tag)) {
parseKeyboardAttributes(res, parser);
}
} else if (event == XmlResourceParser.END_TAG) {
if (inKey) {
inKey = false;
x += key.gap + key.width;
if (x > mTotalWidth) {
mTotalWidth = x;
}
} else if (inRow) {
inRow = false;
y += currentRow.verticalGap;
y += currentRow.defaultHeight;
row++;
} else {
// TODO: error or extend?
}
}
}
} catch (Exception e) {
Log.e(TAG, "Parse error:" + e);
e.printStackTrace();
}
mTotalHeight = y - mDefaultVerticalGap;
}
private void skipToEndOfRow(XmlResourceParser parser)
throws XmlPullParserException, IOException {
int event;
while ((event = parser.next()) != XmlResourceParser.END_DOCUMENT) {
if (event == XmlResourceParser.END_TAG
&& parser.getName().equals(TAG_ROW)) {
break;
}
}
}
private void parseKeyboardAttributes(Resources res, XmlResourceParser parser) {
TypedArray a = res.obtainAttributes(Xml.asAttributeSet(parser),
R.styleable.King_Keyboard);
mDefaultWidth = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyWidth,
mDisplayWidth, mDisplayWidth / 10);
mDefaultHeight = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_keyHeight,
mDisplayHeight, 50);
mDefaultHorizontalGap = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_horizontalGap,
mDisplayWidth, 0);
mDefaultVerticalGap = getDimensionOrFraction(a,
R.styleable.King_Keyboard_android_verticalGap,
mDisplayHeight, 0);
mProximityThreshold = (int) (mDefaultWidth * SEARCH_DISTANCE);
mProximityThreshold = mProximityThreshold * mProximityThreshold; // Square it for comparison
a.recycle();
}
static int getDimensionOrFraction(TypedArray a, int index, int base, int defValue) {
TypedValue value = a.peekValue(index);
if (value == null) return defValue;
if (value.type == TypedValue.TYPE_DIMENSION) {
return a.getDimensionPixelOffset(index, defValue);
} else if (value.type == TypedValue.TYPE_FRACTION) {
// Round it to avoid values like 47.9999 from getting truncated
return Math.round(a.getFraction(index, base, base, defValue));
}
return defValue;
}
}
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,55 @@
package com.king.keyboard
import android.content.Context
import android.util.SparseArray
import android.view.View
import android.view.inputmethod.InputMethodManager
import androidx.annotation.RequiresApi
/**
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
/**
* 判断是否是小写字母
*/
fun Char.isLowerCase(c: Char): Boolean{
return c.toInt() in 97..122
}
/**
* 判断是否是大写字母
*/
fun Char.isUpperCase(c: Char): Boolean{
return c.toInt() in 65..90
}
/**
* 显示系统输入法
*/
fun View.showSystemInputMethod(){
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.showSoftInput(this,InputMethodManager.SHOW_IMPLICIT)
}
/**
* 隐藏系统输入法
*/
fun View.hideSystemInputMethod(){
val imm = context.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager
imm.hideSoftInputFromWindow(windowToken,0)
}
var View.isVisible: Boolean
get() = visibility == View.VISIBLE
set(value) {
visibility = if (value) View.VISIBLE else View.GONE
}
/** Returns true if the collection contains [key]. */
@RequiresApi(16)
fun <T> SparseArray<T>.containsKey(key: Int) = indexOfKey(key) >= 0
/** Allows the use of the index operator for storing values in the collection. */
@RequiresApi(16)
operator fun <T> SparseArray<T>.set(key: Int, value: T) = put(key, value)
@@ -0,0 +1,316 @@
package com.king.keyboard
import android.content.Context
import android.graphics.Canvas
import android.graphics.Paint
import android.graphics.Typeface
import android.graphics.drawable.Drawable
import android.util.AttributeSet
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
/**
* @author <a href="mailto:jenly1314@gmail.com">Jenly</a>
*/
open class KingKeyboardView : KeyboardView {
private var isCap = false
private var isAllCaps = false
private lateinit var config: Config
private val paint by lazy { Paint() }
companion object {
const val iconRatio = 0.5f
}
constructor(context: Context, attrs: AttributeSet?) : super(context, attrs) {
init(context, attrs)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int) : super(context, attrs, defStyleAttr) {
init(context, attrs)
}
constructor(context: Context, attrs: AttributeSet?, defStyleAttr: Int, defStyleRes: Int) : super(context, attrs, defStyleAttr, defStyleRes){
init(context, attrs)
}
private fun init(context: Context, attrs: AttributeSet?) {
config = Config(context)
var a = context.obtainStyledAttributes(attrs, R.styleable.KingKeyboardView)
a.indexCount.let {
config.run {
for (i in 0 until it) {
when (val attr = a.getIndex(i)) {
R.styleable.KingKeyboardView_kkbDeleteDrawable -> deleteDrawable = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbCapitalDrawable -> capitalDrawable = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbCapitalLockDrawable -> capitalLockDrawable = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbCancelDrawable -> cancelDrawable = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbCancelDrawable -> spaceDrawable = a.getDrawable(attr)
R.styleable.KingKeyboardView_android_labelTextSize -> labelTextSize = a.getDimensionPixelSize(attr, labelTextSize)
R.styleable.KingKeyboardView_android_keyTextSize -> keyTextSize = a.getDimensionPixelSize(attr, keyTextSize)
R.styleable.KingKeyboardView_android_keyTextColor -> keyTextColor = a.getColor(attr, keyTextColor)
R.styleable.KingKeyboardView_kkbKeyIconColor -> keyIconColor = a.getColor(attr, ContextCompat.getColor(context, R.color.king_keyboard_key_icon_color))
R.styleable.KingKeyboardView_kkbKeySpecialTextColor -> keySpecialTextColor = a.getColor(attr, keySpecialTextColor)
R.styleable.KingKeyboardView_kkbKeyDoneTextColor -> keyDoneTextColor = a.getColor(attr, keyDoneTextColor)
R.styleable.KingKeyboardView_kkbKeyNoneTextColor -> keyNoneTextColor = a.getColor(attr, keyNoneTextColor)
R.styleable.KingKeyboardView_android_keyBackground -> keyBackground = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbSpecialKeyBackground -> specialKeyBackground = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbDoneKeyBackground -> doneKeyBackground = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbNoneKeyBackground -> noneKeyBackground = a.getDrawable(attr)
R.styleable.KingKeyboardView_kkbKeyDoneTextSize -> keyDoneTextSize = a.getDimensionPixelSize(attr, keyDoneTextSize)
R.styleable.KingKeyboardView_kkbKeyDoneText -> keyDoneText = a.getString(attr)
}
}
}
a.recycle()
}
paint.textAlign = Paint.Align.CENTER
paint.isAntiAlias = true
}
fun getConfig(): Config {
return config
}
fun setConfig(config: Config) {
this.config = config
invalidate()
}
override fun onDraw(canvas: Canvas) {
super.onDraw(canvas)
drawKeyboard(canvas, keyboard?.keys)
}
/**
* 绘制键盘
*/
private fun drawKeyboard(canvas: Canvas,keys: List<Keyboard.Key>?){
keys?.let {
for (key in it) {
drawKey(canvas, key)
}
}
}
/**
* 绘制键盘按键
*/
private fun drawKey(canvas: Canvas, key: Keyboard.Key) {
when (key.codes[0]) {
KingKeyboard.KEYCODE_SHIFT -> drawShiftKey(canvas, key)
KingKeyboard.KEYCODE_MODE_CHANGE -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
KingKeyboard.KEYCODE_CANCEL -> drawCancelKey(canvas, key)
KingKeyboard.KEYCODE_DONE -> drawDoneKey(canvas, key)
KingKeyboard.KEYCODE_DELETE -> drawDeleteKey(canvas, key)
KingKeyboard.KEYCODE_ALT -> drawAltKey(canvas, key)
KingKeyboard.KEYCODE_SPACE -> drawKey(canvas, key, config.keyBackground, config.keyTextColor, config.spaceDrawable)
KingKeyboard.KEYCODE_NONE -> drawNoneKey(canvas, key)
KingKeyboard.KEYCODE_MODE_BACK -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
KingKeyboard.KEYCODE_BACK -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
KingKeyboard.KEYCODE_MORE -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
in -399..-300 -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
// else -> drawKey(canvas,key,keyBackground)
}
}
/**
* 绘制Cancel键,常见于关闭键盘键
*/
private fun drawCancelKey(canvas: Canvas, key: Keyboard.Key) {
drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor, config.cancelDrawable)
}
/**
* 绘制Done键,常见于右下角蓝色的“确定”按键
*/
private fun drawDoneKey(canvas: Canvas, key: Keyboard.Key) {
config.keyDoneText?.let {
key.label = it
}
drawKey(canvas, key, config.doneKeyBackground, config.keyDoneTextColor, null, true)
}
/**
* 绘制Delete键
*/
private fun drawNoneKey(canvas: Canvas, key: Keyboard.Key) {
drawKey(canvas, key, config.noneKeyBackground, config.keyNoneTextColor)
}
/**
* 绘制Alt键
*/
private fun drawAltKey(canvas: Canvas, key: Keyboard.Key) {
drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor)
}
/**
* 绘制Delete键
*/
private fun drawDeleteKey(canvas: Canvas, key: Keyboard.Key) {
drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor, config.deleteDrawable)
}
/**
* 绘制Shift键
*/
private fun drawShiftKey(canvas: Canvas, key: Keyboard.Key) {
when {
isAllCaps -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor, config.capitalLockDrawable)
isCap -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor, config.capitalDrawable)
else -> drawKey(canvas, key, config.specialKeyBackground, config.keySpecialTextColor, config.lowerDrawable)
}
}
/**
* 绘制键盘按键
*/
private fun drawKey(canvas: Canvas, key: Keyboard.Key, keyBackground: Drawable?, textColor: Int, iconDrawable: Drawable? = key.icon, isDone: Boolean = false) {
//绘制按键背景
keyBackground?.run {
if (key.codes[0] != 0) {
state = key.currentDrawableState
}
setBounds(
key.x.plus(paddingLeft),
key.y.plus(paddingTop),
key.x.plus(paddingLeft).plus(key.width),
key.y.plus(paddingTop).plus(key.height)
)
draw(canvas)
}
//绘制键盘图标
iconDrawable?.run {
val drawable = DrawableCompat.wrap(this)
config.keyIconColor?.takeIf { it != 0 }?.let {
drawable.setTint(it)
}
key.icon = drawable
var iconWidth = key.icon.intrinsicWidth.toFloat()
var iconHeight = key.icon.intrinsicHeight.toFloat()
val widthRatio = iconWidth.div(key.width.toFloat())
val heightRatio = iconHeight.div(key.height.toFloat())
if (widthRatio <= heightRatio) {//当图标的宽占比小于等于高占比时,以高度比例为基准并控制在iconRatio比例范围内,进行同比例缩放
val ratio = heightRatio.coerceAtMost(iconRatio)
iconWidth = iconWidth.div(heightRatio).times(ratio)
iconHeight = iconHeight.div(heightRatio).times(ratio)
} else {//反之,则以宽度比例为基准并控制在iconRatio比例范围内,进行同比例缩放
val ratio = widthRatio.coerceAtMost(iconRatio)
iconWidth = iconWidth.div(widthRatio).times(ratio)
iconHeight = iconHeight.div(widthRatio).times(ratio)
}
val left = key.x.plus(paddingLeft).plus(key.width.minus(iconWidth).div(2f)).toInt()
val top = key.y.plus(paddingTop).plus(key.height.minus(iconHeight).div(2f)).toInt()
val right = left.plus(iconWidth).toInt()
val bottom = top.plus(iconHeight).toInt()
key.icon.setBounds(left, top, right, bottom)
key.icon.draw(canvas)
} ?: key.label?.let {
//绘制键盘文字
if (isDone) {
paint.textSize = config.keyDoneTextSize.toFloat()
} else if (it.length > 1 && key.codes.size < 2) {// 键盘key内容多个字符
paint.textSize = config.labelTextSize.toFloat()
} else {
paint.textSize = config.keyTextSize.toFloat()
}
paint.color = textColor
paint.typeface = Typeface.DEFAULT
canvas.drawText(
it.toString(),
key.x.plus(paddingLeft).plus(key.width.div(2f)),
key.y.plus(paddingTop).plus(key.height.div(2.0f)).plus(
paint.textSize.minus(paint.descent()).div(2.0f)
),
paint
)
}
}
fun setCap(isCap: Boolean) {
this.isCap = isCap
}
fun isCap(): Boolean {
return isCap
}
fun setAllCaps(isAllCaps: Boolean) {
this.isAllCaps = isAllCaps
}
fun isAllCaps(): Boolean {
return isAllCaps
}
/**
* Config为KingKeyboard的配置类,方便统一管理配置信息
*/
open class Config(context: Context) {
var deleteDrawable = context.getDrawable(R.drawable.king_keyboard_key_delete)
var lowerDrawable = context.getDrawable(R.drawable.king_keyboard_key_lower)
var capitalDrawable = context.getDrawable(R.drawable.king_keyboard_key_cap)
var capitalLockDrawable = context.getDrawable(R.drawable.king_keyboard_key_all_caps)
var cancelDrawable = context.getDrawable(R.drawable.king_keyboard_key_cancel)
var spaceDrawable = context.getDrawable(R.drawable.king_keyboard_key_space)
var labelTextSize = context.resources.getDimensionPixelSize(R.dimen.king_keyboard_label_text_size)
var keyTextSize = context.resources.getDimensionPixelSize(R.dimen.king_keyboard_text_size)
var keyTextColor = ContextCompat.getColor(context, R.color.king_keyboard_key_text_color)
var keyIconColor: Int? = null
var keySpecialTextColor = ContextCompat.getColor(context, R.color.king_keyboard_key_special_text_color)
var keyDoneTextColor = ContextCompat.getColor(context, R.color.king_keyboard_key_done_text_color)
var keyNoneTextColor = ContextCompat.getColor(context, R.color.king_keyboard_key_none_text_color)
var keyBackground = context.getDrawable(R.drawable.king_keyboard_key_bg)
var specialKeyBackground = context.getDrawable(R.drawable.king_keyboard_special_key_bg)
var doneKeyBackground = context.getDrawable(R.drawable.king_keyboard_done_key_bg)
var noneKeyBackground = context.getDrawable(R.drawable.king_keyboard_none_key_bg)
var keyDoneTextSize = context.resources.getDimensionPixelSize(R.dimen.king_keyboard_done_text_size)
var keyDoneText: CharSequence? = context.getString(R.string.king_keyboard_key_done_text)
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 556 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 979 B

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_done_key_bg_pressed" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_done_key_bg_normal" />
<corners android:radius="4dp" />
</shape>
</item>
</selector>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_key_bg_pressed" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_key_bg_normal" />
<corners android:radius="4dp" />
</shape>
</item>
</selector>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_none_key_bg_pressed" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_none_key_bg_normal" />
<corners android:radius="4dp" />
</shape>
</item>
</selector>
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_pressed="true">
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_special_key_bg_pressed" />
<corners android:radius="4dp" />
</shape>
</item>
<item>
<shape android:shape="rectangle">
<solid android:color="@color/king_keyboard_special_key_bg_normal" />
<corners android:radius="4dp" />
</shape>
</item>
</selector>
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:background="@drawable/king_keyboard_view_bg">
<com.king.keyboard.KingKeyboardView
android:id="@+id/keyboardView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:focusable="true"
android:focusableInTouchMode="true"
android:animateLayoutChanges="true"
android:paddingTop="@dimen/king_keyboard_view_padding_top"
android:paddingBottom="@dimen/king_keyboard_view_padding_bottom"
android:keyBackground="@drawable/king_keyboard_key_bg"
android:keyTextColor="@color/king_keyboard_key_text_color"
android:keyTextSize="@dimen/king_keyboard_text_size"
android:labelTextSize="@dimen/king_keyboard_label_text_size"/>
</RelativeLayout>
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="king_keyboard_key_done_text">完成</string>
<string name="king_keyboard_key_more_text">更多</string>
<string name="king_keyboard_key_back_text">返回</string>
</resources>
+106
View File
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="KingKeyboardView">
<attr name="android:labelTextSize"/>
<attr name="android:keyTextSize"/>
<attr name="android:keyTextColor"/>
<attr name="android:keyBackground"/>
<attr name="kkbDeleteDrawable" format="reference"/>
<attr name="kkbCapitalDrawable" format="reference"/>
<attr name="kkbCapitalLockDrawable" format="reference"/>
<attr name="kkbCancelDrawable" format="reference"/>
<attr name="kkbSpaceDrawable" format="reference"/>
<attr name="kkbSpecialKeyBackground" format="reference"/>
<attr name="kkbDoneKeyBackground" format="reference"/>
<attr name="kkbNoneKeyBackground" format="reference"/>
<attr name="kkbKeyIconColor" format="color"/>
<attr name="kkbKeySpecialTextColor" format="color"/>
<attr name="kkbKeyDoneTextColor" format="color"/>
<attr name="kkbKeyDoneTextSize" format="dimension"/>
<attr name="kkbKeyNoneTextColor" format="color"/>
<attr name="kkbKeyDoneText" format="string"/>
</declare-styleable>
<declare-styleable name="King_KeyboardView">
<attr name="android:keyBackground"/>
<attr name="android:keyTextSize"/>
<attr name="android:labelTextSize" />
<attr name="android:keyTextColor"/>
<attr name="android:keyPreviewLayout" />
<attr name="android:keyPreviewOffset" />
<attr name="android:keyPreviewHeight" />
<attr name="android:verticalCorrection" />
<attr name="android:popupLayout" />
<attr name="android:shadowColor" />
<attr name="android:shadowRadius" />
</declare-styleable>
<declare-styleable name="King_KeyboardViewPreviewState">
<attr name="android:state_long_pressable"/>
</declare-styleable>
<declare-styleable name="King_Keyboard">
<attr name="android:keyWidth" />
<attr name="android:keyHeight" />
<attr name="android:horizontalGap" />
<attr name="android:verticalGap"/>
</declare-styleable>
<declare-styleable name="King_Keyboard_Row">
<attr name="android:rowEdgeFlags"/>
<attr name="android:keyboardMode"/>
</declare-styleable>
<declare-styleable name="King_Keyboard_Key">
<attr name="android:codes"/>
<attr name="android:popupKeyboard"/>
<attr name="android:popupCharacters" />
<attr name="android:keyEdgeFlags"/>
<attr name="android:isModifier" />
<attr name="android:isSticky" />
<attr name="android:isRepeatable" />
<attr name="android:iconPreview"/>
<attr name="android:keyOutputText" />
<attr name="android:keyLabel" />
<attr name="android:keyIcon"/>
<attr name="android:keyboardMode" />
</declare-styleable>
</resources>
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="king_keyboard_key_text_color">#ff333333</color>
<color name="king_keyboard_key_special_text_color">#ff333333</color>
<color name="king_keyboard_key_done_text_color">#ffeeeeee</color>
<color name="king_keyboard_key_none_text_color">#7f999999</color>
<color name="king_keyboard_key_icon_color">#ff333333</color>
<color name="king_keyboard_key_bg_normal">#ffffffff</color>
<color name="king_keyboard_key_bg_pressed">#ffbbbbbb</color>
<color name="king_keyboard_special_key_bg_normal">#ffa8afbf</color>
<color name="king_keyboard_special_key_bg_pressed">#ff989faf</color>
<color name="king_keyboard_done_key_bg_normal">#ff0477ff</color>
<color name="king_keyboard_done_key_bg_pressed">#ff0467ef</color>
<color name="king_keyboard_none_key_bg_normal">#ffefefef</color>
<color name="king_keyboard_none_key_bg_pressed">#ffefefef</color>
</resources>
+22
View File
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen name="king_keyboard_key_height">48dp</dimen>
<dimen name="king_keyboard_key_height2">101dp</dimen>
<dimen name="king_keyboard_key_height3">154dp</dimen>
<dimen name="king_keyboard_vertical_gap">5dp</dimen>
<dimen name="king_keyboard_horizontal_gap">10dp</dimen>
<dimen name="king_keyboard_view_padding_top">6dp</dimen>
<dimen name="king_keyboard_view_padding_bottom">6dp</dimen>
<dimen name="king_keyboard_preview_height">56dp</dimen>
<dimen name="king_keyboard_text_size">20sp</dimen>
<dimen name="king_keyboard_done_text_size">20sp</dimen>
<dimen name="king_keyboard_label_text_size">16sp</dimen>
</resources>
@@ -0,0 +1,5 @@
<resources>
<string name="king_keyboard_key_done_text">Done</string>
<string name="king_keyboard_key_more_text">More</string>
<string name="king_keyboard_key_back_text">Back</string>
</resources>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="23.5%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2" />
<Key
android:codes="51"
android:keyLabel="3" />
<Key
android:codes="-5"
android:keyWidth="24.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="52"
android:keyLabel="4"
android:keyEdgeFlags="left"/>
<Key
android:codes="53"
android:keyLabel="5" />
<Key
android:codes="54"
android:keyLabel="6" />
<Key
android:codes="0"
android:keyWidth="24.5%p"/>
</Row>
<Row>
<Key
android:codes="55"
android:keyLabel="7"
android:keyEdgeFlags="left"/>
<Key
android:codes="56"
android:keyLabel="8" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="23.5%p"/>
<Key
android:codes="-4"
android:keyEdgeFlags="right"
android:keyWidth="24.5%p"
android:keyHeight="@dimen/king_keyboard_key_height2" />
</Row>
<Row>
<Key
android:codes="88"
android:keyLabel="X" />
<Key
android:codes="48"
android:keyLabel="0" />
<Key
android:codes="-3" />
</Row>
</Keyboard>
@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="13%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="97"
android:keyLabel="a"
android:keyWidth="11.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="98"
android:keyLabel="b"
android:keyWidth="11.4%p"/>
<Key
android:codes="99"
android:keyLabel="c"
android:keyWidth="11.3%p"/>
<Key
android:codes="100"
android:keyLabel="d"
android:keyWidth="11.3%p"/>
<Key
android:codes="101"
android:keyLabel="e"
android:keyWidth="11.3%p"/>
<Key
android:codes="102"
android:keyLabel="f"
android:keyWidth="11.3%p"/>
<Key
android:codes="103"
android:keyLabel="g"
android:keyWidth="11.4%p"/>
<Key
android:codes="104"
android:keyLabel="h"
android:keyWidth="11.5%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="105"
android:keyLabel="i"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="106"
android:keyLabel="j" />
<Key
android:codes="107"
android:keyLabel="k" />
<Key
android:codes="108"
android:keyLabel="l" />
<Key
android:codes="109"
android:keyLabel="m" />
<Key
android:codes="110"
android:keyLabel="n" />
<Key
android:codes="111"
android:keyLabel="o"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="112"
android:keyLabel="p"
android:keyWidth="13.5%p"/>
<Key
android:codes="113"
android:keyLabel="q" />
<Key
android:codes="114"
android:keyLabel="r" />
<Key
android:codes="115"
android:keyLabel="s" />
<Key
android:codes="116"
android:keyLabel="t" />
<Key
android:codes="117"
android:keyLabel="u" />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true" />
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="-1"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="118"
android:keyLabel="v" />
<Key
android:codes="119"
android:keyLabel="w" />
<Key
android:codes="120"
android:keyLabel="x" />
<Key
android:codes="121"
android:keyLabel="y" />
<Key
android:codes="122"
android:keyLabel="z" />
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,183 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2"
android:keyWidth="8.9%p" />
<Key
android:codes="51"
android:keyLabel="3"
android:keyWidth="8.9%p" />
<Key
android:codes="52"
android:keyLabel="4"
android:keyWidth="8.9%p" />
<Key
android:codes="53"
android:keyLabel="5"
android:keyWidth="8.9%p" />
<Key
android:codes="54"
android:keyLabel="6"
android:keyWidth="8.9%p" />
<Key
android:codes="55"
android:keyLabel="7"
android:keyWidth="8.9%p" />
<Key
android:codes="56"
android:keyLabel="8"
android:keyWidth="8.9%p" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="8.9%p" />
<Key
android:codes="48"
android:keyLabel="0"
android:keyWidth="8.9%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="113"
android:keyLabel="q"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="119"
android:keyLabel="w"
android:keyWidth="8.9%p"/>
<Key
android:codes="101"
android:keyLabel="e"
android:keyWidth="8.9%p" />
<Key
android:codes="114"
android:keyWidth="8.9%p"
android:keyLabel="r" />
<Key
android:codes="116"
android:keyLabel="t"
android:keyWidth="8.9%p"/>
<Key
android:codes="121"
android:keyLabel="y"
android:keyWidth="8.9%p"/>
<Key
android:codes="117"
android:keyLabel="u"
android:keyWidth="8.9%p"/>
<Key
android:codes="105"
android:keyLabel="i"
android:keyWidth="8.9%p"/>
<Key
android:codes="111"
android:keyLabel="o"
android:keyWidth="8.9%p"/>
<Key
android:codes="112"
android:keyLabel="p"
android:keyWidth="8.9%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="97"
android:keyLabel="a"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="115"
android:keyLabel="s"
android:keyWidth="8.9%p"/>
<Key
android:codes="100"
android:keyLabel="d"
android:keyWidth="8.9%p"/>
<Key
android:codes="102"
android:keyLabel="f"
android:keyWidth="8.9%p"/>
<Key
android:codes="103"
android:keyLabel="g"
android:keyWidth="8.9%p"/>
<Key
android:codes="104"
android:keyLabel="h"
android:keyWidth="8.9%p"/>
<Key
android:codes="106"
android:keyLabel="j"
android:keyWidth="8.9%p"/>
<Key
android:codes="107"
android:keyLabel="k"
android:keyWidth="8.9%p"/>
<Key
android:codes="108"
android:keyLabel="l"
android:keyWidth="8.9%p"/>
<Key
android:codes="-5"
android:keyWidth="8.9%p"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="-1"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="122"
android:keyLabel="z"
android:keyWidth="9%p"/>
<Key
android:codes="120"
android:keyLabel="x"
android:keyWidth="9%p"/>
<Key
android:codes="99"
android:keyLabel="c"
android:keyWidth="9%p"/>
<Key
android:codes="118"
android:keyLabel="v"
android:keyWidth="9%p"/>
<Key
android:codes="98"
android:keyLabel="b"
android:keyWidth="9%p"/>
<Key
android:codes="110"
android:keyLabel="n"
android:keyWidth="9%p"/>
<Key
android:codes="109"
android:keyLabel="m"
android:keyWidth="9%p"/>
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="0x4eac"
android:keyLabel="京"
android:keyEdgeFlags="left" />
<Key
android:codes="0x6d25"
android:keyLabel="津" />
<Key
android:codes="0x6caa"
android:keyLabel="沪" />
<Key
android:codes="0x6e1d"
android:keyLabel="渝" />
<Key
android:codes="0x5180"
android:keyLabel="冀" />
<Key
android:codes="0x8c6b"
android:keyLabel="豫" />
<Key
android:codes="0x4e91"
android:keyLabel="云" />
<Key
android:codes="0x8fbd"
android:keyLabel="辽" />
<Key
android:codes="0x9ed1"
android:keyLabel="黑" />
<Key
android:codes="0x6e58"
android:keyLabel="湘"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="0x7696"
android:keyLabel="皖"
android:keyEdgeFlags="left" />
<Key
android:codes="0x9c81"
android:keyLabel="鲁" />
<Key
android:codes="0x65b0"
android:keyLabel="新" />
<Key
android:codes="0x82cf"
android:keyLabel="苏" />
<Key
android:codes="0x6d59"
android:keyLabel="浙" />
<Key
android:codes="0x8d63"
android:keyLabel="赣" />
<Key
android:codes="0x9102"
android:keyLabel="鄂" />
<Key
android:codes="0x6842"
android:keyLabel="桂" />
<Key
android:codes="0x7518"
android:keyLabel="甘" />
<Key
android:codes="0x664b"
android:keyLabel="晋"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="-103"
android:keyLabel="@string/king_keyboard_key_more_text"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="0x8499"
android:keyLabel="蒙"
android:keyWidth="9%p"/>
<Key
android:codes="0x9655"
android:keyLabel="陕"
android:keyWidth="9%p"/>
<Key
android:codes="0x5409"
android:keyLabel="吉"
android:keyWidth="9%p"/>
<Key
android:codes="0x95fd"
android:keyLabel="闽"
android:keyWidth="9%p"/>
<Key
android:codes="0x8d35"
android:keyLabel="贵"
android:keyWidth="9%p"/>
<Key
android:codes="0x7ca4"
android:keyLabel="粤"
android:keyWidth="9%p"/>
<Key
android:codes="0x9752"
android:keyLabel="青"
android:keyWidth="9%p"/>
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="-2"
android:keyWidth="13.5%p"
android:keyIcon="@drawable/king_keyboard_key_license_plate_number"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="0x85cf"
android:keyLabel="藏"
android:keyWidth="9%p"/>
<Key
android:codes="0x5ddd"
android:keyLabel="川"
android:keyWidth="9%p"/>
<Key
android:codes="0x5b81"
android:keyLabel="宁"
android:keyWidth="9%p"/>
<Key
android:codes="0x743c"
android:keyLabel="琼"
android:keyWidth="9%p"/>
<Key
android:codes="0x6e2f"
android:keyLabel="港"
android:keyWidth="9%p"/>
<Key
android:codes="0x6fb3"
android:keyLabel="澳"
android:keyWidth="9%p"/>
<Key
android:codes="0x6302"
android:keyLabel="挂"
android:keyWidth="9%p"/>
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="0x4eac"
android:keyLabel="京"
android:keyEdgeFlags="left" />
<Key
android:codes="0x6d25"
android:keyLabel="津" />
<Key
android:codes="0x6caa"
android:keyLabel="沪" />
<Key
android:codes="0x6e1d"
android:keyLabel="渝" />
<Key
android:codes="0x5180"
android:keyLabel="冀" />
<Key
android:codes="0x8c6b"
android:keyLabel="豫" />
<Key
android:codes="0x4e91"
android:keyLabel="云" />
<Key
android:codes="0x8fbd"
android:keyLabel="辽" />
<Key
android:codes="0x9ed1"
android:keyLabel="黑" />
<Key
android:codes="0x6e58"
android:keyLabel="湘"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="0x7696"
android:keyLabel="皖"
android:keyEdgeFlags="left" />
<Key
android:codes="0x9c81"
android:keyLabel="鲁" />
<Key
android:codes="0x65b0"
android:keyLabel="新" />
<Key
android:codes="0x82cf"
android:keyLabel="苏" />
<Key
android:codes="0x6d59"
android:keyLabel="浙" />
<Key
android:codes="0x8d63"
android:keyLabel="赣" />
<Key
android:codes="0x9102"
android:keyLabel="鄂" />
<Key
android:codes="0x6842"
android:keyLabel="桂" />
<Key
android:codes="0x7518"
android:keyLabel="甘" />
<Key
android:codes="0x664b"
android:keyLabel="晋"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="-102"
android:keyLabel="@string/king_keyboard_key_back_text"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="0x8499"
android:keyLabel="蒙"
android:keyWidth="9%p"/>
<Key
android:codes="0x9655"
android:keyLabel="陕"
android:keyWidth="9%p"/>
<Key
android:codes="0x5409"
android:keyLabel="吉"
android:keyWidth="9%p"/>
<Key
android:codes="0x95fd"
android:keyLabel="闽"
android:keyWidth="9%p"/>
<Key
android:codes="0x8d35"
android:keyLabel="贵"
android:keyWidth="9%p"/>
<Key
android:codes="0x7ca4"
android:keyLabel="粤"
android:keyWidth="9%p"/>
<Key
android:codes="0x9752"
android:keyLabel="青"
android:keyWidth="9%p"/>
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="-2"
android:keyWidth="13.5%p"
android:keyIcon="@drawable/king_keyboard_key_license_plate_number"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="0x4f7f"
android:keyLabel="使"
android:keyWidth="9%p"/>
<Key
android:codes="0x9886"
android:keyLabel="领"
android:keyWidth="9%p"/>
<Key
android:codes="0x5b66"
android:keyLabel="学"
android:keyWidth="9%p"/>
<Key
android:codes="0x8b66"
android:keyLabel="警"
android:keyWidth="9%p"/>
<Key
android:codes="0x8bd5"
android:keyLabel="试"
android:keyWidth="9%p"/>
<Key
android:codes="0x8d85"
android:keyLabel="超"
android:keyWidth="9%p"/>
<Key
android:codes="0x4e34"
android:keyLabel="临"
android:keyWidth="9%p"/>
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2" />
<Key
android:codes="51"
android:keyLabel="3" />
<Key
android:codes="52"
android:keyLabel="4" />
<Key
android:codes="53"
android:keyLabel="5" />
<Key
android:codes="54"
android:keyLabel="6" />
<Key
android:codes="55"
android:keyLabel="7" />
<Key
android:codes="56"
android:keyLabel="8" />
<Key
android:codes="57"
android:keyLabel="9" />
<Key
android:codes="48"
android:keyLabel="0"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="81"
android:keyLabel="Q"
android:keyEdgeFlags="left" />
<Key
android:codes="87"
android:keyLabel="W" />
<Key
android:codes="69"
android:keyLabel="E" />
<Key
android:codes="82"
android:keyLabel="R" />
<Key
android:codes="84"
android:keyLabel="T" />
<Key
android:codes="89"
android:keyLabel="Y" />
<Key
android:codes="85"
android:keyLabel="U" />
<Key
android:codes="0"
android:keyLabel="I" />
<Key
android:codes="0"
android:keyLabel="O" />
<Key
android:codes="80"
android:keyLabel="P"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="65"
android:keyLabel="A"
android:keyEdgeFlags="left" />
<Key
android:codes="83"
android:keyLabel="S" />
<Key
android:codes="68"
android:keyLabel="D" />
<Key
android:codes="70"
android:keyLabel="F" />
<Key
android:codes="71"
android:keyLabel="G" />
<Key
android:codes="72"
android:keyLabel="H" />
<Key
android:codes="74"
android:keyLabel="J" />
<Key
android:codes="75"
android:keyLabel="K" />
<Key
android:codes="76"
android:keyLabel="L" />
<Key
android:codes="-5"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="-102"
android:keyWidth="13.5%p"
android:keyIcon="@drawable/king_keyboard_key_license_plate"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="90"
android:keyLabel="Z"
android:keyWidth="9%p"/>
<Key
android:codes="88"
android:keyLabel="X"
android:keyWidth="9%p"/>
<Key
android:codes="67"
android:keyLabel="C"
android:keyWidth="9%p"/>
<Key
android:codes="86"
android:keyLabel="V"
android:keyWidth="9%p"/>
<Key
android:codes="66"
android:keyLabel="B"
android:keyWidth="9%p"/>
<Key
android:codes="78"
android:keyLabel="N"
android:keyWidth="9%p"/>
<Key
android:codes="77"
android:keyLabel="M"
android:keyWidth="9%p"/>
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="0x4eac"
android:keyLabel="京"
android:keyEdgeFlags="left" />
<Key
android:codes="0x6d25"
android:keyLabel="津" />
<Key
android:codes="0x6caa"
android:keyLabel="沪" />
<Key
android:codes="0x6e1d"
android:keyLabel="渝" />
<Key
android:codes="0x5180"
android:keyLabel="冀" />
<Key
android:codes="0x8c6b"
android:keyLabel="豫" />
<Key
android:codes="0x4e91"
android:keyLabel="云" />
<Key
android:codes="0x8fbd"
android:keyLabel="辽" />
<Key
android:codes="0x9ed1"
android:keyLabel="黑" />
<Key
android:codes="0x6e58"
android:keyLabel="湘"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="0x7696"
android:keyLabel="皖"
android:keyEdgeFlags="left" />
<Key
android:codes="0x9c81"
android:keyLabel="鲁" />
<Key
android:codes="0x65b0"
android:keyLabel="新" />
<Key
android:codes="0x82cf"
android:keyLabel="苏" />
<Key
android:codes="0x6d59"
android:keyLabel="浙" />
<Key
android:codes="0x8d63"
android:keyLabel="赣" />
<Key
android:codes="0x9102"
android:keyLabel="鄂" />
<Key
android:codes="0x6842"
android:keyLabel="桂" />
<Key
android:codes="0x7518"
android:keyLabel="甘" />
<Key
android:codes="0x664b"
android:keyLabel="晋"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="0x8499"
android:keyLabel="蒙"
android:keyEdgeFlags="left" />
<Key
android:codes="0x9655"
android:keyLabel="陕" />
<Key
android:codes="0x5409"
android:keyLabel="吉" />
<Key
android:codes="0x95fd"
android:keyLabel="闽" />
<Key
android:codes="0x8d35"
android:keyLabel="贵" />
<Key
android:codes="0x7ca4"
android:keyLabel="粤" />
<Key
android:codes="0x9752"
android:keyLabel="青" />
<Key
android:codes="0x85cf"
android:keyLabel="藏" />
<Key
android:codes="0x5ddd"
android:keyLabel="川" />
<Key
android:codes="-5"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="-2"
android:keyWidth="13.5%p"
android:keyIcon="@drawable/king_keyboard_key_license_plate_number"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="0x5b81"
android:keyLabel="宁"
android:keyWidth="9%p"/>
<Key
android:codes="0x743c"
android:keyLabel="琼"
android:keyWidth="9%p"/>
<Key
android:codes="0x6e2f"
android:keyLabel="港"
android:keyWidth="9%p"/>
<Key
android:codes="0x6fb3"
android:keyLabel="澳"
android:keyWidth="9%p"/>
<Key
android:codes="0x6302"
android:keyLabel="挂"
android:keyWidth="9%p"/>
<Key
android:codes="0x5b66"
android:keyLabel="学"
android:keyWidth="9%p"/>
<Key
android:codes="0x8b66"
android:keyLabel="警"
android:keyWidth="9%p"/>
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="13%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="97"
android:keyLabel="a"
android:keyWidth="13.5%p" />
<Key
android:codes="98"
android:keyLabel="b" />
<Key
android:codes="99"
android:keyLabel="c" />
<Key
android:codes="100"
android:keyLabel="d" />
<Key
android:codes="101"
android:keyLabel="e" />
<Key
android:codes="102"
android:keyLabel="f" />
<Key
android:codes="103"
android:keyLabel="g"
android:keyWidth="13.5%p" />
</Row>
<Row>
<Key
android:codes="104"
android:keyLabel="h"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left"/>
<Key
android:codes="105"
android:keyLabel="i" />
<Key
android:codes="106"
android:keyLabel="j" />
<Key
android:codes="107"
android:keyLabel="k" />
<Key
android:codes="108"
android:keyLabel="l" />
<Key
android:codes="109"
android:keyLabel="m" />
<Key
android:codes="110"
android:keyLabel="n"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="111"
android:keyLabel="o"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left"/>
<Key
android:codes="112"
android:keyLabel="p" />
<Key
android:codes="113"
android:keyLabel="q" />
<Key
android:codes="114"
android:keyLabel="r" />
<Key
android:codes="115"
android:keyLabel="s" />
<Key
android:codes="116"
android:keyLabel="t" />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right"/>
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="117"
android:keyLabel="u"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left"/>
<Key
android:codes="118"
android:keyLabel="v" />
<Key
android:codes="119"
android:keyLabel="w" />
<Key
android:codes="120"
android:keyLabel="x" />
<Key
android:codes="121"
android:keyLabel="y" />
<Key
android:codes="122"
android:keyLabel="z" />
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,141 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="113"
android:keyLabel="q"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="119"
android:keyLabel="w"
android:keyWidth="8.9%p"/>
<Key
android:codes="101"
android:keyLabel="e"
android:keyWidth="8.9%p" />
<Key
android:codes="114"
android:keyWidth="8.9%p"
android:keyLabel="r" />
<Key
android:codes="116"
android:keyLabel="t"
android:keyWidth="8.9%p"/>
<Key
android:codes="121"
android:keyLabel="y"
android:keyWidth="8.9%p"/>
<Key
android:codes="117"
android:keyLabel="u"
android:keyWidth="8.9%p"/>
<Key
android:codes="105"
android:keyLabel="i"
android:keyWidth="8.9%p"/>
<Key
android:codes="111"
android:keyLabel="o"
android:keyWidth="8.9%p"/>
<Key
android:codes="112"
android:keyLabel="p"
android:keyWidth="8.9%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="97"
android:keyLabel="a"
android:horizontalGap="5.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="115"
android:keyLabel="s" />
<Key
android:codes="100"
android:keyLabel="d" />
<Key
android:codes="102"
android:keyLabel="f" />
<Key
android:codes="103"
android:keyLabel="g" />
<Key
android:codes="104"
android:keyLabel="h" />
<Key
android:codes="106"
android:keyLabel="j" />
<Key
android:codes="107"
android:keyLabel="k" />
<Key
android:codes="108"
android:keyLabel="l"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="-1"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="122"
android:keyLabel="z" />
<Key
android:codes="120"
android:keyLabel="x" />
<Key
android:codes="99"
android:keyLabel="c" />
<Key
android:codes="118"
android:keyLabel="v" />
<Key
android:codes="98"
android:keyLabel="b" />
<Key
android:codes="110"
android:keyLabel="n" />
<Key
android:codes="109"
android:keyLabel="m" />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true" />
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="-2"
android:keyLabel="\?123"
android:keyWidth="17%p" />
<Key
android:codes="46"
android:keyLabel="."
android:keyWidth="12%p" />
<Key
android:codes="32"
android:keyWidth="36%p"
android:isRepeatable="false"/>
<Key
android:codes="63"
android:keyLabel="\?"
android:keyWidth="12%p" />
<Key
android:codes="-3"
android:keyWidth="17%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2"
android:keyWidth="8.9%p" />
<Key
android:codes="51"
android:keyLabel="3"
android:keyWidth="8.9%p" />
<Key
android:codes="52"
android:keyLabel="4"
android:keyWidth="8.9%p" />
<Key
android:codes="53"
android:keyLabel="5"
android:keyWidth="8.9%p" />
<Key
android:codes="54"
android:keyLabel="6"
android:keyWidth="8.9%p"
/>
<Key
android:codes="55"
android:keyLabel="7"
android:keyWidth="8.9%p" />
<Key
android:codes="56"
android:keyLabel="8"
android:keyWidth="8.9%p" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="8.9%p" />
<Key
android:codes="48"
android:keyLabel="0"
android:keyWidth="8.9%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="33"
android:keyLabel="!"
android:horizontalGap="5.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="64"
android:keyLabel="\@" />
<Key
android:codes="35"
android:keyLabel="#" />
<Key
android:codes="36"
android:keyLabel="\$" />
<Key
android:codes="37"
android:keyLabel="%" />
<Key
android:codes="38"
android:keyLabel="&amp;" />
<Key
android:codes="42"
android:keyLabel="*" />
<Key
android:codes="40"
android:keyLabel="(" />
<Key
android:codes="41"
android:keyLabel=")"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="-103"
android:keyLabel="@string/king_keyboard_key_more_text"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="39"
android:keyLabel="'" />
<Key
android:codes="47"
android:keyLabel="/" />
<Key
android:codes="45"
android:keyLabel="-" />
<Key
android:codes="95"
android:keyLabel="_" />
<Key
android:codes="58"
android:keyLabel=":" />
<Key
android:codes="59"
android:keyLabel=";" />
<Key
android:codes="44"
android:keyLabel="," />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true" />
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="-102"
android:keyWidth="17%p"
android:keyLabel="@string/king_keyboard_key_back_text" />
<Key
android:codes="46"
android:keyWidth="12%p"
android:keyLabel="." />
<Key
android:codes="32"
android:isRepeatable="false"
android:keyWidth="36%p"
android:keyLabel="" />
<Key
android:codes="63"
android:keyWidth="12%p"
android:keyLabel="\?" />
<Key
android:codes="-3"
android:keyWidth="17%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,147 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="9%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="91"
android:keyLabel="["
android:horizontalGap="1%p"
android:keyWidth="8.9%p"
android:keyEdgeFlags="left" />
<Key
android:codes="93"
android:keyLabel="]"
android:keyWidth="8.9%p" />
<Key
android:codes="123"
android:keyLabel="{"
android:keyWidth="8.9%p" />
<Key
android:codes="125"
android:keyLabel="}"
android:keyWidth="8.9%p" />
<Key
android:codes="35"
android:keyLabel="#"
android:keyWidth="8.9%p" />
<Key
android:codes="37"
android:keyLabel="%"
android:keyWidth="8.9%p"
/>
<Key
android:codes="94"
android:keyLabel="^"
android:keyWidth="8.9%p" />
<Key
android:codes="96"
android:keyLabel="`"
android:keyWidth="8.9%p" />
<Key
android:codes="43"
android:keyLabel="+"
android:keyWidth="8.9%p" />
<Key
android:codes="61"
android:keyLabel="="
android:keyWidth="8.9%p"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="126"
android:keyLabel="~"
android:horizontalGap="5.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="92"
android:keyLabel="\\" />
<Key
android:codes="124"
android:keyLabel="|" />
<Key
android:codes="60"
android:keyLabel="&lt;" />
<Key
android:codes="62"
android:keyLabel="&gt;" />
<Key
android:codes="165"
android:keyLabel="¥" />
<Key
android:codes="8364"
android:keyLabel="€" />
<Key
android:codes="163"
android:keyLabel="£" />
<Key
android:codes="8356"
android:keyLabel="₤"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="-101"
android:keyLabel="123"
android:keyWidth="13.5%p"
android:isModifier="true"
android:isSticky="true"
android:keyEdgeFlags="left" />
<Key
android:codes="39"
android:keyLabel="'" />
<Key
android:codes="47"
android:keyLabel="/" />
<Key
android:codes="45"
android:keyLabel="-" />
<Key
android:codes="95"
android:keyLabel="_" />
<Key
android:codes="58"
android:keyLabel=":" />
<Key
android:codes="59"
android:keyLabel=";" />
<Key
android:codes="44"
android:keyLabel="," />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true" />
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="-102"
android:keyWidth="17%p"
android:keyLabel="@string/king_keyboard_key_back_text" />
<Key
android:codes="46"
android:keyWidth="12%p"
android:keyLabel="." />
<Key
android:codes="32"
android:isRepeatable="false"
android:keyWidth="36%p"
android:keyLabel="" />
<Key
android:codes="63"
android:keyWidth="12%p"
android:keyLabel="\?" />
<Key
android:codes="-3"
android:keyWidth="17%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="23.5%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2" />
<Key
android:codes="51"
android:keyLabel="3" />
<Key
android:codes="-5"
android:keyWidth="24.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="52"
android:keyLabel="4"
android:keyEdgeFlags="left"/>
<Key
android:codes="53"
android:keyLabel="5" />
<Key
android:codes="54"
android:keyLabel="6" />
<Key
android:codes="0"
android:keyWidth="24.5%p"/>
</Row>
<Row>
<Key
android:codes="55"
android:keyLabel="7"
android:keyEdgeFlags="left"/>
<Key
android:codes="56"
android:keyLabel="8" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="23.5%p"/>
<Key
android:codes="-4"
android:keyEdgeFlags="right"
android:keyWidth="24.5%p"
android:keyHeight="@dimen/king_keyboard_key_height2" />
</Row>
<Row>
<Key
android:codes="0"
android:keyLabel="" />
<Key
android:codes="48"
android:keyLabel="0" />
<Key
android:codes="-3" />
</Row>
</Keyboard>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="23.5%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2" />
<Key
android:codes="51"
android:keyLabel="3" />
<Key
android:codes="-5"
android:keyWidth="24.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="52"
android:keyLabel="4"
android:keyEdgeFlags="left"/>
<Key
android:codes="53"
android:keyLabel="5" />
<Key
android:codes="54"
android:keyLabel="6" />
<Key
android:codes="0"
android:keyWidth="24.5%p"/>
</Row>
<Row>
<Key
android:codes="55"
android:keyLabel="7"
android:keyEdgeFlags="left"/>
<Key
android:codes="56"
android:keyLabel="8" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="23.5%p"/>
<Key
android:codes="-4"
android:keyEdgeFlags="right"
android:keyWidth="24.5%p"
android:keyHeight="@dimen/king_keyboard_key_height2" />
</Row>
<Row>
<Key
android:codes="46"
android:keyLabel="." />
<Key
android:codes="48"
android:keyLabel="0" />
<Key
android:codes="-3" />
</Row>
</Keyboard>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="23.5%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="49"
android:keyLabel="1"
android:keyEdgeFlags="left" />
<Key
android:codes="50"
android:keyLabel="2" />
<Key
android:codes="51"
android:keyLabel="3" />
<Key
android:codes="-5"
android:keyWidth="24.5%p"
android:isRepeatable="true"
android:keyEdgeFlags="right" />
</Row>
<Row>
<Key
android:codes="52"
android:keyLabel="4"
android:keyEdgeFlags="left"/>
<Key
android:codes="53"
android:keyLabel="5" />
<Key
android:codes="54"
android:keyLabel="6" />
<Key
android:codes="0"
android:keyWidth="24.5%p"/>
</Row>
<Row>
<Key
android:codes="55"
android:keyLabel="7"
android:keyEdgeFlags="left"/>
<Key
android:codes="56"
android:keyLabel="8" />
<Key
android:codes="57"
android:keyLabel="9"
android:keyWidth="23.5%p"/>
<Key
android:codes="-4"
android:keyEdgeFlags="right"
android:keyWidth="24.5%p"
android:keyHeight="@dimen/king_keyboard_key_height2" />
</Row>
<Row>
<Key
android:codes="45"
android:keyLabel="-" />
<Key
android:codes="48"
android:keyLabel="0" />
<Key
android:codes="-3" />
</Row>
</Keyboard>
@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<Keyboard xmlns:android="http://schemas.android.com/apk/res/android"
android:horizontalGap="1%p"
android:keyWidth="13%p"
android:keyHeight="@dimen/king_keyboard_key_height"
android:verticalGap="@dimen/king_keyboard_vertical_gap">
<Row>
<Key
android:codes="65"
android:keyLabel="A"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left" />
<Key
android:codes="66"
android:keyLabel="B" />
<Key
android:codes="67"
android:keyLabel="C" />
<Key
android:codes="68"
android:keyLabel="D" />
<Key
android:codes="69"
android:keyLabel="E" />
<Key
android:codes="70"
android:keyLabel="F" />
<Key
android:codes="71"
android:keyLabel="G"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="72"
android:keyLabel="H"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left"/>
<Key
android:codes="73"
android:keyLabel="I" />
<Key
android:codes="74"
android:keyLabel="J" />
<Key
android:codes="75"
android:keyLabel="K" />
<Key
android:codes="76"
android:keyLabel="L" />
<Key
android:codes="77"
android:keyLabel="M" />
<Key
android:codes="78"
android:keyLabel="N"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right"/>
</Row>
<Row>
<Key
android:codes="79"
android:keyLabel="O"
android:keyWidth="13.5%p"/>
<Key
android:codes="80"
android:keyLabel="P" />
<Key
android:codes="81"
android:keyLabel="Q" />
<Key
android:codes="82"
android:keyLabel="R" />
<Key
android:codes="83"
android:keyLabel="S" />
<Key
android:codes="84"
android:keyLabel="T" />
<Key
android:codes="-5"
android:keyWidth="13.5%p"
android:isRepeatable="true" />
</Row>
<Row android:rowEdgeFlags="bottom">
<Key
android:codes="85"
android:keyLabel="U"
android:keyWidth="13.5%p"
android:keyEdgeFlags="left"/>
<Key
android:codes="86"
android:keyLabel="V" />
<Key
android:codes="87"
android:keyLabel="W" />
<Key
android:codes="88"
android:keyLabel="X" />
<Key
android:codes="89"
android:keyLabel="Y" />
<Key
android:codes="90"
android:keyLabel="Z" />
<Key
android:codes="-3"
android:keyWidth="13.5%p"
android:keyEdgeFlags="right" />
</Row>
</Keyboard>
@@ -0,0 +1,18 @@
package com.king.keyboard
import org.junit.Test
import org.junit.Assert.*
/**
* Example local unit test, which will execute on the development machine (host).
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
class ExampleUnitTest {
@Test
fun addition_isCorrect() {
assertEquals(4, 2 + 2)
}
}
@@ -6,76 +6,88 @@ public class VersionBean implements Serializable {
private int versionId;
private int version;
private String versionName;
private String introduce;
private String updateType;
private String createTime;
private String remark;
private String apkUrl;
private ParamsDao data;
public String getApkUrl() {
return apkUrl;
public ParamsDao getData() {
return data;
}
public void setApkUrl(String apkUrl) {
this.apkUrl = apkUrl;
public void setData(ParamsDao data) {
this.data = data;
}
public int getVersionId() {
return versionId;
}
public static class ParamsDao implements Serializable{
private int versionId;
private int version;
private String versionName;
private String introduce;
private String updateType;
private String createTime;
private String remark;
private String apkUrl;
public void setVersionId(int versionId) {
this.versionId = versionId;
}
public String getApkUrl() {
return apkUrl;
}
public int getVersion() {
return version;
}
public void setApkUrl(String apkUrl) {
this.apkUrl = apkUrl;
}
public void setVersion(int version) {
this.version = version;
}
public int getVersionId() {
return versionId;
}
public String getVersionName() {
return versionName;
}
public void setVersionId(int versionId) {
this.versionId = versionId;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public int getVersion() {
return version;
}
public String getIntroduce() {
return introduce;
}
public void setVersion(int version) {
this.version = version;
}
public void setIntroduce(String introduce) {
this.introduce = introduce;
}
public String getVersionName() {
return versionName;
}
public String getUpdateType() {
return updateType;
}
public void setVersionName(String versionName) {
this.versionName = versionName;
}
public void setUpdateType(String updateType) {
this.updateType = updateType;
}
public String getIntroduce() {
return introduce;
}
public String getCreateTime() {
return createTime;
}
public void setIntroduce(String introduce) {
this.introduce = introduce;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getUpdateType() {
return updateType;
}
public String getRemark() {
return remark;
}
public void setUpdateType(String updateType) {
this.updateType = updateType;
}
public void setRemark(String remark) {
this.remark = remark;
public String getCreateTime() {
return createTime;
}
public void setCreateTime(String createTime) {
this.createTime = createTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
}
}
@@ -66,7 +66,7 @@ public class VersionUtils {
Type type = new TypeToken<CommonResponseBean<VersionBean>>() {
}.getType();
CommonResponseBean<VersionBean> o = JsonUtils.getInstance().fromJson(result, type);
VersionBean data = o.getData();
VersionBean.ParamsDao data = o.getData().getData();
if ("1".equals(data.getUpdateType())) {
downloadBuilder.setForceRedownload(true);
}else{
@@ -74,9 +74,9 @@ public class VersionUtils {
}
if (AppUtils.getAppVersionCode() < data.getVersion()) {
UIData uiData = UIData.create();
uiData.setTitle(o.getData().getVersionName());
uiData.setDownloadUrl(o.getData().getApkUrl());
uiData.setContent(o.getData().getIntroduce());
uiData.setTitle(data.getVersionName());
uiData.setDownloadUrl(data.getApkUrl());
uiData.setContent(data.getIntroduce());
return uiData;
}
if (isShow){
@@ -0,0 +1,39 @@
package com.dahe.mylibrary.weight;
import android.text.InputFilter;
import android.text.Spanned;
/**
* @ClassName InputFilterMinMax
* @Author 用户
* @Date 2022/4/6 11:35
* @Description TODO
*/
public class InputFilterMinMax implements InputFilter {
private int min, max;
public InputFilterMinMax(int min, int max) {
this.min = min;
this.max = max;
}
public InputFilterMinMax(String min, String max) {
this.min = Integer.parseInt(min);
this.max = Integer.parseInt(max);
}
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
try {
int input = Integer.parseInt(dest.toString() + source.toString());
if (isInRange(min, max, input))
return null;
} catch (NumberFormatException nfe) { }
return "";
}
private boolean isInRange(int a, int b, int c) {
return b > a ? c >= a && c <= b : c >= b && c <= a;
}
}
@@ -0,0 +1,94 @@
package com.dahe.mylibrary.weight;
import android.text.InputFilter;
import android.text.Spanned;
import android.text.TextUtils;
import android.util.Log;
/**
* @ClassName NumRangeInputFilter
* @Author 用户
* @Date 2022/4/6 11:38
* @Description TODO
*/
public class NumRangeInputFilter implements InputFilter {
// 只允许输入数字和小数点
private static final String REGEX = "([0-9]|\\.)*";
// 输入的最大金额
private static final double MAX_VALUE = 99.999;
// 小数点后的位数
private static final int POINTER_LENGTH = 3;
private static final String POINTER = ".";
private static final String ZERO_ZERO = "00";
/**
* @param source 新输入的字符串
* @param start 新输入的字符串起始下标,一般为0
* @param end 新输入的字符串终点下标,一般为source长度-1
* @param dest 输入之前文本框内容
* @param dstart 原内容起始坐标,一般为0
* @param dend 原内容终点坐标,一般为dest长度-1
* @return 输入内容
*/
@Override
public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
String sourceText = source.toString();
String destText = dest.toString();
// 新输入的字符串为空(删除剪切等)
if (TextUtils.isEmpty(sourceText)) {
return "";
}
// 拼成字符串
String temp = destText.substring(0, dstart)
+ sourceText.substring(start, end)
+ destText.substring(dend, dest.length());
Log.v("temp", "-" + temp);
// 纯数字加小数点
if (!temp.matches(REGEX)) {
Log.d("TAG", "!纯数字加小数点");
return dest.subSequence(dstart, dend);
}
// 小数点的情况
if (temp.contains(POINTER)) {
// 第一位就是小数点
if (temp.startsWith(POINTER)) {
Log.d("TAG", "第一位就是小数点");
return dest.subSequence(dstart, dend);
}
// 不止一个小数点
if(temp.indexOf(POINTER) != temp.lastIndexOf(POINTER)) {
Log.d("TAG", "不止一个小数点");
return dest.subSequence(dstart, dend);
}
}
double sumText = Double.parseDouble(temp);
if (sumText > MAX_VALUE) {
// 超出最大值
Log.d("TAG", "超出最大值");
return dest.subSequence(dstart, dend);
}
// 有小数点的情况下
if (temp.contains(POINTER)) {
//验证小数点精度,保证小数点后只能输入两位
if (!temp.endsWith(POINTER) && temp.split("\\.")[1].length() > POINTER_LENGTH) {
Log.d("TAG", "保证小数点后只能输入两位");
return dest.subSequence(dstart, dend);
}
} else if (temp.startsWith(POINTER) || temp.startsWith(ZERO_ZERO)) {
// 首位只能有一个0
Log.d("TAG", "首位只能有一个0");
return dest.subSequence(dstart, dend);
}
Log.d("TAG", "正常情况");
return source;
}
}
@@ -18,7 +18,7 @@
android:maxLength="12"
android:maxLines="1"
android:textColor="@color/white"
android:textSize="@dimen/text_18sp"
android:textSize="18dp"
android:textStyle="bold" />
<TextView
+1
View File
@@ -1,3 +1,4 @@
rootProject.name = "Pass"
include ':app'
include ':mylibrary'
include ':keybordlib'