parent
ddd7351fdb
commit
a2a8310573
|
|
@ -10,8 +10,10 @@ android {
|
|||
applicationId "com.ycgis.macall.personalcenter"
|
||||
minSdkVersion 23
|
||||
targetSdkVersion 30
|
||||
versionCode 2401171
|
||||
versionName "3.0.20240117"
|
||||
versionCode 2506051
|
||||
versionName "3.1.20250605.01"
|
||||
// versionCode 2000000
|
||||
// versionName "2.0.202403221"
|
||||
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
|
|
@ -99,5 +101,17 @@ dependencies {
|
|||
//Zxing 二维码识别
|
||||
implementation 'com.github.jenly1314:zxing-lite:2.1.1'
|
||||
|
||||
// implementation('com.github.gzu-liyujiang:Android_CN_OAID:4.2.5.1') {
|
||||
// // 如果使用了移动安全联盟SDK,共存的话需排除掉本项目依赖的华为/荣耀官方广告标识服务SDK,因为移动安全联盟SDK也依赖了华为/荣耀的SDK
|
||||
// // 如果华为官方广告标识服务SDK下载失败或编译报错的话,可考虑在 build.gradle 中增加以下配置:
|
||||
// // repositories { maven { url 'https://developer.huawei.com/repo' } }
|
||||
// // runtimeOnly "com.huawei.hms:ads-identifier:3.4.62.300"
|
||||
// exclude group: 'com.huawei.hms', module: 'ads-identifier'
|
||||
// // 荣耀官方广告标识服务SDK同理:
|
||||
// // repositories { maven { url 'https://developer.hihonor.com/repo' } }
|
||||
// // runtimeOnly "com.hihonor.mcs:ads-identifier:1.0.2.301"
|
||||
// exclude group: 'com.hihonor.mcs', module: 'ads-identifier'
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -20,12 +20,20 @@
|
|||
# hide the original source file name.
|
||||
#-renamesourcefileattribute SourceFile
|
||||
|
||||
|
||||
|
||||
#设备标识符
|
||||
-dontwarn com.github.gzuliyujiang.oaid.**
|
||||
-keep class com.github.gzuliyujiang.oaid.** { *; }
|
||||
|
||||
#统一认证
|
||||
-dontwarn com.anhui.police.auth.**
|
||||
-keep class com.anhui.police.auth.** { *; }
|
||||
|
||||
#应用中心
|
||||
-dontwarn com.anhui.police.market.sdk.**
|
||||
-keep class com.anhui.police.market.** { *; }
|
||||
|
||||
#统一服务组件
|
||||
-dontwarn com.ruansee.macall.unifyservemodulesdk.**
|
||||
-keep class com.ruansee.macall.unifyservemodulesdk.** { *; }
|
||||
|
|
@ -34,10 +42,20 @@
|
|||
-dontwarn com.rs.macall.androidx.basemodel.**
|
||||
-keep class com.rs.macall.androidx.basemodel.** { *; }
|
||||
|
||||
#Base64编码
|
||||
-dontwarn com.base.code.binary.**
|
||||
-keep class com.base.code.binary.** { *; }
|
||||
|
||||
#加载动画
|
||||
-dontwarn com.wang.avi.**
|
||||
-keep class com.wang.avi.** { *; }
|
||||
|
||||
#广告ID
|
||||
-dontwarn com.github.gzuliyujiang.oaid.**
|
||||
-keep class com.github.gzuliyujiang.oaid.** { *; }
|
||||
-dontwarn repeackage.com.**
|
||||
-keep class repeackage.com.** { *; }
|
||||
|
||||
-keep public class * extends androidx.fragment.app.FragmentActivity
|
||||
-keep public class * extends android.app.Application
|
||||
-keep public class * extends androidx.core.content.FileProvider
|
||||
|
|
@ -55,13 +73,14 @@
|
|||
|
||||
-keep public class com.ycgis.macall.personalcenter.p.app.CrashHandler{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.app.RuanseeApplication{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.app.MyAppGlideModule{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.app.UserData{*;}
|
||||
#-keep public class com.ycgis.macall.personalcenter.p.app.AppCache{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.app.AppCache{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.callback.RequestCallback{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.callback.WebActivityCallback{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.presenter.**{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.request.interceptors.**{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.request.interceptors.HttpLoggingInterceptor{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.request.ApiModel{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.request.HttpErrorHandler{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.p.request.RetrofitApi{*;}
|
||||
|
|
@ -69,6 +88,7 @@
|
|||
-keep public class com.ycgis.macall.personalcenter.p.request.UploadProgressResponsBody{*;}
|
||||
|
||||
-keep public class com.ycgis.macall.personalcenter.m.adapterbean.**{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.m.datamodel.PrintModel{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.m.event.MessageEvent{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.m.enumbean.**{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.m.provider.**{*;}
|
||||
|
|
@ -85,15 +105,19 @@ public *;}
|
|||
-keep public class com.ycgis.macall.personalcenter.v.photoview.**{*;}
|
||||
|
||||
-keep public class com.ycgis.macall.personalcenter.util.ReadDeviceInfo{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.AhdsAddressUtils{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.FileUtils{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.IdcardUtils{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.BluetoothManage{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.JiaMi{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.ImageOptimizationUtil{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.IPAddressUtils{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.LocationGPSManage{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.InsertAppUtils{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.NotificationUtils{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.ToThirdPartyAppUtils{
|
||||
|
|
@ -101,6 +125,9 @@ public *;}
|
|||
-keep public class com.ycgis.macall.personalcenter.util.UriUtils{
|
||||
public *;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.PhoneValidateUtils{*;}
|
||||
-keep public class com.ycgis.macall.personalcenter.util.ParamMap{*;}
|
||||
|
||||
-keep public class com.ycgis.zpSDK.*{*;}
|
||||
|
||||
#-keep public class com.ycgis.macall.personalcenter.v.**{
|
||||
# public *;
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -4,15 +4,15 @@
|
|||
"type": "APK",
|
||||
"kind": "Directory"
|
||||
},
|
||||
"applicationId": "com.ruansee.macall.testwebview",
|
||||
"applicationId": "com.ycgis.macall.personalcenter",
|
||||
"variantName": "release",
|
||||
"elements": [
|
||||
{
|
||||
"type": "SINGLE",
|
||||
"filters": [],
|
||||
"versionCode": 5,
|
||||
"versionName": "2.5",
|
||||
"outputFile": "testwebview-release.apk"
|
||||
"versionCode": 2506051,
|
||||
"versionName": "3.1.20250605.01",
|
||||
"outputFile": "app-release.apk"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -6,13 +6,14 @@
|
|||
<uses-permission android:name="android.permission.CAMERA" />
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
|
||||
<uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" />
|
||||
<uses-permission
|
||||
android:name="android.permission.READ_PRIVILEGED_PHONE_STATE"
|
||||
tools:ignore="ProtectedPermissions" />
|
||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_EXTERNAL_STORAGE"
|
||||
tools:ignore="ScopedStorage" />
|
||||
<uses-permission android:name="android.permission.CALL_PHONE" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
|
||||
|
|
@ -26,6 +27,15 @@
|
|||
<uses-permission android:name="com.android.rsgps.provider.READ_PERMISSION" />
|
||||
<uses-permission android:name="com.android.peter.provider.WRITE_PERMISSION" />
|
||||
<uses-permission android:name="android.permission.NFC" />
|
||||
<uses-permission
|
||||
android:name="android.permission.WRITE_SETTINGS"
|
||||
tools:ignore="ProtectedPermissions"
|
||||
tools:node="remove" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_SCAN" />
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
|
||||
<application
|
||||
android:name=".p.app.RuanseeApplication"
|
||||
|
|
@ -37,7 +47,12 @@
|
|||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.NewPersonalCenter"
|
||||
tools:targetApi="n">
|
||||
|
||||
<activity android:name=".v.activity.BluetoothActivity"/>
|
||||
<activity
|
||||
android:name=".v.activity.applyfo.PersonnelReviewActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan" />
|
||||
<activity
|
||||
android:name=".v.activity.ScanCodeActivity"
|
||||
android:theme="@style/Theme.NewPersonalCenter.NoActionBar" />
|
||||
|
|
@ -120,7 +135,7 @@
|
|||
android:name=".v.activity.OpenAppActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan" />
|
||||
android:windowSoftInputMode="adjustResize" />
|
||||
<activity
|
||||
android:name=".v.activity.applyfo.ToBeReviewedActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
|
|
@ -150,12 +165,20 @@
|
|||
android:name=".v.activity.applyfo.ApplyProcessActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan" />
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan" /> <!-- 应用申请入口 -->
|
||||
<activity
|
||||
android:name=".v.activity.applyfo.ApplyForMainActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan" />
|
||||
android:windowSoftInputMode="adjustUnspecified|stateHidden|stateAlwaysHidden|adjustPan">
|
||||
|
||||
<!-- <intent-filter> -->
|
||||
<!-- <action android:name="android.intent.action.MAIN" /> -->
|
||||
|
||||
|
||||
<!-- <category android:name="android.intent.category.LAUNCHER" /> -->
|
||||
<!-- </intent-filter> -->
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".v.activity.OpinionsSuggestionsActivity"
|
||||
android:configChanges="orientation|screenSize"
|
||||
|
|
@ -187,9 +210,10 @@
|
|||
|
||||
<service
|
||||
android:name=".p.service.GetMessageService"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE"
|
||||
android:enabled="true"
|
||||
android:exported="true"/>
|
||||
android:exported="true"
|
||||
android:permission="android.permission.BIND_JOB_SERVICE" />
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
android:authorities="com.ycgis.macall.personalcenter.m.provider.MyFileProvider"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,178 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>这里是一个H5页面</title>
|
||||
</head>
|
||||
<body>
|
||||
<button class="buttonClass" id="buttonId22" onclick="callJS()">JS弹框</button>
|
||||
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId101" onclick="linkBluetooth()">链接蓝牙</button>
|
||||
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId102" onclick="printContentssss()">打印内容</button>
|
||||
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId8" onclick="showTitle()">显示状态栏及消息图标</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId9" onclick="hidTitle()">
|
||||
隐藏状态栏
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId0" onclick="goPersonFaceModule()">测试调用人像组件</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId1" onclick="goNFCModule()">
|
||||
测试调用NFC组件
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId2" onclick="goOCRCarModule()">
|
||||
测试调用OCR车牌组件
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId90" onclick="goOCRSfzModule()">
|
||||
测试调用身份证OCR组件
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="buttonId5" onclick="setSystemStatusBarStyle()">
|
||||
设置状态栏颜色
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="userJiaMi" onclick="getUserJiaMi()">
|
||||
获取用户加密数据
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="SearchJson" onclick="getSearchJson()">
|
||||
获取搜索数据
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="location" onclick="startGPS()">
|
||||
开始定位
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="stopLocation" onclick="stopGPS()">
|
||||
结束定位
|
||||
</button>
|
||||
<p>
|
||||
<button class="buttonClass" id="showNetError" onclick="showNetError()">
|
||||
弹出提示信息
|
||||
</button>
|
||||
<script>
|
||||
|
||||
function linkBluetooth() {
|
||||
callByAndroid.openBluetooth();
|
||||
}
|
||||
|
||||
function printContentssss() {
|
||||
<!-- alert(111111111)-->
|
||||
|
||||
var json = '[{"content":"文字内容","printType":1},{"content":"二维码内容","printType":2}]';
|
||||
callByAndroid.printContentsJSON(json);
|
||||
}
|
||||
|
||||
function showNetError() {
|
||||
callByAndroid.showNetPermission("提示框","这是个测试提示框","李大大","15566556655");
|
||||
}
|
||||
|
||||
function startGPS() {
|
||||
callByAndroid.startLocation();
|
||||
}
|
||||
|
||||
function stopGPS() {
|
||||
callByAndroid.stopLocation();
|
||||
}
|
||||
|
||||
function goPersonFaceModule() {
|
||||
callByAndroid.goPersonFaceModule();
|
||||
}
|
||||
|
||||
function goNFCModule() {
|
||||
callByAndroid.goNFCModule();
|
||||
}
|
||||
|
||||
function goOCRCarModule() {
|
||||
callByAndroid.goOCRCarModule();
|
||||
}
|
||||
|
||||
function goOCRSfzModule() {
|
||||
callByAndroid.goOCRSfzModule();
|
||||
}
|
||||
|
||||
function setSystemStatusBarStyle() {
|
||||
callByAndroid.setSystemStatusBarStyle("#F7F8FC",true);
|
||||
}
|
||||
|
||||
function showTitle() {
|
||||
callByAndroid.isTitleBlock(true);
|
||||
}
|
||||
|
||||
function hidTitle() {
|
||||
callByAndroid.isTitleBlock(false);
|
||||
}
|
||||
|
||||
function callJS() {
|
||||
alert("JS调用了callJS方法");
|
||||
}
|
||||
|
||||
|
||||
function getUserJiaMi() {
|
||||
var st = callByAndroid.getUserInfo();
|
||||
alert("加密数据:"+st);
|
||||
}
|
||||
|
||||
function callErrorResult(a,b,c) {
|
||||
alert("JS调用了callJS方法a ="+a+" | b ="+b+" | c="+c);
|
||||
}
|
||||
|
||||
function callNFCResult(a) {
|
||||
var set = "";
|
||||
for(var i in a){
|
||||
var ss = a[i];
|
||||
set+=ss;
|
||||
}
|
||||
alert("JS调用了callJS方法a ="+set);
|
||||
}
|
||||
|
||||
function callFaceIdentifyResult(a) {
|
||||
var set = "";
|
||||
for(var i in a){
|
||||
var ss = a[i];
|
||||
set+=ss;
|
||||
}
|
||||
alert("JS调用了callJS方法a ="+set);
|
||||
}
|
||||
|
||||
function callCORSfzResult(a) {
|
||||
alert("JS调用了callJS方法a ="+a.toString());
|
||||
}
|
||||
|
||||
function callOCRCarResult(a) {
|
||||
alert("JS调用了callJS方法a ="+a.toString());
|
||||
}
|
||||
|
||||
function callLocationResult(a,b) {
|
||||
alert("获取位置成功:"+a+" || "+b);
|
||||
}
|
||||
|
||||
function callLocationError(a,b) {
|
||||
alert("获取位置失败:错误码:"+a+" || 提示信息:"+b);
|
||||
}
|
||||
|
||||
function skipToMessage() {
|
||||
alert("点击了消息");
|
||||
}
|
||||
|
||||
|
||||
function callBluetoothError(a,b) {
|
||||
alert("JS调用了callJS方法a ="+a+" | b ="+b);
|
||||
}
|
||||
|
||||
function callBluetoothResult(a,b) {
|
||||
alert("JS调用了callJS方法a ="+a+" | b ="+b);
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -18,10 +18,9 @@ public class ApplyAppBean implements Serializable {
|
|||
* code : 200
|
||||
* data : [{"createBy":null,"createTime":"2023-06-02 12:11:26","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"是的","id":6,"name":"2121","icon":"/profile/upload/2023/06/02/logo_20230602121120A001.png","category":"1","deptId":340100000000,"deptName":"合肥市公安局","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":9,"appId":6,"roleName":"超级管理员"},{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":10,"appId":6,"roleName":"地市"}]},{"createBy":null,"createTime":"2023-06-02 10:21:31","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"这是一个治安应用2023年6月2日10:21:31","id":1,"name":"皖治通","icon":"/profile/upload/2023/06/02/logo_20230602102112A002.png","category":"1","deptId":340100000000,"deptName":"合肥市公安局","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":11,"appId":1,"roleName":"普通用户"},{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":12,"appId":1,"roleName":"管理员1"}]},{"createBy":null,"createTime":"2023-06-02 11:58:39","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"是否","id":5,"name":"11111","icon":"/profile/upload/2023/06/02/logo_20230602115827A002.png","category":"1","deptId":340000000000,"deptName":"安徽省公安厅","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":13,"appId":5,"roleName":"12"}]},{"createBy":null,"createTime":"2023-06-02 10:56:43","updateBy":null,"updateTime":"2023-06-03 11:30:27","remark":"1","id":3,"name":"云搜索","icon":"/profile/upload/2023/06/02/btn_record_20230602105626A002.png","category":"1","deptId":800701750001,"deptName":"安徽省","status":1,"createUserId":null,"createDeptId":null,"createUserName":null,"createDeptName":null,"roles":[{"createBy":null,"createTime":null,"updateBy":null,"updateTime":null,"remark":null,"id":14,"appId":3,"roleName":"23"}]}]
|
||||
*/
|
||||
|
||||
private String msg;
|
||||
private int code;
|
||||
private List<DataBean> data;
|
||||
private List<DataBean2> data;
|
||||
|
||||
public String getMsg() {
|
||||
return msg;
|
||||
|
|
@ -39,11 +38,11 @@ public class ApplyAppBean implements Serializable {
|
|||
this.code = code;
|
||||
}
|
||||
|
||||
public List<DataBean> getData() {
|
||||
public List<DataBean2> getData() {
|
||||
return data;
|
||||
}
|
||||
|
||||
public void setData(List<DataBean> data) {
|
||||
public void setData(List<DataBean2> data) {
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
|
|
@ -51,6 +50,63 @@ public class ApplyAppBean implements Serializable {
|
|||
return code == 200;
|
||||
}
|
||||
|
||||
public static class DataBean2 extends BaseBean implements Serializable {
|
||||
private int id;
|
||||
private String remark;
|
||||
private String roleName;
|
||||
private int roleSort;
|
||||
private int status;
|
||||
private boolean isSelect;
|
||||
|
||||
public int getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(int id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getRemark() {
|
||||
return remark;
|
||||
}
|
||||
|
||||
public void setRemark(String remark) {
|
||||
this.remark = remark;
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
||||
public int getRoleSort() {
|
||||
return roleSort;
|
||||
}
|
||||
|
||||
public void setRoleSort(int roleSort) {
|
||||
this.roleSort = roleSort;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public boolean isSelect() {
|
||||
return isSelect;
|
||||
}
|
||||
|
||||
public void setSelect(boolean select) {
|
||||
isSelect = select;
|
||||
}
|
||||
}
|
||||
|
||||
public static class DataBean extends BaseBean implements Serializable {
|
||||
/**
|
||||
* createBy : null
|
||||
|
|
|
|||
|
|
@ -153,8 +153,16 @@ public class ApplyAuditBean extends BaseBean {
|
|||
return "所在单位意见:";
|
||||
case "3":
|
||||
return "所在地市意见:";
|
||||
case "5":
|
||||
return "单位领导意见:";
|
||||
case "6":
|
||||
return "省厅意见:";
|
||||
case "7":
|
||||
return "督察部门意见:";
|
||||
case "8":
|
||||
return "纪检部门意见:";
|
||||
case "9":
|
||||
return "政工部门意见:";
|
||||
default:
|
||||
return "运维单位:";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ public class ApplyBean extends BaseBean {
|
|||
return StringUtil.get(applyReason,"暂无");
|
||||
}
|
||||
|
||||
public String getApplyReasonStr() {
|
||||
return "申请原因:" +getApplyReason();
|
||||
}
|
||||
|
||||
public void setApplyReason(String applyReason) {
|
||||
this.applyReason = applyReason;
|
||||
}
|
||||
|
|
@ -124,13 +128,30 @@ public class ApplyBean extends BaseBean {
|
|||
}
|
||||
|
||||
public String getRoleNameStr() {
|
||||
return "角色名称:" + roleName;
|
||||
return "权限名称:" + StringUtil.get(roleName,"暂无");
|
||||
}
|
||||
|
||||
public String getRoleName() {
|
||||
return roleName;
|
||||
}
|
||||
|
||||
public String getAuthorityStr() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("<font color=\"#323232\">权限名称:</font>");
|
||||
if (roleName == null){
|
||||
builder.append("<font color=\"#323232\">暂无</font>");
|
||||
}else if (roleName.contains("普通")){
|
||||
builder.append("<font color=\"#323232\">");
|
||||
builder.append(roleName);
|
||||
builder.append("</font>");
|
||||
}else {
|
||||
builder.append("<font color=\"#fb8c00\">");
|
||||
builder.append(roleName);
|
||||
builder.append("</font>");
|
||||
}
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
public void setRoleName(String roleName) {
|
||||
this.roleName = roleName;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.ycgis.macall.personalcenter.m.adapterbean;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/29 16:23
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BluetoothOV {
|
||||
private String name;
|
||||
private String address;
|
||||
private int status;
|
||||
private int type;
|
||||
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getAddress() {
|
||||
return address;
|
||||
}
|
||||
|
||||
public void setAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public int getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(int status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(int type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
package com.ycgis.macall.personalcenter.m.adapterbean;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2024/9/17 11:28
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class ExamineDetails {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.ycgis.macall.personalcenter.m.datamodel;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/29 16:56
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class PrintModel {
|
||||
// "content":"文字内容",
|
||||
// * "printType":1
|
||||
|
||||
private String content;
|
||||
private int printType;
|
||||
private int contentWidth;
|
||||
private int contentHeight;
|
||||
private int pageHeight;
|
||||
private int pageWidth;
|
||||
private int zoomLevel;
|
||||
|
||||
public int getZoomLevel() {
|
||||
if (zoomLevel>32) return 32;
|
||||
return Math.max(zoomLevel, 1);
|
||||
}
|
||||
|
||||
public void setZoomLevel(int zoomLevel) {
|
||||
this.zoomLevel = zoomLevel;
|
||||
}
|
||||
|
||||
public String getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
public void setContent(String content) {
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
public int getPrintType() {
|
||||
return printType;
|
||||
}
|
||||
|
||||
public void setPrintType(int printType) {
|
||||
this.printType = printType;
|
||||
}
|
||||
|
||||
public int getContentWidth() {
|
||||
return contentWidth;
|
||||
}
|
||||
|
||||
public void setContentWidth(int contentWidth) {
|
||||
this.contentWidth = contentWidth;
|
||||
}
|
||||
|
||||
public int getContentHeight() {
|
||||
return contentHeight;
|
||||
}
|
||||
|
||||
public void setContentHeight(int contentHeight) {
|
||||
this.contentHeight = contentHeight;
|
||||
}
|
||||
|
||||
public int getPageHeight() {
|
||||
if (pageHeight<100)return 100;
|
||||
return Math.min(pageHeight,2000);
|
||||
}
|
||||
|
||||
public void setPageHeight(int pageHeight) {
|
||||
this.pageHeight = pageHeight;
|
||||
}
|
||||
|
||||
public int getPageWidth() {
|
||||
if (pageWidth<100)return 100;
|
||||
return Math.min(pageWidth,2000);
|
||||
}
|
||||
|
||||
public void setPageWidth(int pageWidth) {
|
||||
this.pageWidth = pageWidth;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
package com.ycgis.macall.personalcenter.m.provider;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.os.Build;
|
||||
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.BluetoothOV;
|
||||
import com.ycgis.macall.personalcenter.util.BluetoothManage;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/29 17:37
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BluetoothBroadcastReceiver extends BroadcastReceiver {
|
||||
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
String action = intent.getAction();
|
||||
if (BluetoothDevice.ACTION_BOND_STATE_CHANGED.equals(action)) {
|
||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
int bondState = intent.getIntExtra(BluetoothDevice.EXTRA_BOND_STATE, BluetoothDevice.ERROR);
|
||||
int prevBondState = intent.getIntExtra(BluetoothDevice.EXTRA_PREVIOUS_BOND_STATE, BluetoothDevice.ERROR);
|
||||
if (bondState == BluetoothDevice.BOND_BONDING) {
|
||||
|
||||
// 正在配对
|
||||
} else if (bondState == BluetoothDevice.BOND_BONDED) {
|
||||
// 配对成功
|
||||
|
||||
} else if (bondState == BluetoothDevice.BOND_NONE) {
|
||||
|
||||
// 取消配对/配对失败
|
||||
}
|
||||
}
|
||||
if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
|
||||
// 设备已连接
|
||||
} else if (BluetoothDevice.ACTION_ACL_DISCONNECTED.equals(action)) {
|
||||
// 设备已断开
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -14,6 +14,8 @@ public class BaseRequestModel<T> {
|
|||
private int total;
|
||||
// private int counts;
|
||||
private T data;
|
||||
private T rows;
|
||||
|
||||
|
||||
// public int getCounts() {
|
||||
// return counts;
|
||||
|
|
@ -23,6 +25,15 @@ public class BaseRequestModel<T> {
|
|||
// this.counts = counts;
|
||||
// }
|
||||
|
||||
|
||||
public T getRows() {
|
||||
return rows;
|
||||
}
|
||||
|
||||
public void setRows(T rows) {
|
||||
this.rows = rows;
|
||||
}
|
||||
|
||||
public int getTotal() {
|
||||
return total;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,11 +37,11 @@ public class AppCache {
|
|||
//统一认证token
|
||||
private String token;
|
||||
|
||||
/* 用户信息加密 */
|
||||
private String userInfo;
|
||||
|
||||
private String imei,imsi;
|
||||
|
||||
|
||||
private AppCache() {
|
||||
|
||||
}
|
||||
|
|
@ -55,7 +55,6 @@ public class AppCache {
|
|||
return appCache;
|
||||
}
|
||||
|
||||
|
||||
public void setIpAndPort(String ip,String port){
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
|
|
@ -125,11 +124,12 @@ public class AppCache {
|
|||
}
|
||||
|
||||
public String getUserInfo() {
|
||||
return userInfo;
|
||||
return StringUtil.get(userInfo,RuanseeApplication.getStringValue("appUserInfo"));
|
||||
}
|
||||
|
||||
public void setUserInfo(String userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
RuanseeApplication.saveData("appUserInfo",userInfo);
|
||||
}
|
||||
|
||||
public String getImei() {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ import com.bumptech.glide.module.AppGlideModule;
|
|||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.rs.macall.androidx.basemodel.request.OkHttpUtils;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.p.request.interceptors.HttpLoggingInterceptor;
|
||||
import com.ycgis.macall.personalcenter.util.FileUtils;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -34,7 +35,7 @@ public class MyAppGlideModule extends AppGlideModule {
|
|||
|
||||
@Override
|
||||
public void registerComponents(@NonNull Context context, @NonNull Glide glide, @NonNull Registry registry) {
|
||||
OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(OkHttpUtils.getClient(30,40,60));
|
||||
OkHttpUrlLoader.Factory factory = new OkHttpUrlLoader.Factory(OkHttpUtils.getClient(30,40,60,new HttpLoggingInterceptor()));
|
||||
registry.replace(GlideUrl.class, InputStream.class, factory);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,6 +51,7 @@ public class RuanseeApplication extends BaseApplication {
|
|||
.setBorderSwitch(isPrintLog)
|
||||
.setLogSwitch(isPrintLog)
|
||||
.setLog2FileSwitch(false);
|
||||
// DeviceIdentifier.register(this);
|
||||
|
||||
//统一服务组件
|
||||
USMConfigure.getDefault().init("11811535", "grzx_test_app");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package com.ycgis.macall.personalcenter.p.callback;
|
||||
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/30 16:49
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public interface BluetoothFragmentListener {
|
||||
|
||||
void onClickBluetoothDevice(BluetoothDevice device);
|
||||
|
||||
void onError(int code,String msg);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
package com.ycgis.macall.personalcenter.p.presenter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.util.ArrayMap;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.core.content.ContextCompat;
|
||||
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2024/3/16 17:51
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BtnSkip {
|
||||
private Map<Integer,Content> contentMap;
|
||||
private Context context;
|
||||
private int selColorId = R.color.colorWhite,defColorId = R.color.colorGrey8;
|
||||
|
||||
public BtnSkip(Context context) {
|
||||
this.context = context;
|
||||
this.contentMap = new ArrayMap<>();
|
||||
}
|
||||
|
||||
public BtnSkip setTextColor(int selColorId , int defColorId){
|
||||
this.defColorId = defColorId;
|
||||
this.selColorId = selColorId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public BtnSkip add(int index, Content content){
|
||||
contentMap.put(index,content);
|
||||
return this;
|
||||
}
|
||||
|
||||
public void clean(){
|
||||
context = null;
|
||||
if (contentMap!=null){
|
||||
for (int key:contentMap.keySet()) {
|
||||
Content content = contentMap.get(key);
|
||||
if (content!=null){
|
||||
content.clean();
|
||||
}
|
||||
}
|
||||
contentMap.clear();
|
||||
}
|
||||
|
||||
contentMap = null;
|
||||
}
|
||||
|
||||
public void unDateStatus(int index,boolean isSel){
|
||||
Content content = contentMap.get(index);
|
||||
if (content == null) return;
|
||||
content.setStatus(isSel);
|
||||
}
|
||||
|
||||
public class Content{
|
||||
private TextView view;
|
||||
private ImageView image;
|
||||
private int selDrawable,defDrawable;
|
||||
|
||||
public Content(TextView view, ImageView image, int selDrawable, int defDrawable) {
|
||||
this.view = view;
|
||||
this.image = image;
|
||||
this.selDrawable = selDrawable;
|
||||
this.defDrawable = defDrawable;
|
||||
}
|
||||
|
||||
private void setStatus(boolean isSel){
|
||||
if (isSel){
|
||||
view.setTextColor(ContextCompat.getColor(context,selColorId));
|
||||
image.setImageDrawable(ContextCompat.getDrawable(context,selDrawable));
|
||||
}else {
|
||||
view.setTextColor(ContextCompat.getColor(context,defColorId));
|
||||
image.setImageDrawable(ContextCompat.getDrawable(context,defDrawable));
|
||||
}
|
||||
}
|
||||
|
||||
public void clean(){
|
||||
view = null;
|
||||
selDrawable = 0;
|
||||
defColorId = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -319,7 +319,6 @@ public class WebViewPresenter extends BasePresenter<WebActivityCallback> {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
public void showLoadWebError(String titleStr, String msg, String lxryName, String lxryPhone) {
|
||||
if (StringUtil.isNullOrEmpty(titleStr)){
|
||||
titleStr = "温馨提示";
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ import com.rs.macall.androidx.basemodel.utils.TypConversion;
|
|||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback;
|
||||
import com.ycgis.macall.personalcenter.p.callback.ImageCallBack;
|
||||
import com.ycgis.macall.personalcenter.p.request.interceptors.HttpLoggingInterceptor;
|
||||
import com.ycgis.macall.personalcenter.util.FileUtils;
|
||||
import com.ycgis.macall.personalcenter.v.activity.applyfo.ApplyForMainActivity;
|
||||
|
||||
|
|
@ -162,7 +163,7 @@ public class AsyncBitmapLoader {
|
|||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.build();
|
||||
OkHttpUtils.getClient(10, 30, 40)
|
||||
OkHttpUtils.getClient(10, 30, 40,new HttpLoggingInterceptor())
|
||||
.newCall(request)
|
||||
.enqueue(new Callback() {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public class RetrofitService {
|
|||
public static void resetRetrofitApi() {
|
||||
retrofitService = new Retrofit.Builder()
|
||||
.baseUrl(RuanseeApplication.getAppCache().getBaseUrlPath())
|
||||
.client(OkHttpUtils.getClient(10, 10, 10,new HttpLoggingInterceptor()))
|
||||
.addConverterFactory(new NullOnEmptyConverterFactory())//处理接口返回没有响应体body
|
||||
// 添加Gson转换器
|
||||
.addConverterFactory(GsonConverterFactory.create())
|
||||
|
|
@ -36,7 +37,6 @@ public class RetrofitService {
|
|||
// ))
|
||||
// 添加Retrofit到RxJava的转换器
|
||||
.addCallAdapterFactory(RxJava2CallAdapterFactory.create())
|
||||
.client(OkHttpUtils.getClient(10, 10, 10,new HttpLoggingInterceptor()))
|
||||
.build()
|
||||
.create(
|
||||
RetrofitApi.class);
|
||||
|
|
|
|||
|
|
@ -33,7 +33,6 @@ public class HttpLoggingInterceptor implements Interceptor {
|
|||
|
||||
private static final Charset UTF8 = Charset.forName("UTF-8");
|
||||
|
||||
private Map<String, String> headers;
|
||||
|
||||
public enum Level {
|
||||
/**
|
||||
|
|
@ -111,16 +110,6 @@ public class HttpLoggingInterceptor implements Interceptor {
|
|||
this(Logger.DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置请求Header
|
||||
*
|
||||
* @param headers header 集合
|
||||
*/
|
||||
public HttpLoggingInterceptor(Map<String, String> headers) {
|
||||
this(Logger.DEFAULT);
|
||||
this.headers = headers;
|
||||
}
|
||||
|
||||
public HttpLoggingInterceptor(Logger logger) {
|
||||
this.logger = logger;
|
||||
}
|
||||
|
|
@ -148,7 +137,7 @@ public class HttpLoggingInterceptor implements Interceptor {
|
|||
RuanseeApplication.getAppCache().setUserInfo(s);
|
||||
}
|
||||
requestBuilder.addHeader("userInfo", RuanseeApplication.getAppCache().getUserInfo());
|
||||
String se = requestS.url().toString();
|
||||
// String se = requestS.url().toString();
|
||||
// if (StringUtil.hasContent(se)) {
|
||||
// if (!se.endsWith(".jpg") && !se.endsWith(".png")&&!se.contains("wzt")){
|
||||
// se = se.replace("http://" + RuanseeApplication.getAppCache().getIp() + ":8081/", RuanseeApplication.getAppCache().getBaseUrlPath());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,383 @@
|
|||
package com.ycgis.macall.personalcenter.util;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
import android.app.Dialog;
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.bluetooth.BluetoothSocket;
|
||||
import android.bluetooth.le.BluetoothLeScanner;
|
||||
import android.bluetooth.le.ScanCallback;
|
||||
import android.bluetooth.le.ScanResult;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
import androidx.recyclerview.widget.RecyclerView;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.WriterException;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
|
||||
import com.rs.macall.androidx.basemodel.decoration.MyDividerItemDecoration;
|
||||
import com.rs.macall.androidx.basemodel.utils.BitMapUtils;
|
||||
import com.rs.macall.androidx.basemodel.utils.LogUtils;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.BluetoothOV;
|
||||
import com.ycgis.macall.personalcenter.m.datamodel.PrintModel;
|
||||
import com.ycgis.macall.personalcenter.m.provider.BluetoothBroadcastReceiver;
|
||||
import com.ycgis.macall.personalcenter.v.adapter.BluetoothListAdapter;
|
||||
|
||||
import org.greenrobot.eventbus.EventBus;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/29 11:22
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BluetoothManage {
|
||||
private static BluetoothManage bluetoothManage;
|
||||
public final static int REQUEST_OPEN_BLUETOOTH = 0x142;
|
||||
private BluetoothAdapter bluetoothAdapter;
|
||||
|
||||
private BluetoothSocket bluetoothSocket;
|
||||
private OutputStream outputStream;
|
||||
private InputStream inputStream;
|
||||
private BluetoothBroadcastReceiver receiver;
|
||||
|
||||
private CallBack callBack;
|
||||
|
||||
// SPP UUID
|
||||
private static final UUID SPP_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
|
||||
|
||||
public void setCallBack(CallBack callBack) {
|
||||
this.callBack = callBack;
|
||||
}
|
||||
|
||||
private BluetoothManage() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static BluetoothManage getInstance() {
|
||||
if (bluetoothManage == null) {
|
||||
synchronized (BluetoothManage.class) {
|
||||
if (bluetoothManage == null) {
|
||||
bluetoothManage = new BluetoothManage();
|
||||
}
|
||||
}
|
||||
}
|
||||
return bluetoothManage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 设备是否支持蓝牙
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public boolean init() {
|
||||
bluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (bluetoothAdapter == null) {
|
||||
// 设备不支持蓝牙
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
// 发送数据
|
||||
public boolean sendData(List<PrintModel> dataList) {
|
||||
if (outputStream != null) {
|
||||
if (dataList == null) return false;
|
||||
try {
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
PrintModel printModel = dataList.get(i);
|
||||
if (printModel.getPrintType() == 1) {
|
||||
outputStream.write(printModel.getContent().getBytes("GBK")); // 部分打印机需GBK编码
|
||||
} else if (printModel.getPrintType() == 2) {
|
||||
Bitmap bitmap = generateQRCode(printModel.getContent(), 100);
|
||||
if (bitmap == null) continue;
|
||||
outputStream.write(decodeBitmap(bitmap)); // 部分打印机需GBK编码
|
||||
} else if (printModel.getPrintType() == 3) {
|
||||
Bitmap bitmap = BitMapUtils.base64ToBitmap(printModel.getContent());
|
||||
if (bitmap == null) continue;
|
||||
outputStream.write(decodeBitmap(bitmap)); // 部分打印机需GBK编码
|
||||
}
|
||||
}
|
||||
outputStream.flush();
|
||||
return true;
|
||||
} catch (IOException | WriterException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断蓝牙是否打开
|
||||
*
|
||||
* @param activity
|
||||
* @return 打开 true false 未打开,并跳转设置页面
|
||||
*/
|
||||
public boolean isBluetoothOpen(Activity activity, boolean isSkipSetting) {
|
||||
if (!bluetoothAdapter.isEnabled()) {
|
||||
if (isSkipSetting) {
|
||||
Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);
|
||||
activity.startActivityForResult(enableBtIntent, REQUEST_OPEN_BLUETOOTH);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 连接指定MAC地址的打印机
|
||||
public boolean connect(String macAddress) {
|
||||
if (bluetoothAdapter == null) return false;
|
||||
BluetoothDevice device = bluetoothAdapter.getRemoteDevice(macAddress);
|
||||
try {
|
||||
bluetoothSocket = device.createRfcommSocketToServiceRecord(SPP_UUID);
|
||||
bluetoothSocket.connect();
|
||||
outputStream = bluetoothSocket.getOutputStream();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
close();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean SPPOpen(BluetoothDevice myDevice) {
|
||||
boolean error = false;
|
||||
bluetoothAdapter = bluetoothAdapter;
|
||||
|
||||
if (!bluetoothAdapter.isEnabled()) {
|
||||
if (callBack != null) {
|
||||
callBack.onConnect(false, "蓝牙适配器没有打开");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
bluetoothAdapter.cancelDiscovery();
|
||||
|
||||
try {
|
||||
//bluetoothSocket = myDevice.createRfcommSocketToServiceRecord(SPP_UUID);
|
||||
Method m = myDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
|
||||
bluetoothSocket = (android.bluetooth.BluetoothSocket) m.invoke(myDevice, 1);
|
||||
} catch (SecurityException | IllegalArgumentException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
|
||||
bluetoothSocket = null;
|
||||
if (callBack != null) {
|
||||
callBack.onConnect(false, "蓝牙端口错误");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
bluetoothSocket.connect();
|
||||
} catch (IOException e2) {
|
||||
if (callBack != null) {
|
||||
callBack.onConnect(false, e2.getLocalizedMessage());
|
||||
}
|
||||
bluetoothSocket = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
outputStream = bluetoothSocket.getOutputStream();
|
||||
} catch (IOException e3) {
|
||||
outputStream = null;
|
||||
error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
inputStream = bluetoothSocket.getInputStream();
|
||||
} catch (IOException e3) {
|
||||
inputStream = null;
|
||||
error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
//SPPClose();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean disconnect() {
|
||||
if (!SPPClose())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean SPPClose() {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
if (outputStream != null) {
|
||||
try {
|
||||
outputStream.flush();
|
||||
} catch (IOException e1) {
|
||||
}
|
||||
try {
|
||||
outputStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
outputStream = null;
|
||||
}
|
||||
if (inputStream != null) {
|
||||
try {
|
||||
inputStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
inputStream = null;
|
||||
}
|
||||
if (bluetoothSocket != null) {
|
||||
try {
|
||||
bluetoothSocket.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
bluetoothSocket = null;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 检查是否已连接
|
||||
public boolean isConnected() {
|
||||
return bluetoothSocket != null && bluetoothSocket.isConnected();
|
||||
}
|
||||
|
||||
// 断开连接
|
||||
public void close() {
|
||||
try {
|
||||
if (outputStream != null) outputStream.close();
|
||||
if (bluetoothSocket != null) bluetoothSocket.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
outputStream = null;
|
||||
bluetoothSocket = null;
|
||||
}
|
||||
|
||||
public BluetoothBroadcastReceiver getReceiver() {
|
||||
if (receiver == null) {
|
||||
receiver = new BluetoothBroadcastReceiver();
|
||||
}
|
||||
return receiver;
|
||||
}
|
||||
|
||||
public void searchBluetoothList(ScanCallback callback) {
|
||||
if (callback == null) return;
|
||||
BluetoothLeScanner bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
|
||||
if (bluetoothLeScanner != null) {
|
||||
stop(callback);
|
||||
bluetoothAdapter.getBluetoothLeScanner().startScan(callback);
|
||||
}
|
||||
}
|
||||
|
||||
public void stop(ScanCallback callback) {
|
||||
if (callback == null) return;
|
||||
BluetoothLeScanner bluetoothLeScanner = bluetoothAdapter.getBluetoothLeScanner();
|
||||
if (bluetoothLeScanner != null) {
|
||||
bluetoothLeScanner.stopScan(callback);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 生成二位码图片
|
||||
*
|
||||
* @param content
|
||||
* @param size
|
||||
* @return
|
||||
* @throws WriterException
|
||||
*/
|
||||
public Bitmap generateQRCode(String content, int size) throws WriterException {
|
||||
QRCodeWriter writer = new QRCodeWriter();
|
||||
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, size, size);
|
||||
Bitmap bmp = Bitmap.createBitmap(size, size, Bitmap.Config.RGB_565);
|
||||
for (int x = 0; x < size; x++) {
|
||||
for (int y = 0; y < size; y++) {
|
||||
bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
}
|
||||
return bmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 位图转换
|
||||
*
|
||||
* @param bmp
|
||||
* @return
|
||||
*/
|
||||
public byte[] decodeBitmap(Bitmap bmp) {
|
||||
int width = bmp.getWidth();
|
||||
int height = bmp.getHeight();
|
||||
int[] pixels = new int[width * height];
|
||||
bmp.getPixels(pixels, 0, width, 0, 0, width, height);
|
||||
|
||||
// 生成 ESC/POS 位图指令
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
baos.write(0x1D);
|
||||
baos.write(0x76);
|
||||
baos.write(0x30);
|
||||
baos.write(0x00);
|
||||
baos.write(width / 8); // 宽度(以8为单位)
|
||||
baos.write(0x00);
|
||||
baos.write(height % 256); // 高度低字节
|
||||
baos.write(height / 256); // 高度高字节
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x += 8) {
|
||||
byte b = 0;
|
||||
for (int n = 0; n < 8; n++) {
|
||||
int pixel = pixels[y * width + x + n];
|
||||
int gray = (Color.red(pixel) + Color.green(pixel) + Color.blue(pixel)) / 3;
|
||||
if (gray < 128) {
|
||||
b |= (1 << (7 - n));
|
||||
}
|
||||
}
|
||||
baos.write(b);
|
||||
}
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
|
||||
public interface CallBack {
|
||||
|
||||
void onConnect(boolean connect, String msg);
|
||||
|
||||
void onPrintSuccess();
|
||||
|
||||
void onPrintFail(String msg);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -181,6 +181,11 @@ public class FileUtils {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算文件
|
||||
* @param file 文件
|
||||
* @return 大小单位Bit
|
||||
*/
|
||||
public static long calculateFileSize(File file) {
|
||||
long totals = 0;
|
||||
if (!file.exists()) return 0;
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ public class LocationGPSManage implements LifecycleObserver {
|
|||
}
|
||||
|
||||
private LocationGPSManage() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import android.annotation.SuppressLint;
|
|||
import android.content.Context;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.text.TextUtils;
|
||||
|
||||
|
|
@ -26,6 +27,24 @@ import java.lang.reflect.Method;
|
|||
public class ReadDeviceInfo {
|
||||
private static final String TAG = "ReadDeviceInfo";
|
||||
|
||||
|
||||
public static String getOAID(Context context) {
|
||||
String oaid = null;
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
oaid = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
} else {
|
||||
oaid = Settings.System.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||
}
|
||||
//处理获取到的OAID
|
||||
if (oaid == null || oaid.isEmpty()) {
|
||||
// OAID获取失败
|
||||
} else {
|
||||
// 成功获取到OAID,进行后续操作
|
||||
}
|
||||
return oaid;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取默认的imei 一般都是IMEI 1
|
||||
*
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
|||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
@Deprecated
|
||||
public class SearchHistoryUtils {
|
||||
|
||||
public static final String SEARCH_HISTORY = "searchHistory";
|
||||
|
|
|
|||
|
|
@ -220,14 +220,8 @@ public class ToThirdPartyAppUtils implements LifecycleObserver {
|
|||
param.put("deptId", RuanseeApplication.getUserData().getDeptCode());
|
||||
param.put("deptName", RuanseeApplication.getUserData().getDeptName());
|
||||
param.put("type", operatorType);
|
||||
String url = "http://192.168.43.183:8081/wzt/app/v1/zamh/addOperationRecords";
|
||||
// String url = "http://192.168.43.183:8081/wzt/app/v1/zamh/addOperationRecords";
|
||||
|
||||
Object appId1 = param.get("appId");
|
||||
if (appId1 instanceof Long){
|
||||
long id = (long) appId1;
|
||||
}else if(appId1 instanceof Integer) {
|
||||
int id = (int) appId1;
|
||||
}
|
||||
|
||||
// MediaType mediaType = MediaType.parse("application/json;charset=utf-8");
|
||||
MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8");
|
||||
|
|
|
|||
|
|
@ -8,8 +8,11 @@ import android.os.Bundle;
|
|||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.anhui.police.market.callback.AbstractMarketResult;
|
||||
import com.anhui.police.market.sdk.MarketConfigure;
|
||||
import com.fri.libfriapkrecord.read.SignRecordTools;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.rs.macall.androidx.basemodel.utils.LogUtils;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
|
|
@ -75,7 +78,35 @@ public class AboutActivity extends BaseViewBindActivity<ActivityAboutBinding> {
|
|||
RuanseeApplication.saveData("NRRecordNumber", recordNumber);
|
||||
}
|
||||
viewBinding.tvBah.setText(String.format("全国注册备案号:%s", recordNumber));
|
||||
// jsdx();
|
||||
|
||||
//3.0.20240111 没有添加检测更新
|
||||
MarketConfigure.detectAppUpdates(this, false, "", new AbstractMarketResult() {
|
||||
@Override
|
||||
public void onResult(String result, boolean upgrade) {
|
||||
LogUtils.w(result);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onConfirm(int stateType) {
|
||||
LogUtils.w("stateType:" + stateType);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCancel() {
|
||||
LogUtils.w("onCancel");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onWarning() {
|
||||
LogUtils.w("onWarning");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onResult(String result) {
|
||||
LogUtils.w(result);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//获取系统内APK文件路径
|
||||
|
|
|
|||
|
|
@ -0,0 +1,234 @@
|
|||
package com.ycgis.macall.personalcenter.v.activity;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.View;
|
||||
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
|
||||
import com.rs.macall.androidx.basemodel.decoration.MyDividerItemDecoration;
|
||||
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityBluetoothBinding;
|
||||
import com.ycgis.macall.personalcenter.m.datamodel.PrintModel;
|
||||
import com.ycgis.macall.personalcenter.util.BluetoothManage;
|
||||
import com.ycgis.macall.personalcenter.v.adapter.BluetoothListAdapter;
|
||||
import com.ycgis.zpSDK.BluetoothSocket;
|
||||
|
||||
import java.lang.reflect.Type;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class BluetoothActivity extends BaseViewBindActivity<ActivityBluetoothBinding> {
|
||||
public static final String EXTRA_BLUETOOTH_DEVICE_ADDRESS = "Bluetooth Device Adrress";
|
||||
public static final String EXTRA_BLUETOOTH_DEVICE_NAME = "Bluetooth Device Name";
|
||||
|
||||
public String TAG = "zpSDK";
|
||||
public BluetoothAdapter btAdapter = null;
|
||||
private BluetoothListAdapter listAdapter1, listAdapter2;
|
||||
private List<BluetoothDevice> pdDataList = new ArrayList<>(), searchDataList = new ArrayList<>();
|
||||
|
||||
private boolean isLinkPrinter = false;
|
||||
|
||||
@Override
|
||||
protected ActivityBluetoothBinding getViewBinding() {
|
||||
return ActivityBluetoothBinding.inflate(getLayoutInflater());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
viewBinding.rvSearchList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
viewBinding.rvSearchList.addItemDecoration(new MyDividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
|
||||
viewBinding.rvYpd.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
viewBinding.rvYpd.addItemDecoration(new MyDividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
|
||||
viewBinding.btnSearch.setVisibility(View.VISIBLE);
|
||||
viewBinding.searchProgress.setVisibility(View.GONE);
|
||||
viewBinding.btnSearch.setOnClickListener(customClickListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readInstanceState(Bundle savedInstanceState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void start() {
|
||||
viewBinding.baseTitle.contentTitle.setText("蓝牙测试");
|
||||
viewBinding.baseTitle.leftImage.setImageDrawable(getDrawables(R.drawable.back_cliener));
|
||||
boolean init = BluetoothManage.getInstance().init();
|
||||
if (!init) {
|
||||
ToastUtil.centered(getContext(), "当前设备不支持蓝牙!");
|
||||
return;
|
||||
}
|
||||
if (!BluetoothManage.getInstance().isBluetoothOpen(getActivity(), true)) {
|
||||
ToastUtil.centered(getContext(), "请先打开蓝牙!");
|
||||
return;
|
||||
}
|
||||
btAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
|
||||
bonded_devices_get();
|
||||
|
||||
//register broadcast receiver
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(BluetoothDevice.ACTION_FOUND);
|
||||
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
|
||||
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
|
||||
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
registerReceiver(mBroadcastReceiver, filter);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void bindViewClick(View v) {
|
||||
if (v.getId() == R.id.titleleft) {
|
||||
finish();
|
||||
return;
|
||||
}
|
||||
|
||||
if (v.getId() == R.id.btn_search) {
|
||||
discovry_do();
|
||||
return;
|
||||
}
|
||||
|
||||
if (v.getId() == R.id.btn_printer) {
|
||||
//{"content":"二维码内容","printType":2},{"content":"base64","printType":3}
|
||||
String prContent = "[{\"content\":\"皖A97B21\n\",\"printType\":1},{\"content\":\"测试全部中文\",\"printType\":2}]";
|
||||
Type type = new TypeToken<List<PrintModel>>() {
|
||||
}.getType();
|
||||
List<PrintModel> data = new Gson().fromJson(prContent, type);
|
||||
boolean b = BluetoothSocket.getInstance().sendData(data);
|
||||
if (b) {
|
||||
ToastUtil.centered(getContext(),"打印完成");
|
||||
} else {
|
||||
ToastUtil.centered(getContext(),"打印失败");
|
||||
// mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-4", "打印失败!");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//get the Bonded devices
|
||||
//获取配对列表
|
||||
private void bonded_devices_get() {
|
||||
pdDataList.clear();
|
||||
Set<BluetoothDevice> PairedDevices = btAdapter.getBondedDevices();
|
||||
if (PairedDevices.size() > 0) {
|
||||
for (BluetoothDevice device : PairedDevices) {
|
||||
// String device_info = device.getName()+"\n"+device.getAddress();
|
||||
pdDataList.add(device);
|
||||
}
|
||||
}
|
||||
initDataPd();
|
||||
}
|
||||
|
||||
private void lk(BluetoothDevice device) {
|
||||
baseShowDialog("正在链接");
|
||||
if (!BluetoothSocket.getInstance().ConnectPrinter(device.getAddress())) {
|
||||
//Toast.makeText(this, "Connect Fail", Toast.LENGTH_SHORT).show();
|
||||
baseDismissDialog();
|
||||
viewBinding.tvPrinter.setText("链接失败");
|
||||
viewBinding.btnPrinter.setVisibility(View.GONE);
|
||||
isLinkPrinter = false;
|
||||
} else {
|
||||
baseDismissDialog();
|
||||
viewBinding.tvPrinter.setText("已连接:" + device.getName());
|
||||
viewBinding.btnPrinter.setVisibility(View.VISIBLE);
|
||||
viewBinding.btnPrinter.setOnClickListener(customClickListener);
|
||||
isLinkPrinter = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void initDataPd() {
|
||||
if (listAdapter1 == null) {
|
||||
listAdapter1 = new BluetoothListAdapter(getContext(), pdDataList);
|
||||
viewBinding.rvYpd.setAdapter(listAdapter1);
|
||||
listAdapter1.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
lk(listAdapter1.getDataItem(pointer));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listAdapter1.upData(pdDataList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取蓝牙设备,并开始搜索设备
|
||||
*/
|
||||
//search BlueTooth devices
|
||||
private void discovry_do() {
|
||||
Log.d("BT", "-----------discovry_do---------");
|
||||
if (!btAdapter.isEnabled()) {
|
||||
btAdapter.enable();
|
||||
while (btAdapter.getState() != BluetoothAdapter.STATE_ON) ;
|
||||
}
|
||||
// setProgressBarIndeterminateVisibility(true);
|
||||
// setTitle("Search devices...");
|
||||
//获取蓝牙设备,并开始搜索设备
|
||||
if (btAdapter.isDiscovering()) {
|
||||
Log.d("BT", "-----------btAdapter.cancelDiscovery()---------");
|
||||
btAdapter.cancelDiscovery();
|
||||
}
|
||||
Log.d("BT", "-----------btAdapter.startDiscovery()---------");
|
||||
btAdapter.startDiscovery();
|
||||
Log.d("BT", "-----------btAdapter.startDiscovery()+END---------");
|
||||
|
||||
viewBinding.btnSearch.setVisibility(View.GONE);
|
||||
viewBinding.searchProgress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// TODO Auto-generated method stub
|
||||
String action = intent.getAction();
|
||||
Log.d("BT", "----------onReceive----------" + action);
|
||||
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
|
||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
|
||||
initSearch(device);
|
||||
}
|
||||
} else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
|
||||
setProgressBarIndeterminateVisibility(false);
|
||||
setTitle("Choose Device");
|
||||
viewBinding.btnSearch.setVisibility(View.VISIBLE);
|
||||
viewBinding.searchProgress.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
super.onDestroy();
|
||||
unregisterReceiver(mBroadcastReceiver);
|
||||
}
|
||||
|
||||
private void initSearch(BluetoothDevice device) {
|
||||
if (listAdapter2 == null) {
|
||||
searchDataList.add(device);
|
||||
listAdapter2 = new BluetoothListAdapter(getContext(), searchDataList);
|
||||
viewBinding.rvSearchList.setAdapter(listAdapter2);
|
||||
|
||||
listAdapter2.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
lk(listAdapter2.getDataItem(pointer));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listAdapter2.addItem(device);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -33,6 +33,7 @@ import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
|||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityMainBinding;
|
||||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.p.presenter.BtnSkip;
|
||||
import com.ycgis.macall.personalcenter.p.request.CommonCompositeManage;
|
||||
import com.ycgis.macall.personalcenter.p.rxjava.ResultObserver;
|
||||
import com.ycgis.macall.personalcenter.p.service.GetMessageService;
|
||||
|
|
@ -52,7 +53,8 @@ import static android.app.Notification.EXTRA_CHANNEL_ID;
|
|||
import static android.provider.Settings.EXTRA_APP_PACKAGE;
|
||||
|
||||
public class MainActivity extends BaseViewBindActivity<ActivityMainBinding> {
|
||||
|
||||
private BtnSkip btnSkip;
|
||||
private int lastIndex = 0;
|
||||
|
||||
@Override
|
||||
protected ActivityMainBinding getViewBinding() {
|
||||
|
|
@ -89,6 +91,12 @@ public class MainActivity extends BaseViewBindActivity<ActivityMainBinding> {
|
|||
switchMainButton(viewBinding.mainPageView.getCurrentItem());
|
||||
}
|
||||
});
|
||||
btnSkip = new BtnSkip(getContext());
|
||||
btnSkip.setTextColor(R.color.bull,R.color.colorGrey5);
|
||||
btnSkip.add(0,btnSkip.new Content(viewBinding.mainTvBottom1,viewBinding.mainIvBottom1,R.drawable.icon_main_home,R.drawable.icon_main_home_def));
|
||||
btnSkip.add(1,btnSkip.new Content(viewBinding.mainTvBottom2,viewBinding.mainIvBottom2,R.drawable.icon_main_message,R.drawable.icon_main_message_def));
|
||||
btnSkip.add(2,btnSkip.new Content(viewBinding.mainTvBottom3,viewBinding.mainIvBottom3,R.drawable.icon_main_work,R.drawable.icon_main_work_def));
|
||||
btnSkip.add(3,btnSkip.new Content(viewBinding.mainTvBottom4,viewBinding.mainIvBottom4,R.drawable.icon_main_my,R.drawable.icon_main_my_def));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -256,54 +264,59 @@ public class MainActivity extends BaseViewBindActivity<ActivityMainBinding> {
|
|||
startActivity(new Intent(getContext(), MyDetailsActivity.class));
|
||||
}
|
||||
|
||||
//核查个人中心对接新警综
|
||||
|
||||
public void onJumpMessage(View view) {
|
||||
viewBinding.mainPageView.setCurrentItem(1);
|
||||
switchMainButton(1);
|
||||
}
|
||||
|
||||
private void switchMainButton(int buttonNum) {
|
||||
switch (buttonNum) {
|
||||
case 0:
|
||||
viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home));
|
||||
viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
viewBinding.mainTvBottom1.setTextColor(getColors(R.color.blue));
|
||||
viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
break;
|
||||
case 1:
|
||||
viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message));
|
||||
viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom2.setTextColor(getColors(R.color.blue));
|
||||
viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
break;
|
||||
case 2:
|
||||
viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work));
|
||||
viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom3.setTextColor(getColors(R.color.blue));
|
||||
viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
break;
|
||||
case 3:
|
||||
viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my));
|
||||
viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
viewBinding.mainTvBottom4.setTextColor(getColors(R.color.blue));
|
||||
break;
|
||||
}
|
||||
btnSkip.unDateStatus(lastIndex,false);
|
||||
btnSkip.unDateStatus(buttonNum,true);
|
||||
lastIndex = buttonNum;
|
||||
// switch (buttonNum) {
|
||||
// case 0:
|
||||
// viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home));
|
||||
// viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
// viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
// viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
// viewBinding.mainTvBottom1.setTextColor(getColors(R.color.blue));
|
||||
// viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
// break;
|
||||
// case 1:
|
||||
// viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
// viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message));
|
||||
// viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
// viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
// viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom2.setTextColor(getColors(R.color.blue));
|
||||
// viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
// break;
|
||||
// case 2:
|
||||
// viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
// viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
// viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work));
|
||||
// viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my_def));
|
||||
// viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom3.setTextColor(getColors(R.color.blue));
|
||||
// viewBinding.mainTvBottom4.setTextColor(getColors(R.color.colorGrey5));
|
||||
// break;
|
||||
// case 3:
|
||||
// viewBinding.mainIvBottom1.setImageDrawable(getDrawables(R.drawable.icon_main_home_def));
|
||||
// viewBinding.mainIvBottom2.setImageDrawable(getDrawables(R.drawable.icon_main_message_def));
|
||||
// viewBinding.mainIvBottom3.setImageDrawable(getDrawables(R.drawable.icon_main_work_def));
|
||||
// viewBinding.mainIvBottom4.setImageDrawable(getDrawables(R.drawable.icon_main_my));
|
||||
// viewBinding.mainTvBottom1.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom2.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom3.setTextColor(getColors(R.color.colorGrey5));
|
||||
// viewBinding.mainTvBottom4.setTextColor(getColors(R.color.blue));
|
||||
// break;
|
||||
// }
|
||||
}
|
||||
|
||||
private boolean isExit = false;
|
||||
|
|
|
|||
|
|
@ -79,7 +79,6 @@ import top.zibin.luban.OnCompressListener;
|
|||
|
||||
public class MyDetailsActivity extends BaseViewBindActivity<ActivityMyDetailsBinding> implements PermissionListener {
|
||||
private InputDialog inputDialog;
|
||||
private TextView tvUpdate;
|
||||
private MyDetailsViewModel viewModel;
|
||||
private String imei = "", imsi = "";
|
||||
private File photoFile;
|
||||
|
|
@ -100,6 +99,9 @@ public class MyDetailsActivity extends BaseViewBindActivity<ActivityMyDetailsBin
|
|||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 返回上级页面
|
||||
*/
|
||||
private void returnPreviousPage() {
|
||||
if (isUpdate) {
|
||||
setResult(UPDATE_INFO);
|
||||
|
|
@ -110,10 +112,7 @@ public class MyDetailsActivity extends BaseViewBindActivity<ActivityMyDetailsBin
|
|||
@Override
|
||||
protected void init() {
|
||||
viewModel = ViewModelProviders.of(this).get(MyDetailsViewModel.class);
|
||||
//13.98 + 0.55 - 8
|
||||
//5000 1000 13.38 - 80000 5.38
|
||||
// 1300 + 3300 + 800 = 5400
|
||||
//9500 - 5400 = 4100 = 预留800 = 3300
|
||||
//9500 - 2422 - 1000 -3000
|
||||
viewModel.addUpdateLiveDataObserve(this, new Observer<BaseBean>() {
|
||||
@Override
|
||||
public void onChanged(BaseBean baseBean) {
|
||||
|
|
@ -226,10 +225,10 @@ public class MyDetailsActivity extends BaseViewBindActivity<ActivityMyDetailsBin
|
|||
updatePhotoDialog("选择头像");
|
||||
} else if (v.getId() == R.id.my_details_tv_dept) {
|
||||
ToastUtil.centered(getContext(), "正在紧急对接中");
|
||||
// Intent intent = new Intent(getContext(), UpdateDeptActivity.class);
|
||||
// intent.putExtra("imei", imei);
|
||||
// intent.putExtra("imsi", imsi);
|
||||
// startActivity(intent);
|
||||
Intent intent = new Intent(getContext(), UpdateDeptActivity.class);
|
||||
intent.putExtra("imei", imei);
|
||||
intent.putExtra("imsi", imsi);
|
||||
startActivity(intent);
|
||||
} else if (v.getId() == R.id.my_details_tv_phone1) {
|
||||
upDate(1, "修改移动警务号码", viewBinding.myDetailsTvPhone1);
|
||||
} else if (v.getId() == R.id.my_details_tv_phone2) {
|
||||
|
|
@ -277,7 +276,7 @@ public class MyDetailsActivity extends BaseViewBindActivity<ActivityMyDetailsBin
|
|||
@Override
|
||||
public void onSuccess(File file) {
|
||||
if (isDel) {
|
||||
if (photoFile != null || !photoFile.getName().equals(file.getName())) {
|
||||
if (photoFile != null && !photoFile.getName().equals(file.getName())) {
|
||||
photoFile.delete();
|
||||
photoFile = null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.ycgis.macall.personalcenter.v.activity;
|
|||
import android.Manifest;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.app.Activity;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.ColorDrawable;
|
||||
|
|
@ -19,9 +20,8 @@ import android.webkit.JavascriptInterface;
|
|||
import android.webkit.WebSettings;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import androidx.lifecycle.Lifecycle;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.just.agentweb.AgentWeb;
|
||||
import com.just.agentweb.AgentWebConfig;
|
||||
import com.just.agentweb.DefaultWebClient;
|
||||
|
|
@ -46,23 +46,30 @@ import com.ruansee.macall.unifyservemodulesdk.bean.OcrSfzBean;
|
|||
import com.ycgis.macall.personalcenter.BuildConfig;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityOpenAppBinding;
|
||||
import com.ycgis.macall.personalcenter.m.datamodel.PrintModel;
|
||||
import com.ycgis.macall.personalcenter.m.model.SelectFileOptions;
|
||||
import com.ycgis.macall.personalcenter.p.app.CrashHandler;
|
||||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.p.app.UserData;
|
||||
import com.ycgis.macall.personalcenter.p.callback.BluetoothFragmentListener;
|
||||
import com.ycgis.macall.personalcenter.p.callback.GPSLocationListener;
|
||||
import com.ycgis.macall.personalcenter.p.callback.WebActivityCallback;
|
||||
import com.ycgis.macall.personalcenter.p.presenter.WebViewPresenter;
|
||||
import com.ycgis.macall.personalcenter.p.request.ApiModel;
|
||||
import com.ycgis.macall.personalcenter.p.request.DownloadUtil;
|
||||
import com.ycgis.macall.personalcenter.util.BluetoothManage;
|
||||
import com.ycgis.macall.personalcenter.util.FileUtils;
|
||||
import com.ycgis.macall.personalcenter.util.JiaMi;
|
||||
import com.ycgis.macall.personalcenter.util.LocationGPSManage;
|
||||
import com.ycgis.macall.personalcenter.v.fragment.BluetoothDialogFragment;
|
||||
import com.ycgis.zpSDK.BluetoothSocket;
|
||||
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Type;
|
||||
import java.net.URLDecoder;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
|
@ -75,6 +82,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
private Handler myHandler;
|
||||
private GPSLocationListener gpsLocationListener;
|
||||
|
||||
|
||||
///////////////// 接收参数的KEY //////////////////
|
||||
/*第三方应用appId*/
|
||||
public static final String paramKey9 = "appName";
|
||||
|
|
@ -132,14 +140,6 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
finish();
|
||||
}
|
||||
});
|
||||
//统一服务组件
|
||||
// USMConfigure.getDefault().init("16854", "stegst");
|
||||
// viewBinding.tvTestJs.setOnClickListener(new CustomClickListener() {
|
||||
// @Override
|
||||
// public void onSingleClick(View v) {
|
||||
// mAgentWeb.getJsAccessEntrace().quickCallJs("callErrorResult", operationType, "test", "aseg");
|
||||
// }
|
||||
// });
|
||||
androidMethodInterface = new AndroidMethodInterface();
|
||||
viewBinding.titleleft.setOnClickListener(new CustomClickListener() {
|
||||
@Override
|
||||
|
|
@ -212,6 +212,26 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
// initService();
|
||||
initWebView();
|
||||
usComponentSDK.setUSMListener(uscListener);
|
||||
|
||||
/**
|
||||
* 需要进行检测的权限数组
|
||||
*/
|
||||
List<String> needPermissions = new ArrayList<>();
|
||||
needPermissions.add(Manifest.permission.CAMERA);
|
||||
needPermissions.add(Manifest.permission.WRITE_EXTERNAL_STORAGE);
|
||||
needPermissions.add(Manifest.permission.ACCESS_COARSE_LOCATION);
|
||||
needPermissions.add(Manifest.permission.ACCESS_FINE_LOCATION);
|
||||
needPermissions.add(Manifest.permission.READ_EXTERNAL_STORAGE);
|
||||
needPermissions.add(Manifest.permission.READ_PHONE_STATE);
|
||||
needPermissions.add(Manifest.permission.CALL_PHONE);
|
||||
needPermissions.add(Manifest.permission.ACCESS_NETWORK_STATE);
|
||||
|
||||
if (Build.VERSION.SDK_INT >= 31) {
|
||||
needPermissions.add("android.permission.BLUETOOTH_SCAN");
|
||||
needPermissions.add("android.permission.BLUETOOTH_CONNECT");
|
||||
needPermissions.add("android.permission.BLUETOOTH_ADVERTISE");
|
||||
}
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
|
||||
requestPermissions(needPermissions, this);
|
||||
} else {
|
||||
|
|
@ -243,9 +263,16 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
if (!isDestroyed() && mAgentWeb != null) {
|
||||
mAgentWeb.getWebCreator().getWebView().reload();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean isEventBus() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void onPause() {
|
||||
if (mAgentWeb.getWebCreator() != null) {
|
||||
|
|
@ -271,6 +298,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
if (mAgentWeb.getWebCreator() != null) {
|
||||
mAgentWeb.getWebLifeCycle().onDestroy();
|
||||
}
|
||||
BluetoothSocket.getInstance().disconnect();
|
||||
androidMethodInterface = null;
|
||||
appID = "";
|
||||
secret = "";
|
||||
|
|
@ -279,6 +307,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
// }
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 绑定远程服务RemoteService
|
||||
*/
|
||||
|
|
@ -397,15 +426,14 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
|
||||
mAgentWeb.getWebCreator().getWebView().setDownloadListener((url1, userAgent, contentDisposition, mimetype, contentLength) -> {
|
||||
if (StringUtil.isNullOrEmpty(url1)) {
|
||||
ToastUtil.centered(getContext(), "下载链接为空,请检查链接是否真实!");
|
||||
ToastUtil.showTest(getContext(), "下载链接为空,请检查链接是否真实!");
|
||||
return;
|
||||
}
|
||||
String s1 = url1.toLowerCase();
|
||||
if (!s1.startsWith("http://") && !s1.startsWith("https://")) {
|
||||
ToastUtil.centered(getContext(), "URL缺少请求头,将默认使用Http协议下载");
|
||||
ToastUtil.showTest(getContext(), "URL缺少请求头,将默认使用Http协议下载");
|
||||
url1 = "http://" + url1;
|
||||
}
|
||||
|
||||
String fileName = "";
|
||||
if (StringUtil.hasContent(contentDisposition)) {
|
||||
String[] split = contentDisposition.split("=");
|
||||
|
|
@ -413,7 +441,6 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
}
|
||||
if (StringUtil.isNullOrEmpty(fileName)) {
|
||||
fileName = url1.substring(url1.lastIndexOf("/") + 1);
|
||||
|
||||
}
|
||||
String jm = URLDecoder.decode(fileName);
|
||||
if (fileName.length() > jm.length()) {
|
||||
|
|
@ -456,37 +483,39 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 统一服务组件回调
|
||||
*/
|
||||
private USMListener uscListener = new USMListener() {
|
||||
@Override
|
||||
public void onUSCSuccess(String operationType, ComponentBaseBean resultBean) {
|
||||
LogUtils.d(TAG, operationType);
|
||||
if (resultBean == null) {
|
||||
ToastUtil.centered(getContext(), "错误的返回值!");
|
||||
ToastUtil.showTest(getContext(), "错误的返回值!");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callErrorResult", operationType, String.valueOf(ErrorMsg.ERROR_RESULT.getIndex()), ErrorMsg.ERROR_RESULT.getName());
|
||||
return;
|
||||
}
|
||||
if (resultBean instanceof NFCBean) {
|
||||
NFCBean bean = (NFCBean) resultBean;
|
||||
ToastUtil.centered(getContext(), "NFC返回:" + bean.getName());
|
||||
ToastUtil.showTest(getContext(), "NFC返回:" + bean.getName());
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callNFCResult", new Gson().toJson(bean));
|
||||
return;
|
||||
}
|
||||
if (resultBean instanceof FaceIdentifyBean) {
|
||||
FaceIdentifyBean bean = (FaceIdentifyBean) resultBean;
|
||||
ToastUtil.centered(getContext(), "人像:" + bean.getName());
|
||||
ToastUtil.showTest(getContext(), "人像:" + bean.getName());
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callFaceIdentifyResult", new Gson().toJson(bean));
|
||||
return;
|
||||
}
|
||||
if (resultBean instanceof OcrSfzBean) {
|
||||
OcrSfzBean bean = (OcrSfzBean) resultBean;
|
||||
ToastUtil.centered(getContext(), "OCR身份证返回:" + bean.getName());
|
||||
ToastUtil.showTest(getContext(), "OCR身份证返回:" + bean.getName());
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callCORSfzResult", new Gson().toJson(bean));
|
||||
return;
|
||||
}
|
||||
if (resultBean instanceof CarOcrDataBean) {
|
||||
CarOcrDataBean bean = (CarOcrDataBean) resultBean;
|
||||
ToastUtil.centered(getContext(), "OCRCar返回:" + bean.getData().get(0).getPlateNumber());
|
||||
ToastUtil.showTest(getContext(), "OCRCar返回:" + bean.getData().get(0).getPlateNumber());
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callOCRCarResult", new Gson().toJson(bean));
|
||||
}
|
||||
}
|
||||
|
|
@ -494,7 +523,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
@Override
|
||||
public void onUSCError(String operationType, int code, String msg) {
|
||||
if (ErrorMsg.ERROR_USER_CANCEL.getIndex() != code) {
|
||||
ToastUtil.centered(getContext(), String.format("错误码%s || %s", code, msg));
|
||||
ToastUtil.showTest(getContext(), String.format("错误码%s || %s", code, msg));
|
||||
}
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callErrorResult", operationType, String.valueOf(code), msg);
|
||||
}
|
||||
|
|
@ -523,6 +552,14 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
return;
|
||||
}
|
||||
}
|
||||
if (requestCode == BluetoothManage.REQUEST_OPEN_BLUETOOTH) {
|
||||
if (resultCode == Activity.RESULT_OK) {
|
||||
if (!BluetoothManage.getInstance().isBluetoothOpen(getActivity(), false)) {
|
||||
ToastUtil.centered(getContext(), "请打开蓝牙功能后使用!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (webViewPresenter.mFilePathCallback != null) {
|
||||
webViewPresenter.onActivityResultAboveL(requestCode, resultCode, data);
|
||||
// webViewPresenter.mFilePathCallback.onReceiveValue(null);
|
||||
|
|
@ -542,7 +579,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
return new GPSLocationListener() {
|
||||
@Override
|
||||
public void onLocationChanged(Location location) {
|
||||
ToastUtil.centered(getContext(), "调用位置更新" + location.toString());
|
||||
ToastUtil.showTest(getContext(), "调用位置更新" + location.toString());
|
||||
if (location != null) {
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callLocationResult", location.getLongitude() + "", location.getLatitude() + "");
|
||||
}
|
||||
|
|
@ -550,7 +587,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
|
||||
@Override
|
||||
public void stopLocation() {
|
||||
ToastUtil.centered(getContext(), "调用停止位置更新");
|
||||
ToastUtil.showTest(getContext(), "调用停止位置更新");
|
||||
if (mAgentWeb == null) return;
|
||||
try {
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callLocationError", "-102", "停止定位");
|
||||
|
|
@ -563,19 +600,6 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 需要进行检测的权限数组
|
||||
*/
|
||||
protected String[] needPermissions = {
|
||||
Manifest.permission.CAMERA,
|
||||
Manifest.permission.WRITE_EXTERNAL_STORAGE,
|
||||
Manifest.permission.ACCESS_COARSE_LOCATION,
|
||||
Manifest.permission.ACCESS_FINE_LOCATION,
|
||||
Manifest.permission.READ_EXTERNAL_STORAGE,
|
||||
Manifest.permission.READ_PHONE_STATE,
|
||||
Manifest.permission.CALL_PHONE,
|
||||
Manifest.permission.ACCESS_NETWORK_STATE
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onGranted() {
|
||||
|
|
@ -606,7 +630,7 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
|
||||
@JavascriptInterface
|
||||
public void stopLocation() {
|
||||
// ToastUtil.centered(getContext(),"H5调用了停止定位");
|
||||
ToastUtil.showTest(getContext(), "H5调用了停止定位");
|
||||
LocationGPSManage manage = LocationGPSManage.getInstance();
|
||||
if (gpsLocationListener == null) {
|
||||
gpsLocationListener = getGPSLocationListener();
|
||||
|
|
@ -829,6 +853,109 @@ public class OpenAppActivity extends BaseViewBindActivity<ActivityOpenAppBinding
|
|||
public void goOCRSfzModule() {
|
||||
usComponentSDK.openOcrSfzComponent(OpenAppActivity.this);
|
||||
}
|
||||
|
||||
@JavascriptInterface
|
||||
public void openBluetooth() {
|
||||
BluetoothManage instance = BluetoothManage.getInstance();
|
||||
if (!instance.init()) {
|
||||
ToastUtil.centered(getContext(), "当前设备不支持蓝牙!");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-1", "当前设备不支持蓝牙");
|
||||
return;
|
||||
}
|
||||
if (!instance.isBluetoothOpen(getActivity(), true)) {
|
||||
ToastUtil.centered(getContext(), "请先打开蓝牙!");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-2", "蓝牙未打卡");
|
||||
return;
|
||||
}
|
||||
BluetoothDevice remoteDevice = BluetoothSocket.getInstance().getRemoteDevice();
|
||||
if (remoteDevice!=null){
|
||||
ToastUtil.centered(getContext(),"蓝牙已连接");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothResult", "1", "蓝牙已连接!");
|
||||
}else {
|
||||
openBluetoothFragment();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* [
|
||||
* {"content":"文字内容",
|
||||
* "printType":1,
|
||||
* "pageWidth":100,
|
||||
* "pageHeight":100
|
||||
* },
|
||||
* {"content":"二维码内容",
|
||||
* "printType":2,
|
||||
* "zoomLevel":5,
|
||||
* "pageWidth":100,
|
||||
* "pageHeight":100
|
||||
* },
|
||||
* {"content":"base64",
|
||||
* "printType":3,
|
||||
* "contentWidth:":90,
|
||||
* "contentHeight:":90,
|
||||
* "pageWidth":100,
|
||||
* "pageHeight":100
|
||||
* }
|
||||
* ]
|
||||
* @param json
|
||||
*/
|
||||
@JavascriptInterface
|
||||
public void printContentsJSON(String json) {
|
||||
ToastUtil.centered(getContext(),"JS调起打印事件");
|
||||
LogUtils.w(TAG,"打印内容:"+json);
|
||||
if (StringUtil.isNullOrEmpty(json)) {
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-3", "没有打印内容!");
|
||||
return;
|
||||
}
|
||||
Type type = new TypeToken<List<PrintModel>>() {
|
||||
}.getType();
|
||||
List<PrintModel> data = new Gson().fromJson(json, type);
|
||||
boolean b = BluetoothSocket.getInstance().sendData(data);
|
||||
if (b) {
|
||||
ToastUtil.centered(getContext(),"打印完成");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothResult", "2", "打印完成!");
|
||||
} else {
|
||||
ToastUtil.centered(getContext(),"打印失败");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-4", "打印失败!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void openBluetoothFragment() {
|
||||
// 在Activity中
|
||||
BluetoothDialogFragment dialog = new BluetoothDialogFragment();
|
||||
dialog.setBluetoothFragmentListener(new BluetoothFragmentListener() {
|
||||
@Override
|
||||
public void onClickBluetoothDevice(BluetoothDevice device) {
|
||||
linkBluetooth(device);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onError(int code, String msg) {
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", code+"",msg);
|
||||
}
|
||||
});
|
||||
dialog.show(getSupportFragmentManager(), "MyDialog");
|
||||
}
|
||||
|
||||
private boolean isLinkPrinter = false;
|
||||
|
||||
/*
|
||||
*链接蓝牙
|
||||
*/
|
||||
private void linkBluetooth(BluetoothDevice device) {
|
||||
baseShowDialog("正在链接");
|
||||
if (!BluetoothSocket.getInstance().ConnectPrinter(device.getAddress())) {
|
||||
ToastUtil.centered(getContext(),"蓝牙连接失败");
|
||||
//Toast.makeText(this, "Connect Fail", Toast.LENGTH_SHORT).show();
|
||||
baseDismissDialog();
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothError", "-3", "蓝牙连接失败!");
|
||||
isLinkPrinter = false;
|
||||
} else {
|
||||
ToastUtil.centered(getContext(),"蓝牙已连接");
|
||||
mAgentWeb.getJsAccessEntrace().quickCallJs("callBluetoothResult", "1", "蓝牙已连接!");
|
||||
baseDismissDialog();
|
||||
isLinkPrinter = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -16,6 +16,8 @@ import com.anhui.police.auth.sdk.AuthType;
|
|||
import com.anhui.police.auth.sdk.callback.IAuthTaskType;
|
||||
import com.anhui.police.auth.sdk.callback.IAuthUserListener;
|
||||
|
||||
import com.base.code.binary.Base64;
|
||||
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.rs.macall.androidx.basemodel.callback.PermissionListener;
|
||||
|
||||
|
|
@ -123,8 +125,8 @@ public class StartActivity extends BaseViewBindActivity<ActivityStartBinding> im
|
|||
imei = ReadDeviceInfo.getDeviceId(getContext());
|
||||
if (StringUtil.isNullOrEmpty(imei)) {
|
||||
imei = ReadDeviceInfo.getIMEI1(getContext());
|
||||
RuanseeApplication.getAppCache().setImei(imei);
|
||||
}
|
||||
RuanseeApplication.getAppCache().setImei(imei);
|
||||
}
|
||||
String imsi = RuanseeApplication.getAppCache().getImsi();
|
||||
if (StringUtil.isNullOrEmpty(imsi)) {
|
||||
|
|
@ -134,13 +136,24 @@ public class StartActivity extends BaseViewBindActivity<ActivityStartBinding> im
|
|||
}
|
||||
RuanseeApplication.getAppCache().setImsi(imsi);
|
||||
}
|
||||
|
||||
// if(StringUtil.isNullOrEmpty(imei)){
|
||||
// imei = DeviceIdentifier.getIMEI(this);;
|
||||
// }
|
||||
// //5eb3e978a849befa
|
||||
// String oaid = ReadDeviceInfo.getOAID(getContext());
|
||||
// if ( DeviceID.supportedOAID(this)){
|
||||
// oaid = DeviceIdentifier.getOAID(this);
|
||||
// }
|
||||
// LogUtils.w("oaid",oaid);
|
||||
// ToastUtil.centered(getContext(),String.format(" IMEI = %S || imsi = %S || oaid = %S ",imei,imsi,oaid));
|
||||
}
|
||||
|
||||
private void setFormal() {
|
||||
// RuanseeApplication.getAppCache().setIpAndPort("192.168.43.183", "8081");
|
||||
RuanseeApplication.getAppCache().setIpAndPort("20.90.2.2", "80");
|
||||
// getAccessToken();
|
||||
if (RuanseeApplication.isHFVersion) {
|
||||
// if (RuanseeApplication.isHFVersion) {
|
||||
// PService ps = new PService(this);
|
||||
// try {
|
||||
// viewBinding.tvLoadMsg.setText("单点登录成功!");
|
||||
|
|
@ -160,7 +173,7 @@ public class StartActivity extends BaseViewBindActivity<ActivityStartBinding> im
|
|||
// viewBinding.tvLoadMsg.setText("用户登录失败!获取用户失败!");
|
||||
// ysFinish();
|
||||
// }
|
||||
} else {
|
||||
// } else {
|
||||
boolean isUpdateAuthType = RuanseeApplication.getBooleanValue("isUpdateAuthType", false);
|
||||
if (isUpdateAuthType) {
|
||||
AuthSDK sdk = AuthSDK.getDefault();
|
||||
|
|
@ -177,7 +190,7 @@ public class StartActivity extends BaseViewBindActivity<ActivityStartBinding> im
|
|||
} else {
|
||||
AuthSDK.getDefault().getToken(0.8f, iTokenListener);
|
||||
}
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
private IAuthUserListener iTokenListener = new IAuthUserListener() {
|
||||
|
|
@ -251,10 +264,14 @@ public class StartActivity extends BaseViewBindActivity<ActivityStartBinding> im
|
|||
}
|
||||
userData.setIp(RuanseeApplication.getAppCache().getLocalIp());
|
||||
ApiModel.uploadOperationLog("3","3","用户登录应用");
|
||||
|
||||
String substring = RuanseeApplication.getUserData().getDeptCode().substring(0, 4);
|
||||
RuanseeApplication.getUserData().setDepartmentCode(substring);
|
||||
RuanseeApplication.getUserData().setDepartmentName(AhdsAddressUtils.getAddressNameByCode(RuanseeApplication.getUserData().getDeptCode()));
|
||||
|
||||
String s = userData.toJson();
|
||||
|
||||
String s1 = Base64.encodeBase64String(s.getBytes());
|
||||
RuanseeApplication.getAppCache().setUserInfo(s1);
|
||||
initWatermark();
|
||||
viewBinding.startMsg.setText("正在获取用户信息!");
|
||||
myHandler.sendEmptyMessageDelayed(2, 800);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ import com.ycgis.macall.personalcenter.p.app.UserData;
|
|||
import com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback;
|
||||
import com.ycgis.macall.personalcenter.p.request.ApiModel;
|
||||
import com.ycgis.macall.personalcenter.p.request.RetrofitService;
|
||||
import com.ycgis.macall.personalcenter.util.AhdsAddressUtils;
|
||||
import com.ycgis.macall.personalcenter.v.adapter.ApplyForMainAdapter;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
@ -44,10 +45,12 @@ import java.util.Map;
|
|||
public class ApplyForMainActivity extends BaseViewBindActivity<ActivityApplyForMainBinding> {
|
||||
private ApplyForMainAdapter applyForMainAdapter;
|
||||
|
||||
//TODO 正式环境地址
|
||||
public static final String BASE_PHOTO_URL = "http://20.90.2.2";
|
||||
public static final String BASE_URL = BASE_PHOTO_URL + "/yysq_app_out/";
|
||||
|
||||
// public static final String BASE_PHOTO_URL = "http://192.168.0.110:8086";
|
||||
//TODO 测试环境地址
|
||||
// public static final String BASE_PHOTO_URL = "http://192.168.0.109:8086";
|
||||
// public static final String BASE_URL = BASE_PHOTO_URL + "/app/";
|
||||
|
||||
private Map<String, ActionBean> actionBeanMap;
|
||||
|
|
@ -93,6 +96,8 @@ public class ApplyForMainActivity extends BaseViewBindActivity<ActivityApplyForM
|
|||
|
||||
@Override
|
||||
protected void start() {
|
||||
//TODO 测试使用
|
||||
// setTestUer();
|
||||
UserData userData = RuanseeApplication.getUserData();
|
||||
viewBinding.tvUserName.setText(String.format("你好!%s警官(%s)", userData.getUserName(), userData.getUserCode()));
|
||||
viewBinding.tvUserDeptName.setText(userData.getDeptName());
|
||||
|
|
@ -189,6 +194,14 @@ public class ApplyForMainActivity extends BaseViewBindActivity<ActivityApplyForM
|
|||
bean4.setIconId(R.drawable.ic_zhyy);
|
||||
actionBeanMap.put("审核记录", bean4);
|
||||
|
||||
ActionBean bean8 = new ActionBean();
|
||||
bean8.setBaseType(1);
|
||||
bean8.setaClass(PersonnelReviewActivity.class);
|
||||
// bean8.addParam("operatingType", 3);
|
||||
bean8.setName("人员审查");
|
||||
bean8.setIconId(R.drawable.ic_zhyy);
|
||||
actionBeanMap.put("人员审查", bean8);
|
||||
|
||||
// dataList.add(bean4);
|
||||
ActionBean bean5 = new ActionBean();
|
||||
bean5.setBaseType(1);
|
||||
|
|
@ -201,9 +214,10 @@ public class ApplyForMainActivity extends BaseViewBindActivity<ActivityApplyForM
|
|||
}
|
||||
|
||||
private void setTestUer() {
|
||||
//53.1.229.115:8086
|
||||
RuanseeApplication.getAppCache().setIpAndPort("20.90.2.2", "80");
|
||||
UserData userData = RuanseeApplication.getUserData();
|
||||
userData.setUserCode("ahst");
|
||||
userData.setUserCode("admin");
|
||||
userData.setUserName("陈乐");
|
||||
userData.setDeptCode("340012000000");
|
||||
userData.setDeptName("省厅");
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
package com.ycgis.macall.personalcenter.v.activity.applyfo;
|
||||
|
||||
import androidx.appcompat.app.AppCompatActivity;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityApplyProcessBinding;
|
||||
|
||||
public class ApplyProcessActivity extends BaseViewBindActivity<ActivityApplyProcessBinding> {
|
||||
|
|
@ -22,7 +21,7 @@ public class ApplyProcessActivity extends BaseViewBindActivity<ActivityApplyProc
|
|||
|
||||
@Override
|
||||
protected void init() {
|
||||
|
||||
viewBinding.titleleft.setOnClickListener(v -> finish());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -41,11 +41,15 @@ import okhttp3.RequestBody;
|
|||
*/
|
||||
public class InitiateApplyForActivity extends BaseViewBindActivity<ActivityInitiateApplyForBinding> {
|
||||
/**
|
||||
* 弃用
|
||||
* 用于缓存选择的用户和角色。
|
||||
* key:应用ID
|
||||
* value : {"应用名称","角色名"}
|
||||
*/
|
||||
private Map<String, String[]> selectValue;
|
||||
// @Deprecated
|
||||
// private Map<String, String[]> selectValue;
|
||||
|
||||
private String[] selectCount;
|
||||
|
||||
private String selectData;
|
||||
private String appId;
|
||||
|
|
@ -90,8 +94,8 @@ public class InitiateApplyForActivity extends BaseViewBindActivity<ActivityIniti
|
|||
viewBinding.tvSelectJs.setOnClickListener(null);
|
||||
appId = bean.getId();
|
||||
viewBinding.contentTitle.setText("撤销权限申请");
|
||||
selectValue = new HashMap<>();
|
||||
selectValue.put(appId,new String[]{bean.getSysName(),bean.getRoleName()});
|
||||
// selectValue = new HashMap<>();
|
||||
// selectValue.put(appId,new String[]{bean.getSysName(),bean.getRoleName()});
|
||||
}
|
||||
}else {
|
||||
viewBinding.btnSelectApp.setOnClickListener(customClickListener);
|
||||
|
|
@ -126,36 +130,44 @@ public class InitiateApplyForActivity extends BaseViewBindActivity<ActivityIniti
|
|||
ToastUtil.centered(getContext(), "选择应用错误!");
|
||||
return;
|
||||
}
|
||||
selectData = data.getStringExtra("selectData");
|
||||
Type type = new TypeToken<Map<String, String[]>>() {
|
||||
}.getType();
|
||||
try {
|
||||
Map<String, String[]> selectValues = new Gson().fromJson(selectData, type);
|
||||
if (selectValues==null){
|
||||
ToastUtil.centered(getContext(),"Type conversion exception");
|
||||
|
||||
selectCount = data.getStringArrayExtra("selectContent");
|
||||
if (selectCount == null||StringUtil.isContainEmpty(selectCount)){
|
||||
ToastUtil.centered(getContext(),"参数错误");
|
||||
return;
|
||||
}
|
||||
if (selectValue!=null){
|
||||
selectValue.clear();
|
||||
}
|
||||
selectValue = selectValues;
|
||||
Set<String> strings = selectValue.keySet();
|
||||
StringBuilder builder = new StringBuilder();
|
||||
String sp = "";
|
||||
for (String key : strings) {
|
||||
builder.append(sp);
|
||||
String[] strings1 = selectValue.get(key);
|
||||
builder.append(strings1[0]);
|
||||
builder.append("(");
|
||||
builder.append(strings1[1]);
|
||||
builder.append(")");
|
||||
sp = ";";
|
||||
}
|
||||
viewBinding.tvSelectApp.setText(builder.toString());
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
ToastUtil.centered(getContext(),"错误:"+e.getMessage());
|
||||
}
|
||||
viewBinding.tvSelectApp.setText(selectCount[1]);
|
||||
|
||||
// selectData = data.getStringExtra("selectData");
|
||||
// Type type = new TypeToken<Map<String, String[]>>() {
|
||||
// }.getType();
|
||||
// try {
|
||||
// Map<String, String[]> selectValues = new Gson().fromJson(selectData, type);
|
||||
// if (selectValues==null){
|
||||
// ToastUtil.centered(getContext(),"Type conversion exception");
|
||||
// return;
|
||||
// }
|
||||
// if (selectValue!=null){
|
||||
// selectValue.clear();
|
||||
// }
|
||||
// selectValue = selectValues;
|
||||
// Set<String> strings = selectValue.keySet();
|
||||
// StringBuilder builder = new StringBuilder();
|
||||
// String sp = "";
|
||||
// for (String key : strings) {
|
||||
// builder.append(sp);
|
||||
// String[] strings1 = selectValue.get(key);
|
||||
// builder.append(strings1[0]);
|
||||
// builder.append("(");
|
||||
// builder.append(strings1[1]);
|
||||
// builder.append(")");
|
||||
// sp = ";";
|
||||
// }
|
||||
// viewBinding.tvSelectApp.setText(builder.toString());
|
||||
// }catch (Exception e){
|
||||
// e.printStackTrace();
|
||||
// ToastUtil.centered(getContext(),"错误:"+e.getMessage());
|
||||
// }
|
||||
}
|
||||
// if (requestCode == 1016) {//选择角色返回
|
||||
// if (data == null) {
|
||||
|
|
@ -187,7 +199,7 @@ public class InitiateApplyForActivity extends BaseViewBindActivity<ActivityIniti
|
|||
private void save() {
|
||||
String selectApp = getTextString(viewBinding.tvSelectApp);
|
||||
if (StringUtil.isNullOrEmpty(selectApp)) {
|
||||
ToastUtil.centered(getContext(), "请选择申请应用!");
|
||||
ToastUtil.centered(getContext(), "请先选择申请权限!");
|
||||
return;
|
||||
}
|
||||
String phone = getEditText(viewBinding.editPhone);
|
||||
|
|
@ -202,22 +214,26 @@ public class InitiateApplyForActivity extends BaseViewBindActivity<ActivityIniti
|
|||
}
|
||||
baseShowDialog("正在提交请稍后...");
|
||||
List<Map<String, Object>> requestData = new ArrayList<>();
|
||||
Set<String> strings = selectValue.keySet();
|
||||
// Set<String> strings = selectValue.keySet();
|
||||
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
|
||||
param.put("roleId", selectCount[0]);
|
||||
param.put("roleName", selectCount[1]);
|
||||
|
||||
param.put("contact", phone);
|
||||
param.put("reason", reason);
|
||||
param.put("opType", getTextString(viewBinding.spSpinner));
|
||||
for (String key : strings) {
|
||||
String[] strings1 = selectValue.get(key);
|
||||
Map<String, Object> param1 = new HashMap<>(param);
|
||||
param1.put("appId", key);
|
||||
param1.put("appName", strings1[0]);
|
||||
param1.put("appRole", strings1[1]);
|
||||
requestData.add(param1);
|
||||
}
|
||||
// for (String key : strings) {
|
||||
// String[] strings1 = selectValue.get(key);
|
||||
// Map<String, Object> param1 = new HashMap<>(param);
|
||||
// param1.put("appId", key);
|
||||
// param1.put("appName", strings1[0]);
|
||||
// param1.put("appRole", strings1[1]);
|
||||
// requestData.add(param1);
|
||||
// }
|
||||
MediaType mediaType = MediaType.Companion.parse("application/json;charset=utf-8");
|
||||
RequestBody stringBody = RequestBody.Companion.create(new Gson().toJson(requestData), mediaType);
|
||||
RequestBody stringBody = RequestBody.Companion.create(new Gson().toJson(param), mediaType);
|
||||
|
||||
Map<String, String> headMap = new HashMap<>(1);
|
||||
headMap.put("app-yysq-token", RuanseeApplication.getAppCache().getApply_token());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,259 @@
|
|||
package com.ycgis.macall.personalcenter.v.activity.applyfo;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
|
||||
import com.rs.macall.androidx.basemodel.decoration.MyDividerItemDecoration;
|
||||
import com.rs.macall.androidx.basemodel.utils.LogUtils;
|
||||
import com.rs.macall.androidx.basemodel.utils.SmartRefreshLayoutHelp;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.TypConversion;
|
||||
import com.scwang.smart.refresh.layout.api.RefreshLayout;
|
||||
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityPersonnelReviewBinding;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.ApplyBean;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.BaseBean;
|
||||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback;
|
||||
import com.ycgis.macall.personalcenter.p.request.ApiModel;
|
||||
import com.ycgis.macall.personalcenter.p.request.RetrofitService;
|
||||
import com.ycgis.macall.personalcenter.v.adapter.InitiateRecordAdapter;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.json.JSONArray;
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 人员审查
|
||||
*/
|
||||
public class PersonnelReviewActivity extends BaseViewBindActivity<ActivityPersonnelReviewBinding> {
|
||||
private InitiateRecordAdapter adapter;
|
||||
|
||||
private int page;
|
||||
private final int pageSize = 10;
|
||||
private int total;
|
||||
|
||||
@Override
|
||||
protected boolean isImmersiveStatusBar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected ActivityPersonnelReviewBinding getViewBinding() {
|
||||
return ActivityPersonnelReviewBinding.inflate(getLayoutInflater());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
viewBinding.reviewSearch.editQuery.setHint("请输入警号姓名搜索");
|
||||
SmartRefreshLayoutHelp.setRefreshAndLoad(getContext(), viewBinding.reviewSrf);
|
||||
viewBinding.reviewRv.addItemDecoration(new MyDividerItemDecoration(getContext(),LinearLayoutManager.VERTICAL));
|
||||
viewBinding.reviewRv.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
viewBinding.reviewTitle.titleleft.setOnClickListener(v -> finish());
|
||||
viewBinding.reviewTitle.leftImage.setImageDrawable(getDrawable(R.drawable.ic_back));
|
||||
viewBinding.reviewTitle.contentTitle.setText("人员审查");
|
||||
viewBinding.reviewSearch.editQuery.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readInstanceState(Bundle savedInstanceState) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void start() {
|
||||
viewBinding.reviewSearch.editQuery.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
||||
@Override
|
||||
public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
String editText = getEditText(viewBinding.reviewSearch.editQuery);
|
||||
searchData(editText);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
viewBinding.reviewSrf.setOnRefreshLoadMoreListener(new OnRefreshLoadMoreListener() {
|
||||
@Override
|
||||
public void onLoadMore(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
if (pageSize * page >= total) {
|
||||
//没有gengd
|
||||
refreshLayout.finishLoadMoreWithNoMoreData();
|
||||
return;
|
||||
}
|
||||
page++;
|
||||
getData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRefresh(@NonNull @NotNull RefreshLayout refreshLayout) {
|
||||
refreshLayout.resetNoMoreData();
|
||||
page = 1;
|
||||
getData();
|
||||
}
|
||||
});
|
||||
viewBinding.reviewSrf.autoRefresh();
|
||||
}
|
||||
|
||||
private void searchData(String searchWord) {
|
||||
if (StringUtil.isNullOrEmpty(searchWord)) {
|
||||
ToastUtil.centered(getContext(), "请输入警号或者姓名进行搜索!");
|
||||
return;
|
||||
}
|
||||
viewBinding.reviewSrf.autoRefresh();
|
||||
}
|
||||
|
||||
private void getData() {
|
||||
String editText = getEditText(viewBinding.reviewSearch.editQuery);
|
||||
Map<String, String> headMap = new HashMap<>(1);
|
||||
headMap.put("app-yysq-token", RuanseeApplication.getAppCache().getApply_token());
|
||||
Map<String, Object> param = new HashMap<>();
|
||||
param.put("pageSize", String.valueOf(pageSize));
|
||||
param.put("pageNum", String.valueOf(page));
|
||||
if (StringUtil.hasContent(editText)) {
|
||||
if (StringUtil.isInteger(editText)) {
|
||||
param.put("userName", editText);
|
||||
} else {
|
||||
param.put("nickName", editText);
|
||||
}
|
||||
}
|
||||
ApiModel.request(RetrofitService.getBaseInstance().applyGet(ApplyForMainActivity.BASE_URL + "apply/shenchalist", headMap, param),
|
||||
new BaseRequestCallback<JsonObject>() {
|
||||
|
||||
@Override
|
||||
public void onRequestSuccess(JsonObject result) {
|
||||
LogUtils.d(result.toString());
|
||||
try {
|
||||
JSONObject object = new JSONObject(result.toString());
|
||||
int code = TypConversion.getJsonInt(object, "code", -1);
|
||||
if (code == 200) {
|
||||
total = TypConversion.getJsonInt(object, "total", -1);
|
||||
JSONArray rows = TypConversion.getJSONArray(object, "rows");
|
||||
|
||||
List<BaseBean> dataList = new ArrayList<>();
|
||||
for (int i = 0; i < rows.length(); i++) {
|
||||
JSONObject jsonObject = TypConversion.getJSONObject(rows, i);
|
||||
if (jsonObject == null) return;
|
||||
ApplyBean bean = new ApplyBean();
|
||||
bean.setBaseType(3);
|
||||
bean.setApplyReason(TypConversion.getJsonStr(jsonObject, "reason"));
|
||||
bean.setId(TypConversion.getJsonStr(jsonObject, "id"));
|
||||
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "roleName"));
|
||||
bean.setNode(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
bean.setPhone(TypConversion.getJsonStr(jsonObject, "contact"));
|
||||
bean.setName(TypConversion.getJsonStr(jsonObject, "nickName"));
|
||||
bean.setCode(TypConversion.getJsonStr(jsonObject, "userName"));
|
||||
bean.setDeptCode(TypConversion.getJsonStr(jsonObject, "deptId"));
|
||||
bean.setDeptName(TypConversion.getJsonStr(jsonObject, "deptName"));
|
||||
bean.setIdCordNum(TypConversion.getJsonStr(jsonObject, "idcard"));
|
||||
bean.setState(1);
|
||||
bean.setTime(TypConversion.getJsonStr(jsonObject, "opTime"));
|
||||
bean.setUserId(TypConversion.getJsonStr(jsonObject, "userId"));
|
||||
bean.setApplyReason(TypConversion.getJsonStr(jsonObject, "reason"));
|
||||
String opType = TypConversion.getJsonStr(jsonObject, "opType");
|
||||
bean.setType("申请".equals(opType) ? 1 : 2);
|
||||
dataList.add(bean);
|
||||
}
|
||||
if (viewBinding.reviewSrf.isRefreshing()) {
|
||||
viewBinding.reviewSrf.finishRefresh();
|
||||
if (dataList.isEmpty()) {
|
||||
getErrorList(0, "暂无审核记录!");
|
||||
return;
|
||||
}
|
||||
initData(dataList);
|
||||
} else {
|
||||
viewBinding.reviewSrf.finishLoadMore();
|
||||
if (!dataList.isEmpty()) {
|
||||
adapter.addData(dataList);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (viewBinding.reviewSrf.isRefreshing()) {
|
||||
viewBinding.reviewSrf.finishRefresh();
|
||||
getErrorList(-1, TypConversion.getJsonStr(object, "msg"));
|
||||
} else {
|
||||
viewBinding.reviewSrf.finishLoadMore();
|
||||
ToastUtil.centered(getContext(), TypConversion.getJsonStr(object, "msg"));
|
||||
}
|
||||
}
|
||||
} catch (JSONException e) {
|
||||
e.printStackTrace();
|
||||
if (viewBinding.reviewSrf.isRefreshing()) {
|
||||
viewBinding.reviewSrf.finishRefresh();
|
||||
getErrorList(-1, e.getMessage());
|
||||
} else {
|
||||
viewBinding.reviewSrf.finishLoadMore();
|
||||
ToastUtil.centered(getContext(), e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRequestFailure(String msg) {
|
||||
LogUtils.e(msg);
|
||||
if (viewBinding.reviewSrf.isRefreshing()) {
|
||||
viewBinding.reviewSrf.finishRefresh();
|
||||
getErrorList(-1, msg);
|
||||
} else {
|
||||
viewBinding.reviewSrf.finishLoadMore();
|
||||
ToastUtil.centered(getContext(), msg);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
private void getErrorList(int type, String msg) {
|
||||
List<BaseBean> baseBeans = new ArrayList<>();
|
||||
BaseBean baseBean = new BaseBean() {
|
||||
};
|
||||
baseBean.setBaseType(type);
|
||||
baseBean.setBaseMessage(msg);
|
||||
baseBeans.add(baseBean);
|
||||
initData(baseBeans);
|
||||
}
|
||||
|
||||
private void initData(List<BaseBean> baseBeans) {
|
||||
if (adapter == null) {
|
||||
adapter = new InitiateRecordAdapter(getContext(), baseBeans);
|
||||
adapter.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
BaseBean dataItem = adapter.getDataItem(pointer);
|
||||
if (dataItem instanceof ApplyBean) {
|
||||
ApplyBean bean = (ApplyBean) dataItem;
|
||||
Intent intent = new Intent(getContext(), ApplyDetailsActivity.class);
|
||||
intent.putExtra("data", new Gson().toJson(bean));
|
||||
intent.putExtra("operatingType", 3);
|
||||
startActivity(intent);
|
||||
}
|
||||
}
|
||||
});
|
||||
viewBinding.reviewRv.setAdapter(adapter);
|
||||
} else {
|
||||
adapter.upData(baseBeans);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -82,6 +82,7 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
}
|
||||
}
|
||||
});
|
||||
viewBinding.rvAppList.addItemDecoration(new MyDividerItemDecoration(getContext(),LinearLayoutManager.VERTICAL,45));
|
||||
viewBinding.rvAppList.addItemDecoration(myDividerItemDecoration);
|
||||
// viewBinding.search.editQuery.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||
SmartRefreshLayoutHelp.setPullDownToRefresh(getContext(), viewBinding.srlRefresh);
|
||||
|
|
@ -94,10 +95,10 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
|
||||
@Override
|
||||
protected void start() {
|
||||
viewBinding.leftImage.setImageDrawable(getDrawables(R.drawable.back_cliener));
|
||||
// viewBinding.leftImage.setImageDrawable(getDrawables(R.drawable.back_cliener));
|
||||
viewBinding.rightText.setText("确定");
|
||||
// goneView(viewBinding.search.getRoot());
|
||||
viewBinding.contentTitle.setText("选择应用和角色");
|
||||
viewBinding.contentTitle.setText(R.string.applyTitleSelectPermissions1);
|
||||
setViewOnClickListener(viewBinding.titleright);
|
||||
setViewOnClickListener(viewBinding.titleleft);
|
||||
// queryEvent();
|
||||
|
|
@ -146,6 +147,22 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
}
|
||||
|
||||
private void submit() {
|
||||
if (selectContent == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (StringUtil.isContainEmpty(selectContent)) {
|
||||
ToastUtil.centered(getContext(), "请选择权限");
|
||||
return;
|
||||
}
|
||||
Intent intent = new Intent();
|
||||
// intent.putExtra("roleId", String.valueOf(bean1.getId()));
|
||||
// intent.putExtra("selectData", new Gson().toJson(param));
|
||||
intent.putExtra("selectContent", selectContent);
|
||||
setResult(Activity.RESULT_OK, intent);
|
||||
finish();
|
||||
}
|
||||
/*private void submit() {
|
||||
if (appAdapter == null) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -167,12 +184,12 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
intent.putExtra("selectData", new Gson().toJson(param));
|
||||
setResult(Activity.RESULT_OK, intent);
|
||||
finish();
|
||||
}
|
||||
}*/
|
||||
|
||||
private void getAppData() {
|
||||
Map<String, String> headMap = new HashMap<>(1);
|
||||
headMap.put("app-yysq-token", RuanseeApplication.getAppCache().getApply_token());
|
||||
ApiModel.request(RetrofitService.getBaseInstance().applyGet(ApplyForMainActivity.BASE_URL + "app/alllist", headMap, new HashMap<>()),
|
||||
ApiModel.request(RetrofitService.getBaseInstance().applyGet(ApplyForMainActivity.BASE_URL + "role/alllist", headMap, new HashMap<>()),
|
||||
new BaseRequestCallback<JsonObject>() {
|
||||
@Override
|
||||
public void onRequestFailure(String msg) {
|
||||
|
|
@ -203,8 +220,8 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
initAppData(dataList);
|
||||
return;
|
||||
}
|
||||
List<ApplyAppBean.DataBean> data = applyAppBean.getData();
|
||||
handlerData(data);
|
||||
List<ApplyAppBean.DataBean2> data = applyAppBean.getData();
|
||||
handlerData2(data);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
List<BaseBean> dataList = new ArrayList<>();
|
||||
|
|
@ -219,6 +236,24 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
});
|
||||
}
|
||||
|
||||
private void handlerData2(List<ApplyAppBean.DataBean2> data) {
|
||||
List<BaseBean> dataList = new ArrayList<>();
|
||||
if (data == null || data.isEmpty()) {
|
||||
BaseBean baseBean = new BaseBean() {
|
||||
};
|
||||
baseBean.setBaseType(0);
|
||||
baseBean.setBaseMessage("暂无应用");
|
||||
dataList.add(baseBean);
|
||||
} else {
|
||||
for (ApplyAppBean.DataBean2 b : data) {
|
||||
b.setBaseType(4);
|
||||
dataList.add(b);
|
||||
}
|
||||
}
|
||||
initAppData(dataList);
|
||||
}
|
||||
|
||||
|
||||
private void handlerData(List<ApplyAppBean.DataBean> data) {
|
||||
Map<String, String[]> stringMap = null;
|
||||
if (StringUtil.hasContent(selectData)) {
|
||||
|
|
@ -317,6 +352,8 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
|
||||
private int selectPointer = 0;
|
||||
|
||||
private String[] selectContent = new String[2];
|
||||
|
||||
//
|
||||
private void initAppData(List<BaseBean> dataList) {
|
||||
if (appAdapter == null) {
|
||||
|
|
@ -326,6 +363,38 @@ public class SelectSystemActivity extends BaseViewBindActivity<ActivitySelectSys
|
|||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
BaseBean item = appAdapter.getDataItem(pointer);
|
||||
if (item instanceof ApplyAppBean.DataBean2) {
|
||||
ApplyAppBean.DataBean2 dataItem = (ApplyAppBean.DataBean2) item;
|
||||
if (dataItem.isSelect()) {
|
||||
dataItem.setSelect(false);
|
||||
appAdapter.notifyItemChanged(pointer, 1);
|
||||
selectContent[0] = "";
|
||||
selectContent[1] = "";
|
||||
return;
|
||||
}
|
||||
List<BaseBean> data = appAdapter.getData();
|
||||
int lastIndex = -1;
|
||||
for (int i = 0; i < data.size(); i++) {
|
||||
BaseBean baseBean = data.get(i);
|
||||
if (baseBean instanceof ApplyAppBean.DataBean2) {
|
||||
ApplyAppBean.DataBean2 d = (ApplyAppBean.DataBean2) baseBean;
|
||||
if (d.isSelect()) {
|
||||
lastIndex = i;
|
||||
d.setSelect(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
dataItem = (ApplyAppBean.DataBean2) item;
|
||||
dataItem.setSelect(true);
|
||||
appAdapter.notifyItemChanged(pointer, 1);
|
||||
selectContent[0] = String.valueOf(dataItem.getId());
|
||||
selectContent[1] = dataItem.getRoleName();
|
||||
if (lastIndex == -1)return;
|
||||
appAdapter.notifyItemChanged(lastIndex, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
if (item instanceof ApplyAppBean.DataBean) {
|
||||
ApplyAppBean.DataBean dataItem = (ApplyAppBean.DataBean) item;
|
||||
if (dataItem.getBaseType() != 1) return;
|
||||
|
|
|
|||
|
|
@ -308,8 +308,8 @@ public class ToBeReviewedActivity extends BaseViewBindActivity<ActivityToBeRevie
|
|||
ApplyBean bean = new ApplyBean();
|
||||
bean.setBaseType(operatingType);
|
||||
bean.setId(TypConversion.getJsonStr(jsonObject, "id"));
|
||||
bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
// bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
// bean.setRoleName(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
bean.setPhone(TypConversion.getJsonStr(jsonObject, "contact"));
|
||||
bean.setApplyReason(TypConversion.getJsonStr(jsonObject, "reason"));
|
||||
bean.setSysId(TypConversion.getJsonStr(jsonObject, "appId"));
|
||||
|
|
@ -323,6 +323,7 @@ public class ToBeReviewedActivity extends BaseViewBindActivity<ActivityToBeRevie
|
|||
bean.setTime(TypConversion.getJsonStr(jsonObject, "opTime"));
|
||||
bean.setUserId(TypConversion.getJsonStr(jsonObject, "userId"));
|
||||
String opType = TypConversion.getJsonStr(jsonObject, "opType");
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "roleName"));
|
||||
bean.setType("申请".equals(opType) ? 1 : 2);
|
||||
dataList.add(bean);
|
||||
}
|
||||
|
|
@ -401,8 +402,8 @@ public class ToBeReviewedActivity extends BaseViewBindActivity<ActivityToBeRevie
|
|||
ApplyBean bean = new ApplyBean();
|
||||
bean.setBaseType(operatingType);
|
||||
bean.setId(TypConversion.getJsonStr(jsonObject, "id"));
|
||||
bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
// bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
// bean.setRoleName(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
bean.setName(TypConversion.getJsonStr(jsonObject, "nickName"));
|
||||
bean.setCode(TypConversion.getJsonStr(jsonObject, "userName"));
|
||||
bean.setDeptCode(TypConversion.getJsonStr(jsonObject, "deptId"));
|
||||
|
|
@ -414,6 +415,7 @@ public class ToBeReviewedActivity extends BaseViewBindActivity<ActivityToBeRevie
|
|||
bean.setTime(TypConversion.getJsonStr(jsonObject, "opTime"));
|
||||
bean.setUserId(TypConversion.getJsonStr(jsonObject, "userId"));
|
||||
String opType = TypConversion.getJsonStr(jsonObject, "opType");
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "roleName"));
|
||||
bean.setType("申请".equals(opType) ? 1 : 2);
|
||||
dataList.add(bean);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,15 +4,17 @@ import android.content.Intent;
|
|||
import android.os.Bundle;
|
||||
import android.text.Editable;
|
||||
import android.text.TextWatcher;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.Gravity;
|
||||
import android.view.MenuItem;
|
||||
import android.view.View;
|
||||
import android.view.inputmethod.EditorInfo;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.appcompat.widget.PopupMenu;
|
||||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
import com.rs.macall.androidx.basemodel.callback.CustomClickListener;
|
||||
import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
|
||||
|
|
@ -21,6 +23,7 @@ import com.rs.macall.androidx.basemodel.utils.LogUtils;
|
|||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.TypConversion;
|
||||
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ActivityTravelAssistantBinding;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.TravelCityBean;
|
||||
|
|
@ -39,11 +42,13 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* 差旅助手
|
||||
*/
|
||||
public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravelAssistantBinding> {
|
||||
private TravelAssistantAdapter historyAdapter, popularAdapter;
|
||||
private TravelSearchListAdapter searchAdapter;
|
||||
private int level = 2;
|
||||
|
||||
@Override
|
||||
protected ActivityTravelAssistantBinding getViewBinding() {
|
||||
|
|
@ -77,6 +82,7 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
viewBinding.travelTitle.contentTitle.setText("差旅助手");
|
||||
viewBinding.travelTitle.leftImage.setImageDrawable(getDrawable(R.drawable.back_cliener));
|
||||
viewBinding.travelTitle.titleleft.setOnClickListener(v -> finish());
|
||||
viewBinding.travelTitle.rightText.setText("一般人员▼");
|
||||
viewBinding.trvaelSearch.editQuery.setHint("搜索城市 如:北京/bj/beijing");
|
||||
viewBinding.trvaelSearch.editQuery.setImeOptions(EditorInfo.IME_ACTION_SEARCH);
|
||||
viewBinding.trvaelSearch.btnClean.setOnClickListener(new CustomClickListener() {
|
||||
|
|
@ -86,6 +92,12 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
goneView(viewBinding.travelRvApplist);
|
||||
}
|
||||
});
|
||||
viewBinding.travelTitle.rightText.setOnClickListener(new CustomClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
popup(v);
|
||||
}
|
||||
});
|
||||
viewBinding.trvaelSearch.editQuery.setOnEditorActionListener((v, actionId, event) -> {
|
||||
if (actionId == EditorInfo.IME_ACTION_SEARCH) {
|
||||
String searchWord = getEditText(viewBinding.trvaelSearch.editQuery);
|
||||
|
|
@ -95,7 +107,6 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
}
|
||||
return false;
|
||||
});
|
||||
|
||||
viewBinding.trvaelSearch.editQuery.addTextChangedListener(new TextWatcher() {
|
||||
@Override
|
||||
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
||||
|
|
@ -119,7 +130,7 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
baseShowDialog("正在获取数据,请稍后...");
|
||||
getDataS();
|
||||
}
|
||||
|
||||
//083432 范
|
||||
private TravelCityBean getErrorBean(int type, String msg) {
|
||||
TravelCityBean bean = new TravelCityBean();
|
||||
bean.setBaseType(type);
|
||||
|
|
@ -127,6 +138,20 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
return bean;
|
||||
}
|
||||
|
||||
public void popup(View view) {
|
||||
PopupMenu popupMenu = new PopupMenu(this, view, Gravity.RIGHT);
|
||||
popupMenu.inflate(R.menu.travel_assistant_level);
|
||||
popupMenu.show();
|
||||
popupMenu.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener() {
|
||||
@Override
|
||||
public boolean onMenuItemClick(MenuItem item) {
|
||||
viewBinding.travelTitle.rightText.setText(item.getTitle()+"▼");
|
||||
level = item.getItemId() == R.id.menu_travel_level2?1:2;
|
||||
return false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private void searchApp(String searchWord) {
|
||||
ApiModel.request(RetrofitService.getBaseInstance().getSearchCity(searchWord), new BaseRequestCallback<JsonObject>() {
|
||||
@Override
|
||||
|
|
@ -294,7 +319,7 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
historyAdapter.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
TravelCityBean dataItem = popularAdapter.getDataItem(pointer);
|
||||
TravelCityBean dataItem = historyAdapter.getDataItem(pointer);
|
||||
if (dataItem.getBaseType() == 1) {
|
||||
handlerFootData(dataItem);
|
||||
}
|
||||
|
|
@ -308,7 +333,7 @@ public class TravelAssistantActivity extends BaseViewBindActivity<ActivityTravel
|
|||
private void handlerFootData(TravelCityBean bean) {
|
||||
Intent intent = new Intent(getContext(), TravelDetailsActivity.class);
|
||||
intent.putExtra("cityName", bean.getName());
|
||||
intent.putExtra("level", "1");
|
||||
intent.putExtra("level", String.valueOf(level));
|
||||
startActivity(intent);
|
||||
if (historyAdapter == null) return;
|
||||
List<TravelCityBean> data = historyAdapter.getData();
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
package com.ycgis.macall.personalcenter.v.activity.travel;
|
||||
|
||||
|
||||
import android.content.Intent;
|
||||
import android.os.Bundle;
|
||||
|
||||
|
|
@ -15,7 +14,6 @@ import com.ycgis.macall.personalcenter.databinding.ActivityTravelDetailsBinding;
|
|||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.p.callback.BaseRequestCallback;
|
||||
import com.ycgis.macall.personalcenter.p.request.ApiModel;
|
||||
import com.ycgis.macall.personalcenter.p.request.CommonComposite;
|
||||
import com.ycgis.macall.personalcenter.p.request.CommonCompositeManage;
|
||||
import com.ycgis.macall.personalcenter.p.request.RetrofitService;
|
||||
|
||||
|
|
@ -24,6 +22,7 @@ import org.json.JSONObject;
|
|||
|
||||
public class TravelDetailsActivity extends BaseViewBindActivity<ActivityTravelDetailsBinding> {
|
||||
private String cityName;
|
||||
// 1 是 司局级人员 2 是一般人员
|
||||
private String level;
|
||||
|
||||
@Override
|
||||
|
|
@ -52,7 +51,11 @@ public class TravelDetailsActivity extends BaseViewBindActivity<ActivityTravelDe
|
|||
|
||||
@Override
|
||||
protected void start() {
|
||||
if ("1".equals(level)){
|
||||
viewBinding.travelDetalisTitle.contentTitle.setText("司局级报销标准");
|
||||
}else {
|
||||
viewBinding.travelDetalisTitle.contentTitle.setText("一般人员报销标准");
|
||||
}
|
||||
viewBinding.travelDetalisTitle.leftImage.setImageDrawable(getDrawable(R.drawable.back_cliener));
|
||||
viewBinding.travelDetalisTitle.titleleft.setOnClickListener(v -> finish());
|
||||
baseShowDialog("正在加载请稍后...");
|
||||
|
|
|
|||
|
|
@ -0,0 +1,89 @@
|
|||
package com.ycgis.macall.personalcenter.v.adapter;
|
||||
|
||||
import android.annotation.SuppressLint;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.Context;
|
||||
import android.os.Build;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.widget.TextView;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.rs.macall.androidx.basemodel.base.BaseRecyclerAdapter;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.BluetoothOV;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/29 16:38
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BluetoothListAdapter extends BaseRecyclerAdapter<BluetoothDevice ,BaseRecyclerAdapter.ViewHolder> {
|
||||
|
||||
public BluetoothListAdapter(Context context, List<BluetoothDevice> dataList) {
|
||||
super(context, dataList);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@NotNull
|
||||
@Override
|
||||
public BaseRecyclerAdapter.ViewHolder onCreateViewHolder(@NonNull @NotNull ViewGroup parent, int viewType) {
|
||||
View inflate = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_bluetooth_list, parent, false);
|
||||
return new SimpleViewHolder(inflate).findViewById(R.id.bluetooth_name).findViewById(R.id.bluetooth_mac).findViewById(R.id.bluetooth_status);
|
||||
}
|
||||
|
||||
@SuppressLint("SetTextI18n")
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull BaseRecyclerAdapter.ViewHolder viewHolder, int position) {
|
||||
BluetoothDevice dataItem = getDataItem(position);
|
||||
if (viewHolder instanceof BaseRecyclerAdapter.SimpleViewHolder){
|
||||
SimpleViewHolder holder =(SimpleViewHolder)viewHolder;
|
||||
TextView name = holder.getView(R.id.bluetooth_name, TextView.class);
|
||||
TextView address = holder.getView(R.id.bluetooth_mac, TextView.class);
|
||||
TextView status = holder.getView(R.id.bluetooth_status, TextView.class);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
||||
name.setText(dataItem.getAlias());
|
||||
} else {
|
||||
name.setText(dataItem.getName());
|
||||
}
|
||||
address.setText(dataItem.getAddress());
|
||||
status.setText(getStatusStr(dataItem.getBondState())+" "+ getTypeStr(dataItem.getType()) );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getStatusStr(int status) {
|
||||
if (status == 11) {
|
||||
return "正在配对";
|
||||
}
|
||||
if (status == 12) {
|
||||
return "已配对";
|
||||
}
|
||||
return "未配对";
|
||||
}
|
||||
|
||||
public String getTypeStr(int type) {
|
||||
switch (type) {
|
||||
case 1:
|
||||
|
||||
return "BR/EDR";
|
||||
case 2:
|
||||
|
||||
return "LE-only";
|
||||
case 3:
|
||||
|
||||
return "BR/EDR/LE";
|
||||
case 0:
|
||||
default:
|
||||
|
||||
return "未知";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ycgis.macall.personalcenter.v.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
|
|
@ -140,6 +141,8 @@ public class InitiateRecordAdapter extends BaseRecyclerAdapter<BaseBean, BaseRec
|
|||
});
|
||||
}
|
||||
binding.setData(dataItem);
|
||||
binding.tvSystemName.setText(Html.fromHtml(dataItem.getAuthorityStr()));
|
||||
|
||||
if (longClickListener != null) {
|
||||
binding.getRoot().setOnLongClickListener(new OnAdapterLongClickListener<BaseBean>(dataItem, position) {
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.ycgis.macall.personalcenter.v.adapter;
|
||||
|
||||
import android.content.Context;
|
||||
import android.text.Html;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
|
@ -13,7 +14,9 @@ import com.bumptech.glide.Glide;
|
|||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseRecyclerAdapter;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.ItemApplySelectRoleBinding;
|
||||
import com.ycgis.macall.personalcenter.databinding.ItemSelecctRoleBinding;
|
||||
import com.ycgis.macall.personalcenter.databinding.ItemSelectAppBinding;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.ApplyAppBean;
|
||||
|
|
@ -66,16 +69,54 @@ public class SelectSystemAdapter extends BaseRecyclerAdapter<BaseBean, BaseRecyc
|
|||
ItemSelecctRoleBinding binding = ItemSelecctRoleBinding.bind(view);
|
||||
return new ShowRoleViewHolder(binding);
|
||||
}
|
||||
if (viewType == 4) {
|
||||
View view = bindView(parent, R.layout.item_apply_select_role);
|
||||
ItemApplySelectRoleBinding binding = ItemApplySelectRoleBinding.bind(view);
|
||||
return new ViewBindingHolder<>(binding);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBindViewHolder(@NonNull @NotNull BaseRecyclerAdapter.ViewHolder viewHolder, int position) {
|
||||
BaseBean item = getDataItem(position);
|
||||
if (viewHolder instanceof BaseRecyclerAdapter.ViewBindingHolder) {
|
||||
ViewBindingHolder holder = (ViewBindingHolder) viewHolder;
|
||||
if (holder.viewBind instanceof ItemApplySelectRoleBinding){
|
||||
ItemApplySelectRoleBinding binding = (ItemApplySelectRoleBinding) holder.viewBind;
|
||||
if (item instanceof ApplyAppBean.DataBean2){
|
||||
ApplyAppBean.DataBean2 dataItem = (ApplyAppBean.DataBean2) item;
|
||||
if (dataItem.isSelect()) {
|
||||
binding.ivSelect.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_item_sel));
|
||||
binding.getRoot().setBackground(ContextCompat.getDrawable(context, R.color.colorGreen4));
|
||||
} else {
|
||||
binding.ivSelect.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.select_def));
|
||||
binding.getRoot().setBackground(ContextCompat.getDrawable(context, R.color.colorWhite));
|
||||
}
|
||||
if (StringUtil.hasContent(dataItem.getRoleName())){
|
||||
StringBuilder builder = new StringBuilder();
|
||||
if (dataItem.getRoleName().contains("普通")){
|
||||
builder.append("<font color=\"#323232\">");
|
||||
builder.append(dataItem.getRoleName());
|
||||
builder.append("</font><font color=\"#888888\"> (");
|
||||
builder.append(dataItem.getRemark());
|
||||
builder.append(")</font>");
|
||||
}else {
|
||||
builder.append("<font color=\"#fb8c00\">");
|
||||
builder.append(dataItem.getRoleName());
|
||||
builder.append("</font><font color=\"#ffcc80\"> (");
|
||||
builder.append(dataItem.getRemark());
|
||||
builder.append(")</font>");
|
||||
}
|
||||
binding.tvAppName.setText(Html.fromHtml(builder.toString()));
|
||||
}
|
||||
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (holder.viewBind instanceof ItemSelectAppBinding) {
|
||||
ItemSelectAppBinding binding = (ItemSelectAppBinding) holder.viewBind;
|
||||
BaseBean item = getDataItem(position);
|
||||
if (item instanceof SelectAppBean) {
|
||||
SelectAppBean dataItem = (SelectAppBean) item;
|
||||
binding.tvAppName.setText(dataItem.getAppName());
|
||||
|
|
@ -156,11 +197,25 @@ public class SelectSystemAdapter extends BaseRecyclerAdapter<BaseBean, BaseRecyc
|
|||
if (!(o instanceof Integer)) return;
|
||||
int a = (int) o;
|
||||
if (a == 1) {
|
||||
BaseBean item = getDataItem(position);
|
||||
if (viewHolder instanceof BaseRecyclerAdapter.ViewBindingHolder) {
|
||||
ViewBindingHolder holder = (ViewBindingHolder) viewHolder;
|
||||
if (holder.viewBind instanceof ItemApplySelectRoleBinding) {
|
||||
ItemApplySelectRoleBinding binding = (ItemApplySelectRoleBinding) holder.viewBind;
|
||||
if (item instanceof ApplyAppBean.DataBean2) {
|
||||
ApplyAppBean.DataBean2 dataItem = (ApplyAppBean.DataBean2) item;
|
||||
if (dataItem.isSelect()) {
|
||||
binding.ivSelect.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.icon_item_sel));
|
||||
binding.getRoot().setBackground(ContextCompat.getDrawable(context, R.color.colorGreen4));
|
||||
} else {
|
||||
binding.ivSelect.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.select_def));
|
||||
binding.getRoot().setBackground(ContextCompat.getDrawable(context, R.color.colorWhite));
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (holder.viewBind instanceof ItemSelectAppBinding) {
|
||||
ItemSelectAppBinding binding = (ItemSelectAppBinding) holder.viewBind;
|
||||
BaseBean item = getDataItem(position);
|
||||
if (item instanceof ApplyAppBean.DataBean) {
|
||||
ApplyAppBean.DataBean dataItem = (ApplyAppBean.DataBean) item;
|
||||
if (dataItem.isSelect()) {
|
||||
|
|
|
|||
|
|
@ -187,9 +187,10 @@ public class ApplyRecordFragment extends BaseViewBindFragment<FragmentApplyRecor
|
|||
ApplyBean bean = new ApplyBean();
|
||||
bean.setBaseType(1);
|
||||
bean.setId(TypConversion.getJsonStr(jsonObject,"id"));
|
||||
bean.setSysId(TypConversion.getJsonStr(jsonObject,"appId"));
|
||||
bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
// bean.setSysId(TypConversion.getJsonStr(jsonObject,"appId"));
|
||||
// bean.setSysName(TypConversion.getJsonStr(jsonObject, "appName"));
|
||||
bean.setRoleName(TypConversion.getJsonStr(jsonObject, "roleName"));
|
||||
bean.setNode(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
bean.setPhone(TypConversion.getJsonStr(jsonObject, "contact"));
|
||||
bean.setName(TypConversion.getJsonStr(jsonObject, "nickName"));
|
||||
bean.setCode(TypConversion.getJsonStr(jsonObject, "userName"));
|
||||
|
|
@ -197,7 +198,6 @@ public class ApplyRecordFragment extends BaseViewBindFragment<FragmentApplyRecor
|
|||
bean.setDeptName(TypConversion.getJsonStr(jsonObject, "deptName"));
|
||||
bean.setIdCordNum(TypConversion.getJsonStr(jsonObject, "idcard"));
|
||||
bean.setState(TypConversion.getJsonInt(jsonObject, "status", 11));
|
||||
bean.setNode(TypConversion.getJsonStr(jsonObject, "appRole"));
|
||||
bean.setTime(TypConversion.getJsonStr(jsonObject, "opTime"));
|
||||
bean.setUserId(TypConversion.getJsonStr(jsonObject, "userId"));
|
||||
bean.setApplyReason(TypConversion.getJsonStr(jsonObject, "reason"));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,250 @@
|
|||
package com.ycgis.macall.personalcenter.v.fragment;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.os.Bundle;
|
||||
import android.util.Log;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.fragment.app.DialogFragment;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import com.rs.macall.androidx.basemodel.callback.CustomClickListener;
|
||||
import com.rs.macall.androidx.basemodel.callback.SimpleListClickListener;
|
||||
import com.rs.macall.androidx.basemodel.decoration.MyDividerItemDecoration;
|
||||
import com.rs.macall.androidx.basemodel.utils.DimensionConvert;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.rs.macall.androidx.basemodel.utils.ToastUtil;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.FragmendDialogBluetoothBinding;
|
||||
import com.ycgis.macall.personalcenter.p.callback.BluetoothFragmentListener;
|
||||
import com.ycgis.macall.personalcenter.util.BluetoothManage;
|
||||
import com.ycgis.macall.personalcenter.v.adapter.BluetoothListAdapter;
|
||||
import com.ycgis.zpSDK.BluetoothSocket;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* created by: Macall
|
||||
* create time: 2025/5/30 16:34
|
||||
* copyright: @ruansee.com
|
||||
* Describe:
|
||||
*/
|
||||
public class BluetoothDialogFragment extends DialogFragment {
|
||||
private FragmendDialogBluetoothBinding viewBinding;
|
||||
|
||||
public String TAG = "zpSDK";
|
||||
public BluetoothAdapter btAdapter = null;
|
||||
private BluetoothListAdapter listAdapter1, listAdapter2;
|
||||
private List<BluetoothDevice> pdDataList = new ArrayList<>(), searchDataList = new ArrayList<>();
|
||||
private BluetoothFragmentListener bluetoothFragmentListener;
|
||||
|
||||
public void setBluetoothFragmentListener(BluetoothFragmentListener bluetoothFragmentListener) {
|
||||
this.bluetoothFragmentListener = bluetoothFragmentListener;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(@Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
super.onCreate(savedInstanceState);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@org.jetbrains.annotations.Nullable
|
||||
@Override
|
||||
public View onCreateView(@NonNull @NotNull LayoutInflater inflater, @Nullable @org.jetbrains.annotations.Nullable ViewGroup container, @Nullable @org.jetbrains.annotations.Nullable Bundle savedInstanceState) {
|
||||
viewBinding = FragmendDialogBluetoothBinding.inflate(getLayoutInflater());
|
||||
initView();
|
||||
startPage();
|
||||
return viewBinding.getRoot();
|
||||
}
|
||||
|
||||
private void initView() {
|
||||
viewBinding.rvSearchList.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
viewBinding.rvSearchList.addItemDecoration(new MyDividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
|
||||
viewBinding.rvYpd.setLayoutManager(new LinearLayoutManager(getContext(), LinearLayoutManager.VERTICAL, false));
|
||||
viewBinding.rvYpd.addItemDecoration(new MyDividerItemDecoration(getContext(), LinearLayoutManager.VERTICAL));
|
||||
viewBinding.btnSearch.setVisibility(View.VISIBLE);
|
||||
viewBinding.searchProgress.setVisibility(View.GONE);
|
||||
viewBinding.btnSearch.setOnClickListener(customClickListener);
|
||||
}
|
||||
|
||||
private void startPage() {
|
||||
boolean init = BluetoothManage.getInstance().init();
|
||||
if (!init) {
|
||||
ToastUtil.centered(getContext(), "当前设备不支持蓝牙!");
|
||||
if (bluetoothFragmentListener!=null) bluetoothFragmentListener.onError(-1,"当前设备不支持蓝牙");
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
if (!BluetoothManage.getInstance().isBluetoothOpen(getActivity(), true)) {
|
||||
ToastUtil.centered(getContext(), "请先打开蓝牙!");
|
||||
if (bluetoothFragmentListener!=null) bluetoothFragmentListener.onError(-2,"蓝牙未打卡");
|
||||
dismiss();
|
||||
return;
|
||||
}
|
||||
btAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
BluetoothDevice remoteDevice = BluetoothSocket.getInstance().getRemoteDevice();
|
||||
if (remoteDevice != null){
|
||||
viewBinding.tvPrinters.setText("已连接|"+remoteDevice.getName());
|
||||
}else {
|
||||
viewBinding.tvPrinters.setText("未连接打印机");
|
||||
}
|
||||
|
||||
bonded_devices_get();
|
||||
|
||||
//register broadcast receiver
|
||||
IntentFilter filter = new IntentFilter();
|
||||
filter.addAction(BluetoothDevice.ACTION_FOUND);
|
||||
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_STARTED);
|
||||
filter.addAction(BluetoothAdapter.ACTION_DISCOVERY_FINISHED);
|
||||
filter.addAction(BluetoothAdapter.ACTION_STATE_CHANGED);
|
||||
getActivity().registerReceiver(mBroadcastReceiver, filter);
|
||||
}
|
||||
|
||||
private void onBindView(int viewId){
|
||||
if (viewId == R.id.btn_search) {
|
||||
discovry_do();
|
||||
}
|
||||
}
|
||||
|
||||
private CustomClickListener customClickListener = new CustomClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v) {
|
||||
onBindView(v.getId());
|
||||
}
|
||||
};
|
||||
|
||||
@Override
|
||||
public void onStart() {
|
||||
super.onStart();
|
||||
// 设置Dialog宽度
|
||||
if (getDialog() != null && getDialog().getWindow() != null) {
|
||||
getDialog().getWindow().setLayout(ViewGroup.LayoutParams.MATCH_PARENT,
|
||||
DimensionConvert.dip2px(getContext(),680));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
//获取蓝牙设备,并开始搜索设备
|
||||
if (btAdapter.isDiscovering()) {
|
||||
Log.d("BT", "-----------btAdapter.cancelDiscovery()---------");
|
||||
btAdapter.cancelDiscovery();
|
||||
}
|
||||
getActivity().unregisterReceiver(mBroadcastReceiver);
|
||||
// BluetoothSocket.getInstance().disconnect();
|
||||
}
|
||||
|
||||
|
||||
//get the Bonded devices
|
||||
//获取配对列表
|
||||
private void bonded_devices_get() {
|
||||
pdDataList.clear();
|
||||
Set<BluetoothDevice> PairedDevices = btAdapter.getBondedDevices();
|
||||
if (PairedDevices.size() > 0) {
|
||||
for (BluetoothDevice device : PairedDevices) {
|
||||
if (device == null)continue;
|
||||
if (StringUtil.isNullOrEmpty(device.getAddress()))continue;
|
||||
// String device_info = device.getName()+"\n"+device.getAddress();
|
||||
pdDataList.add(device);
|
||||
}
|
||||
}
|
||||
initDataPd();
|
||||
}
|
||||
|
||||
private void initDataPd() {
|
||||
if (listAdapter1 == null) {
|
||||
listAdapter1 = new BluetoothListAdapter(getContext(), pdDataList);
|
||||
viewBinding.rvYpd.setAdapter(listAdapter1);
|
||||
listAdapter1.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
if (bluetoothFragmentListener != null){
|
||||
bluetoothFragmentListener.onClickBluetoothDevice(listAdapter1.getDataItem(pointer));
|
||||
}
|
||||
dismiss();
|
||||
// lk(listAdapter1.getDataItem(pointer));
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listAdapter1.upData(pdDataList);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 获取蓝牙设备,并开始搜索设备
|
||||
*/
|
||||
//search BlueTooth devices
|
||||
private void discovry_do() {
|
||||
Log.d("BT", "-----------discovry_do---------");
|
||||
if (!btAdapter.isEnabled()) {
|
||||
btAdapter.enable();
|
||||
while (btAdapter.getState() != BluetoothAdapter.STATE_ON) ;
|
||||
}
|
||||
//获取蓝牙设备,并开始搜索设备
|
||||
if (btAdapter.isDiscovering()) {
|
||||
Log.d("BT", "-----------btAdapter.cancelDiscovery()---------");
|
||||
btAdapter.cancelDiscovery();
|
||||
}
|
||||
Log.d("BT", "-----------btAdapter.startDiscovery()---------");
|
||||
btAdapter.startDiscovery();
|
||||
Log.d("BT", "-----------btAdapter.startDiscovery()+END---------");
|
||||
|
||||
viewBinding.btnSearch.setVisibility(View.GONE);
|
||||
viewBinding.searchProgress.setVisibility(View.VISIBLE);
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void initSearch(BluetoothDevice device) {
|
||||
if (StringUtil.isNullOrEmpty(device.getAddress()))return;
|
||||
if (listAdapter2 == null) {
|
||||
searchDataList.add(device);
|
||||
listAdapter2 = new BluetoothListAdapter(getContext(), searchDataList);
|
||||
viewBinding.rvSearchList.setAdapter(listAdapter2);
|
||||
listAdapter2.setListClickListener(new SimpleListClickListener() {
|
||||
@Override
|
||||
public void onSingleClick(View v, int pointer) {
|
||||
if (bluetoothFragmentListener != null){
|
||||
bluetoothFragmentListener.onClickBluetoothDevice(listAdapter2.getDataItem(pointer));
|
||||
}
|
||||
dismiss();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listAdapter2.addItem(device);
|
||||
}
|
||||
}
|
||||
|
||||
BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() {
|
||||
@Override
|
||||
public void onReceive(Context context, Intent intent) {
|
||||
// TODO Auto-generated method stub
|
||||
String action = intent.getAction();
|
||||
Log.d("BT", "----------onReceive----------" + action);
|
||||
if (BluetoothDevice.ACTION_FOUND.equals(action)) {
|
||||
BluetoothDevice device = intent.getParcelableExtra(BluetoothDevice.EXTRA_DEVICE);
|
||||
if (device.getBondState() != BluetoothDevice.BOND_BONDED) {
|
||||
initSearch(device);
|
||||
}
|
||||
} else if (BluetoothAdapter.ACTION_DISCOVERY_FINISHED.equals(action)) {
|
||||
viewBinding.btnSearch.setVisibility(View.VISIBLE);
|
||||
viewBinding.searchProgress.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
@ -2,13 +2,12 @@ package com.ycgis.macall.personalcenter.v.fragment;
|
|||
|
||||
import android.content.Context;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.drawable.Drawable;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.coordinatorlayout.widget.CoordinatorLayout;
|
||||
import androidx.core.content.ContextCompat;
|
||||
import androidx.fragment.app.Fragment;
|
||||
|
||||
import android.view.LayoutInflater;
|
||||
|
|
@ -23,14 +22,11 @@ import com.google.android.material.bottomsheet.BottomSheetDialog;
|
|||
import com.google.android.material.bottomsheet.BottomSheetDialogFragment;
|
||||
import com.rs.macall.androidx.basemodel.callback.CustomClickListener;
|
||||
import com.rs.macall.androidx.basemodel.utils.DimensionConvert;
|
||||
import com.rs.macall.androidx.basemodel.utils.MResource;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.rs.macall.androidx.basemodel.view.Watermark;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.FragmentFrequentlyQuestionsDetailsBinding;
|
||||
import com.ycgis.macall.personalcenter.m.adapterbean.FrequentlyItemBean;
|
||||
import com.ycgis.macall.personalcenter.p.app.AppCache;
|
||||
import com.ycgis.macall.personalcenter.p.app.RuanseeApplication;
|
||||
import com.ycgis.macall.personalcenter.v.photoview.ShowPhotoDialog;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
package com.ycgis.macall.personalcenter.v.fragment;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.ContentValues;
|
||||
import android.content.Intent;
|
||||
import android.graphics.Bitmap;
|
||||
import android.net.Uri;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
|
@ -13,11 +15,15 @@ import androidx.lifecycle.ViewModelProviders;
|
|||
import androidx.recyclerview.widget.GridLayoutManager;
|
||||
import androidx.recyclerview.widget.LinearLayoutManager;
|
||||
|
||||
import android.os.Environment;
|
||||
import android.provider.MediaStore;
|
||||
import android.text.Html;
|
||||
import android.view.View;
|
||||
import android.widget.ImageView;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.king.zxing.CameraScan;
|
||||
|
|
@ -127,8 +133,8 @@ public class Home2Fragment extends BaseViewBindFragment<FragmentHome2Binding> {
|
|||
protected void startView(View view) {
|
||||
setUserInfoUI();
|
||||
//45 *1 * 24 *20
|
||||
viewModel.addBannerData(this, this::initBanner);
|
||||
viewModel.getBanner();
|
||||
// viewModel.addBannerData(this, this::initBanner);
|
||||
// viewModel.getBanner();
|
||||
viewModel.addAppList(this, this::initAppData);
|
||||
viewModel.getAppList();
|
||||
viewModel.addMsgList(this, homeMessageBean -> {
|
||||
|
|
@ -139,6 +145,18 @@ public class Home2Fragment extends BaseViewBindFragment<FragmentHome2Binding> {
|
|||
viewModel.getMessage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建图片地址uri,用于保存拍照后的照片 Android 10以后使用这种方法
|
||||
*/
|
||||
private Uri createImageUri() {
|
||||
String status = Environment.getExternalStorageState();
|
||||
// 判断是否有SD卡,优先使用SD卡存储,当没有SD卡时使用手机存储
|
||||
if (status.equals(Environment.MEDIA_MOUNTED)) {
|
||||
return getContext().getContentResolver().insert(MediaStore.Images.Media.EXTERNAL_CONTENT_URI, new ContentValues());
|
||||
} else {
|
||||
return getContext().getContentResolver().insert(MediaStore.Images.Media.INTERNAL_CONTENT_URI, new ContentValues());
|
||||
}
|
||||
}
|
||||
@Subscribe(threadMode = ThreadMode.MAIN)
|
||||
public void hanMessage(MessageEvent event) {
|
||||
if (event.getCount() <= 0) return;
|
||||
|
|
@ -184,11 +202,12 @@ public class Home2Fragment extends BaseViewBindFragment<FragmentHome2Binding> {
|
|||
Bitmap bitmap = new LoadPhotoImage().loadPhotoImage(RuanseeApplication.getUserData().getPhoto(), viewBinding.homeTvUserPhoto, new ImageCallBack() {
|
||||
@Override
|
||||
public void imageLoad(ImageView imageView, Bitmap bitmap) {
|
||||
if (getActivity() == null)return;
|
||||
// viewBinding.homeTvUserPhoto.setImageBitmap(bitmap);
|
||||
if (getActivity().isDestroyed()) return;
|
||||
Glide.with(getContext())
|
||||
.load(bitmap)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(20)))
|
||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
||||
.into(viewBinding.homeTvUserPhoto);
|
||||
}
|
||||
|
||||
|
|
@ -201,10 +220,11 @@ public class Home2Fragment extends BaseViewBindFragment<FragmentHome2Binding> {
|
|||
});
|
||||
|
||||
if (bitmap != null) {
|
||||
if (getActivity() == null)return;
|
||||
if (getActivity().isDestroyed()) return;
|
||||
Glide.with(getContext())
|
||||
.load(bitmap)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(20)))
|
||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
||||
.into(viewBinding.homeTvUserPhoto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,6 +84,7 @@ public class MessageContentFragment extends BaseViewBindFragment<FragmentMessage
|
|||
|
||||
@Override
|
||||
protected void lazyLoad() {
|
||||
viewBinding.msgSrLayout.autoRefresh();
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -137,9 +138,9 @@ public class MessageContentFragment extends BaseViewBindFragment<FragmentMessage
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!isVisible){
|
||||
if (adapter == null){
|
||||
viewBinding.msgSrLayout.autoRefresh();
|
||||
isVisible = true;
|
||||
isRefresh = false;
|
||||
}
|
||||
if (!isRecord&&isRefresh){
|
||||
viewBinding.msgSrLayout.autoRefresh();
|
||||
|
|
|
|||
|
|
@ -1,31 +1,21 @@
|
|||
package com.ycgis.macall.personalcenter.v.fragment;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Typeface;
|
||||
import android.os.Bundle;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.fragment.app.Fragment;
|
||||
import androidx.fragment.app.FragmentActivity;
|
||||
import androidx.viewpager2.adapter.FragmentStateAdapter;
|
||||
import androidx.viewpager2.widget.ViewPager2;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.TypedValue;
|
||||
import android.view.LayoutInflater;
|
||||
import android.view.View;
|
||||
import android.view.ViewGroup;
|
||||
import android.webkit.WebSettings;
|
||||
import android.widget.TextSwitcher;
|
||||
import android.widget.TextView;
|
||||
|
||||
import com.google.android.material.tabs.TabLayout;
|
||||
import com.google.android.material.tabs.TabLayoutMediator;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindFragment;
|
||||
import com.ycgis.macall.personalcenter.R;
|
||||
import com.ycgis.macall.personalcenter.databinding.FragmentMessageBinding;
|
||||
import com.ycgis.macall.personalcenter.v.activity.MainActivity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ import android.widget.ImageView;
|
|||
import android.widget.Toolbar;
|
||||
|
||||
import com.bumptech.glide.Glide;
|
||||
import com.bumptech.glide.load.resource.bitmap.CircleCrop;
|
||||
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
|
||||
import com.bumptech.glide.request.RequestOptions;
|
||||
import com.rs.macall.androidx.basemodel.base.BaseViewBindActivity;
|
||||
|
|
@ -34,6 +35,7 @@ import com.ycgis.macall.personalcenter.p.request.LoadPhotoImage;
|
|||
import com.ycgis.macall.personalcenter.v.activity.AboutActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.ApplicationGuideActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.AuthenticationActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.BluetoothActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.FrequentlyQuestionsActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.MyDetailsActivity;
|
||||
import com.ycgis.macall.personalcenter.v.activity.OpinionsSuggestionsActivity;
|
||||
|
|
@ -123,7 +125,7 @@ public class MyFragment extends BaseViewBindFragment<FragmentMyBinding> {
|
|||
if (getActivity().isDestroyed())return;
|
||||
Glide.with(getContext())
|
||||
.load(bitmap)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(20)))
|
||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
||||
.into(viewBinding.myIvPolicePhoto);
|
||||
}
|
||||
|
||||
|
|
@ -138,13 +140,11 @@ public class MyFragment extends BaseViewBindFragment<FragmentMyBinding> {
|
|||
// viewBinding.myIvPolicePhoto.setImageBitmap(bitmap);
|
||||
Glide.with(getContext())
|
||||
.load(bitmap)
|
||||
.apply(RequestOptions.bitmapTransform(new RoundedCorners(20)))
|
||||
.apply(RequestOptions.bitmapTransform(new CircleCrop()))
|
||||
.into(viewBinding.myIvPolicePhoto);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void onActivityResult(int requestCode, int resultCode, @Nullable @org.jetbrains.annotations.Nullable Intent data) {
|
||||
if (resultCode == MyDetailsActivity.UPDATE_INFO){
|
||||
|
|
@ -196,11 +196,19 @@ public class MyFragment extends BaseViewBindFragment<FragmentMyBinding> {
|
|||
item1.setTitle("认证管理");
|
||||
item1.setActivityClass(AuthenticationActivity.class);
|
||||
dataList.add(item1);
|
||||
|
||||
item1 = new MyItem();
|
||||
item1.setActivityClass(AboutActivity.class);
|
||||
item1.setIcon(R.drawable.icon_about);
|
||||
item1.setTitle("关于");
|
||||
dataList.add(item1);
|
||||
|
||||
// item1 = new MyItem();
|
||||
// item1.setActivityClass(BluetoothActivity.class);
|
||||
// item1.setIcon(R.drawable.icon_about);
|
||||
// item1.setTitle("蓝牙调试");
|
||||
// dataList.add(item1);
|
||||
|
||||
initData(dataList);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ public class WorkbenchFragment extends BaseViewBindFragment<FragmentWorkbenchBin
|
|||
|
||||
@Override
|
||||
protected void lazyLoad() {
|
||||
|
||||
viewBinding.workRefresh.autoRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -109,9 +109,8 @@ public class WorkbenchFragment extends BaseViewBindFragment<FragmentWorkbenchBin
|
|||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
if (!isVisible) {
|
||||
if (appListAdapter == null){
|
||||
viewBinding.workRefresh.autoRefresh();
|
||||
isVisible = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -225,7 +225,7 @@ public class HomeViewModel extends BaseViewModel {
|
|||
}
|
||||
|
||||
public void getMessage() {
|
||||
ApiModel.request(RetrofitService.getBaseInstance().getMessage(0, 1, 3),
|
||||
ApiModel.request(RetrofitService.getBaseInstance().getMessage(0, 1, 6),
|
||||
new BaseRequestCallback<BaseRequestModel<PagingModel<MessageBean>>>() {
|
||||
@Override
|
||||
public void onRequestFailure(String msg) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class MyDetailsViewModel extends BaseViewModel {
|
|||
final Map<String, String> param = new HashMap<>();
|
||||
AppCache cacheData = RuanseeApplication.getAppCache();
|
||||
param.put("token", cacheData.getToken());
|
||||
param.put("clientType", "MOBILE");
|
||||
param.put("clientType", "MOBILE");//SERVER
|
||||
param.put("imsi1", imsi);
|
||||
param.put("deviceFlags", imei);
|
||||
param.put("sysCode", cacheData.getSysmCode());
|
||||
|
|
|
|||
|
|
@ -0,0 +1,402 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.bluetooth.BluetoothDevice;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Color;
|
||||
|
||||
import com.google.zxing.BarcodeFormat;
|
||||
import com.google.zxing.WriterException;
|
||||
import com.google.zxing.common.BitMatrix;
|
||||
import com.google.zxing.qrcode.QRCodeWriter;
|
||||
import com.rs.macall.androidx.basemodel.utils.BitMapUtils;
|
||||
import com.rs.macall.androidx.basemodel.utils.StringUtil;
|
||||
import com.ycgis.macall.personalcenter.m.datamodel.PrintModel;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
|
||||
public class BluetoothSocket {
|
||||
public static String ErrorMessage = "No Error";
|
||||
private static final UUID SPP_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
|
||||
private static BluetoothAdapter myBluetoothAdapter;
|
||||
private static BluetoothDevice myDevice;
|
||||
private static android.bluetooth.BluetoothSocket mySocket = null;
|
||||
private static OutputStream myOutStream = null;
|
||||
private static InputStream myInStream = null;
|
||||
private static BluetoothSocket mBluetoothSocket = null;
|
||||
|
||||
private final static String GBK = "GBK";
|
||||
|
||||
public static BluetoothSocket getInstance() {
|
||||
if (mBluetoothSocket == null)
|
||||
mBluetoothSocket = new BluetoothSocket();
|
||||
return mBluetoothSocket;
|
||||
}
|
||||
|
||||
|
||||
// 检查是否已连接
|
||||
public boolean isConnected() {
|
||||
return mySocket != null && mySocket.isConnected();
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO 仅且仅当 {@link #isConnected()} 结果为true时该方法返回连接设备
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public BluetoothDevice getRemoteDevice() {
|
||||
if (isConnected())
|
||||
return mySocket.getRemoteDevice();
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public boolean ConnectPrinter(String BDAddr) {
|
||||
if (BDAddr.equals("") || BDAddr == null) {
|
||||
ErrorMessage = "没有选择打印机";
|
||||
return false;
|
||||
}
|
||||
myBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (myBluetoothAdapter == null) {
|
||||
ErrorMessage = "蓝牙系统错误";
|
||||
return false;
|
||||
}
|
||||
myDevice = myBluetoothAdapter.getRemoteDevice(BDAddr);
|
||||
if (myDevice == null) {
|
||||
ErrorMessage = "读取蓝牙设备错误";
|
||||
return false;
|
||||
}
|
||||
if (!SPPOpen(myBluetoothAdapter, myDevice)) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean SPPOpen(BluetoothAdapter bluetoothAdapter, BluetoothDevice btDevice) {
|
||||
boolean error = false;
|
||||
myBluetoothAdapter = bluetoothAdapter;
|
||||
myDevice = btDevice;
|
||||
|
||||
if (!myBluetoothAdapter.isEnabled()) {
|
||||
ErrorMessage = "蓝牙适配器没有打开";
|
||||
return false;
|
||||
}
|
||||
myBluetoothAdapter.cancelDiscovery();
|
||||
|
||||
try {
|
||||
//mySocket = myDevice.createRfcommSocketToServiceRecord(SPP_UUID);
|
||||
Method m = myDevice.getClass().getMethod("createRfcommSocket", new Class[]{int.class});
|
||||
mySocket = (android.bluetooth.BluetoothSocket) m.invoke(myDevice, 1);
|
||||
} catch (SecurityException e) {
|
||||
mySocket = null;
|
||||
ErrorMessage = "蓝牙端口错误";
|
||||
return false;
|
||||
} catch (NoSuchMethodException e) {
|
||||
mySocket = null;
|
||||
ErrorMessage = "蓝牙端口错误";
|
||||
return false;
|
||||
} catch (IllegalArgumentException e) {
|
||||
mySocket = null;
|
||||
ErrorMessage = "蓝牙端口错误";
|
||||
return false;
|
||||
} catch (IllegalAccessException e) {
|
||||
mySocket = null;
|
||||
ErrorMessage = "蓝牙端口错误";
|
||||
return false;
|
||||
} catch (InvocationTargetException e) {
|
||||
mySocket = null;
|
||||
ErrorMessage = "蓝牙端口错误";
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
mySocket.connect();
|
||||
} catch (IOException e2) {
|
||||
ErrorMessage = e2.getLocalizedMessage();//"无法连接蓝牙打印机";
|
||||
mySocket = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
myOutStream = mySocket.getOutputStream();
|
||||
} catch (IOException e3) {
|
||||
myOutStream = null;
|
||||
error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
try {
|
||||
myInStream = mySocket.getInputStream();
|
||||
} catch (IOException e3) {
|
||||
myInStream = null;
|
||||
error = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (error) {
|
||||
//SPPClose();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean disconnect() {
|
||||
if (!SPPClose())
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean SPPClose() {
|
||||
try {
|
||||
Thread.sleep(1000);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
if (myOutStream != null) {
|
||||
try {
|
||||
myOutStream.flush();
|
||||
} catch (IOException e1) {
|
||||
}
|
||||
try {
|
||||
myOutStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
myOutStream = null;
|
||||
}
|
||||
if (myInStream != null) {
|
||||
try {
|
||||
myInStream.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
myInStream = null;
|
||||
}
|
||||
if (mySocket != null) {
|
||||
try {
|
||||
mySocket.close();
|
||||
} catch (IOException e) {
|
||||
}
|
||||
mySocket = null;
|
||||
}
|
||||
try {
|
||||
Thread.sleep(200);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
// 发送数据
|
||||
public boolean sendData(List<PrintModel> dataList) {
|
||||
if (!isConnected())return false;
|
||||
if (myOutStream != null) {
|
||||
if (dataList == null) return false;
|
||||
try {
|
||||
boolean isNewline = dataList.size()>1;
|
||||
for (int i = 0; i < dataList.size(); i++) {
|
||||
PrintModel printModel = dataList.get(i);
|
||||
if (printModel == null) continue;
|
||||
if (printModel.getPrintType() == 1) {
|
||||
String content = printModel.getContent();
|
||||
if (StringUtil.isNullOrEmpty(content)){
|
||||
continue;
|
||||
}
|
||||
if (isNewline){
|
||||
if (!content.endsWith("\n")){
|
||||
content = content+"\n";
|
||||
}
|
||||
}
|
||||
printText(content,printModel);
|
||||
} else if (printModel.getPrintType() == 2) {
|
||||
printQrCode(printModel);
|
||||
} else if (printModel.getPrintType() == 3) {
|
||||
printBitMap(printModel);
|
||||
// Bitmap bitmap = BitMapUtils.base64ToBitmap(printModel.getContent());
|
||||
// if (bitmap == null) continue;
|
||||
// myOutStream.write(decodeBitmap(bitmap)); // 部分打印机需GBK编码
|
||||
}
|
||||
}
|
||||
myOutStream.flush();
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public boolean printText(String content, PrintModel model) throws UnsupportedEncodingException {
|
||||
zpPrinter zpSDK = new zpPrinter();
|
||||
zpSDK.pageSetup(model.getPageWidth(), model.getPageHeight());
|
||||
//zpSDK.drawBarCode(10,10,"123456789012",1,0,4,80);
|
||||
zpSDK.alignLeft();
|
||||
zpSDK.drawText(10, 10,content, "思源黑体", 24, 0, 0, false, false);
|
||||
String print = zpSDK.print(0, 0);
|
||||
return Write(print.getBytes(GBK));
|
||||
}
|
||||
|
||||
public boolean printBitMap(PrintModel model){
|
||||
Bitmap bitmap = BitMapUtils.base64ToBitmap(model.getContent());
|
||||
if (bitmap == null) return false;
|
||||
zpPrinter zpSDK = new zpPrinter();
|
||||
zpSDK.pageSetup(model.getPageWidth(), model.getPageHeight());
|
||||
zpSDK.drawGraphic(10,10,model.getContentHeight(),model.getContentWidth(),bitmap);
|
||||
byte[] bytes = zpSDK.printByte(0, 1);
|
||||
byte[] gzipBytes = GZIPFrame.codec(bytes);
|
||||
return Write(gzipBytes); // 部分打印机需GBK编码
|
||||
}
|
||||
|
||||
public boolean printQrCode(PrintModel model) {
|
||||
zpPrinter zpSDK = new zpPrinter();
|
||||
try {
|
||||
zpSDK.pageSetup(model.getPageWidth(), model.getPageHeight());
|
||||
zpSDK.drawQrCode(10, 10, model.getContent(), 0, model.getZoomLevel(), 4);
|
||||
String print = zpSDK.print(0, 0);
|
||||
// return Write(print.getBytes("GBK")); // 部分打印机需GBK编码/
|
||||
return Write(print.getBytes("UTF-8")); // 部分打印机需GBK编码
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
e.printStackTrace();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean Write(byte[] Data) {
|
||||
try {
|
||||
myOutStream.write(Data);
|
||||
} catch (IOException e) {
|
||||
ErrorMessage = "发送蓝牙数据失败";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean Write(byte[] Data, int DataLen) {
|
||||
try {
|
||||
myOutStream.write(Data, 0, DataLen);
|
||||
} catch (IOException e) {
|
||||
ErrorMessage = "发送蓝牙数据失败";
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void SPPFlush() {
|
||||
int i = 0, DataLen = 0;
|
||||
try {
|
||||
DataLen = myInStream.available();
|
||||
} catch (IOException e1) {
|
||||
}
|
||||
for (i = 0; i < DataLen; i++) {
|
||||
try {
|
||||
myInStream.read();
|
||||
} catch (IOException e) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public byte[] Read(int Timeout) {
|
||||
byte[] data = null;
|
||||
float rest = (float) Timeout;
|
||||
int len = 0;
|
||||
try {
|
||||
len = myInStream.available();
|
||||
if (len > 0) {
|
||||
myInStream.skip(myInStream.available());
|
||||
}
|
||||
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
try {
|
||||
while (rest > 0.0F) {
|
||||
if (myInStream != null) {
|
||||
int available = myInStream.available();
|
||||
if (available > 0) {
|
||||
data = new byte[available];
|
||||
myInStream.read(data);
|
||||
return data;
|
||||
}
|
||||
Thread.sleep(100L);
|
||||
rest -= 0.1F;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
} catch (Exception var6) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成二位码图片
|
||||
*
|
||||
* @param content
|
||||
* @param size
|
||||
* @return
|
||||
* @throws WriterException
|
||||
*/
|
||||
public Bitmap generateQRCode(String content, int size) throws WriterException {
|
||||
QRCodeWriter writer = new QRCodeWriter();
|
||||
BitMatrix bitMatrix = writer.encode(content, BarcodeFormat.QR_CODE, size, size);
|
||||
Bitmap bmp = Bitmap.createBitmap(size, size, Bitmap.Config.RGB_565);
|
||||
for (int x = 0; x < size; x++) {
|
||||
for (int y = 0; y < size; y++) {
|
||||
bmp.setPixel(x, y, bitMatrix.get(x, y) ? Color.BLACK : Color.WHITE);
|
||||
}
|
||||
}
|
||||
return bmp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 位图转换
|
||||
*
|
||||
* @param bmp
|
||||
* @return
|
||||
*/
|
||||
public byte[] decodeBitmap(Bitmap bmp) {
|
||||
int width = bmp.getWidth();
|
||||
int height = bmp.getHeight();
|
||||
int[] pixels = new int[width * height];
|
||||
bmp.getPixels(pixels, 0, width, 0, 0, width, height);
|
||||
|
||||
// 生成 ESC/POS 位图指令
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
baos.write(0x1D);
|
||||
baos.write(0x76);
|
||||
baos.write(0x30);
|
||||
baos.write(0x00);
|
||||
baos.write(width / 8); // 宽度(以8为单位)
|
||||
baos.write(0x00);
|
||||
baos.write(height % 256); // 高度低字节
|
||||
baos.write(height / 256); // 高度高字节
|
||||
|
||||
for (int y = 0; y < height; y++) {
|
||||
for (int x = 0; x < width; x += 8) {
|
||||
byte b = 0;
|
||||
for (int n = 0; n < 8; n++) {
|
||||
int pixel = pixels[y * width + x + n];
|
||||
int gray = (Color.red(pixel) + Color.green(pixel) + Color.blue(pixel)) / 3;
|
||||
if (gray < 128) {
|
||||
b |= (1 << (7 - n));
|
||||
}
|
||||
}
|
||||
baos.write(b);
|
||||
}
|
||||
}
|
||||
return baos.toByteArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,131 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Paint;
|
||||
import android.graphics.Paint.Align;
|
||||
|
||||
import java.io.BufferedOutputStream;
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.zip.CRC32;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
|
||||
|
||||
public class GZIPFrame {
|
||||
private static Bitmap myBitmap = null;
|
||||
private static Canvas myCanvas = null;
|
||||
private static Paint myPaint = null;
|
||||
private static int myBitmapHeight = 0;
|
||||
private static int myBitmapWidth = 0;
|
||||
//private static int PrinterDotWidth = 768;
|
||||
private static int PrinterDotWidth = 1600;
|
||||
private static int PrinterDotPerMM = 8;
|
||||
|
||||
public static byte[] codec(byte []data)
|
||||
{
|
||||
byte[] gzipData=null;
|
||||
ByteArrayOutputStream gzipStram = new ByteArrayOutputStream();
|
||||
try {
|
||||
GZIPOutputStream zos = new GZIPOutputStream(new BufferedOutputStream(gzipStram));
|
||||
zos.write(data);
|
||||
zos.close();
|
||||
}catch (IOException e) {e.printStackTrace();}
|
||||
gzipData=gzipStram.toByteArray();
|
||||
long length=gzipData.length;
|
||||
CRC32 crc32 = new CRC32();
|
||||
crc32.update(gzipData,8,(int)(length-8-4));
|
||||
long crc=crc32.getValue();
|
||||
|
||||
gzipData[4]=(byte)((length>>0)&0xFF);
|
||||
gzipData[5]=(byte)((length>>8)&0xFF);
|
||||
gzipData[6]=(byte)((length>>16)&0xFF);
|
||||
gzipData[7]=(byte)((length>>24)&0xFF);
|
||||
gzipData[gzipData.length-4]=(byte)((crc>>0)&0xFF);
|
||||
gzipData[gzipData.length-3]=(byte)((crc>>8)&0xFF);
|
||||
gzipData[gzipData.length-2]=(byte)((crc>>16)&0xFF);
|
||||
gzipData[gzipData.length-1]=(byte)((crc>>24)&0xFF);
|
||||
|
||||
/*
|
||||
String outFilename= Environment.getExternalStorageDirectory().getPath()+"/1688/"+System.currentTimeMillis()+".gz";
|
||||
try
|
||||
{
|
||||
FileOutputStream out = new FileOutputStream(outFilename);
|
||||
out.write(gzipData);
|
||||
out.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
*/
|
||||
return gzipData;
|
||||
}
|
||||
|
||||
public static byte[] Draw_Page_Bitmap_(Bitmap bmp) {
|
||||
// matrix.postRotate(Rotate);
|
||||
int w=bmp.getWidth();
|
||||
int h=bmp.getHeight();
|
||||
myBitmapWidth=w;
|
||||
myBitmapHeight=h;
|
||||
myBitmap = Bitmap.createBitmap(w, h, Bitmap.Config.RGB_565);
|
||||
myCanvas = new Canvas(myBitmap);
|
||||
myPaint = new Paint();
|
||||
myPaint.setColor(Color.BLACK);
|
||||
myPaint.setTextSize(10);
|
||||
myPaint.setTextAlign(Align.LEFT);
|
||||
myPaint.setStrokeWidth(10);
|
||||
myCanvas.drawColor(Color.WHITE);
|
||||
/* myCanvas.drawBitmap(dstbmp,xx,yy, myPaint);*/
|
||||
myCanvas.drawBitmap(bmp,0,0, myPaint);
|
||||
//-------------------------
|
||||
int len;
|
||||
if(myBitmapWidth>PrinterDotWidth)myBitmapWidth=PrinterDotWidth;
|
||||
len = (myBitmapWidth+7) / 8;
|
||||
byte[] bitmapdata = new byte[(len+4)*myBitmapHeight];
|
||||
int ndata=0;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int[] RowData = new int[myBitmapWidth * myBitmapHeight];
|
||||
myBitmap.getPixels(RowData, 0, myBitmapWidth, 0, 0, myBitmapWidth, myBitmapHeight);
|
||||
|
||||
for(i = 0; i < myBitmapHeight;i++)
|
||||
{
|
||||
bitmapdata[ndata+0] = 0x1F;
|
||||
bitmapdata[ndata+1] = 0x10;
|
||||
bitmapdata[ndata+2] = (byte)(len%256);
|
||||
bitmapdata[ndata+3] = (byte)(len/256);
|
||||
for(j = 0; j < len; j++)
|
||||
{
|
||||
bitmapdata[ndata+4 + j] = 0;
|
||||
}
|
||||
for(j = 0; j < myBitmapWidth; j++)
|
||||
{
|
||||
int color = RowData[i * myBitmapWidth + j];
|
||||
int b = (color>>0)&0xff;
|
||||
int g = (color>>8)&0xff;
|
||||
int r = (color>>16)&0xff;
|
||||
int grey = (r+g+b)/3;
|
||||
//if( grey <12 )
|
||||
if( grey <153 )
|
||||
bitmapdata[ndata+4 + j/8] |= (byte)(0x80 >> (j%8));
|
||||
}
|
||||
if(1==1) // <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><C3BF>ĩβ<C4A9><CEB2>0x00
|
||||
{
|
||||
int size;
|
||||
for(size=len-1;size>=0;size--)if(bitmapdata[ndata+4+size]!=0)break;
|
||||
size = size+1;
|
||||
size=len;
|
||||
bitmapdata[ndata+2] = (byte)(size%256);
|
||||
bitmapdata[ndata+3] = (byte)(size/256);
|
||||
ndata+=4+size;
|
||||
}
|
||||
|
||||
}
|
||||
bitmapdata= codec(bitmapdata);
|
||||
|
||||
|
||||
return bitmapdata;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,227 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
import android.content.BroadcastReceiver;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.IntentFilter;
|
||||
import android.hardware.usb.UsbConstants;
|
||||
import android.hardware.usb.UsbDevice;
|
||||
import android.hardware.usb.UsbDeviceConnection;
|
||||
import android.hardware.usb.UsbEndpoint;
|
||||
import android.hardware.usb.UsbInterface;
|
||||
import android.hardware.usb.UsbManager;
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
|
||||
public class UsbSocket {
|
||||
|
||||
Context context;
|
||||
String TAG="zpSDK";
|
||||
static UsbSocket mUsbSocket=null;
|
||||
private int sysVersion;
|
||||
public static UsbSocket getInstance(Context context)
|
||||
{
|
||||
if (mUsbSocket==null)
|
||||
mUsbSocket=new UsbSocket(context);
|
||||
return mUsbSocket;
|
||||
}
|
||||
private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION";
|
||||
UsbManager mUsbManager;
|
||||
|
||||
UsbSocket(Context context)
|
||||
{
|
||||
this.context=context;
|
||||
sysVersion = Integer.parseInt(Build.VERSION.SDK);
|
||||
// if(sysVersion<19)
|
||||
// context.onNewIntent(context.getIntent());
|
||||
context.registerReceiver(mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_ATTACHED));
|
||||
context.registerReceiver(mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED));
|
||||
}
|
||||
|
||||
private final BroadcastReceiver mUsbReceiver = new BroadcastReceiver()
|
||||
{
|
||||
public void onReceive(Context context, Intent intent)
|
||||
{
|
||||
String action = intent.getAction();
|
||||
if(UsbManager.ACTION_USB_DEVICE_ATTACHED.equals(action))
|
||||
{
|
||||
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
|
||||
if(device.getVendorId()==1155&&device.getProductId()==22339)
|
||||
{
|
||||
Log.e(TAG, "USB打印机已接入");
|
||||
Toast.makeText(context,"USB打印机已接入", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
if(UsbManager.ACTION_USB_DEVICE_DETACHED.equals(action))
|
||||
{
|
||||
UsbDevice device = (UsbDevice) intent.getParcelableExtra(UsbManager.EXTRA_DEVICE);
|
||||
if(device.getVendorId()==1155&&device.getProductId()==22339)
|
||||
{
|
||||
Log.e(TAG, "USB打印机已断开");
|
||||
Toast.makeText(context,"USB打印机已断开", Toast.LENGTH_LONG).show();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
public void ConnectPrinter()
|
||||
{
|
||||
context.registerReceiver(mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_ATTACHED));
|
||||
context.registerReceiver(mUsbReceiver, new IntentFilter(UsbManager.ACTION_USB_DEVICE_DETACHED));
|
||||
}
|
||||
|
||||
public String Write(byte[] prnData)
|
||||
{
|
||||
UsbManager usbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
|
||||
HashMap<String, UsbDevice> deviceList = usbManager.getDeviceList();
|
||||
Iterator<UsbDevice> deviceIterator = deviceList.values().iterator();
|
||||
while(deviceIterator.hasNext())
|
||||
{
|
||||
//Log.d("zpSDK","USB deviceIterator");
|
||||
UsbDevice usbDevice = deviceIterator.next();
|
||||
//Log.d("zpSDK",String.valueOf(usbDevice.getVendorId())+","+String.valueOf(usbDevice.getProductId()));
|
||||
if(usbDevice.getVendorId()!=1155||usbDevice.getProductId()!=22339)continue;
|
||||
if(writePort(usbManager,usbDevice,prnData))
|
||||
{
|
||||
Log.e(TAG, "USB打印成功");
|
||||
|
||||
//Looper.prepare();
|
||||
Toast.makeText(context,"USB打印成功", Toast.LENGTH_LONG).show();
|
||||
//Looper.loop();
|
||||
return "USB打印成功";
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.e(TAG, "USB打印失败");
|
||||
// Looper.prepare();
|
||||
Toast.makeText(context,"USB打印失败", Toast.LENGTH_LONG).show();
|
||||
// Looper.loop();
|
||||
return "USB打印失败";
|
||||
}
|
||||
}
|
||||
Log.e(TAG, "无法连接USB打印机");
|
||||
// Looper.prepare();
|
||||
Toast.makeText(context,"无法连接USB打印机", Toast.LENGTH_LONG).show();
|
||||
// Looper.loop();
|
||||
return "无法连接USB打印机";
|
||||
}
|
||||
|
||||
boolean writePort(UsbManager manager,UsbDevice usbDev, byte[] data)
|
||||
{
|
||||
boolean success=false;
|
||||
UsbEndpoint end_in = null;
|
||||
UsbEndpoint end_out = null;
|
||||
byte[] buffer = new byte[64];
|
||||
try {
|
||||
UsbInterface interf = usbDev.getInterface(0);
|
||||
UsbDeviceConnection connection = manager.openDevice(usbDev);//连接usb设备
|
||||
if (connection == null) {
|
||||
Log.d(TAG, "mUsbDeviceConnection can't be null");
|
||||
return false;
|
||||
}
|
||||
if (connection.claimInterface(interf, true)) {
|
||||
//Log.d(TAG,"claimInterface success");
|
||||
int endpointCount = interf.getEndpointCount();
|
||||
for (int i = 0; i < endpointCount; i++) {
|
||||
UsbEndpoint endpoint = interf.getEndpoint(i);
|
||||
if (endpoint.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) {
|
||||
if (UsbConstants.USB_DIR_IN == endpoint.getDirection()) {
|
||||
end_in = endpoint;//获取读数据通道
|
||||
} else if(UsbConstants.USB_DIR_OUT == endpoint.getDirection()){
|
||||
end_out = endpoint;//获取写数据通道
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
connection.close();
|
||||
Log.d(TAG,"claimInterface fail");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (end_out != null)
|
||||
{
|
||||
// bulkTransfer通过给定的endpoint来进行大量的数据传输,传输的方向取决于该节点的方向,
|
||||
// 传输成果返回传输字节数组的长度,失败返回负数
|
||||
int send_ret = connection.bulkTransfer(end_out, buffer,buffer.length,0 );
|
||||
send_ret=0;
|
||||
int total_length=data.length;
|
||||
//API28之前的系统,bulkTransfer最大包不能超过16384,所以要拆包
|
||||
int pack = data.length / 16384;
|
||||
int j = 0;
|
||||
for (j = 0; j < pack; j++) {
|
||||
byte[] newBuffer = Arrays.copyOfRange(data, j * 16384, 16384 + j * 16384);
|
||||
// 参数依次为:下行端点,字节数组消息,消息长度,响应时间
|
||||
send_ret += connection.bulkTransfer(end_out, newBuffer, newBuffer.length, 0);
|
||||
}
|
||||
if(send_ret<total_length){
|
||||
byte[] newBuffer = Arrays.copyOfRange(data, j * 16384, total_length);
|
||||
send_ret += connection.bulkTransfer(end_out, newBuffer, newBuffer.length, 0);
|
||||
}
|
||||
Log.d(TAG,"send Data:"+","+String.valueOf(send_ret));
|
||||
if (send_ret >= data.length)success=true;
|
||||
if (connection != null)
|
||||
{
|
||||
connection.releaseInterface(interf);
|
||||
connection.close();
|
||||
}
|
||||
interf = null;
|
||||
connection = null;
|
||||
}
|
||||
} catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
return success;
|
||||
}
|
||||
|
||||
|
||||
public byte[] Read(int Timeout)
|
||||
{
|
||||
// UsbManager usbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
|
||||
// UsbDeviceConnection connection = manager.openDevice(usbDev);
|
||||
UsbManager usbManager = (UsbManager) context.getSystemService(Context.USB_SERVICE);
|
||||
HashMap<String,UsbDevice> deviceHashMap = usbManager.getDeviceList();
|
||||
Iterator<UsbDevice> iterator = deviceHashMap.values().iterator();
|
||||
|
||||
System.out.println("deviceHashMap.isEmpty()"+deviceHashMap.isEmpty());
|
||||
|
||||
UsbEndpoint inEndpoint=null;
|
||||
byte[] byte2 = new byte[1024];
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
UsbDevice usbDevice = iterator.next();
|
||||
if(usbDevice.getVendorId()!=1155||usbDevice.getProductId()!=22339)continue;
|
||||
UsbInterface usbInterface = usbDevice.getInterface(0);//USBEndpoint为读写数据所需的节点
|
||||
UsbDeviceConnection connection = usbManager.openDevice(usbDevice);
|
||||
|
||||
if (connection.claimInterface(usbInterface, true)) {
|
||||
int endpointCount = usbInterface.getEndpointCount();
|
||||
for (int i = 0; i < endpointCount; i++) {
|
||||
UsbEndpoint endpoint = usbInterface.getEndpoint(i);
|
||||
if (endpoint.getType() == UsbConstants.USB_ENDPOINT_XFER_BULK) {
|
||||
if (UsbConstants.USB_DIR_IN == endpoint.getDirection()) {
|
||||
inEndpoint = endpoint;//获取读数据通道
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
connection.close();
|
||||
Log.d(TAG,"claimInterface fail");
|
||||
return null;
|
||||
}
|
||||
|
||||
int ret = connection.bulkTransfer(inEndpoint, byte2, byte2.length, Timeout);
|
||||
Log.i(TAG, "ret:" + ret);
|
||||
Log.i(TAG, "bat is ok length:" + byte2.length);
|
||||
for (Byte byte1 : byte2) {
|
||||
Log.i(TAG,"byte1 :" + byte1);
|
||||
}
|
||||
}
|
||||
return byte2;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,216 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.UnknownHostException;
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
public class WifiSocket {
|
||||
|
||||
public static String ErrorMessage = "No Error";
|
||||
private static Socket wifiSocket = null;
|
||||
private static OutputStream myOutStream = null;
|
||||
private static InputStream myInStream = null;
|
||||
private static WifiSocket mWifiSocket = null;
|
||||
wifiListener mwifiListener=null;
|
||||
boolean isWrite = true;
|
||||
boolean isRead = true;
|
||||
|
||||
private WifiSocket(wifiListener listener) {
|
||||
mwifiListener = listener;
|
||||
}
|
||||
|
||||
public static WifiSocket getInstance(wifiListener listener){
|
||||
if (mWifiSocket==null)
|
||||
mWifiSocket = new WifiSocket(listener);
|
||||
return mWifiSocket;
|
||||
}
|
||||
|
||||
|
||||
public void ConnectPrinter(String ip) {
|
||||
InetAddress mInetaddr = null;
|
||||
int port = 9100;
|
||||
if (ip == null||ip.equals("")) {
|
||||
} else {
|
||||
try {
|
||||
mInetaddr = InetAddress.getByName(ip);
|
||||
} catch (UnknownHostException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
InetAddress finalMInetaddr = mInetaddr;
|
||||
Timer timer = new Timer();
|
||||
timer.schedule(new TimerTask() {
|
||||
@Override
|
||||
public void run() {
|
||||
try {
|
||||
wifiSocket = new Socket(finalMInetaddr, port);
|
||||
|
||||
myOutStream = wifiSocket.getOutputStream();
|
||||
myInStream = wifiSocket.getInputStream();
|
||||
mwifiListener.receivedmsg("finish");
|
||||
} catch (UnknownHostException var4) {
|
||||
mwifiListener.receivedmsg("timeout");
|
||||
} catch (IOException var5) {
|
||||
mwifiListener.receivedmsg("timeout");
|
||||
}
|
||||
}
|
||||
}, 1500);
|
||||
|
||||
mwifiListener.receivedmsg("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean disconncet() {
|
||||
try {
|
||||
Thread.sleep(1000L);
|
||||
} catch (InterruptedException var6) {
|
||||
}
|
||||
mwifiListener.receivedmsg("");
|
||||
mwifiListener.receivedstatus(null);
|
||||
if (myOutStream != null) {
|
||||
try {
|
||||
myOutStream.flush();
|
||||
} catch (IOException var5) {
|
||||
}
|
||||
|
||||
try {
|
||||
myOutStream.close();
|
||||
} catch (IOException var4) {
|
||||
}
|
||||
|
||||
myOutStream = null;
|
||||
}
|
||||
|
||||
if (myInStream != null) {
|
||||
try {
|
||||
myInStream.close();
|
||||
} catch (IOException var3) {
|
||||
}
|
||||
|
||||
myInStream = null;
|
||||
}
|
||||
|
||||
if (wifiSocket != null) {
|
||||
try {
|
||||
wifiSocket.close();
|
||||
} catch (IOException var2) {
|
||||
}
|
||||
|
||||
wifiSocket = null;
|
||||
}
|
||||
|
||||
try {
|
||||
Thread.sleep(200L);
|
||||
} catch (InterruptedException var1) {
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public void Write(byte[] Data) {
|
||||
|
||||
isWrite = true;
|
||||
if (isWrite)
|
||||
{
|
||||
isWrite = false;
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
myOutStream.write(Data);
|
||||
isWrite = true;
|
||||
} catch (IOException var2) {
|
||||
mwifiListener.receivedmsg("发送数据失败");
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void Write(byte[] Data, int DataLen) {
|
||||
|
||||
isWrite = true;
|
||||
if (isWrite)
|
||||
{
|
||||
isWrite = false;
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
myOutStream.write(Data, 0, DataLen);
|
||||
isWrite = true;
|
||||
} catch (IOException var2) {
|
||||
mwifiListener.receivedmsg("发送数据失败");
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
|
||||
public static void Flush() {
|
||||
int DataLen = 0;
|
||||
|
||||
try {
|
||||
DataLen = myInStream.available();
|
||||
} catch (IOException var4) {
|
||||
}
|
||||
|
||||
for(int i = 0; i < DataLen; ++i) {
|
||||
try {
|
||||
myInStream.read();
|
||||
} catch (IOException var3) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void Read(int Timeout) {
|
||||
new Thread(){
|
||||
@Override
|
||||
public void run() {
|
||||
byte[] buffer = new byte[1024];
|
||||
int bytes;
|
||||
int len = 0;
|
||||
|
||||
try {
|
||||
len = myInStream.available();
|
||||
} catch (IOException var4) {
|
||||
}
|
||||
|
||||
if (len>0)
|
||||
{
|
||||
try {
|
||||
myInStream.skip(myInStream.available());
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
try {
|
||||
bytes = myInStream.read(buffer);
|
||||
if (bytes>0)
|
||||
{
|
||||
final byte[] data = new byte[bytes];
|
||||
System.arraycopy(buffer, 0, data, 0, bytes);
|
||||
mwifiListener.receivedstatus(data);
|
||||
return;
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
}.start();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,837 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.IntBuffer;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class _PrinterPageImpl
|
||||
{
|
||||
private String printStr = ""; //add printer cmd string
|
||||
private byte[] printByte = new byte[1024*1024*2]; //add printer cmd byte[]
|
||||
private int printByteLen = 0;
|
||||
private String LastprintStr = ""; //last cmd string
|
||||
private byte[] LastprintByte = new byte[1024*1024*2];
|
||||
private int LastprintByteLen = 0;
|
||||
private int PrintTime = 1;
|
||||
private int mHeight ;
|
||||
private int mWidth;
|
||||
public void Create(int width, int height) {
|
||||
printStr = "";printByteLen = 0;
|
||||
mHeight = height;
|
||||
mWidth = width;
|
||||
|
||||
}
|
||||
|
||||
public void setPrintTime(int time){
|
||||
PrintTime=time;
|
||||
}
|
||||
|
||||
void add(String str)
|
||||
{
|
||||
printStr+=str;
|
||||
}
|
||||
|
||||
void addByte(byte[] buffer)
|
||||
{
|
||||
System.arraycopy(buffer, 0, printByte, printByteLen, buffer.length);
|
||||
printByteLen += buffer.length;
|
||||
}
|
||||
|
||||
public void Create(int width, int height,int r,int gap) {
|
||||
|
||||
printStr = "";printByteLen = 0;
|
||||
mHeight = height;
|
||||
mWidth= width;
|
||||
switch (r){
|
||||
case 0:
|
||||
add("ZPROTATE\r\n");
|
||||
break;
|
||||
case 1:
|
||||
add("ZPROTATE90\r\n");
|
||||
break;
|
||||
case 2:
|
||||
add("ZPROTATE180\r\n");
|
||||
break;
|
||||
case 3:
|
||||
add("ZPROTATE270\r\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if (gap==1)
|
||||
add("GAP-SENSE\r\n");
|
||||
else if (gap== 2)
|
||||
add("BAR-SENSE LEFT\r\n");
|
||||
else if (gap== 3)
|
||||
add("BAR-SENSE\r\n");
|
||||
|
||||
}
|
||||
|
||||
public String getPrintStr()
|
||||
{
|
||||
return LastprintStr;
|
||||
}
|
||||
|
||||
public byte[] getPrintByte()
|
||||
{
|
||||
byte[] buffer = new byte[LastprintByteLen];
|
||||
System.arraycopy(LastprintByte, 0, buffer, 0, LastprintByteLen);
|
||||
return buffer;
|
||||
}
|
||||
|
||||
public void prefeed(int len)
|
||||
{
|
||||
add(String.format("PREFEED %d\r\n", new Object[] {Integer.valueOf(len)}));
|
||||
}
|
||||
public void postfeed(int len)
|
||||
{
|
||||
add(String.format("POSTFEED %d\r\n", new Object[] {Integer.valueOf(len)})) ;
|
||||
}
|
||||
|
||||
|
||||
public void INVERSE(int x0, int y0, int x1, int y1, int width) {
|
||||
|
||||
String str = String.format("INVERSE-LINE %d %d %d %d %d\r\n", x0, y0, x1, y1, width);
|
||||
add(str);
|
||||
|
||||
}
|
||||
|
||||
public void DrawBitmap(Bitmap bmp, int x, int y, boolean rotate) {
|
||||
|
||||
int w = bmp.getWidth();
|
||||
int h = bmp.getHeight();
|
||||
int byteCountW = (w + 7) / 8;
|
||||
int[] bmpData = new int[w * h];
|
||||
byte[] outData = new byte[byteCountW * h];
|
||||
bmp.copyPixelsToBuffer(IntBuffer.wrap(bmpData));
|
||||
|
||||
int i1;
|
||||
for(int yy = 0; yy < h; ++yy) {
|
||||
for(int xx = 0; xx < w; ++xx) {
|
||||
int c = bmpData[yy * w + xx];
|
||||
i1 = c >> 16 & 255;
|
||||
int g = c >> 8 & 255;
|
||||
int b = c & 255;
|
||||
int gray = (i1 * 30 + g * 59 + b * 11 + 50) / 100;
|
||||
if(gray < 128) {
|
||||
outData[byteCountW * yy + xx / 8] = (byte)(outData[byteCountW * yy + xx / 8] | 128 >> xx % 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
String cmd = "EG";
|
||||
if(rotate) {
|
||||
cmd = "VEG";
|
||||
}
|
||||
|
||||
String strCmdHeader = String.format("%s %d %d %d %d ", new Object[]{cmd, Integer.valueOf(byteCountW), Integer.valueOf(h), Integer.valueOf(x), Integer.valueOf(y)});
|
||||
String strData = "";
|
||||
|
||||
for( i1 = 0; i1 < outData.length; ++i1) {
|
||||
strData = strData + this.ByteToString(outData[i1]);
|
||||
}
|
||||
|
||||
add(strCmdHeader + strData + "000\r\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void DrawBitmapCG(Bitmap bmp, int x, int y, boolean rotate) {
|
||||
|
||||
int w = bmp.getWidth();
|
||||
int h = bmp.getHeight();
|
||||
int byteCountW = (w + 7) / 8;
|
||||
int[] bmpData = new int[w * h];
|
||||
byte[] outData = new byte[byteCountW * h];
|
||||
bmp.copyPixelsToBuffer(IntBuffer.wrap(bmpData));
|
||||
|
||||
int i1;
|
||||
for(int yy = 0; yy < h; ++yy) {
|
||||
for(int xx = 0; xx < w; ++xx) {
|
||||
int c = bmpData[yy * w + xx];
|
||||
i1 = c >> 16 & 255;
|
||||
int g = c >> 8 & 255;
|
||||
int b = c & 255;
|
||||
int gray = (i1 * 30 + g * 59 + b * 11 + 50) / 100;
|
||||
if(gray < 128) {
|
||||
outData[byteCountW * yy + xx / 8] = (byte)(outData[byteCountW * yy + xx / 8] | 128 >> xx % 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
String cmd = "CG";
|
||||
if(rotate) {
|
||||
cmd = "VCG";
|
||||
}
|
||||
String strCmdHeader = String.format("%s %d %d %d %d ", new Object[]{cmd, Integer.valueOf(byteCountW), Integer.valueOf(h), Integer.valueOf(x), Integer.valueOf(y)});
|
||||
addByte(strCmdHeader.getBytes());
|
||||
addByte(outData);
|
||||
}
|
||||
|
||||
public void barcodeText(int font, int size, int offset, int rotate, int width, int ratio, int height, int x, int y, String data) {
|
||||
|
||||
String cm = String.format("BARCODE 128 %d %d %d %d %d %s\r\n", width, ratio, height,x,y,data);
|
||||
if (rotate==1)
|
||||
cm = String.format("VBARCODE 128 %d %d %d %d %d %s\r\n", width, ratio, height,x,y,data);
|
||||
|
||||
String str = String.format("BARCODE-TEXT %d %d %d\r\n", font, size, offset);
|
||||
add(str);
|
||||
add(cm);
|
||||
add("BARCODE-TEXT OFF\r\n");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void DrawText(int text_x, int text_y, String text, int fontSize, int rotate, int bold, boolean reverse, boolean underline) {
|
||||
|
||||
if (bold!=0)
|
||||
{
|
||||
setBold(bold);
|
||||
}
|
||||
if (underline)
|
||||
{
|
||||
underLine(true);
|
||||
}
|
||||
|
||||
String cmd = "T";
|
||||
if (rotate == 90) cmd = "VT";
|
||||
if (rotate == 180) cmd = "T180";
|
||||
if (rotate == 270) cmd = "T270";
|
||||
|
||||
int f_size = 24;
|
||||
int f_height = 24;
|
||||
|
||||
if (fontSize == 1) {
|
||||
f_size = 55;
|
||||
f_height = 16;
|
||||
}
|
||||
|
||||
if (fontSize == 2) {
|
||||
f_size = 24;
|
||||
f_height = 24;
|
||||
}
|
||||
|
||||
if (fontSize == 3) {
|
||||
f_size = 56;
|
||||
f_height = 32;
|
||||
}
|
||||
|
||||
if (fontSize == 4) {
|
||||
f_size = 24;
|
||||
setMag(2,2);
|
||||
f_height = 48;
|
||||
}
|
||||
|
||||
if (fontSize == 5) {
|
||||
f_size = 56;
|
||||
setMag(2,2);
|
||||
f_height = 64;
|
||||
}
|
||||
|
||||
if (fontSize == 6) {
|
||||
f_size = 24;
|
||||
setMag(3,3);
|
||||
f_height = 72;
|
||||
}
|
||||
|
||||
if (fontSize == 7) {
|
||||
f_size = 32;
|
||||
setMag(4,4);
|
||||
f_height = 96;
|
||||
}
|
||||
if (fontSize == 8) {
|
||||
f_size = 24;
|
||||
setMag(5,5);
|
||||
f_height = 120;
|
||||
}
|
||||
if (fontSize == 9) {
|
||||
f_size = 32;
|
||||
setMag(6,6);
|
||||
f_height = 192;
|
||||
}
|
||||
if (fontSize == 10) {
|
||||
f_size = 24;
|
||||
setMag(7,7);
|
||||
f_height = 168;
|
||||
}
|
||||
if (fontSize == 11) {
|
||||
f_size = 32;
|
||||
setMag(8,8);
|
||||
f_height = 256;
|
||||
}
|
||||
if (fontSize == 12) {
|
||||
f_size = 24;
|
||||
setMag(9,9);
|
||||
f_height = 216;
|
||||
}
|
||||
|
||||
|
||||
String temp = String.format("%s %d %d %d %d %s\r\n", new Object[]{cmd, Integer.valueOf(f_size), Integer.valueOf(0), Integer.valueOf(text_x), Integer.valueOf(text_y), text});
|
||||
add(temp);
|
||||
if (reverse) {
|
||||
|
||||
byte[] bytetext = (byte[]) null;
|
||||
try {
|
||||
bytetext = text.getBytes("gbk");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return;
|
||||
}
|
||||
if (bytetext == null)
|
||||
return;
|
||||
int block_h = f_height;
|
||||
int block_w = f_height / 2 * bytetext.length;
|
||||
|
||||
INVERSE(text_x, text_y, text_x + block_w, text_y, f_height);
|
||||
|
||||
}
|
||||
if (underline)
|
||||
{
|
||||
underLine(false);
|
||||
}
|
||||
setMag(0,0);
|
||||
if (bold!=0)
|
||||
{
|
||||
setBold(0);
|
||||
}
|
||||
// int f_name = 1;
|
||||
// int f_size = 0;
|
||||
// int f_height = 1;
|
||||
// if (mBold!=bold)
|
||||
// {
|
||||
// mBold=bold;
|
||||
// setBold(mBold);
|
||||
// }
|
||||
// if (mUnderLine!=underline)
|
||||
// {
|
||||
// mUnderLine=underline;
|
||||
// underLine(mUnderLine);
|
||||
// }
|
||||
//
|
||||
// String textScale = "";
|
||||
// boolean f_width;
|
||||
// if (fontSize == 1) {
|
||||
// f_name = 55;
|
||||
// f_width = true;
|
||||
// f_height = 16;
|
||||
// f_size = 0;
|
||||
// } else if (fontSize == 2) {
|
||||
// f_name = 20;
|
||||
// f_width = true;
|
||||
// f_height = 20;
|
||||
// f_size = 0;
|
||||
// } else if (fontSize == 3) {
|
||||
// f_name = 24;
|
||||
// f_width = true;
|
||||
// f_height = 24;
|
||||
// f_size = 0;
|
||||
// } else if (fontSize == 4) {
|
||||
// f_name = 28;
|
||||
// f_width = true;
|
||||
// f_height = 28;
|
||||
// f_size = 0;
|
||||
// } else if (fontSize == 5) {
|
||||
// f_name = 56;
|
||||
// f_width = true;
|
||||
// f_height = 32;
|
||||
// f_size = 0;
|
||||
// } else if (fontSize == 6) {
|
||||
// f_name = 24;
|
||||
// f_width = true;
|
||||
// f_height = 48;
|
||||
// f_size = 0;
|
||||
// setMag(2,2);
|
||||
// } else if (fontSize == 7) {
|
||||
// f_name = 56;
|
||||
// f_width = true;
|
||||
// f_height = 64;
|
||||
// f_size = 0;
|
||||
// setMag(2,2);
|
||||
// } else if (fontSize == 8) {
|
||||
// f_name = 56;
|
||||
// f_width = true;
|
||||
// f_height = 96;
|
||||
// f_size = 0;
|
||||
// setMag(3,3);
|
||||
// } else {
|
||||
// f_name = 24;
|
||||
// f_width = true;
|
||||
// f_height = 24;
|
||||
// f_size = 0;
|
||||
// setMag(0,0);
|
||||
// }
|
||||
//
|
||||
// String cmd = "T";
|
||||
// if (rotate != 0) {
|
||||
// if (rotate == 1) {
|
||||
// cmd = "VT";
|
||||
// } else if (rotate == 2) {
|
||||
// cmd = "T180";
|
||||
// } else if (rotate == 3) {
|
||||
// cmd = "T270";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// String str = String.format("%s %s %s %d %d %s\r\n", cmd, Integer.valueOf(f_name), Integer.valueOf(f_size), text_x, text_y, text);
|
||||
// printStr+=str;
|
||||
//
|
||||
//
|
||||
// if (reverse) {
|
||||
// Object var16 = null;
|
||||
//
|
||||
// byte[] bytetext;
|
||||
// try {
|
||||
// bytetext = text.getBytes("gbk");
|
||||
// } catch (UnsupportedEncodingException var19) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// if (bytetext == null) {
|
||||
// return;
|
||||
// }
|
||||
//
|
||||
// int block_w = f_height / 2 * bytetext.length;
|
||||
// this.INVERSE(text_x, text_y, text_x + block_w, text_y, f_height);
|
||||
// }
|
||||
//
|
||||
// if (underline)
|
||||
// underLine(false);
|
||||
//
|
||||
// if (bold!=0) {
|
||||
// setBold(0);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// setMag(0,0);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public void SetPace()
|
||||
{
|
||||
add("PACE\r\n");
|
||||
}
|
||||
|
||||
|
||||
public void DrawText(int text_x, int text_y, String text, int fontType,int fontSize, int rotate, int bold, boolean reverse, boolean underline) {
|
||||
|
||||
if (underline)
|
||||
{
|
||||
underLine(true);
|
||||
}
|
||||
if (bold!=0)
|
||||
{
|
||||
setBold(bold);
|
||||
}
|
||||
|
||||
String cmd = "T";
|
||||
if (rotate == 90) cmd = "VT";
|
||||
if (rotate == 180) cmd = "T180";
|
||||
if (rotate == 270) cmd = "T270";
|
||||
|
||||
|
||||
int f_height = fontSize;
|
||||
if (f_height==0)
|
||||
f_height=24;
|
||||
|
||||
|
||||
String temp = String.format("%s %d %d %d %d %s\r\n", new Object[]{cmd, Integer.valueOf(fontType), Integer.valueOf(fontSize), Integer.valueOf(text_x), Integer.valueOf(text_y), text});
|
||||
add(temp);
|
||||
if (reverse) {
|
||||
|
||||
byte[] bytetext = (byte[]) null;
|
||||
try {
|
||||
bytetext = text.getBytes("gbk");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return;
|
||||
}
|
||||
if (bytetext == null)
|
||||
return;
|
||||
int block_h = f_height;
|
||||
int block_w = f_height / 2 * bytetext.length;
|
||||
|
||||
INVERSE(text_x, text_y, text_x + block_w, text_y, f_height);
|
||||
}
|
||||
}
|
||||
|
||||
public void DrawText(int text_x, int text_y, String text, String fontType,int fontSize, int rotate, int bold, boolean reverse, boolean underline) {
|
||||
|
||||
if (underline)
|
||||
{
|
||||
underLine(true);
|
||||
}
|
||||
if (bold!=0)
|
||||
{
|
||||
setBold(bold);
|
||||
}
|
||||
|
||||
String cmd = "T";
|
||||
if (rotate == 90) cmd = "VT";
|
||||
if (rotate == 180) cmd = "T180";
|
||||
if (rotate == 270) cmd = "T270";
|
||||
|
||||
|
||||
//int f_height = 24*fontSize;
|
||||
int f_height = fontSize;
|
||||
if (f_height==0)
|
||||
f_height=24;
|
||||
|
||||
// setMag(fontSize,fontSize);
|
||||
|
||||
String temp = String.format("%s %s %d %d %d %s\r\n", new Object[]{cmd, fontType, Integer.valueOf(fontSize), Integer.valueOf(text_x), Integer.valueOf(text_y), text});
|
||||
add(temp);
|
||||
if (reverse) {
|
||||
|
||||
byte[] bytetext = (byte[]) null;
|
||||
try {
|
||||
bytetext = text.getBytes("gbk");
|
||||
} catch (UnsupportedEncodingException e) {
|
||||
return;
|
||||
}
|
||||
if (bytetext == null)
|
||||
return;
|
||||
int block_h = f_height;
|
||||
int block_w = f_height / 2 * bytetext.length;
|
||||
|
||||
INVERSE(text_x, text_y, text_x + block_w, text_y, f_height);
|
||||
|
||||
|
||||
}
|
||||
if (underline)
|
||||
{
|
||||
underLine(false);
|
||||
}
|
||||
setMag(0,0);
|
||||
if (bold!=0)
|
||||
{
|
||||
setBold(0);
|
||||
}
|
||||
}
|
||||
|
||||
public void count(int mun) {
|
||||
String str = String.format("COUNT %d\r\n", new Object[] {Integer.valueOf(mun)});
|
||||
add(str);
|
||||
}
|
||||
|
||||
public void setMag(int w, int h) {
|
||||
String str = String.format("SETMAG %d %d\r\n",new Object[] {Integer.valueOf(w), Integer.valueOf(h)});
|
||||
add(str);
|
||||
}
|
||||
|
||||
public void Drawbox(int x0, int y0, int x1, int y1, int width) {
|
||||
|
||||
String str = String.format("BOX %d %d %d %d %d\r\n", new Object[] {Integer.valueOf(x0), Integer.valueOf(y0), Integer.valueOf(x1), Integer.valueOf(y1), Integer.valueOf(width)});
|
||||
add(str);
|
||||
}
|
||||
|
||||
public void DrawLine(int x0, int y0, int x1, int y1, int width) {
|
||||
String str = String.format("LINE %d %d %d %d %d\r\n", new Object[] {Integer.valueOf(x0), Integer.valueOf(y0), Integer.valueOf(x1), Integer.valueOf(y1), Integer.valueOf(width)});
|
||||
add(str);
|
||||
}
|
||||
|
||||
|
||||
public void DrawBarcode1D(String type, int x, int y, String text, int width, int height, int rotate) {
|
||||
|
||||
String cmd = "BARCODE";
|
||||
if (rotate==1)
|
||||
cmd = "VBARCODE";
|
||||
String str = String.format("%s %s %d 1 %d %d %d %s\r\n", new Object[] { cmd, type, Integer.valueOf(width - 1), Integer.valueOf(height), Integer.valueOf(x), Integer.valueOf(y), text });
|
||||
|
||||
add(str);
|
||||
}
|
||||
public void DrawBarcodeQRcode(int x, int y, String text, int size, String errLevel, boolean rotate,int len) {
|
||||
|
||||
String cmd = "BARCODE";
|
||||
if (rotate)
|
||||
cmd = "VBARCODE";
|
||||
String str = String.format("%s QR %d %d M %d U %d\r\n", new Object[] { cmd, Integer.valueOf(x), Integer.valueOf(y), Integer.valueOf(len),Integer.valueOf(size) });
|
||||
add(str);
|
||||
String tm = String.format("%sA,", errLevel);
|
||||
add(tm);
|
||||
add(text);
|
||||
add("\r\nENDQR\r\n");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void alignLeft() {
|
||||
add("LEFT\r\n");
|
||||
}
|
||||
public void alignRight() {
|
||||
add("RIGHT\r\n");
|
||||
}
|
||||
public void alignCenter() {
|
||||
add("CENTER\r\n");
|
||||
}
|
||||
public void end() {
|
||||
add("END\r\n");
|
||||
}
|
||||
public void about() {
|
||||
add("ABOUT\r\n");
|
||||
}
|
||||
|
||||
public class CONCAT
|
||||
{
|
||||
String str;
|
||||
public CONCAT(int font, int size, int offset, String str)
|
||||
{
|
||||
|
||||
this.str = String.format("%d %d %d %s\r\n", new Object[] { Integer.valueOf(font), Integer.valueOf(size), Integer.valueOf(offset), str });
|
||||
}
|
||||
public String getStr()
|
||||
{
|
||||
return this.str;
|
||||
}
|
||||
}
|
||||
|
||||
public void textConcatenation(int x, int y, List<CONCAT> concat, int rotate) {
|
||||
String temp = String.format("CONCAT %d %d\r\n", new Object[] {Integer.valueOf(x), Integer.valueOf(y)});
|
||||
if (rotate==1) {
|
||||
temp = String.format("VCONCAT %d %d\r\n", new Object[] {Integer.valueOf(x), Integer.valueOf(y)});
|
||||
}
|
||||
add(temp);
|
||||
for (int i=0;i<concat.size();i++)
|
||||
{
|
||||
add(concat.get(i).getStr());
|
||||
}
|
||||
|
||||
add("ENDCONCAT\r\n");
|
||||
}
|
||||
|
||||
public void multLine(int height, int fontTpye,int fontSize,int x, int y, int rotate, String...strs) {
|
||||
String direction = "T";
|
||||
add(String.format("ML %d\r\n", new Object[] {Integer.valueOf(height)}));
|
||||
switch(rotate)
|
||||
{
|
||||
case 0:
|
||||
direction = "T";
|
||||
break;
|
||||
case 90:
|
||||
direction = "T90";
|
||||
break;
|
||||
case 180:
|
||||
direction = "T180";
|
||||
break;
|
||||
case 270:
|
||||
direction = "T270";
|
||||
break;
|
||||
default:
|
||||
direction="T";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
String temp = String.format("%s %d %d %d %d\r\n", new Object[] { direction, Integer.valueOf(fontTpye), Integer.valueOf(fontSize), Integer.valueOf(x), Integer.valueOf(y)});
|
||||
add(temp);
|
||||
for (String s:strs)
|
||||
{
|
||||
add(String.format("%s\r\n", new Object[] {s}));
|
||||
}
|
||||
add("ENDML\r\n");
|
||||
}
|
||||
|
||||
public void contRast(int level) {
|
||||
add(String.format("CONTRAST %d\r\n", new Object[] {Integer.valueOf(level)}));
|
||||
}
|
||||
|
||||
public void speed(int level) {
|
||||
add(String.format("SPEED %d\r\n", new Object[] {Integer.valueOf(level)}));
|
||||
}
|
||||
|
||||
public void setBold(int level) {
|
||||
add(String.format("SETBOLD %d\r\n", new Object[] {Integer.valueOf(level)})) ;
|
||||
}
|
||||
|
||||
public void setSP(int spacing){add(String.format("SETSP %d\r\n", new Object[] {Integer.valueOf(spacing)}));}
|
||||
|
||||
public void underLine(boolean mode) {
|
||||
if (mode)
|
||||
add(String.format("UNDERLINE ON\r\n")) ;
|
||||
else
|
||||
add(String.format("UNDERLINE OFF\r\n"));
|
||||
}
|
||||
public void pace() {
|
||||
add("PACE\r\n");
|
||||
}
|
||||
|
||||
public void printWait(int time) {
|
||||
add(String.format("WAIT %d\r\n", new Object[] {Integer.valueOf(time)}));
|
||||
}
|
||||
|
||||
public void backGround(int level) {
|
||||
add(String.format("f %d\r\n", new Object[] {Integer.valueOf(level)}));
|
||||
}
|
||||
|
||||
public void bkText(int font, int size, int x, int y, int lev,String str, int rotate) {
|
||||
String direction = "BKT";
|
||||
switch(rotate)
|
||||
{
|
||||
case 0:
|
||||
direction = "BKT";
|
||||
break;
|
||||
case 90:
|
||||
direction = "BKT90";
|
||||
break;
|
||||
case 180:
|
||||
direction = "BKT180";
|
||||
break;
|
||||
case 270:
|
||||
direction = "BKT270";
|
||||
break;
|
||||
default:
|
||||
direction="BKT";
|
||||
break;
|
||||
}
|
||||
|
||||
String temp = String.format("BACKGROUND %d\r\n",new Object[]{Integer.valueOf(lev)})
|
||||
+String.format(
|
||||
"%s %d %d %d %d %s\r\n", new Object[] {direction, Integer.valueOf(font), Integer.valueOf(size), Integer.valueOf(x), Integer.valueOf(y),str}
|
||||
) +"BACKGROUND 0\r\n";
|
||||
add(temp);
|
||||
|
||||
}
|
||||
|
||||
public void drawDATAMATRIX(int x,int y,int h,String str)
|
||||
{
|
||||
String begin = String.format("B DATAMATRIX %d %d H %d\r\n",new Object[]{Integer.valueOf(x),Integer.valueOf(y),Integer.valueOf(h)});
|
||||
|
||||
String end="\r\nENDDATAMATRIX\r\n";
|
||||
|
||||
add((begin+str+end));
|
||||
|
||||
|
||||
}
|
||||
public void print(int skip) {
|
||||
|
||||
if(printByteLen != 0)
|
||||
{
|
||||
String str = String.format("! 0 200 200 %d %d\r\n"+
|
||||
"PAGE-WIDTH %d\r\n",
|
||||
new Object[] { Integer.valueOf(mHeight), Integer.valueOf(PrintTime),Integer.valueOf(mWidth)});
|
||||
StringBuilder st = new StringBuilder(printStr);
|
||||
st.insert(0,str);
|
||||
LastprintStr = st.toString();
|
||||
|
||||
LastprintByteLen = 0;
|
||||
byte[] tmp = LastprintStr.getBytes();
|
||||
System.arraycopy(tmp, 0, LastprintByte, 0, tmp.length);
|
||||
LastprintByteLen += tmp.length;
|
||||
System.arraycopy(printByte, 0, LastprintByte, LastprintByteLen, printByteLen);
|
||||
LastprintByteLen += printByteLen;
|
||||
String strTmp="";
|
||||
if(skip == 1) strTmp = "GAP-SENSE\r\nFORM\r\nPRINT\r\n";
|
||||
else if(skip == 2) strTmp = "BAR-SENSE-LEFT\r\nFORM\r\nPRINT\r\n";
|
||||
else if(skip == 3) strTmp = "BAR-SENSE\r\nFORM\r\nPRINT\r\n";
|
||||
else strTmp = "PRINT\r\n";
|
||||
LastprintStr += strTmp;
|
||||
|
||||
byte[] tmplast = strTmp.getBytes();
|
||||
System.arraycopy(tmplast, 0, LastprintByte, LastprintByteLen, tmplast.length);
|
||||
LastprintByteLen += tmplast.length;
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (skip)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1:
|
||||
add("GAP-SENSE\r\n");
|
||||
break;
|
||||
case 2:
|
||||
add("BAR-SENSE-LEFT\r\n");
|
||||
break;
|
||||
case 3:
|
||||
add("BAR-SENSE\r\n");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
add("FORM\r\n");
|
||||
add("PRINT\r\n");
|
||||
String str = String.format("! 0 200 200 %d %d\r\n"+
|
||||
"PAGE-WIDTH %d\r\n",
|
||||
new Object[] { Integer.valueOf(mHeight), Integer.valueOf(PrintTime),Integer.valueOf(mWidth)});
|
||||
StringBuilder st = new StringBuilder(printStr);
|
||||
st.insert(0,str);
|
||||
LastprintStr = st.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public void print() {
|
||||
if(printByteLen != 0)
|
||||
{
|
||||
String str = String.format("! 0 200 200 %d %d\r\n"+
|
||||
"PAGE-WIDTH %d\r\n",
|
||||
new Object[] { Integer.valueOf(mHeight), Integer.valueOf(PrintTime),Integer.valueOf(mWidth)});
|
||||
StringBuilder st = new StringBuilder(printStr);
|
||||
st.insert(0,str);
|
||||
LastprintStr = st.toString();
|
||||
LastprintByteLen = 0;
|
||||
byte[] tmp = LastprintStr.getBytes();
|
||||
System.arraycopy(tmp, 0, LastprintByte, 0, tmp.length);
|
||||
LastprintByteLen += tmp.length;
|
||||
System.arraycopy(printByte, 0, LastprintByte, LastprintByteLen, printByteLen);
|
||||
LastprintByteLen += printByteLen;
|
||||
|
||||
String strTmp="PRINT\r\n";
|
||||
LastprintStr += strTmp;
|
||||
byte[] tmplast = strTmp.getBytes();
|
||||
System.arraycopy(tmplast, 0, LastprintByte, LastprintByteLen, tmplast.length);
|
||||
LastprintByteLen += tmplast.length;
|
||||
}
|
||||
else{
|
||||
add("FORM\r\n");
|
||||
add("PRINT\r\n");
|
||||
String str = String.format("! 0 200 200 %d %d\r\n"+
|
||||
"PAGE-WIDTH %d\r\n",
|
||||
new Object[] { Integer.valueOf(mHeight), Integer.valueOf(PrintTime),Integer.valueOf(mWidth)});
|
||||
StringBuilder st = new StringBuilder(printStr);
|
||||
st.insert(0,str);
|
||||
LastprintStr = st.toString();
|
||||
}
|
||||
}
|
||||
|
||||
private String IntToHex(byte data) {
|
||||
char ch;
|
||||
String r = "";
|
||||
switch (data)
|
||||
{ case 0:
|
||||
case 1:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
ch = (char)(data + 48);
|
||||
r = Character.toString(ch);
|
||||
return r;case 10: return "A";case 11: return "B";case 12: return "C";case 13: return "D";case 14: return "E";case 15: return "F"; } Log.d("long", "ch is error "); return r;
|
||||
}
|
||||
|
||||
|
||||
private String ByteToString(byte data) {
|
||||
String str = "";
|
||||
byte d1 = (byte)(data >> 4 & 0xF);
|
||||
byte d2 = (byte)(data & 0xF);
|
||||
str = String.valueOf(IntToHex(d1)) + IntToHex(d2);
|
||||
return str;
|
||||
}
|
||||
public String version(){
|
||||
return "V1.5";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.Canvas;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.graphics.pdf.PdfRenderer;
|
||||
import android.os.Build;
|
||||
import android.os.Environment;
|
||||
import android.os.ParcelFileDescriptor;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class printPDF {
|
||||
|
||||
Context mCotext;
|
||||
ArrayList<Bitmap> mbitmaps=null;
|
||||
|
||||
public printPDF(Context con)
|
||||
{
|
||||
mCotext = con;
|
||||
mbitmaps = new ArrayList<Bitmap>();
|
||||
}
|
||||
|
||||
|
||||
/** 打开PDF文件
|
||||
* @param pdfPath pdf路径
|
||||
* @param maxWeight 最大宽度
|
||||
* */
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
public void openPDF(String pdfPath, int maxWeight)
|
||||
{
|
||||
mbitmaps = pdfToBitmap(pdfPath,maxWeight);
|
||||
//savePDFToImage("PRINT");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/** PDF成功转化为Bitmap,并返回list
|
||||
* */
|
||||
public ArrayList<Bitmap> getMbitmaps()
|
||||
{return mbitmaps;}
|
||||
|
||||
|
||||
|
||||
/** 把PDF以PNG的格式保存到本地文件夹
|
||||
* @param Path 保存路径
|
||||
* */
|
||||
void savePDFToImage(String Path)
|
||||
{
|
||||
String savePath= Environment.getExternalStorageDirectory().getAbsolutePath()+File.separator+Path;
|
||||
if (mbitmaps==null)
|
||||
return;
|
||||
for (int i = 0; i < mbitmaps.size(); i++) {
|
||||
try {
|
||||
File file = new File(savePath);
|
||||
if (!file.exists()) {
|
||||
file.mkdirs();
|
||||
}
|
||||
String localFile = savePath + "/" + i + ".png";
|
||||
Log.i("test_sign", "图片全路径localFile = " + localFile);
|
||||
File f = new File(localFile);
|
||||
FileOutputStream fos = new FileOutputStream(f);
|
||||
mbitmaps.get(i).compress(Bitmap.CompressFormat.PNG, 100, fos);
|
||||
fos.flush();
|
||||
fos.close();
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private Bitmap zoomImage(Bitmap bgimage, int newWidth) {
|
||||
// 获取这个图片的宽和高
|
||||
float width = bgimage.getWidth();
|
||||
float height = bgimage.getHeight();
|
||||
// 创建操作图片用的matrix对象
|
||||
Matrix matrix = new Matrix();
|
||||
// 计算宽高缩放率
|
||||
double scale = (float)newWidth / width;
|
||||
// Log.d("zkprinter","bmp zoomImage scale:"+scale);
|
||||
// 缩放图片动作
|
||||
matrix.postScale((float)scale,(float)scale);
|
||||
Bitmap bitmap = Bitmap.createBitmap(bgimage, 0, 0, (int) width,
|
||||
(int) height, matrix, true);
|
||||
// Log.d("zkprinter","bmp zoomImage width:"+bitmap.getWidth()+",height:"+bitmap.getHeight());
|
||||
return bitmap;
|
||||
}
|
||||
|
||||
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
|
||||
private ArrayList<Bitmap> pdfToBitmap(String pdfPath, int maxWeight) {
|
||||
File pdfFile = new File(pdfPath);
|
||||
ArrayList<Bitmap> bitmaps = new ArrayList<>();
|
||||
PdfRenderer renderer = null;
|
||||
try {
|
||||
renderer = new PdfRenderer(ParcelFileDescriptor.open(pdfFile, ParcelFileDescriptor.MODE_READ_ONLY));
|
||||
|
||||
} catch (Exception ex) {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
if (renderer==null)
|
||||
return null;
|
||||
Bitmap bitmap;
|
||||
final int pageCount = renderer.getPageCount();
|
||||
for (int i = 0; i < pageCount; i++) {
|
||||
PdfRenderer.Page page = renderer.openPage(i);
|
||||
int width = mCotext.getResources().getDisplayMetrics().densityDpi / 72 * page.getWidth();
|
||||
int height = mCotext.getResources().getDisplayMetrics().densityDpi / 72 * page.getHeight();
|
||||
//Log.d("zkprinter","bmp ori1 width:"+width+",height:"+height);
|
||||
bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
|
||||
//todo 以下三行处理图片存储到本地出现黑屏的问题,这个涉及到背景问题
|
||||
Canvas canvas = new Canvas(bitmap);
|
||||
canvas.drawColor(Color.WHITE);
|
||||
canvas.drawBitmap(bitmap, 0, 0, null);
|
||||
Rect r = new Rect(0, 0, width, height);
|
||||
page.render(bitmap, r, null, PdfRenderer.Page.RENDER_MODE_FOR_DISPLAY);
|
||||
//Log.d("zkprinter","bmp ori2 width:"+bitmap.getWidth()+",height:"+bitmap.getHeight());
|
||||
Bitmap b=zoomImage(bitmap,maxWeight);
|
||||
bitmaps.add(b);
|
||||
// close the page
|
||||
page.close();
|
||||
}
|
||||
// close the renderer
|
||||
renderer.close();
|
||||
return bitmaps;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
public interface wifiListener {
|
||||
|
||||
void receivedmsg(String msg);
|
||||
void receivedstatus(byte[] statue);
|
||||
}
|
||||
|
|
@ -0,0 +1,392 @@
|
|||
package com.ycgis.zpSDK;
|
||||
|
||||
|
||||
import android.content.Context;
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
import android.util.Log;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public class zpPrinter
|
||||
{
|
||||
private Context context;
|
||||
static int w;
|
||||
static int h;
|
||||
String TAG = "zpSDK";
|
||||
|
||||
_PrinterPageImpl impl=new _PrinterPageImpl();
|
||||
|
||||
/*************CPCL指令接口********************CPCL指令接口*************************CPCL指令接口*****************************/
|
||||
|
||||
public void drawDATAMATRIX(int x,int y,int h,String str)
|
||||
{
|
||||
impl.drawDATAMATRIX(x,y,h,str);
|
||||
}
|
||||
|
||||
/**执行打印操作
|
||||
* @param skip 走纸方式
|
||||
* 0:不走纸;1:设置标签检测;2:设置左黑标检测指令;3:设置右黑标检测指令;
|
||||
* */
|
||||
public String print(int horizontal, int skip) {
|
||||
impl.print(skip);
|
||||
return impl.getPrintStr();
|
||||
}
|
||||
|
||||
public byte[] printByte(int horizontal, int skip) {
|
||||
impl.print(skip);
|
||||
return impl.getPrintByte();
|
||||
}
|
||||
|
||||
|
||||
/**设置打印次数
|
||||
* @param time 次数
|
||||
* 设置打印次数,默认为 1 次
|
||||
* */
|
||||
|
||||
public void setPrintTime(int time){impl.setPrintTime(time);}
|
||||
|
||||
public void noPrint(int horizontal, int skip) {
|
||||
impl.print(skip);
|
||||
}
|
||||
|
||||
public void noPrint() {
|
||||
impl.print();
|
||||
}
|
||||
|
||||
/**执行打印操作*/
|
||||
public String print() {
|
||||
impl.print();
|
||||
return impl.getPrintStr();
|
||||
}
|
||||
|
||||
/**打印填入的CPCL指令*/
|
||||
public void printPrintStr()
|
||||
{
|
||||
Log.e(TAG, impl.getPrintStr() );
|
||||
}
|
||||
|
||||
public String getprintPrintStr()
|
||||
{
|
||||
return impl.getPrintStr();
|
||||
}
|
||||
|
||||
/**设置页面宽高*/
|
||||
public void pageSetup(int pageWidth, int pageHeight) {
|
||||
w = pageWidth;
|
||||
h = pageHeight;
|
||||
impl.Create(pageWidth, pageHeight);
|
||||
}
|
||||
|
||||
/**设置页面宽高*
|
||||
* @param pageWidth 打印纸宽度
|
||||
* @param pageHeight 打印纸高度
|
||||
* @param r 旋转180度打印 0:不旋转;1:旋转90;2:旋转180;3:旋转270;
|
||||
* @param gap 走纸方式
|
||||
* 0:不走纸;1:设置标签检测;2:设置左黑标检测指令;3:设置右黑标检测指令;
|
||||
*/
|
||||
|
||||
public void pageSetup(int pageWidth, int pageHeight,int r,int gap) {
|
||||
w = pageWidth;
|
||||
h = pageHeight;
|
||||
impl.Create(pageWidth, pageHeight,r,gap);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 打印矩形框
|
||||
*
|
||||
* @param top_left_x 矩形框左上角 x 坐标
|
||||
* @param top_left_y 矩形框左上角 y 坐标
|
||||
* @param bottom_right_x 矩形框右下角 x 坐标
|
||||
* @param bottom_right_y 矩形框右下角 y 坐标
|
||||
* @param lineWidth 边框线条宽度
|
||||
*/
|
||||
public void drawBox(int lineWidth, int top_left_x, int top_left_y, int bottom_right_x, int bottom_right_y) {
|
||||
impl.Drawbox(top_left_x, top_left_y, bottom_right_x, bottom_right_y,
|
||||
lineWidth);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印实线
|
||||
*
|
||||
* @param start_x 线条起始点 x 坐标
|
||||
* @param start_y 线条起始点 y 坐标
|
||||
* @param end_x 线条结束点 x 坐标
|
||||
* @param end_y 线条结束点 y 坐标
|
||||
* @param lineWidth 线条宽度
|
||||
*/
|
||||
public void drawLine(int lineWidth, int start_x, int start_y, int end_x, int end_y, boolean fullline) {
|
||||
impl.DrawLine(start_x, start_y, end_x, end_y, lineWidth);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印文字
|
||||
*
|
||||
* @param text 要打印的文本内容
|
||||
* @param text_x 文字起始横坐标
|
||||
* @param text_y 文字起始纵坐标
|
||||
* @param fontSize fontSize - 字体大小
|
||||
* @param rotate 旋转角度(逆时针) 支持 0; 90; 180 ;270;
|
||||
* @param bold 打印粗细
|
||||
* @param reverse 反向打印
|
||||
* @param underline 下划线
|
||||
*/
|
||||
public void drawText(int text_x, int text_y, String text, int fontSize, int rotate, int bold, boolean reverse, boolean underline) {
|
||||
impl.DrawText(text_x, text_y, text, fontSize, rotate, bold, reverse, underline);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印文字
|
||||
*
|
||||
* @param text 要打印的文本内容
|
||||
* @param text_x 文字起始横坐标
|
||||
* @param text_y 文字起始纵坐标
|
||||
* @param fontType fontType - 字体类型(int)
|
||||
* @param fontSize fontSize - 字体大小
|
||||
* @param rotate 旋转角度(逆时针) 支持 0; 90; 180 ;270;
|
||||
* @param bold 打印粗细
|
||||
* @param reverse 反向打印
|
||||
* @param underline 下划线
|
||||
*/
|
||||
|
||||
public void drawText(int text_x, int text_y, String text, int fontType,int fontSize, int rotate, int bold, boolean reverse, boolean underline){
|
||||
impl.DrawText(text_x, text_y, text, fontType,fontSize, rotate, bold, reverse, underline);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印文字
|
||||
*
|
||||
* @param text 要打印的文本内容
|
||||
* @param text_x 文字起始横坐标
|
||||
* @param text_y 文字起始纵坐标
|
||||
* @param fontType fontType - 字体类型(string)
|
||||
* @param fontSize fontSize - 字体大小
|
||||
* @param rotate 旋转角度(逆时针) 支持 0; 90; 180 ;270;
|
||||
* @param bold 打印粗细
|
||||
* @param reverse 反向打印
|
||||
* @param underline 下划线
|
||||
*/
|
||||
|
||||
public void drawText(int text_x, int text_y, String text, String fontType,int fontSize, int rotate, int bold, boolean reverse, boolean underline){
|
||||
impl.DrawText(text_x, text_y, text, fontType,fontSize, rotate, bold, reverse, underline);
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印条形码
|
||||
*
|
||||
* @param text 条形码的内容
|
||||
* @param start_x 条形码起始横坐标
|
||||
* @param start_y 条形码起始纵坐标
|
||||
* @param height 条形码高度
|
||||
* @param linewidth 条形码线宽度
|
||||
* @param type 条形码类型 0:CODE39; 1:CODE128;2:CODE93; 3:CODEBAR; 4:EAN8; 5:EAN13; 6:UPCA; 7:UPC-E; 8:I2OF5
|
||||
* @param rotate 旋转角度 支持 0:水平条码;1:竖直条码
|
||||
*/
|
||||
public void drawBarCode(int start_x, int start_y, String text, int type, int rotate, int linewidth, int height) {
|
||||
String type_ = "128";
|
||||
if (type == 0)
|
||||
type_ = "39";
|
||||
if (type == 1)
|
||||
type_ = "128";
|
||||
if (type == 2)
|
||||
type_ = "93";
|
||||
if (type == 3)
|
||||
type_ = "CODABAR";
|
||||
if (type == 4)
|
||||
type_ = "EAN8";
|
||||
if (type == 5)
|
||||
type_ = "EAN13";
|
||||
if (type == 6)
|
||||
type_ = "UPCA";
|
||||
if (type == 7)
|
||||
type_ = "UPCE";
|
||||
if (type == 8) {
|
||||
type_ = "I2OF5";
|
||||
}
|
||||
|
||||
impl.DrawBarcode1D(type_,start_x, start_y, text, linewidth, height, rotate);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 打印二维码
|
||||
*
|
||||
* @param text 二维码内容
|
||||
* @param start_x 二维码起始横坐标
|
||||
* @param start_y 二维码起始纵坐标
|
||||
* @param ver 二维码放大倍数,值的范围是1-32,默认填6
|
||||
* @param lel 二维码版本型号,值的范围是1-40,越大标识尺寸越大,尺寸17+n*4,0表示自动
|
||||
* @param rotate 旋转角度
|
||||
*/
|
||||
public void drawQrCode(int start_x, int start_y, String text, int rotate, int ver, int lel) { impl.DrawBarcodeQRcode(start_x, start_y, text, ver,"M",false,lel); }
|
||||
|
||||
|
||||
/**
|
||||
* 打印图片
|
||||
*
|
||||
* @param start_x 位图开始的X坐标
|
||||
* @param start_y 位图开始的Y坐标
|
||||
* @param bmp_size_x 位图高
|
||||
* @param bmp_size_y 位图宽
|
||||
* @param bmp 位图
|
||||
*/
|
||||
//public void drawGraphic(int start_x, int start_y, int bmp_size_x, int bmp_size_y, Bitmap bmp) { impl.DrawBitmap(bmp,start_x, start_y,false); }
|
||||
public void drawGraphic(int start_x, int start_y, int bmp_size_x, int bmp_size_y, Bitmap bmp) { impl.DrawBitmapCG(bmp,start_x, start_y,false); }
|
||||
|
||||
public void drawImageFormFile(int start_x, int start_y, String filepath) {
|
||||
|
||||
Bitmap bmp=null;
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
fis = new FileInputStream(filepath);
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
bmp = BitmapFactory.decodeStream(fis);
|
||||
impl.DrawBitmap(bmp,start_x, start_y,false);
|
||||
}
|
||||
|
||||
/**反白线段*/
|
||||
public void drawINVERSE(int x0, int y0, int x1, int y1, int width) { impl.INVERSE(x0, y0, x1, y1, width); }
|
||||
/**打印前走纸
|
||||
* {length}: 走纸距离点数。8点=1mm
|
||||
*/
|
||||
public void prefeed(int len) { impl.prefeed(len); }
|
||||
/**打印后走纸
|
||||
* {length}: 走纸距离点数。8点=1mm
|
||||
*/
|
||||
public void postfeed(int len) { impl.postfeed(len); }
|
||||
/**左对齐*/
|
||||
public void alignLeft() { impl.alignLeft(); }
|
||||
/**右对齐*/
|
||||
public void alignRight() { impl.alignRight(); }
|
||||
/**中心对齐*/
|
||||
public void alignCenter() { impl.alignCenter(); }
|
||||
/**结束指令*/
|
||||
public void end() { impl.end(); }
|
||||
/**忽略指令*/
|
||||
public void about() { impl.about(); }
|
||||
/**数字自动增减;
|
||||
* ±65535内的任意整数*/
|
||||
public void count(int mun) { impl.count(mun); }
|
||||
/**字符放大*/
|
||||
public void setMag(int w, int h) { impl.setMag(w,h); }
|
||||
/**字符间距
|
||||
* 字符与字符之间的间隔大小,spacing*0.125mm
|
||||
*/
|
||||
public void setSP(int spacing){impl.setSP(spacing);}
|
||||
|
||||
/**批量打印
|
||||
* 按下走纸键打印第二张,再按下打印第三张
|
||||
*/
|
||||
public void setPace() {
|
||||
impl.SetPace();
|
||||
}
|
||||
|
||||
/**设置对比度指令
|
||||
{level}: 对比度等级
|
||||
0 = 默认
|
||||
1 = 中等
|
||||
2 = 黑
|
||||
3 = 非常黑
|
||||
设置打印对比度。对比度越高,打印越黑,打印速度越慢
|
||||
*/
|
||||
public void contRast(int level) { impl.contRast(level); }
|
||||
/**打印速度
|
||||
* {speed level}: 0-5的数值,0是最慢的速度
|
||||
*/
|
||||
public void speed(int level) { impl.speed(level); }
|
||||
/**设置字体为粗体
|
||||
* {level} = 0 取消粗体模式
|
||||
* {level} > 1 设置打印字体为粗体
|
||||
*/
|
||||
public void setBold(int level) { impl.setBold(level); }
|
||||
/**延时打印
|
||||
* 延时1/8的时间*/
|
||||
public void printWait(int time) { impl.printWait(time); }
|
||||
|
||||
/**
|
||||
* 条码识别符
|
||||
*
|
||||
* @param font 识别符字体编号
|
||||
* @param size 识别符字号
|
||||
* @param offset 离条码远近的偏移点数 8点=1mm
|
||||
* @param rotate 旋转角度 支持 0:水平条码;1:竖直条码
|
||||
* @param width 窄条码的宽度点数,默认1
|
||||
* @param ratio 宽条码和窄条码的比率,默认1
|
||||
* @param height 条码高度点数(8点/mm)
|
||||
* @param x 条码开始的X轴坐标
|
||||
* @param y 条码开始的Y轴坐标
|
||||
* @param data 条码数据
|
||||
*/
|
||||
public void barcodeText(int font, int size, int offset, int rotate, int width, int ratio, int height, int x, int y, String data) {
|
||||
impl.barcodeText(font, size, offset, rotate, width, ratio, height, x, y, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 文字关联
|
||||
*
|
||||
* @param x X轴 开始坐标
|
||||
* @param y Y轴 开始坐标
|
||||
* @param concat 离条码远近的偏移点数 8点=1mm
|
||||
* @param rotate 旋转角度 支持 0:水平条码;1:竖直条码
|
||||
// * class CONCAT
|
||||
// * {
|
||||
// * @param str 要打印的文本内容
|
||||
// * @param font 字体的名字或者编号
|
||||
// * @param size 字体字号
|
||||
// * @param offset 开始坐标的偏移点数 8点=1mm
|
||||
// * public CONCAT(int font,int size,int offset,String str)
|
||||
// * }
|
||||
*/
|
||||
public void textConcatenation(int x, int y, List<_PrinterPageImpl.CONCAT> concat, int rotate) {
|
||||
impl.textConcatenation(x, y, concat, rotate);
|
||||
}
|
||||
|
||||
/**
|
||||
* 多行打印
|
||||
*
|
||||
* @param height 每行文字的高度
|
||||
* @param fontSize 字体标号
|
||||
* @param fontSize 字体大小
|
||||
* @param x X轴开始坐标
|
||||
* @param y Y轴开始坐标
|
||||
* @param rotate 旋转角度(逆时针) 支持 0 90 180 270
|
||||
* @param strs 需要打印的文字
|
||||
*/
|
||||
public void multLine(int height, int fontType,int fontSize, int x, int y, int rotate, String... strs) {
|
||||
impl.multLine(height, fontType,fontSize,x, y, rotate, strs);
|
||||
}
|
||||
|
||||
/**
|
||||
* 水印文字灰度级
|
||||
* @param level 设置水印文字的灰度0-255,值越大颜色越深
|
||||
*/
|
||||
public void backGround(int level) { impl.backGround(level); }
|
||||
|
||||
/**
|
||||
* 打印水印
|
||||
*
|
||||
* @param font 字体名字或者编号
|
||||
* @param size 字号
|
||||
* @param x X轴开始坐标
|
||||
* @param y Y轴开始坐标
|
||||
* @param rotate 旋转角度(逆时针) 支持 0 90 180 270
|
||||
* @param str 需要打印的文字
|
||||
* @param lev 水印深浅0-255
|
||||
*/
|
||||
public void bkText(int font, int size, int x, int y, int lev,String str, int rotate) {
|
||||
impl.bkText(font, size, x, y, lev,str, rotate);
|
||||
}
|
||||
|
||||
/**版本信息*/
|
||||
public String version() { return impl.version(); }
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 146 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 167 KiB |
|
|
@ -141,6 +141,7 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:visibility="gone"
|
||||
android:background="@color/colorWhite"
|
||||
android:orientation="horizontal"
|
||||
android:minHeight="@dimen/dp40"
|
||||
|
|
@ -183,7 +184,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="申请角色:"
|
||||
android:text="申请权限:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
|
|
@ -194,7 +195,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginEnd="@dimen/dp8"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="角色名称"
|
||||
android:hint="权限名称"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textColorHint="@color/colorGrey5"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
|
|
|||
|
|
@ -98,11 +98,16 @@
|
|||
<com.ycgis.macall.personalcenter.v.photoview.PhotoView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="0dp"
|
||||
android:src="@drawable/sr_yysqlc"
|
||||
android:rotation="90"
|
||||
android:scaleX="1.5"
|
||||
android:scaleY="1.5"
|
||||
android:src="@drawable/sr_yysqlc_ii"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintHorizontal_bias="0.0"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/base_title" />
|
||||
app:layout_constraintTop_toBottomOf="@+id/base_title"
|
||||
app:layout_constraintVertical_bias="0.0" />
|
||||
|
||||
|
||||
<!-- <LinearLayout-->
|
||||
|
|
|
|||
|
|
@ -0,0 +1,120 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".v.activity.BluetoothActivity">
|
||||
|
||||
<include
|
||||
android:id="@+id/base_title"
|
||||
layout="@layout/app_base_title" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp48"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="打印机:"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_printer"
|
||||
android:layout_width="0dp"
|
||||
android:layout_weight="1"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="未连接"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_printer"
|
||||
android:layout_width="@dimen/dp68"
|
||||
android:layout_height="@dimen/dp46"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:visibility="gone"
|
||||
android:text="打印"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
style="@style/HFG"
|
||||
android:layout_marginTop="@dimen/dp5" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已配对设备↓"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_ypd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10" />
|
||||
|
||||
<View
|
||||
style="@style/HFG"
|
||||
android:layout_marginTop="@dimen/dp5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="搜索列表↓"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="@dimen/dp58"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:visibility="gone"
|
||||
android:text="搜索设备"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/search_progress"
|
||||
android:layout_width="@dimen/dp25"
|
||||
android:layout_height="@dimen/dp25"
|
||||
android:layout_marginEnd="@dimen/dp15" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_search_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -150,7 +150,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_marginStart="@dimen/dp8"
|
||||
android:text="系统和角色:"
|
||||
android:text="@string/applyTitleSelectPermissions"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
|
|
@ -175,7 +175,7 @@
|
|||
android:layout_marginStart="@dimen/dp8"
|
||||
android:layout_marginEnd="@dimen/dp5"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="点击选择系统角色"
|
||||
android:hint="@string/applyClickSelectPermissions"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textColorHint="@color/colorGrey5"
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
|
@ -250,7 +250,7 @@
|
|||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="联系方式:"
|
||||
android:text="@string/applyTitlePhone"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
|
|
@ -265,7 +265,7 @@
|
|||
android:minHeight="@dimen/dp38"
|
||||
android:background="@drawable/back_gount_cat_type_bj1"
|
||||
android:gravity="center_vertical"
|
||||
android:hint="请输入联系电话"
|
||||
android:hint="@string/applyInputPhoe"
|
||||
android:inputType="phone"
|
||||
android:paddingStart="@dimen/dp8"
|
||||
android:textColor="@color/colorGrey8"
|
||||
|
|
@ -301,7 +301,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingStart="@dimen/dp2"
|
||||
android:text="申请原因:"
|
||||
android:text="@string/applyTitleReason"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp14"
|
||||
tools:ignore="RtlSymmetry" />
|
||||
|
|
@ -316,7 +316,7 @@
|
|||
android:layout_marginEnd="@dimen/dp8"
|
||||
android:background="@drawable/back_gount_cat_type_bj1"
|
||||
android:gravity="top"
|
||||
android:hint="请输入原因"
|
||||
android:hint="@string/applyInputReason"
|
||||
android:padding="@dimen/dp5"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textColorHint="@color/colorGrey5"
|
||||
|
|
@ -332,7 +332,7 @@
|
|||
android:layout_margin="25dp"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:text="提交"
|
||||
android:text="@string/submitApply"
|
||||
android:background="@drawable/mancolor_round_button"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -15,26 +15,27 @@
|
|||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
android:background="@drawable/card_white_round_8"
|
||||
android:layout_margin="@dimen/dp15">
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
android:layout_height="0dp"
|
||||
android:layout_weight="1">
|
||||
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="15dp"
|
||||
android:paddingBottom="15dp">
|
||||
android:layout_margin="10dp"
|
||||
android:paddingBottom="10dp">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_title"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="15dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
android:layout_marginTop="5dp"
|
||||
android:textStyle="bold"
|
||||
tools:text="关于XX的通知信息标题关于XX的通知信息标题关于XX的通知信息"
|
||||
android:textColor="@color/colorGrey8"
|
||||
|
|
@ -47,11 +48,12 @@
|
|||
android:id="@+id/imageView10"
|
||||
android:layout_width="@dimen/dp26"
|
||||
android:layout_height="@dimen/dp26"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/ic_zhyy"
|
||||
android:layout_marginStart="@dimen/dp10"
|
||||
tools:src="@drawable/ic_zhyy"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/msg_dept"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/msg_dept" />
|
||||
app:layout_constraintTop_toTopOf="@+id/msg_dept"
|
||||
tools:ignore="ContentDescription" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_dept"
|
||||
|
|
@ -65,7 +67,6 @@
|
|||
app:layout_constraintTop_toBottomOf="@+id/msg_title"
|
||||
tools:text="娱乐特行管理" />
|
||||
|
||||
|
||||
<View
|
||||
android:id="@+id/view3"
|
||||
android:layout_width="match_parent"
|
||||
|
|
@ -95,22 +96,24 @@
|
|||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/view3" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/msg_time"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center|right"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_marginEnd="@dimen/dp15"
|
||||
android:layout_marginBottom="@dimen/dp10"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toBottomOf="@+id/msg_content"
|
||||
tools:text="2022-10-27 18:00" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@
|
|||
android:layout_weight="1"
|
||||
android:textSize="16sp"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:text="证据号码"/>
|
||||
android:text="证件号码"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/my_details_tv_idcard"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical"
|
||||
tools:context=".v.activity.applyfo.PersonnelReviewActivity">
|
||||
|
||||
<include
|
||||
android:id="@+id/review_title"
|
||||
layout="@layout/app_base_title"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<include
|
||||
android:id="@+id/review_search"
|
||||
layout="@layout/model_search_gray"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:layout_marginHorizontal="@dimen/dp15"
|
||||
android:layout_width="match_parent"/>
|
||||
|
||||
<com.scwang.smart.refresh.layout.SmartRefreshLayout
|
||||
android:id="@+id/review_srf"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_height="match_parent">
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/review_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"/>
|
||||
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -102,7 +102,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:background="@color/transparent"
|
||||
android:paddingVertical="@dimen/dp15"
|
||||
android:paddingBottom="@dimen/dp15"
|
||||
android:paddingTop="@dimen/dp5"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
|
|||
|
|
@ -15,11 +15,20 @@
|
|||
android:id="@+id/travel_tv_city_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_margin="@dimen/dp10"
|
||||
android:textColor="@color/colorBluen7"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:layout_margin="@dimen/dp10"
|
||||
tools:text="合肥市差旅报销标准:" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
|
@ -30,29 +39,29 @@
|
|||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:gravity="center"
|
||||
android:text="交通费"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:text="交通费"/>
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@color/colorWhite"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="火车:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="火车:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_train"
|
||||
|
|
@ -65,6 +74,7 @@
|
|||
tools:text="硬席(硬座、硬卧)\n高铁/动车\n全列软席列车二等座" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
|
|
@ -73,22 +83,22 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@color/colorWhite"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="飞机:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="飞机:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_aircraft"
|
||||
|
|
@ -108,25 +118,26 @@
|
|||
android:layout_height="1dp"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@color/colorGrey2" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:layout_marginBottom="@dimen/dp3"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="轮船:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="轮船:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_ships"
|
||||
|
|
@ -141,41 +152,42 @@
|
|||
</LinearLayout>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:background="@drawable/label_fill_bull"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:gravity="center"
|
||||
android:text="住宿费"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:text="住宿费"/>
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:layout_marginBottom="@dimen/dp3"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:gravity="center_vertical"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:layout_height="wrap_content">
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="住宿:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="住宿:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_stay"
|
||||
|
|
@ -191,40 +203,41 @@
|
|||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:background="@drawable/label_fill_bull"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:gravity="center"
|
||||
android:text="其他"
|
||||
android:textColor="@color/colorWhite"
|
||||
android:text="其他"/>
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:background="@color/colorWhite"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="车补:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="车补:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_car_repair"
|
||||
|
|
@ -237,6 +250,7 @@
|
|||
tools:text="80/人天" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="1dp"
|
||||
|
|
@ -245,23 +259,23 @@
|
|||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:orientation="horizontal"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp3"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:layout_marginBottom="@dimen/dp3"
|
||||
android:background="@drawable/round_bottom_white_8"
|
||||
android:gravity="center_vertical"
|
||||
android:minHeight="@dimen/dp50"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="@dimen/dp5"
|
||||
android:layout_height="wrap_content">
|
||||
android:paddingVertical="@dimen/dp10">
|
||||
|
||||
<TextView
|
||||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="wrap_content"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:gravity="center"
|
||||
android:text="餐补:"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="餐补:"/>
|
||||
android:textSize="@dimen/sp14" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/travel_tv_meal"
|
||||
|
|
@ -280,5 +294,8 @@
|
|||
<View
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp10" />
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="460dp"
|
||||
android:background="@color/colorWhite"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp56"
|
||||
android:gravity="center"
|
||||
android:text="已配对蓝牙列表"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<View style="@style/HFG"/>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/bluetooth_rv"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="400dp" />
|
||||
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -36,7 +36,7 @@
|
|||
android:layout_marginTop="25dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:gravity="center_vertical"
|
||||
android:text="应用加载失败,请联系管理员!"
|
||||
tools:text="应用加载失败,请联系管理员!"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
android:layout_marginStart="35dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:gravity="center"
|
||||
android:text="张三:"
|
||||
tools:text="张三:"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="16sp"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -64,7 +64,7 @@
|
|||
android:layout_marginEnd="15dp"
|
||||
android:autoLink="phone"
|
||||
android:gravity="center_vertical"
|
||||
android:text="15155166556"
|
||||
tools:text="15155166556"
|
||||
android:textColorLink="@color/bull"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="16sp"
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@
|
|||
android:textColor="@color/colorGrey6"
|
||||
android:text="应用需要通知权限,请至点击确定至设置中心设置应用通知权限!"/>
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_determine"
|
||||
android:layout_width="match_parent"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,115 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@drawable/round_top_white_8"
|
||||
android:orientation="vertical"
|
||||
android:layout_height="680dp">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp48"
|
||||
android:gravity="center"
|
||||
android:textSize="@dimen/sp16"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:text="连接蓝牙"/>
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:paddingHorizontal="@dimen/dp10"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:text="打印机:"/>
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_printers"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:text="未连接"/>
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
<View
|
||||
style="@style/HFG"
|
||||
android:layout_marginTop="@dimen/dp5" />
|
||||
|
||||
<androidx.core.widget.NestedScrollView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent">
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="match_parent"
|
||||
android:orientation="vertical">
|
||||
|
||||
<TextView
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="已配对设备↓"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_ypd"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10" />
|
||||
|
||||
<View
|
||||
style="@style/HFG"
|
||||
android:layout_marginTop="@dimen/dp5" />
|
||||
|
||||
<LinearLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<TextView
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_weight="1"
|
||||
android:text="搜索列表↓"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp16" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btn_search"
|
||||
android:layout_width="@dimen/dp58"
|
||||
android:layout_height="@dimen/dp40"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
android:visibility="gone"
|
||||
android:text="搜索设备"/>
|
||||
|
||||
<ProgressBar
|
||||
android:id="@+id/search_progress"
|
||||
android:layout_width="@dimen/dp25"
|
||||
android:layout_height="@dimen/dp25"
|
||||
android:layout_marginEnd="@dimen/dp15" />
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<androidx.recyclerview.widget.RecyclerView
|
||||
android:id="@+id/rv_search_list"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp10" />
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
</androidx.core.widget.NestedScrollView>
|
||||
|
||||
|
||||
</LinearLayout>
|
||||
|
|
@ -126,6 +126,7 @@
|
|||
android:layout_height="@dimen/dp110"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
android:visibility="gone"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
|
|
|||
|
|
@ -60,14 +60,14 @@
|
|||
android:id="@+id/tv_user_code"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="45dp"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginStart="15dp"
|
||||
android:layout_marginTop="12dp"
|
||||
android:background="@drawable/round_baby_blue"
|
||||
android:gravity="center_vertical"
|
||||
android:orientation="horizontal"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:paddingVertical="1dp"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent">
|
||||
|
||||
<TextView
|
||||
|
|
@ -136,6 +136,7 @@
|
|||
android:layout_width="@dimen/dp88"
|
||||
android:layout_height="@dimen/dp88"
|
||||
android:layout_marginTop="@dimen/dp48"
|
||||
android:scaleType="fitXY"
|
||||
android:background="@drawable/icon_my_photo_bg"
|
||||
android:src="@drawable/icon_police_woman"
|
||||
android:padding="@dimen/dp2"
|
||||
|
|
|
|||
|
|
@ -50,10 +50,9 @@
|
|||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="5dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:text="@{data.sysNameStr}"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp16"
|
||||
tools:text="系统名称"
|
||||
tools:text="权限名称"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
@ -65,6 +64,7 @@
|
|||
android:layout_marginTop="5dp"
|
||||
android:background="@drawable/bk_ls"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:visibility="gone"
|
||||
android:paddingVertical="2dp"
|
||||
android:text="@{data.roleName}"
|
||||
android:textColor="@color/colorGreen7"
|
||||
|
|
@ -82,6 +82,7 @@
|
|||
android:background="@drawable/bk_hs"
|
||||
android:paddingHorizontal="5dp"
|
||||
android:paddingVertical="2dp"
|
||||
android:visibility="gone"
|
||||
android:text="@{data.typeStr2}"
|
||||
android:textColor="@color/colorYellow8"
|
||||
android:textSize="@dimen/sp12"
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:text="@{data.auditUserTypeStr}"
|
||||
tools:text="类型"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -45,6 +46,7 @@
|
|||
android:paddingEnd="@dimen/dp6"
|
||||
android:paddingBottom="@dimen/dp2"
|
||||
android:text="@{data.stateStr}"
|
||||
tools:text="状态"
|
||||
android:textColor="@color/colorYellow8"
|
||||
android:textSize="@dimen/sp12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
@ -68,6 +70,7 @@
|
|||
android:layout_marginEnd="8dp"
|
||||
android:minHeight="58dp"
|
||||
android:text="@{data.opinion}"
|
||||
tools:text="暂无审核意见"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
|
|
@ -81,6 +84,7 @@
|
|||
android:layout_marginEnd="10dp"
|
||||
android:layout_marginBottom="2dp"
|
||||
android:text="@{data.reviewedBy}"
|
||||
tools:text="张三(999012)"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
app:layout_constraintBottom_toTopOf="@+id/tv_audit_dept"
|
||||
|
|
@ -95,6 +99,7 @@
|
|||
android:text="@{data.auditDeptName}"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
tools:text="安徽省公安厅"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
|
||||
|
|
@ -104,6 +109,7 @@
|
|||
android:layout_height="@dimen/dp68"
|
||||
android:layout_marginEnd="15dp"
|
||||
android:layout_marginBottom="5dp"
|
||||
tools:src="@drawable/icon_not_record"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent" />
|
||||
<!-- <TextView-->
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="@dimen/dp8"
|
||||
android:text="系统名称:"
|
||||
android:text="申请权限:"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
|
|
@ -31,7 +31,8 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp8"
|
||||
android:layout_marginEnd="@dimen/dp5"
|
||||
android:text="@{data.sysName}"
|
||||
android:text="@{data.roleName}"
|
||||
tools:text="高级权限"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_state"
|
||||
|
|
@ -42,7 +43,8 @@
|
|||
android:id="@+id/tv_role_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:text="@{data.roleNameStr}"
|
||||
android:text="@{data.applyReasonStr}"
|
||||
tools:text="申请原因上课的金发科技是空间的司法会计房间里空间"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintStart_toStartOf="@+id/textView17"
|
||||
|
|
@ -70,6 +72,7 @@
|
|||
android:paddingEnd="@dimen/dp6"
|
||||
android:paddingBottom="@dimen/dp2"
|
||||
android:text="@{data.stateStr}"
|
||||
tools:text="待审核"
|
||||
android:textSize="@dimen/sp12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
|
@ -80,6 +83,7 @@
|
|||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp2"
|
||||
android:text="@{data.nodeStr}"
|
||||
tools:text="上级单位审核中"
|
||||
android:visibility="gone"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
|
|
@ -94,6 +98,7 @@
|
|||
android:text="@{data.timeStr}"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp16"
|
||||
tools:text="2024-06-22 15:25:33"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_node"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_node" />
|
||||
|
||||
|
|
|
|||
|
|
@ -40,32 +40,33 @@
|
|||
app:layout_constraintStart_toStartOf="@+id/tv_applicant"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_applicant" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_system_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:layout_marginEnd="5dp"
|
||||
android:hint="系统"
|
||||
android:text="@{data.sysNameStr}"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintEnd_toStartOf="@+id/tv_state"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
<!-- <TextView-->
|
||||
<!-- android:id="@+id/tv_system_name"-->
|
||||
<!-- android:layout_width="0dp"-->
|
||||
<!-- android:layout_height="wrap_content"-->
|
||||
<!-- android:layout_marginStart="10dp"-->
|
||||
<!-- android:layout_marginTop="8dp"-->
|
||||
<!-- android:layout_marginEnd="5dp"-->
|
||||
<!-- android:hint="系统"-->
|
||||
<!-- android:text="@{data.sysNameStr}"-->
|
||||
<!-- android:textColor="@color/colorGrey7"-->
|
||||
<!-- android:textSize="@dimen/sp16"-->
|
||||
<!-- app:layout_constraintEnd_toStartOf="@+id/tv_state"-->
|
||||
<!-- app:layout_constraintStart_toStartOf="parent"-->
|
||||
<!-- app:layout_constraintTop_toTopOf="parent" />-->
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_role_name"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:text="@{data.roleNameStr}"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="8dp"
|
||||
android:hint="角色"
|
||||
android:text="@{data.roleNameStr}"
|
||||
android:textColor="@color/colorGrey7"
|
||||
android:textSize="@dimen/sp16"
|
||||
app:layout_constraintStart_toStartOf="@+id/tv_system_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/tv_system_name" />
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tv_type"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:layout_width="match_parent"
|
||||
android:background="@color/colorWhite"
|
||||
android:paddingVertical="@dimen/dp10"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_select"
|
||||
android:layout_width="@dimen/dp24"
|
||||
android:layout_height="@dimen/dp24"
|
||||
android:layout_marginStart="10dp"
|
||||
android:src="@drawable/select_def"
|
||||
app:layout_constraintBottom_toBottomOf="@+id/tv_app_name"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="@+id/tv_app_name" />
|
||||
|
||||
<!-- "<font color=\"#808080\">全部消息(</font><font color=\"#FF9124\">" + counts + "</font><font color=\"#808080\">)</font>"-->
|
||||
<TextView
|
||||
android:id="@+id/tv_app_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
android:text="普通权限(展示人员、同户籍、车辆、前科简项信息;开放静态人像比对功能)"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/iv_select"
|
||||
app:layout_constraintTop_toTopOf="parent" />
|
||||
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -0,0 +1,48 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:paddingBottom="@dimen/dp8"
|
||||
xmlns:tools="http://schemas.android.com/tools">
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bluetooth_name"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginHorizontal="@dimen/dp10"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginTop="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:textColor="@color/colorGrey8"
|
||||
android:textSize="@dimen/sp14"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toStartOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:text="深加工技术" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bluetooth_mac"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginStart="10dp"
|
||||
android:layout_marginEnd="10dp"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp12"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintStart_toEndOf="@+id/bluetooth_status"
|
||||
app:layout_constraintTop_toTopOf="@+id/bluetooth_status"
|
||||
tools:text="MAC:02:15:22:3C:0A:12" />
|
||||
|
||||
<TextView
|
||||
android:id="@+id/bluetooth_status"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="3dp"
|
||||
android:textColor="@color/colorGrey6"
|
||||
android:textSize="@dimen/sp12"
|
||||
app:layout_constraintStart_toStartOf="@+id/bluetooth_name"
|
||||
app:layout_constraintTop_toBottomOf="@+id/bluetooth_name"
|
||||
tools:text="已配对" />
|
||||
|
||||
</androidx.constraintlayout.widget.ConstraintLayout>
|
||||
|
|
@ -3,8 +3,8 @@
|
|||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="vertical"
|
||||
android:paddingTop="40dp"
|
||||
android:paddingBottom="40dp"
|
||||
android:paddingTop="@dimen/dp88"
|
||||
android:paddingBottom="@dimen/dp88"
|
||||
android:layout_gravity="center"
|
||||
android:gravity="center">
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
android:background="@color/colorWhite"
|
||||
android:layout_height="wrap_content">
|
||||
|
||||
|
||||
<ImageView
|
||||
android:id="@+id/iv_select"
|
||||
android:layout_width="@dimen/dp22"
|
||||
|
|
|
|||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:id="@+id/menu_travel_level1"
|
||||
android:title="一般人员"/>
|
||||
<item android:id="@+id/menu_travel_level2"
|
||||
android:title="司局级"/>
|
||||
</menu>
|
||||
|
|
@ -17,4 +17,11 @@
|
|||
<string name="Workbench">工作台</string>
|
||||
<string name="not_insert_usc_apk">检测到设备没有安装统一服务组件,未安装可能会导致应用内NFC、OCR等功能无法正常使用,请点击下载安装。</string>
|
||||
<string name="kind_reminder">温馨提示</string>
|
||||
<string name="applyTitleSelectPermissions1">选择权限</string>
|
||||
<string name="applyTitleSelectPermissions">选择权限:</string>
|
||||
<string name="applyClickSelectPermissions">点击选择权限</string>
|
||||
<string name="applyTitlePhone">联系方式:</string>
|
||||
<string name="applyInputPhoe">请输入联系电话</string>
|
||||
<string name="applyTitleReason">申请原因:</string>
|
||||
<string name="applyInputReason">请输入原因</string>
|
||||
</resources>
|
||||
|
|
@ -13,6 +13,7 @@
|
|||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="com.android.launcher.permission.READ_SETTINGS"/>
|
||||
|
||||
<application
|
||||
android:name=".app.RuanseeApp"
|
||||
|
|
@ -23,7 +24,7 @@
|
|||
android:roundIcon="@drawable/icon_login2"
|
||||
android:supportsRtl="true"
|
||||
android:theme="@style/Theme.NewPersonalCenter">
|
||||
<activity android:name=".activity.SettingActivity"></activity>
|
||||
<activity android:name=".activity.SettingActivity"/>
|
||||
<activity android:name=".activity.StartActivity">
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
|
|
@ -32,7 +33,9 @@
|
|||
</intent-filter>
|
||||
</activity>
|
||||
<activity android:name=".activity.MainActivity"/>
|
||||
<activity android:name=".activity.OpenAppActivity"/>
|
||||
<activity android:name=".activity.OpenAppActivity"
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"/>
|
||||
|
||||
<provider
|
||||
android:name="androidx.core.content.FileProvider"
|
||||
|
|
|
|||
Loading…
Reference in New Issue