Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Android
TradeSteward
Commits
f4616a2a
Commit
f4616a2a
authored
11 months ago
by
linwei
Browse files
Options
Download
Email Patches
Plain Diff
优化蓝牙搜索列表
parent
018757a0
master
dev
dev-learning-center
dev-permission
dev-uniapp
master-uniapp
v9.39.0_tag
v9.38.0_tag
v9.37.1_tag
v9.37.0_tag
v9.36.1_tag
v9.36.0_tag
v9.35.0_tag
v9.34.2_tag
v9.34.1_tag
v9.34.0_tag
v9.33.0_tag
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
printermodule/src/main/java/com/urovo/wugumofang/printermodule/Printer.java
+1
-1
...main/java/com/urovo/wugumofang/printermodule/Printer.java
printermodule/src/main/java/com/urovo/wugumofang/printermodule/PrinterManage.java
+8
-8
...ava/com/urovo/wugumofang/printermodule/PrinterManage.java
src/com/urovo/activity/systemsetting/view/BluetoothSettingActivity.kt
+16
-5
...o/activity/systemsetting/view/BluetoothSettingActivity.kt
with
25 additions
and
14 deletions
+25
-14
printermodule/src/main/java/com/urovo/wugumofang/printermodule/Printer.java
+
1
-
1
View file @
f4616a2a
...
...
@@ -14,7 +14,7 @@ import java.util.List;
public
abstract
class
Printer
{
protected
String
mAddress
;
protected
BluetoothSocket
mBluetoothSocket
;
protected
LabelPrinter
mLabelPrinter
;
protected
LabelPrinter
mLabelPrinter
=
new
LabelPrinter
()
;
protected
static
final
Object
mLock
=
new
Object
();
protected
boolean
mIsPrinting
=
false
;
private
PrinterUtil
.
PrintCallback
mPrintCallback
;
...
...
This diff is collapsed.
Click to expand it.
printermodule/src/main/java/com/urovo/wugumofang/printermodule/PrinterManage.java
+
8
-
8
View file @
f4616a2a
...
...
@@ -195,14 +195,14 @@ public class PrinterManage extends Printer {
*/
private
boolean
connectPrinter
(
String
address
)
{
boolean
result
=
false
;
if
(
null
!=
mLabelPrinter
)
{
if
(
mLabelPrinter
.
Disconnect
()
==
ConstantParams
.
CONSTANT_STARTS_0
)
{
mLabelPrinter
=
null
;
}
else
{
mHandler
.
sendEmptyMessage
(
AppConstants
.
Printer
.
ADDRESS_INVALID
);
}
}
mLabelPrinter
=
new
LabelPrinter
();
//
if (null != mLabelPrinter) {
//
if (mLabelPrinter.Disconnect() == ConstantParams.CONSTANT_STARTS_0) {
//
mLabelPrinter = null;
//
} else {
//
mHandler.sendEmptyMessage(AppConstants.Printer.ADDRESS_INVALID);
//
}
//
}
//
mLabelPrinter = new LabelPrinter();
int
status
=
mLabelPrinter
.
ConnectPrinter
(
ConstantParams
.
CONSTANT_STARTS_7
,
address
,
ConstantParams
.
CONSTANT_STARTS_4
);
if
(
status
==
ConstantParams
.
CONSTANT_STARTS_0
)
{
...
...
This diff is collapsed.
Click to expand it.
src/com/urovo/activity/systemsetting/view/BluetoothSettingActivity.kt
+
16
-
5
View file @
f4616a2a
...
...
@@ -207,12 +207,23 @@ class BluetoothSettingActivity : BaseActivity() {
val
device
=
intent
.
getParcelableExtra
<
BluetoothDevice
>(
BluetoothDevice
.
EXTRA_DEVICE
)
//if (device.bondState == BluetoothDevice.BOND_BONDED) {
mBluetoothSettingAdapter
?.
addData
(
BluetoothInfoEntity
(
device
.
name
,
device
.
address
if
(
mNewPrinterType
)
{
if
(
device
.
name
.
notNullAndEmpty
()
&&
device
.
name
.
startsWith
(
"BTP"
))
{
mBluetoothSettingAdapter
?.
addData
(
BluetoothInfoEntity
(
device
.
name
,
device
.
address
)
)
}
}
else
{
mBluetoothSettingAdapter
?.
addData
(
BluetoothInfoEntity
(
device
.
name
,
device
.
address
)
)
)
}
//}
}
else
if
(
BluetoothAdapter
.
ACTION_DISCOVERY_STARTED
==
action
)
{
showTipDialog
(
R
.
string
.
bluetooth_setting_search_device_tip
)
...
...
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help