Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
Widget
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Android Widget
Widget
Commits
bfc13c15
Commit
bfc13c15
authored
Jan 09, 2022
by
王雷
Browse files
Options
Browse Files
Download
Plain Diff
修改打印机打印回调内容
parents
47d82032
e00cc222
Changes
14
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
1019 additions
and
6 deletions
+1019
-6
build.gradle
KeyBoardView/build.gradle
+1
-1
CommonKeyBoardKeyBoard.kt
.../java/com/qmai/android/keyboard/CommonKeyBoardKeyBoard.kt
+274
-0
icon_key_board_delete.png
...iew/src/main/res/drawable-xhdpi/icon_key_board_delete.png
+0
-0
savestock_blue.xml
KeyBoardView/src/main/res/drawable/savestock_blue.xml
+4
-0
attrs.xml
KeyBoardView/src/main/res/values/attrs.xml
+12
-0
inputphonekeyboard.xml
KeyBoardView/src/main/res/xml/inputphonekeyboard.xml
+80
-0
activity_main.xml
app/src/main/res/layout/activity_main.xml
+40
-0
build.gradle
websocket/build.gradle
+3
-3
litepal.xml
websocket/src/main/assets/litepal.xml
+1
-1
SocketCheckMessage.kt
...main/java/com/zhimai/websocket/bean/SocketCheckMessage.kt
+5
-0
SocketRecordBean.kt
...c/main/java/com/zhimai/websocket/bean/SocketRecordBean.kt
+25
-0
MsgWebSocketIOTUtil.kt
...ain/java/com/zhimai/websocket/util/MsgWebSocketIOTUtil.kt
+559
-1
RxTimerUtil.java
.../src/main/java/com/zhimai/websocket/util/RxTimerUtil.java
+13
-0
SysCode.java
...cket/src/main/java/com/zhimai/websocket/util/SysCode.java
+2
-0
No files found.
KeyBoardView/build.gradle
View file @
bfc13c15
...
@@ -37,7 +37,7 @@ repositories {
...
@@ -37,7 +37,7 @@ repositories {
}
}
group
'com.qmai.android.widget'
group
'com.qmai.android.widget'
version
'1.1.4
4
-SNAPSHOT'
version
'1.1.4
5
-SNAPSHOT'
gradlePublish
{
gradlePublish
{
...
...
KeyBoardView/src/main/java/com/qmai/android/keyboard/CommonKeyBoardKeyBoard.kt
0 → 100644
View file @
bfc13c15
This diff is collapsed.
Click to expand it.
KeyBoardView/src/main/res/drawable-xhdpi/icon_key_board_delete.png
0 → 100644
View file @
bfc13c15
1.65 KB
KeyBoardView/src/main/res/drawable/savestock_blue.xml
0 → 100644
View file @
bfc13c15
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<solid
android:color=
"#3478F3"
/>
</shape>
\ No newline at end of file
KeyBoardView/src/main/res/values/attrs.xml
View file @
bfc13c15
...
@@ -100,4 +100,16 @@
...
@@ -100,4 +100,16 @@
<attr
name=
"keyboardMode"
/>
<attr
name=
"keyboardMode"
/>
</declare-styleable>
</declare-styleable>
<!--按钮控件(CommonKeyBoardKeyBoardStyleable)的设置-->
<declare-styleable
name=
"CommonKeyBoardKeyBoardStyleable"
>
<attr
name=
"sureText"
format=
"string"
/>
<attr
name=
"sureTextColor"
format=
"reference|color"
/>
<attr
name=
"sureTextSize"
format=
"dimension"
/>
<attr
name=
"clearTextColor"
format=
"reference|color"
/>
<attr
name=
"clearText"
format=
"string"
/>
<attr
name=
"clearTextSize"
format=
"dimension"
/>
<attr
name=
"pointColor"
format=
"reference|color"
/>
<attr
name=
"pointSize"
format=
"dimension"
/>
</declare-styleable>
</resources>
</resources>
\ No newline at end of file
KeyBoardView/src/main/res/xml/inputphonekeyboard.xml
0 → 100644
View file @
bfc13c15
<?xml version="1.0" encoding="utf-8"?>
<Keyboard
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:keyHeight=
"41dp"
android:horizontalGap=
"1dp"
android:verticalGap=
"1dp"
android:keyWidth=
"25%p"
>
<Row>
<Key
android:codes=
"1"
android:keyEdgeFlags=
"left"
android:keyLabel=
"1"
/>
<Key
android:codes=
"2"
android:keyLabel=
"2"
/>
<Key
android:codes=
"3"
android:keyEdgeFlags=
"right"
android:keyLabel=
"3"
/>
<Key
android:codes=
"11"
android:keyEdgeFlags=
"right"
android:isRepeatable=
"true"
android:keyLabel=
""
/>
</Row>
<Row>
<Key
android:codes=
"4"
android:keyEdgeFlags=
"left"
android:keyLabel=
"4"
/>
<Key
android:codes=
"5"
android:keyLabel=
"5"
/>
<Key
android:codes=
"6"
android:keyLabel=
"6"
/>
<Key
android:codes=
"-11"
android:keyEdgeFlags=
"right"
android:keyHeight=
"181dp"
android:keyLabel=
"结账"
/>
</Row>
<Row>
<Key
android:codes=
"7"
android:keyEdgeFlags=
"left"
android:keyLabel=
"7"
/>
<Key
android:codes=
"8"
android:keyLabel=
"8"
/>
<Key
android:codes=
"9"
android:keyLabel=
"9"
/>
<Key
android:codes=
"-"
android:keyEdgeFlags=
"right"
android:keyHeight=
"0dp"
/>
</Row>
<Row>
<Key
android:codes=
"20"
android:keyEdgeFlags=
"left"
android:keyLabel=
""
/>
<Key
android:codes=
"0"
android:keyLabel=
"0"
/>
<Key
android:codes=
"10"
android:isRepeatable=
"true"
android:keyIcon =
"@drawable/icon_key_board_delete"
/>
<Key
android:codes=
"-"
android:keyEdgeFlags=
"right"
android:keyHeight=
"0dp"
/>
</Row>
</Keyboard>
app/src/main/res/layout/activity_main.xml
View file @
bfc13c15
...
@@ -117,6 +117,46 @@
...
@@ -117,6 +117,46 @@
android:keyBackground=
"@drawable/stockbtn_keyboard_key"
android:keyBackground=
"@drawable/stockbtn_keyboard_key"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
android:layout_height=
"wrap_content"
/>
<com.qmai.android.keyboard.CommonKeyBoardKeyBoard
android:id=
"@+id/keyPhone"
android:layout_marginLeft=
"140dp"
android:layout_marginRight=
"140dp"
android:layout_marginTop=
"20dp"
android:background=
"@drawable/shape_key"
android:paddingRight=
"1dp"
android:keyTextColor=
"#333333"
android:paddingTop=
"1dp"
android:paddingBottom=
"1dp"
android:paddingLeft=
"1dp"
android:keyTextSize=
"16sp"
android:verticalGap=
"10dp"
android:shadowColor=
"#ffffff"
android:keyBackground=
"@drawable/stockbtn_keyboard_key"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
/>
<com.qmai.android.keyboard.MoneyNumberKeyBoardKeyBoard
android:id=
"@+id/moneyKeyboard"
app:layout_constraintTop_toBottomOf=
"@+id/quickInputRecycler"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"100dp"
android:layout_marginRight=
"100dp"
android:background=
"@drawable/shape_key"
android:keyBackground=
"@drawable/stockbtn_keyboard_key"
android:keyTextColor=
"@color/black"
android:keyTextSize=
"18sp"
android:paddingStart=
"1dp"
android:layout_alignParentBottom=
"true"
android:paddingTop=
"1dp"
android:paddingEnd=
"4dp"
android:paddingBottom=
"1dp"
android:shadowColor=
"#ffffff"
android:layout_marginBottom=
"16dp"
android:layout_gravity=
"bottom|center_horizontal"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
</LinearLayout>
</LinearLayout>
...
...
websocket/build.gradle
View file @
bfc13c15
...
@@ -3,11 +3,11 @@ apply plugin: "com.whl.gradle-publish-plugin"
...
@@ -3,11 +3,11 @@ apply plugin: "com.whl.gradle-publish-plugin"
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android'
apply
plugin:
'kotlin-android-extensions'
apply
plugin:
'kotlin-android-extensions'
android
{
android
{
compileSdkVersion
27
compileSdkVersion
30
defaultConfig
{
defaultConfig
{
minSdkVersion
15
minSdkVersion
15
targetSdkVersion
27
targetSdkVersion
30
versionCode
1
versionCode
1
versionName
"1.0"
versionName
"1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
...
@@ -22,7 +22,7 @@ android {
...
@@ -22,7 +22,7 @@ android {
}
}
group
'com.qmai.android.sdk'
group
'com.qmai.android.sdk'
version
'
2.1.5
-SNAPSHOT'
version
'
3.0.0.2
-SNAPSHOT'
gradlePublish
{
gradlePublish
{
...
...
websocket/src/main/assets/litepal.xml
View file @
bfc13c15
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
For example:
For example:
<version value="1" />
<version value="1" />
-->
-->
<version
value=
"
3
"
/>
<version
value=
"
4
"
/>
<!--
<!--
Define your models in the list with mapping tag, LitePal will
Define your models in the list with mapping tag, LitePal will
...
...
websocket/src/main/java/com/zhimai/websocket/bean/SocketCheckMessage.kt
View file @
bfc13c15
...
@@ -14,6 +14,8 @@ class SocketCheckMessage : LitePalSupport() {
...
@@ -14,6 +14,8 @@ class SocketCheckMessage : LitePalSupport() {
var
messageId
:
String
?
=
null
var
messageId
:
String
?
=
null
//订单号
//订单号
var
orderNo
:
String
?
=
null
var
orderNo
:
String
?
=
null
//消息的routingKey
var
routingKey
:
String
?=
null
//设备id
//设备id
var
deviceId
:
String
?
=
null
var
deviceId
:
String
?
=
null
...
@@ -44,5 +46,8 @@ class SocketCheckMessage : LitePalSupport() {
...
@@ -44,5 +46,8 @@ class SocketCheckMessage : LitePalSupport() {
//是否播报
//是否播报
var
isPlay
:
String
?
=
null
var
isPlay
:
String
?
=
null
//扩展字段 预留
var
other
:
String
?
=
null
}
}
\ No newline at end of file
websocket/src/main/java/com/zhimai/websocket/bean/SocketRecordBean.kt
0 → 100644
View file @
bfc13c15
package
com.zhimai.websocket.bean
import
org.litepal.crud.LitePalSupport
/**
* @author: 高英祥
* @github:
* @time: 2021/9/29 16:27
* @desc:
* @doc:
*/
class
SocketRecordBean
:
LitePalSupport
()
{
var
time
:
String
?
=
null
//当时的动作
var
action
:
String
?
=
null
//错误信息
var
error
:
String
?
=
null
//说明
var
desc
:
String
?
=
null
//预留扩展字段1
var
otherOne
:
String
?
=
null
//预留扩展字段2
var
otherTwo
:
String
?
=
null
}
\ No newline at end of file
websocket/src/main/java/com/zhimai/websocket/util/MsgWebSocketIOTUtil.kt
View file @
bfc13c15
This diff is collapsed.
Click to expand it.
websocket/src/main/java/com/zhimai/websocket/util/RxTimerUtil.java
View file @
bfc13c15
...
@@ -18,6 +18,7 @@ public class RxTimerUtil {
...
@@ -18,6 +18,7 @@ public class RxTimerUtil {
private
static
final
String
TAG
=
"RxTimerUtil"
;
private
static
final
String
TAG
=
"RxTimerUtil"
;
private
static
Disposable
mDisposableTime
;
private
static
Disposable
mDisposableTime
;
private
static
Disposable
mDisposableSocket
;
private
static
Disposable
mDisposableSocket
;
private
static
Disposable
mDisposableIOTSocket
;
private
static
Disposable
mDisposablepPrint
;
private
static
Disposable
mDisposablepPrint
;
private
static
Disposable
mDisposableOther
;
private
static
Disposable
mDisposableOther
;
...
@@ -84,6 +85,10 @@ public class RxTimerUtil {
...
@@ -84,6 +85,10 @@ public class RxTimerUtil {
break
;
break
;
case
SysCode
.
RX_TIMER_TYPE
.
OTHER
:
case
SysCode
.
RX_TIMER_TYPE
.
OTHER
:
mDisposableOther
=
disposable
;
mDisposableOther
=
disposable
;
break
;
case
SysCode
.
RX_TIMER_TYPE
.
IOT_SOCKET_PING
:
mDisposableIOTSocket
=
disposable
;
break
;
}
}
}
}
...
@@ -135,6 +140,14 @@ public class RxTimerUtil {
...
@@ -135,6 +140,14 @@ public class RxTimerUtil {
mDisposableOther
.
dispose
();
mDisposableOther
.
dispose
();
Log
.
e
(
TAG
,
"====定时器取消mDisposableOther======"
);
Log
.
e
(
TAG
,
"====定时器取消mDisposableOther======"
);
}
}
break
;
case
SysCode
.
RX_TIMER_TYPE
.
IOT_SOCKET_PING
:
if
(
mDisposableIOTSocket
!=
null
&&
!
mDisposableIOTSocket
.
isDisposed
())
{
mDisposableIOTSocket
.
dispose
();
Log
.
e
(
TAG
,
"====定时器取消mDisposableIOTSocket======"
);
}
break
;
}
}
}
}
...
...
websocket/src/main/java/com/zhimai/websocket/util/SysCode.java
View file @
bfc13c15
...
@@ -13,6 +13,8 @@ public class SysCode {
...
@@ -13,6 +13,8 @@ public class SysCode {
int
SOCKET
=
1
;
int
SOCKET
=
1
;
int
PRINT
=
2
;
int
PRINT
=
2
;
int
OTHER
=
3
;
int
OTHER
=
3
;
int
IOT_SOCKET_PING
=
4
;
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment