Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
supplier
Overview
Overview
Details
Activity
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王宇航
supplier
Commits
c1d4845a
Commit
c1d4845a
authored
Jul 17, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
7.17 針式打印帶顏色,斜體,加粗樣式PRJ單。打印機新增配置,打印新增通用配置。打印邏輯修改。BUG文檔內容修改
parent
786854c5
Hide whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
3300 additions
and
1070 deletions
+3300
-1070
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
+14
-1
base-module/src/main/java/com/gingersoft/gsa/cloud/base/widget/DialogUtils.java
+37
-10
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
+90
-9
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
+6
-3
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
+28
-14
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
+60
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/PrintCurrencyDaoUtils.java
+156
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/WheelView.java
+1
-1
base-module/src/main/res/layout/dialog_select_print_device.xml
+2
-1
base-module/src/main/res/layout/print_layout_print.xml
+44
-49
base-module/src/main/res/layout/print_layout_print_bill.xml
+58
-52
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
+0
-1
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/MainService.java
+2
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
+9
-9
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
+1
-1
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
+1
-0
other_order_mode/src/main/res/layout/layout_order_receiving.xml
+4
-0
print-module/src/main/AndroidManifest.xml
+1
-0
print-module/src/main/debug/AndroidManifest.xml
+37
-36
print-module/src/main/java/com/joe/print/di/component/PrintAddCurrencyComponent.java
+17
-0
print-module/src/main/java/com/joe/print/di/module/PrintAddCurrencyModule.java
+37
-0
print-module/src/main/java/com/joe/print/mvp/contract/LocalPrintContract.java
+8
-1
print-module/src/main/java/com/joe/print/mvp/contract/PrintAddCurrencyContract.java
+25
-0
print-module/src/main/java/com/joe/print/mvp/model/LocalPrintModel.java
+10
-0
print-module/src/main/java/com/joe/print/mvp/model/PrintAddCurrencyModel.java
+50
-0
print-module/src/main/java/com/joe/print/mvp/model/bean/PrintInfoBean.java
+239
-2
print-module/src/main/java/com/joe/print/mvp/model/bean/PrjBean.java
+6
-6
print-module/src/main/java/com/joe/print/mvp/model/server/GetPrintInfoService.java
+0
-2
print-module/src/main/java/com/joe/print/mvp/model/server/PrintInfoService.java
+5
-1
print-module/src/main/java/com/joe/print/mvp/presenter/LocalPrintPresenter.java
+32
-0
print-module/src/main/java/com/joe/print/mvp/presenter/PrintAddCurrencyPresenter.java
+95
-0
print-module/src/main/java/com/joe/print/mvp/presenter/PrinterAddPresenter.java
+8
-1
print-module/src/main/java/com/joe/print/mvp/print/EpsonPrint.java
+95
-16
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrder.java
+11
-3
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
+19
-13
print-module/src/main/java/com/joe/print/mvp/print/PrintServe.java
+16
-10
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
+8
-1
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
+45
-18
print-module/src/main/java/com/joe/print/mvp/print/utils/MyPrintUtils.java
+112
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintAddCurrencyActivity.java
+293
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintTestActivity.java
+5
-5
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
+130
-72
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterListActivity.java
+12
-7
print-module/src/main/java/com/joe/print/mvp/ui/adapter/DialogPrinterListAdapter.java
+1
-1
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
+57
-1
print-module/src/main/res/layout/activity_ip_print_setting_fragment.xml
+0
-9
print-module/src/main/res/layout/activity_print.xml
+0
-7
print-module/src/main/res/layout/activity_print_add_currency.xml
+349
-0
print-module/src/main/res/layout/fragment_local_print.xml
+71
-22
print-module/src/main/res/layout/print_confirm_order_view.xml
+368
-354
print-module/src/main/res/layout/print_currency_item.xml
+63
-0
print-module/src/main/res/layout/printer_activity_add.xml
+556
-329
print-module/src/main/res/values/styles.xml
+6
-0
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
View file @
c1d4845a
...
...
@@ -197,7 +197,10 @@ public class OrderDetail implements Serializable {
public
static
final
byte
FOOD_TYPE
=
3
;
public
static
final
byte
MODIFIER_TYPE
=
4
;
public
static
final
byte
DISCOUNT_TYPE
=
5
;
/**
* 廚房單打印主項
*/
private
long
ktPrintMainItem
;
public
OrderDetail
()
{
}
...
...
@@ -245,6 +248,7 @@ public class OrderDetail implements Serializable {
this
.
discountStatus
=
orderDetail
.
discountStatus
;
this
.
status
=
orderDetail
.
status
;
this
.
printSeting
=
orderDetail
.
printSeting
;
this
.
ktPrintMainItem
=
orderDetail
.
ktPrintMainItem
;
}
public
int
getSelected
()
{
...
...
@@ -599,6 +603,14 @@ public class OrderDetail implements Serializable {
this
.
discountStatus
=
discountStatus
;
}
public
long
getKtPrintMainItem
()
{
return
ktPrintMainItem
;
}
public
void
setKtPrintMainItem
(
long
ktPrintMainItem
)
{
this
.
ktPrintMainItem
=
ktPrintMainItem
;
}
/**
* 已送單食品轉換
*
...
...
@@ -794,6 +806,7 @@ public class OrderDetail implements Serializable {
public
static
OrderDetail
modifierTransOrderDetail
(
Modifier
modifier
,
long
id
,
long
productId
,
int
number
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setProductName
(
modifier
.
getModifierName
());
modifier
.
getKtPrintMainItem
();
orderDetail
.
setTopId
(
modifier
.
getTopId
());
orderDetail
.
setParentId
(
id
);
orderDetail
.
setProductId
(
modifier
.
getMid
());
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/widget/DialogUtils.java
View file @
c1d4845a
...
...
@@ -7,8 +7,6 @@ import android.graphics.Bitmap;
import
android.graphics.Color
;
import
android.graphics.drawable.ColorDrawable
;
import
android.graphics.drawable.Drawable
;
import
android.util.DisplayMetrics
;
import
android.util.Log
;
import
android.util.SparseArray
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
...
...
@@ -16,7 +14,6 @@ import android.view.View;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.FrameLayout
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
...
...
@@ -25,6 +22,9 @@ import com.bumptech.glide.load.engine.DiskCacheStrategy;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
import
com.bumptech.glide.request.RequestOptions
;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.gingersoft.gsa.cloud.ui.view.WheelView
;
import
java.util.List
;
/**
* Created by Wyh on 2019/11/1.
...
...
@@ -34,7 +34,7 @@ public abstract class DialogUtils {
private
static
Dialog
dialog
;
private
View
view
;
private
int
style
=
R
.
style
.
PhotoDialog
;
// private int mWidth = WindowManager.LayoutParams.WRAP_CONTENT;
// private int mWidth = WindowManager.LayoutParams.WRAP_CONTENT;
// private int mHeight = WindowManager.LayoutParams.WRAP_CONTENT;
private
ViewHepler
viewHepler
;
...
...
@@ -43,7 +43,7 @@ public abstract class DialogUtils {
init
(
mContext
);
}
private
void
init
(
Context
context
)
{
private
void
init
(
Context
context
)
{
dismiss
();
dialog
=
new
Dialog
(
context
);
viewHepler
=
getViewHepler
(
context
);
...
...
@@ -67,7 +67,7 @@ public abstract class DialogUtils {
public
DialogUtils
setWidth
(
int
width
)
{
if
(
dialog
!=
null
)
{
Window
window
=
dialog
.
getWindow
();
if
(
window
!=
null
)
{
if
(
window
!=
null
)
{
WindowManager
.
LayoutParams
p
=
window
.
getAttributes
();
// 获取对话框当前的参数值
p
.
width
=
width
;
window
.
setAttributes
(
p
);
...
...
@@ -79,7 +79,7 @@ public abstract class DialogUtils {
public
DialogUtils
setHeight
(
int
height
)
{
if
(
dialog
!=
null
)
{
Window
window
=
dialog
.
getWindow
();
if
(
window
!=
null
)
{
if
(
window
!=
null
)
{
WindowManager
.
LayoutParams
p
=
window
.
getAttributes
();
// 获取对话框当前的参数值
p
.
height
=
height
;
window
.
setAttributes
(
p
);
...
...
@@ -99,7 +99,7 @@ public abstract class DialogUtils {
return
this
;
}
public
DialogUtils
setBackgroundResource
(
int
resid
){
public
DialogUtils
setBackgroundResource
(
int
resid
)
{
if
(
dialog
!=
null
)
{
Window
window
=
dialog
.
getWindow
();
if
(
window
!=
null
)
{
...
...
@@ -220,9 +220,9 @@ public abstract class DialogUtils {
mConvertView
=
view
;
}
public
void
clearAll
(){
public
void
clearAll
()
{
context
=
null
;
if
(
mViews
!=
null
)
{
if
(
mViews
!=
null
)
{
mViews
.
clear
();
}
mConvertView
=
null
;
...
...
@@ -368,4 +368,31 @@ public abstract class DialogUtils {
}
}
public
interface
onPopupSureClickListener
{
void
onClick
(
int
select
);
}
public
static
void
showSelectPopop
(
Context
context
,
List
<
String
>
items
,
String
title
,
int
defaultSelect
,
onPopupSureClickListener
onClickListener
)
{
new
DialogUtils
(
context
,
R
.
layout
.
dialog_select_print_device
)
{
@Override
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
hepler
.
setText
(
R
.
id
.
tv_title
,
title
);
WheelView
wheelView
=
hepler
.
getView
(
R
.
id
.
wv_model
);
wheelView
.
setSeletion
(
defaultSelect
);
wheelView
.
setItems
(
items
);
hepler
.
getView
(
R
.
id
.
btn_cancel
).
setOnClickListener
(
v
->
dialog
.
dismiss
());
hepler
.
getView
(
R
.
id
.
btn_confirm
).
setOnClickListener
(
v
->
{
dialog
.
dismiss
();
if
(
onClickListener
!=
null
)
onClickListener
.
onClick
(
wheelView
.
getSeletedIndex
());
});
}
}
.
setWidth
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
)
.
setGravity
(
Gravity
.
BOTTOM
)
.
show
();
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/bean/PrinterDeviceBean.java
View file @
c1d4845a
...
...
@@ -42,12 +42,33 @@ public class PrinterDeviceBean implements Serializable {
*/
private
Long
flyPrinterDeviceId2
;
private
int
foodIsBold
;
//食品是否加粗 1是 2否
private
String
foodFont
;
private
int
foodIsItalic
;
//食品是否斜體 1是 2否
private
int
modifierIsBold
;
//細項是否加粗 1是 2否
private
String
modifierFont
;
//細項字號
private
int
modifierIsItalic
;
//細項是否斜體 1是 2否
private
int
numberIsFlip
;
//數量大於1顔色是否翻轉 1是 2否
@Generated
(
hash
=
626885316
)
public
PrinterDeviceBean
()
{
}
@Generated
(
hash
=
1228354346
)
public
PrinterDeviceBean
(
Long
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
Long
uid
,
Integer
port
,
Integer
type
,
Long
printerModelId
,
String
paperSpecification
,
String
printerName
,
String
model
,
String
noteContent
,
Long
printerDeviceDefaultId
,
Long
flyPrinterDeviceId
,
Long
flyPrinterDeviceId2
)
{
public
PrinterDeviceBean
(
String
ip
,
Integer
port
,
String
paperSpecification
)
{
this
.
ip
=
ip
;
this
.
port
=
port
;
this
.
paperSpecification
=
paperSpecification
;
}
@Generated
(
hash
=
1904986682
)
public
PrinterDeviceBean
(
Long
id
,
Long
dbid
,
String
name
,
Integer
restaurantId
,
String
ip
,
Long
uid
,
Integer
port
,
Integer
type
,
Long
printerModelId
,
String
paperSpecification
,
String
printerName
,
String
model
,
String
noteContent
,
Long
printerDeviceDefaultId
,
Long
flyPrinterDeviceId
,
Long
flyPrinterDeviceId2
,
int
foodIsBold
,
String
foodFont
,
int
foodIsItalic
,
int
modifierIsBold
,
String
modifierFont
,
int
modifierIsItalic
,
int
numberIsFlip
)
{
this
.
id
=
id
;
this
.
dbid
=
dbid
;
this
.
name
=
name
;
...
...
@@ -64,13 +85,13 @@ public class PrinterDeviceBean implements Serializable {
this
.
printerDeviceDefaultId
=
printerDeviceDefaultId
;
this
.
flyPrinterDeviceId
=
flyPrinterDeviceId
;
this
.
flyPrinterDeviceId2
=
flyPrinterDeviceId2
;
}
public
PrinterDeviceBean
(
String
ip
,
Integer
port
,
String
paperSpecification
)
{
this
.
ip
=
ip
;
this
.
port
=
port
;
this
.
paperSpecification
=
paperSpecification
;
this
.
foodIsBold
=
foodIsBold
;
this
.
foodFont
=
foodFont
;
this
.
foodIsItalic
=
foodIsItalic
;
this
.
modifierIsBold
=
modifierIsBold
;
this
.
modifierFont
=
modifierFont
;
this
.
modifierIsItalic
=
modifierIsItalic
;
this
.
numberIsFlip
=
numberIsFlip
;
}
public
Long
getId
()
{
...
...
@@ -203,4 +224,64 @@ public class PrinterDeviceBean implements Serializable {
public
void
setPrinterDeviceDefaultId
(
Long
printerDeviceDefaultId
)
{
this
.
printerDeviceDefaultId
=
printerDeviceDefaultId
;
}
public
static
long
getSerialVersionUID
()
{
return
serialVersionUID
;
}
public
int
getFoodIsBold
()
{
return
foodIsBold
;
}
public
void
setFoodIsBold
(
int
foodIsBold
)
{
this
.
foodIsBold
=
foodIsBold
;
}
public
String
getFoodFont
()
{
return
foodFont
;
}
public
void
setFoodFont
(
String
foodFont
)
{
this
.
foodFont
=
foodFont
;
}
public
int
getFoodIsItalic
()
{
return
foodIsItalic
;
}
public
void
setFoodIsItalic
(
int
foodIsItalic
)
{
this
.
foodIsItalic
=
foodIsItalic
;
}
public
int
getModifierIsBold
()
{
return
modifierIsBold
;
}
public
void
setModifierIsBold
(
int
modifierIsBold
)
{
this
.
modifierIsBold
=
modifierIsBold
;
}
public
String
getModifierFont
()
{
return
modifierFont
;
}
public
void
setModifierFont
(
String
modifierFont
)
{
this
.
modifierFont
=
modifierFont
;
}
public
int
getModifierIsItalic
()
{
return
modifierIsItalic
;
}
public
void
setModifierIsItalic
(
int
modifierIsItalic
)
{
this
.
modifierIsItalic
=
modifierIsItalic
;
}
public
int
getNumberIsFlip
()
{
return
numberIsFlip
;
}
public
void
setNumberIsFlip
(
int
numberIsFlip
)
{
this
.
numberIsFlip
=
numberIsFlip
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoMaster.java
View file @
c1d4845a
...
...
@@ -28,10 +28,11 @@ public class DaoMaster extends AbstractDaoMaster {
FoodComboDao
.
createTable
(
db
,
ifNotExists
);
FoodModifierDao
.
createTable
(
db
,
ifNotExists
);
FunctionDao
.
createTable
(
db
,
ifNotExists
);
LanguageDao
.
createTable
(
db
,
ifNotExists
);
ModifierDao
.
createTable
(
db
,
ifNotExists
);
PrinterDeviceBeanDao
.
createTable
(
db
,
ifNotExists
);
PrintModelBeanDao
.
createTable
(
db
,
ifNotExists
);
LanguageDao
.
createTable
(
db
,
ifNotExists
);
PrintCurrencyBeanDao
.
createTable
(
db
,
ifNotExists
);
}
/** Drops underlying database table using DAOs. */
...
...
@@ -43,10 +44,11 @@ public class DaoMaster extends AbstractDaoMaster {
FoodComboDao
.
dropTable
(
db
,
ifExists
);
FoodModifierDao
.
dropTable
(
db
,
ifExists
);
FunctionDao
.
dropTable
(
db
,
ifExists
);
LanguageDao
.
dropTable
(
db
,
ifExists
);
ModifierDao
.
dropTable
(
db
,
ifExists
);
PrinterDeviceBeanDao
.
dropTable
(
db
,
ifExists
);
PrintModelBeanDao
.
dropTable
(
db
,
ifExists
);
LanguageDao
.
dropTable
(
db
,
ifExists
);
PrintCurrencyBeanDao
.
dropTable
(
db
,
ifExists
);
}
/**
...
...
@@ -72,10 +74,11 @@ public class DaoMaster extends AbstractDaoMaster {
registerDaoClass
(
FoodComboDao
.
class
);
registerDaoClass
(
FoodModifierDao
.
class
);
registerDaoClass
(
FunctionDao
.
class
);
registerDaoClass
(
LanguageDao
.
class
);
registerDaoClass
(
ModifierDao
.
class
);
registerDaoClass
(
PrinterDeviceBeanDao
.
class
);
registerDaoClass
(
PrintModelBeanDao
.
class
);
registerDaoClass
(
LanguageDao
.
class
);
registerDaoClass
(
PrintCurrencyBeanDao
.
class
);
}
public
DaoSession
newSession
()
{
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/DaoSession.java
View file @
c1d4845a
...
...
@@ -15,10 +15,11 @@ import com.gingersoft.gsa.cloud.database.bean.Food;
import
com.gingersoft.gsa.cloud.database.bean.FoodCombo
;
import
com.gingersoft.gsa.cloud.database.bean.FoodModifier
;
import
com.gingersoft.gsa.cloud.database.bean.Function
;
import
com.gingersoft.gsa.cloud.database.bean.Language
;
import
com.gingersoft.gsa.cloud.database.bean.Modifier
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrintModelBean
;
import
com.gingersoft.gsa.cloud.database.bean.Language
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.greendao.ComboItemDao
;
import
com.gingersoft.gsa.cloud.database.greendao.DiscountDao
;
...
...
@@ -27,10 +28,11 @@ import com.gingersoft.gsa.cloud.database.greendao.FoodDao;
import
com.gingersoft.gsa.cloud.database.greendao.FoodComboDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FoodModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.FunctionDao
;
import
com.gingersoft.gsa.cloud.database.greendao.LanguageDao
;
import
com.gingersoft.gsa.cloud.database.greendao.ModifierDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrinterDeviceBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrintModelBeanDao
;
import
com.gingersoft.gsa.cloud.database.greendao.LanguageDao
;
import
com.gingersoft.gsa.cloud.database.greendao.PrintCurrencyBeanDao
;
// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.
...
...
@@ -48,10 +50,11 @@ public class DaoSession extends AbstractDaoSession {
private
final
DaoConfig
foodComboDaoConfig
;
private
final
DaoConfig
foodModifierDaoConfig
;
private
final
DaoConfig
functionDaoConfig
;
private
final
DaoConfig
languageDaoConfig
;
private
final
DaoConfig
modifierDaoConfig
;
private
final
DaoConfig
printerDeviceBeanDaoConfig
;
private
final
DaoConfig
printModelBeanDaoConfig
;
private
final
DaoConfig
languageDaoConfig
;
private
final
DaoConfig
printCurrencyBeanDaoConfig
;
private
final
ComboItemDao
comboItemDao
;
private
final
DiscountDao
discountDao
;
...
...
@@ -60,10 +63,11 @@ public class DaoSession extends AbstractDaoSession {
private
final
FoodComboDao
foodComboDao
;
private
final
FoodModifierDao
foodModifierDao
;
private
final
FunctionDao
functionDao
;
private
final
LanguageDao
languageDao
;
private
final
ModifierDao
modifierDao
;
private
final
PrinterDeviceBeanDao
printerDeviceBeanDao
;
private
final
PrintModelBeanDao
printModelBeanDao
;
private
final
LanguageDao
languageDao
;
private
final
PrintCurrencyBeanDao
printCurrencyBeanDao
;
public
DaoSession
(
Database
db
,
IdentityScopeType
type
,
Map
<
Class
<?
extends
AbstractDao
<?,
?>>,
DaoConfig
>
daoConfigMap
)
{
...
...
@@ -90,9 +94,6 @@ public class DaoSession extends AbstractDaoSession {
functionDaoConfig
=
daoConfigMap
.
get
(
FunctionDao
.
class
).
clone
();
functionDaoConfig
.
initIdentityScope
(
type
);
languageDaoConfig
=
daoConfigMap
.
get
(
LanguageDao
.
class
).
clone
();
languageDaoConfig
.
initIdentityScope
(
type
);
modifierDaoConfig
=
daoConfigMap
.
get
(
ModifierDao
.
class
).
clone
();
modifierDaoConfig
.
initIdentityScope
(
type
);
...
...
@@ -102,6 +103,12 @@ public class DaoSession extends AbstractDaoSession {
printModelBeanDaoConfig
=
daoConfigMap
.
get
(
PrintModelBeanDao
.
class
).
clone
();
printModelBeanDaoConfig
.
initIdentityScope
(
type
);
languageDaoConfig
=
daoConfigMap
.
get
(
LanguageDao
.
class
).
clone
();
languageDaoConfig
.
initIdentityScope
(
type
);
printCurrencyBeanDaoConfig
=
daoConfigMap
.
get
(
PrintCurrencyBeanDao
.
class
).
clone
();
printCurrencyBeanDaoConfig
.
initIdentityScope
(
type
);
comboItemDao
=
new
ComboItemDao
(
comboItemDaoConfig
,
this
);
discountDao
=
new
DiscountDao
(
discountDaoConfig
,
this
);
expandInfoDao
=
new
ExpandInfoDao
(
expandInfoDaoConfig
,
this
);
...
...
@@ -109,10 +116,11 @@ public class DaoSession extends AbstractDaoSession {
foodComboDao
=
new
FoodComboDao
(
foodComboDaoConfig
,
this
);
foodModifierDao
=
new
FoodModifierDao
(
foodModifierDaoConfig
,
this
);
functionDao
=
new
FunctionDao
(
functionDaoConfig
,
this
);
languageDao
=
new
LanguageDao
(
languageDaoConfig
,
this
);
modifierDao
=
new
ModifierDao
(
modifierDaoConfig
,
this
);
printerDeviceBeanDao
=
new
PrinterDeviceBeanDao
(
printerDeviceBeanDaoConfig
,
this
);
printModelBeanDao
=
new
PrintModelBeanDao
(
printModelBeanDaoConfig
,
this
);
languageDao
=
new
LanguageDao
(
languageDaoConfig
,
this
);
printCurrencyBeanDao
=
new
PrintCurrencyBeanDao
(
printCurrencyBeanDaoConfig
,
this
);
registerDao
(
ComboItem
.
class
,
comboItemDao
);
registerDao
(
Discount
.
class
,
discountDao
);
...
...
@@ -121,10 +129,11 @@ public class DaoSession extends AbstractDaoSession {
registerDao
(
FoodCombo
.
class
,
foodComboDao
);
registerDao
(
FoodModifier
.
class
,
foodModifierDao
);
registerDao
(
Function
.
class
,
functionDao
);
registerDao
(
Language
.
class
,
languageDao
);
registerDao
(
Modifier
.
class
,
modifierDao
);
registerDao
(
PrinterDeviceBean
.
class
,
printerDeviceBeanDao
);
registerDao
(
PrintModelBean
.
class
,
printModelBeanDao
);
registerDao
(
Language
.
class
,
languageDao
);
registerDao
(
PrintCurrencyBean
.
class
,
printCurrencyBeanDao
);
}
public
void
clear
()
{
...
...
@@ -135,10 +144,11 @@ public class DaoSession extends AbstractDaoSession {
foodComboDaoConfig
.
clearIdentityScope
();
foodModifierDaoConfig
.
clearIdentityScope
();
functionDaoConfig
.
clearIdentityScope
();
languageDaoConfig
.
clearIdentityScope
();
modifierDaoConfig
.
clearIdentityScope
();
printerDeviceBeanDaoConfig
.
clearIdentityScope
();
printModelBeanDaoConfig
.
clearIdentityScope
();
languageDaoConfig
.
clearIdentityScope
();
printCurrencyBeanDaoConfig
.
clearIdentityScope
();
}
public
ComboItemDao
getComboItemDao
()
{
...
...
@@ -169,10 +179,6 @@ public class DaoSession extends AbstractDaoSession {
return
functionDao
;
}
public
LanguageDao
getLanguageDao
()
{
return
languageDao
;
}
public
ModifierDao
getModifierDao
()
{
return
modifierDao
;
}
...
...
@@ -185,4 +191,12 @@ public class DaoSession extends AbstractDaoSession {
return
printModelBeanDao
;
}
public
LanguageDao
getLanguageDao
()
{
return
languageDao
;
}
public
PrintCurrencyBeanDao
getPrintCurrencyBeanDao
()
{
return
printCurrencyBeanDao
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/database/greendao/PrinterDeviceBeanDao.java
View file @
c1d4845a
...
...
@@ -40,6 +40,13 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
public
final
static
Property
PrinterDeviceDefaultId
=
new
Property
(
13
,
Long
.
class
,
"printerDeviceDefaultId"
,
false
,
"PRINTER_DEVICE_DEFAULT_ID"
);
public
final
static
Property
FlyPrinterDeviceId
=
new
Property
(
14
,
Long
.
class
,
"flyPrinterDeviceId"
,
false
,
"FLY_PRINTER_DEVICE_ID"
);
public
final
static
Property
FlyPrinterDeviceId2
=
new
Property
(
15
,
Long
.
class
,
"flyPrinterDeviceId2"
,
false
,
"FLY_PRINTER_DEVICE_ID2"
);
public
final
static
Property
FoodIsBold
=
new
Property
(
16
,
int
.
class
,
"foodIsBold"
,
false
,
"FOOD_IS_BOLD"
);
public
final
static
Property
FoodFont
=
new
Property
(
17
,
String
.
class
,
"foodFont"
,
false
,
"FOOD_FONT"
);
public
final
static
Property
FoodIsItalic
=
new
Property
(
18
,
int
.
class
,
"foodIsItalic"
,
false
,
"FOOD_IS_ITALIC"
);
public
final
static
Property
ModifierIsBold
=
new
Property
(
19
,
int
.
class
,
"modifierIsBold"
,
false
,
"MODIFIER_IS_BOLD"
);
public
final
static
Property
ModifierFont
=
new
Property
(
20
,
String
.
class
,
"modifierFont"
,
false
,
"MODIFIER_FONT"
);
public
final
static
Property
ModifierIsItalic
=
new
Property
(
21
,
int
.
class
,
"modifierIsItalic"
,
false
,
"MODIFIER_IS_ITALIC"
);
public
final
static
Property
NumberIsFlip
=
new
Property
(
22
,
int
.
class
,
"numberIsFlip"
,
false
,
"NUMBER_IS_FLIP"
);
}
...
...
@@ -70,7 +77,14 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
"\"NOTE_CONTENT\" TEXT,"
+
// 12: noteContent
"\"PRINTER_DEVICE_DEFAULT_ID\" INTEGER,"
+
// 13: printerDeviceDefaultId
"\"FLY_PRINTER_DEVICE_ID\" INTEGER,"
+
// 14: flyPrinterDeviceId
"\"FLY_PRINTER_DEVICE_ID2\" INTEGER);"
);
// 15: flyPrinterDeviceId2
"\"FLY_PRINTER_DEVICE_ID2\" INTEGER,"
+
// 15: flyPrinterDeviceId2
"\"FOOD_IS_BOLD\" INTEGER NOT NULL ,"
+
// 16: foodIsBold
"\"FOOD_FONT\" TEXT,"
+
// 17: foodFont
"\"FOOD_IS_ITALIC\" INTEGER NOT NULL ,"
+
// 18: foodIsItalic
"\"MODIFIER_IS_BOLD\" INTEGER NOT NULL ,"
+
// 19: modifierIsBold
"\"MODIFIER_FONT\" TEXT,"
+
// 20: modifierFont
"\"MODIFIER_IS_ITALIC\" INTEGER NOT NULL ,"
+
// 21: modifierIsItalic
"\"NUMBER_IS_FLIP\" INTEGER NOT NULL );"
);
// 22: numberIsFlip
}
/** Drops the underlying database table. */
...
...
@@ -162,6 +176,21 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
if
(
flyPrinterDeviceId2
!=
null
)
{
stmt
.
bindLong
(
16
,
flyPrinterDeviceId2
);
}
stmt
.
bindLong
(
17
,
entity
.
getFoodIsBold
());
String
foodFont
=
entity
.
getFoodFont
();
if
(
foodFont
!=
null
)
{
stmt
.
bindString
(
18
,
foodFont
);
}
stmt
.
bindLong
(
19
,
entity
.
getFoodIsItalic
());
stmt
.
bindLong
(
20
,
entity
.
getModifierIsBold
());
String
modifierFont
=
entity
.
getModifierFont
();
if
(
modifierFont
!=
null
)
{
stmt
.
bindString
(
21
,
modifierFont
);
}
stmt
.
bindLong
(
22
,
entity
.
getModifierIsItalic
());
stmt
.
bindLong
(
23
,
entity
.
getNumberIsFlip
());
}
@Override
...
...
@@ -247,6 +276,21 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
if
(
flyPrinterDeviceId2
!=
null
)
{
stmt
.
bindLong
(
16
,
flyPrinterDeviceId2
);
}
stmt
.
bindLong
(
17
,
entity
.
getFoodIsBold
());
String
foodFont
=
entity
.
getFoodFont
();
if
(
foodFont
!=
null
)
{
stmt
.
bindString
(
18
,
foodFont
);
}
stmt
.
bindLong
(
19
,
entity
.
getFoodIsItalic
());
stmt
.
bindLong
(
20
,
entity
.
getModifierIsBold
());
String
modifierFont
=
entity
.
getModifierFont
();
if
(
modifierFont
!=
null
)
{
stmt
.
bindString
(
21
,
modifierFont
);
}
stmt
.
bindLong
(
22
,
entity
.
getModifierIsItalic
());
stmt
.
bindLong
(
23
,
entity
.
getNumberIsFlip
());
}
@Override
...
...
@@ -272,7 +316,14 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
cursor
.
isNull
(
offset
+
12
)
?
null
:
cursor
.
getString
(
offset
+
12
),
// noteContent
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getLong
(
offset
+
13
),
// printerDeviceDefaultId
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getLong
(
offset
+
14
),
// flyPrinterDeviceId
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getLong
(
offset
+
15
)
// flyPrinterDeviceId2
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getLong
(
offset
+
15
),
// flyPrinterDeviceId2
cursor
.
getInt
(
offset
+
16
),
// foodIsBold
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
),
// foodFont
cursor
.
getInt
(
offset
+
18
),
// foodIsItalic
cursor
.
getInt
(
offset
+
19
),
// modifierIsBold
cursor
.
isNull
(
offset
+
20
)
?
null
:
cursor
.
getString
(
offset
+
20
),
// modifierFont
cursor
.
getInt
(
offset
+
21
),
// modifierIsItalic
cursor
.
getInt
(
offset
+
22
)
// numberIsFlip
);
return
entity
;
}
...
...
@@ -295,6 +346,13 @@ public class PrinterDeviceBeanDao extends AbstractDao<PrinterDeviceBean, Long> {
entity
.
setPrinterDeviceDefaultId
(
cursor
.
isNull
(
offset
+
13
)
?
null
:
cursor
.
getLong
(
offset
+
13
));
entity
.
setFlyPrinterDeviceId
(
cursor
.
isNull
(
offset
+
14
)
?
null
:
cursor
.
getLong
(
offset
+
14
));
entity
.
setFlyPrinterDeviceId2
(
cursor
.
isNull
(
offset
+
15
)
?
null
:
cursor
.
getLong
(
offset
+
15
));
entity
.
setFoodIsBold
(
cursor
.
getInt
(
offset
+
16
));
entity
.
setFoodFont
(
cursor
.
isNull
(
offset
+
17
)
?
null
:
cursor
.
getString
(
offset
+
17
));
entity
.
setFoodIsItalic
(
cursor
.
getInt
(
offset
+
18
));
entity
.
setModifierIsBold
(
cursor
.
getInt
(
offset
+
19
));
entity
.
setModifierFont
(
cursor
.
isNull
(
offset
+
20
)
?
null
:
cursor
.
getString
(
offset
+
20
));
entity
.
setModifierIsItalic
(
cursor
.
getInt
(
offset
+
21
));
entity
.
setNumberIsFlip
(
cursor
.
getInt
(
offset
+
22
));
}
@Override
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/database/utils/PrintCurrencyDaoUtils.java
0 → 100644
View file @
c1d4845a
package
com
.
gingersoft
.
gsa
.
cloud
.
database
.
utils
;
//package com.gingersoft.gsa.cloud.database.utils;
import
android.content.Context
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.database.DaoManager
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.greendao.PrintCurrencyBeanDao
;
import
org.greenrobot.greendao.query.QueryBuilder
;
import
java.util.List
;
/**
* Created by Wyh on 2020/1/17.
*/
public
class
PrintCurrencyDaoUtils
{
private
static
final
String
TAG
=
PrintCurrencyDaoUtils
.
class
.
getSimpleName
();
private
DaoManager
mManager
;
public
PrintCurrencyDaoUtils
(
Context
context
)
{
mManager
=
DaoManager
.
getInstance
();
mManager
.
init
(
context
);
}
/**
* 完成PrintCurrencyBean记录的插入,如果表未创建,先创建PrintCurrencyBean表
*
* @return
*/
public
boolean
insertPrintCurrencyBean
(
PrintCurrencyBean
printerDevice
)
{
boolean
flag
=
false
;
flag
=
mManager
.
getDaoSession
().
getPrintCurrencyBeanDao
().
insert
(
printerDevice
)
==
-
1
?
false
:
true
;
Log
.
i
(
TAG
,
"insert printerDevice :"
+
flag
+
"-->"
+
printerDevice
.
toString
());
return
flag
;
}
/**
* 插入多条数据,在子线程操作
*
* @param printerDeviceList
* @return
*/
public
boolean
insertMultPrintCurrencyBean
(
final
List
<
PrintCurrencyBean
>
printerDeviceList
)
{
boolean
flag
=
false
;
try
{
mManager
.
getDaoSession
().
runInTx
(
new
Runnable
()
{
@Override
public
void
run
()
{
for
(
PrintCurrencyBean
PrintCurrencyBean
:
printerDeviceList
)
{
mManager
.
getDaoSession
().
insertOrReplace
(
PrintCurrencyBean
);
}
}
});
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 修改一条数据
*
* @param printerDevice
* @return
*/
public
boolean
updatePrintCurrencyBean
(
PrintCurrencyBean
printerDevice
)
{
boolean
flag
=
false
;
try
{
mManager
.
getDaoSession
().
update
(
printerDevice
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 删除单条记录
*
* @param printerDevice
* @return
*/
public
boolean
deletePrintCurrencyBean
(
PrintCurrencyBean
printerDevice
)
{
boolean
flag
=
false
;
try
{
//按照id删除
mManager
.
getDaoSession
().
delete
(
printerDevice
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 删除所有记录
*
* @return
*/
public
boolean
deleteAll
()
{
boolean
flag
=
false
;
try
{
//按照id删除
mManager
.
getDaoSession
().
deleteAll
(
PrintCurrencyBean
.
class
);
flag
=
true
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
flag
;
}
/**
* 查询所有记录
*
* @return
*/
public
List
<
PrintCurrencyBean
>
queryAllPrintCurrencyBean
()
{
return
mManager
.
getDaoSession
().
loadAll
(
PrintCurrencyBean
.
class
);
}
/**
* 根据主键id查询记录
*
* @param key
* @return
*/
public
PrintCurrencyBean
queryPrintCurrencyBeanById
(
long
key
)
{
return
mManager
.
getDaoSession
().
load
(
PrintCurrencyBean
.
class
,
key
);
}
/**
* 使用native sql进行查询操作
*/
public
List
<
PrintCurrencyBean
>
queryPrintCurrencyBeanByNativeSql
(
String
sql
,
String
[]
conditions
)
{
return
mManager
.
getDaoSession
().
queryRaw
(
PrintCurrencyBean
.
class
,
sql
,
conditions
);
}
/**
* 使用queryBuilder进行查询
*
* @return
*/
public
List
<
PrintCurrencyBean
>
queryPrintCurrencyBeanByQueryBuilder
(
long
PrintCurrencyBeanId
)
{
QueryBuilder
<
PrintCurrencyBean
>
queryBuilder
=
mManager
.
getDaoSession
().
queryBuilder
(
PrintCurrencyBean
.
class
);
return
queryBuilder
.
where
(
PrintCurrencyBeanDao
.
Properties
.
Id
.
eq
(
PrintCurrencyBeanId
)).
list
();
}
public
void
closeConnection
()
{
mManager
.
closeConnection
();
}
}
print-module/src/main/java/com/joe/print/mvp
/ui/view/WheelView.java
→
base-module/src/main/java/com/gingersoft/gsa/cloud
/ui/view/WheelView.java
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
ui
.
view
;
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
view
;
import
android.app.Activity
;
import
android.content.Context
;
...
...
print
-module/src/main/res/layout/dialog_select_print_device.xml
→
base
-module/src/main/res/layout/dialog_select_print_device.xml
View file @
c1d4845a
...
...
@@ -6,6 +6,7 @@
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_title"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:gravity=
"center"
...
...
@@ -14,7 +15,7 @@
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
/>
<com.
joe.print.mvp
.ui.view.WheelView
<com.
gingersoft.gsa.cloud
.ui.view.WheelView
android:id=
"@+id/wv_model"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
...
...
base-module/src/main/res/layout/print_layout_print.xml
View file @
c1d4845a
...
...
@@ -47,54 +47,51 @@
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_restaurant_name"
/>
<TextView
android:id=
"@+id/tv_dining_table_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
<LinearLayout
android:id=
"@+id/layout_table_name"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"餐檯:"
android:orientation=
"horizontal"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/line_restaurant_name"
/>
<TextView
android:id=
"@+id/tv_dining_table_number"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_dining_table_text"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_people_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"right"
android:text=
"人數:"
app:layout_constraintHorizontal_bias=
"0.3"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_dining_table_number"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_people"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
app:layout_constraintBottom_toBottomOf=
"@id/tv_people_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_people_text"
app:layout_constraintTop_toTopOf=
"@id/tv_people_text"
/>
app:layout_constraintTop_toBottomOf=
"@id/line_restaurant_name"
>
<TextView
android:id=
"@+id/tv_dining_table_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"餐檯:"
/>
<TextView
android:id=
"@+id/tv_dining_table_number"
style=
"@style/Print_text_style"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
/>
<TextView
android:id=
"@+id/tv_people_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"人數:"
/>
<TextView
android:id=
"@+id/tv_people"
style=
"@style/Print_text_style"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
app:layout_constraintBottom_toBottomOf=
"@id/tv_people_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_people_text"
app:layout_constraintTop_toTopOf=
"@id/tv_people_text"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_number_text"
...
...
@@ -104,7 +101,7 @@
android:text=
"單號:"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/
tv_dining_table_text
"
/>
app:layout_constraintTop_toBottomOf=
"@id/
layout_table_name
"
/>
<TextView
android:id=
"@+id/tv_order_num"
...
...
@@ -156,7 +153,6 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"——————————————————————————————————————————————————"
app:layout_constraintHorizontal_weight=
"0.6"
app:layout_constraintRight_toRightOf=
"parent"
...
...
@@ -178,7 +174,6 @@
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"——————————————————————————————————————————————————"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/rv_bill_amount"
...
...
base-module/src/main/res/layout/print_layout_print_bill.xml
View file @
c1d4845a
...
...
@@ -19,8 +19,8 @@
android:layout_marginTop=
"10dp"
android:gravity=
"center"
android:text=
"gs1"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
...
...
@@ -31,9 +31,9 @@
android:layout_gravity=
"center_horizontal"
android:gravity=
"center"
android:text=
"yan"
app:layout_constraintTop_toBottomOf=
"@id/tv_brand_name"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_brand_name"
/>
<TextView
android:id=
"@+id/tv_print_bill_order_num"
...
...
@@ -46,104 +46,110 @@
<TextView
android:id=
"@+id/line_restaurant_name"
style=
"@style/Print_text_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:maxLines=
"1"
style=
"@style/Print_text_style"
android:text=
"——————————————————————————————————————————————————"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_print_bill_order_num"
/>
<TextView
android:id=
"@+id/tv_dining_table_text"
android:layout_width=
"wrap_content"
style=
"@style/Print_text_style"
<LinearLayout
android:id=
"@+id/layout_dining_table"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"餐檯:"
android:orientation=
"horizontal"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/line_restaurant_name"
/
>
app:layout_constraintTop_toBottomOf=
"@id/line_restaurant_name"
>
<TextView
android:id=
"@+id/tv_dining_table_number"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
style=
"@style/Print_text_style"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_dining_table_text"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_dining_table_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:text=
"餐檯:"
/>
<TextView
android:id=
"@+id/tv_dining_table_number"
style=
"@style/Print_text_style"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_dining_table_text"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_people_text"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:gravity=
"right"
android:text=
"人數:"
style=
"@style/Print_text_style"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_people_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"right"
android:text=
"人數:"
app:layout_constraintBottom_toBottomOf=
"@id/tv_dining_table_text"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_dining_table_text"
/>
<TextView
android:id=
"@+id/tv_people"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
style=
"@style/Print_text_style"
app:layout_constraintBottom_toBottomOf=
"@id/tv_people_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_people_text"
app:layout_constraintTop_toTopOf=
"@id/tv_people_text"
/>
<TextView
android:id=
"@+id/tv_people"
style=
"@style/Print_text_style"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_5"
app:layout_constraintBottom_toBottomOf=
"@id/tv_people_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_people_text"
app:layout_constraintTop_toTopOf=
"@id/tv_people_text"
/>
</LinearLayout>
<TextView
android:id=
"@+id/tv_order_number_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"單號:"
style=
"@style/Print_text_style"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/
tv_dining_table_text
"
/>
app:layout_constraintTop_toBottomOf=
"@id/
layout_dining_table
"
/>
<TextView
android:id=
"@+id/tv_order_num"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
style=
"@style/Print_text_style"
app:layout_constraintBottom_toBottomOf=
"@id/tv_order_number_text"
app:layout_constraintLeft_toRightOf=
"@id/tv_order_number_text"
app:layout_constraintTop_toTopOf=
"@id/tv_order_number_text"
/>
<TextView
android:id=
"@+id/tv_data_text"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"下單時間:"
style=
"@style/Print_text_style"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_order_number_text"
/>
<TextView
android:id=
"@+id/tv_date"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
style=
"@style/Print_text_style"
app:layout_constraintLeft_toRightOf=
"@id/tv_data_text"
app:layout_constraintTop_toBottomOf=
"@id/tv_order_number_text"
/>
<TextView
android:id=
"@+id/line_order_info"
style=
"@style/Print_text_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
style=
"@style/Print_text_style"
android:text=
"——————————————————————————————————————————————————"
app:layout_constraintTop_toBottomOf=
"@id/tv_date"
/>
...
...
@@ -199,23 +205,23 @@
<TextView
android:id=
"@+id/tv_amount"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
android:text=
"$"
style=
"@style/Print_text_style"
app:layout_constraintRight_toLeftOf=
"@id/tv_total_amount"
app:layout_constraintTop_toBottomOf=
"@id/line_price_info"
/>
<TextView
android:id=
"@+id/tv_total_amount"
style=
"@style/Print_text_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginLeft=
"@dimen/dp_5"
android:text=
"0"
style=
"@style/Print_text_style"
app:layout_constraintBottom_toBottomOf=
"@id/tv_amount"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/tv_amount"
/>
...
...
download-module/src/main/java/com/gingersoft/gsa/cloud/download/mvp/presenter/DownloadPresenter.java
View file @
c1d4845a
...
...
@@ -633,7 +633,6 @@ public class DownloadPresenter extends BasePresenter<DownloadContract.Model, Dow
@Override
public
void
onNext
(
@NonNull
BaseResult
result
)
{
if
(
result
.
isSuccess
())
{
if
(
result
.
getData
()
!=
null
)
{
ExpandInfoDaoUtils
expandInfoDaoUtils
=
new
ExpandInfoDaoUtils
(
IActivity
);
expandInfoDaoUtils
.
deleteAll
();
...
...
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/model/service/MainService.java
View file @
c1d4845a
...
...
@@ -16,6 +16,8 @@ import retrofit2.http.Query;
*/
public
interface
MainService
{
// @Headers({"Domain-Name: system_url"})/**/
@POST
(
"user/logout"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
Object
>
loginOut
(
@Body
RequestBody
requestBody
);
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/model/viewModel/PageViewModel.kt
View file @
c1d4845a
...
...
@@ -468,7 +468,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
}
launch
({
//單獨包起來,哪怕這接口報錯也不要影響到正常的邏輯
repository
.
addPrj
(
dataBean
.
Order_ID
.
toString
(),
restaurantId
,
ids
.
toString
())
repository
.
addPrj
(
dataBean
.
Order_ID
.
toString
(),
restaurantId
,
ids
.
toString
()
,
GsaCloudApplication
.
getMemberId
(
GsaCloudApplication
.
getAppContext
()).
toString
()
)
GetInfoUpdateService
.
loginfo
.
append
(
"添加PRJ:orderId:"
+
dataBean
.
Order_ID
.
toString
()
+
"restaurantId:"
+
restaurantId
+
"orderDetailsIds:"
+
ids
.
toString
())
GetInfoUpdateService
.
loginfo
.
append
(
"\n"
)
},
{
...
...
@@ -482,7 +482,7 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
// 初始化用於打印的view
// 送單成功後,再調用接口獲取取餐碼
repository
.
getOrderInfo
(
dataBean
.
ID
.
toString
()).
apply
{
if
(
data
!=
null
&&
data
!!
.
isNotEmpty
())
{
if
(
data
!=
null
&&
data
!!
.
isNotEmpty
())
{
data
?.
get
(
0
)
?.
let
{
it
.
order_type
=
dataBean
.
order_type
it
.
orderPayType
=
dataBean
.
orderPayType
...
...
@@ -534,13 +534,13 @@ class PageViewModel(private val repository: WeatherRepository) : ViewModel() {
* 打開錢箱
*/
fun
openCashBox
()
{
launch
({
//單獨包起來,哪怕這接口報錯也不要影響到正常的邏輯
repository
.
addPrj
(
"11112364"
,
"153"
,
"48863116,48863117,48863119"
)
},
{
it
.
printStackTrace
()
Log
.
e
(
"eee"
,
"錯誤信息222:"
+
it
.
message
)
})
//
launch({
//
//單獨包起來,哪怕這接口報錯也不要影響到正常的邏輯
//
repository.addPrj("11112364", "153", "48863116,48863117,48863119")
//
}, {
//
it.printStackTrace()
//
Log.e("eee", "錯誤信息222:" + it.message)
//
})
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
6
)
.
addParam
(
PrintConstans
.
PRINT_LOADING
,
false
)
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/service/GetInfoUpdateService.kt
View file @
c1d4845a
...
...
@@ -248,7 +248,7 @@ class GetInfoUpdateService : Service() {
Log
.
e
(
TAG
,
"onFailure"
+
t
!!
.
message
)
if
(!
this
@GetInfoUpdateService
.
isDestroy
)
{
// Log.e(TAG, "沒銷毀")
// initSocket()//创建一个新的连接
// initSocket()//创建一个新的连接
Expected HTTP 101 response but was '502 Bad Gateway'
}
else
{
webSocket
?.
cancel
()
it
.
dispatcher
().
cancelAll
()
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
View file @
c1d4845a
...
...
@@ -131,6 +131,7 @@ class OrderDetailsActivity : BaseActivity() {
if
(
orderDetails
.
isDelete
==
0
)
{
//如果是第三方物流,不顯示結賬按鈕
}
else
{
btnList
.
add
(
BtnBuilder
().
getAssignDeliveryBtn
())
btnList
.
add
(
BtnBuilder
().
getClosingBtn
())
}
orderStatusText
=
"派送中"
...
...
other_order_mode/src/main/res/layout/layout_order_receiving.xml
View file @
c1d4845a
...
...
@@ -43,6 +43,10 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentEnd=
"true"
android:paddingTop=
"@dimen/dp_5"
android:paddingBottom=
"@dimen/dp_5"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:background=
"@drawable/shape_cloas_btn"
android:text=
"停止接單"
android:textColor=
"@color/white"
...
...
print-module/src/main/AndroidManifest.xml
View file @
c1d4845a
...
...
@@ -16,6 +16,7 @@
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
<activity
android:name=
".mvp.ui.activity.PrintTestActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrintAddCurrencyActivity"
/>
</application>
...
...
print-module/src/main/debug/AndroidManifest.xml
View file @
c1d4845a
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.joe.print"
>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.joe.print"
>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.BLUETOOTH"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<application
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:networkSecurityConfig=
"@xml/network_android"
android:roundIcon=
"@mipmap/ic_launcher"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".mvp.ui.activity.PrintAddCurrencyActivity"
></activity>
<activity
android:name=
".mvp.ui.activity.PrintActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterAddActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrintTestActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".mvp.ui.activity.PrinterListActivity"
/>
<application
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:label=
"@string/app_name"
android:roundIcon=
"@mipmap/ic_launcher"
android:supportsRtl=
"true"
android:networkSecurityConfig=
"@xml/network_android"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".mvp.ui.activity.PrintActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrinterAddActivity"
/>
<activity
android:name=
".mvp.ui.activity.PrintTestActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
</application>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
"com.joe.print.mvp.ui.activity.PrinterListActivity"
/>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
</application>
</manifest>
</manifest>
\ No newline at end of file
print-module/src/main/java/com/joe/print/di/component/PrintAddCurrencyComponent.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
di
.
component
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.joe.print.di.module.PrintAddCurrencyModule
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.joe.print.mvp.ui.activity.PrintAddCurrencyActivity
;
@ActivityScope
@Component
(
modules
=
PrintAddCurrencyModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
PrintAddCurrencyComponent
{
void
inject
(
PrintAddCurrencyActivity
activity
);
}
\ No newline at end of file
print-module/src/main/java/com/joe/print/di/module/PrintAddCurrencyModule.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
di
.
module
;
import
com.jess.arms.di.scope.ActivityScope
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.joe.print.mvp.contract.PrintAddCurrencyContract
;
import
com.joe.print.mvp.model.PrintAddCurrencyModel
;
@Module
public
class
PrintAddCurrencyModule
{
private
PrintAddCurrencyContract
.
View
view
;
/**
* 构建PrintAddCurrencyModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
*
* @param view
*/
public
PrintAddCurrencyModule
(
PrintAddCurrencyContract
.
View
view
)
{
this
.
view
=
view
;
}
@ActivityScope
@Provides
PrintAddCurrencyContract
.
View
providePrintAddCurrencyView
()
{
return
this
.
view
;
}
@ActivityScope
@Provides
PrintAddCurrencyContract
.
Model
providePrintAddCurrencyModel
(
PrintAddCurrencyModel
model
)
{
return
model
;
}
}
\ No newline at end of file
print-module/src/main/java/com/joe/print/mvp/contract/LocalPrintContract.java
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
import
java.util.List
;
import
io.reactivex.Observable
;
public
interface
LocalPrintContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
void
loadView
(
List
<
PrintCurrencyBean
>
printCurrencyBeans
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
Observable
<
PublicBean
>
getPrinterCurrencyList
(
String
restaurantId
);
}
}
print-module/src/main/java/com/joe/print/mvp/contract/PrintAddCurrencyContract.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
public
interface
PrintAddCurrencyContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
void
addSuccess
(
boolean
isSuccess
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
Observable
<
PublicBean
>
getPrinterCurrencyList
(
String
restaurantId
);
Observable
<
PublicBean
>
addPrinterCurrency
(
RequestBody
requestBody
);
}
}
print-module/src/main/java/com/joe/print/mvp/model/LocalPrintModel.java
View file @
c1d4845a
...
...
@@ -2,6 +2,7 @@ package com.joe.print.mvp.model;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
...
...
@@ -11,6 +12,9 @@ import com.jess.arms.di.scope.FragmentScope;
import
javax.inject.Inject
;
import
com.joe.print.mvp.contract.LocalPrintContract
;
import
com.joe.print.mvp.model.server.PrintInfoService
;
import
io.reactivex.Observable
;
@FragmentScope
...
...
@@ -31,4 +35,9 @@ public class LocalPrintModel extends BaseModel implements LocalPrintContract.Mod
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
PublicBean
>
getPrinterCurrencyList
(
String
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
PrintInfoService
.
class
).
getCurrencyPrenterList
(
restaurantId
);
}
}
\ No newline at end of file
print-module/src/main/java/com/joe/print/mvp/model/PrintAddCurrencyModel.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.ActivityScope
;
import
javax.inject.Inject
;
import
com.joe.print.mvp.contract.PrintAddCurrencyContract
;
import
com.joe.print.mvp.model.server.PrintInfoService
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
@ActivityScope
public
class
PrintAddCurrencyModel
extends
BaseModel
implements
PrintAddCurrencyContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
PrintAddCurrencyModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
PublicBean
>
getPrinterCurrencyList
(
String
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
PrintInfoService
.
class
).
getCurrencyPrenterList
(
restaurantId
);
}
@Override
public
Observable
<
PublicBean
>
addPrinterCurrency
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
PrintInfoService
.
class
).
addCurrencyPrenter
(
requestBody
);
}
}
\ No newline at end of file
print-module/src/main/java/com/joe/print/mvp/model/bean/PrintInfoBean.java
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
model
.
bean
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
java.util.ArrayList
;
import
java.util.List
;
public
class
PrintInfoBean
{
//數組多長就有多少列
private
String
[]
content
;
//private int[] widght;//每列佔比權重
private
Boolean
[]
isBold
=
new
Boolean
[]{
false
};
private
Boolean
[]
isItalic
=
new
Boolean
[]{
false
};
private
int
[]
color
=
new
int
[]{
0
};
private
double
[]
size
=
new
double
[]{
1
};
...
...
@@ -39,7 +49,6 @@ public class PrintInfoBean {
}
public
PrintInfoBean
(
String
[]
content
,
int
gravity
)
{
this
.
content
=
content
;
this
.
gravity
=
gravity
;
...
...
@@ -56,6 +65,13 @@ public class PrintInfoBean {
this
.
gravity
=
gravity
;
}
public
PrintInfoBean
(
String
[]
content
,
int
[]
color
,
double
[]
size
,
int
gravity
)
{
this
.
content
=
content
;
this
.
color
=
color
;
this
.
size
=
size
;
this
.
gravity
=
gravity
;
}
public
PrintInfoBean
(
String
[]
content
,
Boolean
[]
isBold
,
int
gravity
)
{
this
.
content
=
content
;
this
.
isBold
=
isBold
;
...
...
@@ -82,6 +98,23 @@ public class PrintInfoBean {
this
.
gravity
=
gravity
;
}
public
PrintInfoBean
(
String
[]
content
,
Boolean
[]
isBold
,
int
[]
color
,
double
[]
size
,
int
gravity
)
{
this
.
content
=
content
;
this
.
isBold
=
isBold
;
this
.
color
=
color
;
this
.
size
=
size
;
this
.
gravity
=
gravity
;
}
public
PrintInfoBean
(
String
[]
content
,
Boolean
[]
isBold
,
Boolean
[]
isItalic
,
int
[]
color
,
double
[]
size
,
int
gravity
)
{
this
.
content
=
content
;
this
.
isBold
=
isBold
;
this
.
isItalic
=
isItalic
;
this
.
color
=
color
;
this
.
size
=
size
;
this
.
gravity
=
gravity
;
}
public
String
[]
getContent
()
{
return
content
;
}
...
...
@@ -98,6 +131,14 @@ public class PrintInfoBean {
this
.
isBold
=
isBold
;
}
public
Boolean
[]
getIsItalic
()
{
return
isItalic
;
}
public
void
setIsItalic
(
Boolean
[]
isItalic
)
{
this
.
isItalic
=
isItalic
;
}
public
int
[]
getColor
()
{
return
color
;
}
...
...
@@ -129,4 +170,200 @@ public class PrintInfoBean {
public
void
setLanguage
(
String
[]
language
)
{
Language
=
language
;
}
public
static
List
<
List
<
PrintInfoBean
>>
transPrjBean
(
List
<
PrjBean
.
DataBean
.
Bean
>
datas
,
int
paperWidth
,
String
printLocation
,
PrinterDeviceBean
deviceBean
,
PrintCurrencyBean
printCurrencyBean
)
{
List
<
List
<
PrintInfoBean
>>
prjPrintBeans
=
new
ArrayList
<>();
//通過打印位置生成多張用於打印的bitmap
for
(
PrjBean
.
DataBean
.
Bean
prjbean
:
datas
)
{
List
<
PrjBean
.
DataBean
.
Bean
>
noCut
=
new
ArrayList
<>();
//遍歷當前打印位置所有的食品
if
(
prjbean
.
getStatus
()
==
2
)
{
//切紙,單獨生成一條prj數據
List
<
PrjBean
.
DataBean
.
Bean
>
beans
=
new
ArrayList
<>();
beans
.
add
(
prjbean
);
prjPrintBeans
.
add
(
getPrjPrintInfoBean
(
printLocation
,
paperWidth
,
beans
,
deviceBean
,
printCurrencyBean
));
}
else
{
//不切紙,保存到單獨的集合里,之後生成一組數據
noCut
.
add
(
prjbean
);
}
if
(
noCut
.
size
()
>
0
)
{
prjPrintBeans
.
add
(
getPrjPrintInfoBean
(
printLocation
,
paperWidth
,
noCut
,
deviceBean
,
printCurrencyBean
));
}
}
return
prjPrintBeans
;
}
/**
* 生成一張prj打印數據
*
* @return
*/
private
static
List
<
PrintInfoBean
>
getPrjPrintInfoBean
(
String
key
,
int
peparWidth
,
List
<
PrjBean
.
DataBean
.
Bean
>
prjBeans
,
PrinterDeviceBean
deviceBean
,
PrintCurrencyBean
printCurrencyBean
)
{
List
<
PrintInfoBean
>
printInfoBeans
=
new
ArrayList
<>();
boolean
foodIsBold
=
false
;
//食品是否加粗
boolean
foodItemIsBolde
=
false
;
//細項是否加粗
boolean
foodIsItalic
=
false
;
//食品是否斜體
boolean
modifierIsItalic
=
false
;
//細項是否斜體
boolean
numberIsFlip
=
false
;
//數量大於1顏色是否翻轉
int
foodColor
=
0
;
//食品顏色
int
modifierColor
=
0
;
//細項顏色
if
(
printCurrencyBean
!=
null
)
{
foodColor
=
printCurrencyBean
.
getFoodComplexion
();
modifierColor
=
printCurrencyBean
.
getModifierComplexion
();
}
if
(
deviceBean
.
getFoodIsBold
()
==
1
)
{
foodIsBold
=
true
;
}
else
if
(
printCurrencyBean
!=
null
)
{
foodIsBold
=
printCurrencyBean
.
getFoodIsBold
()
==
1
;
}
if
(
deviceBean
.
getModifierIsBold
()
==
1
)
{
foodItemIsBolde
=
true
;
}
else
if
(
printCurrencyBean
!=
null
)
{
foodItemIsBolde
=
printCurrencyBean
.
getModifierIsBold
()
==
1
;
}
if
(
deviceBean
.
getFoodIsItalic
()
==
1
)
{
foodIsItalic
=
true
;
}
else
if
(
printCurrencyBean
!=
null
)
{
foodIsItalic
=
printCurrencyBean
.
getFoodIsItalic
()
==
1
;
}
if
(
deviceBean
.
getModifierIsItalic
()
==
1
)
{
modifierIsItalic
=
true
;
}
else
if
(
printCurrencyBean
!=
null
)
{
modifierIsItalic
=
printCurrencyBean
.
getModifierIsItalic
()
==
1
;
}
if
(
deviceBean
.
getNumberIsFlip
()
==
1
)
{
numberIsFlip
=
true
;
}
else
if
(
printCurrencyBean
!=
null
)
{
numberIsFlip
=
printCurrencyBean
.
getNumberIsFlip
()
==
1
;
}
if
(
prjBeans
==
null
||
prjBeans
.
size
()
<=
0
)
{
return
null
;
}
PrjBean
.
DataBean
.
Bean
prjBean
=
prjBeans
.
get
(
0
);
if
(
prjBean
==
null
)
{
return
null
;
}
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTableName
()))
{
if
(
prjBean
.
getOrderType
()
==
7
)
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"自取"
},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getTakeFoodCode
()))
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"取餐碼:"
,
prjBean
.
getTakeFoodCode
()},
new
Boolean
[]{
false
,
true
},
new
double
[]{
1
,
2
},
0
));
}
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getBillNo
()))
{
//訂單碼不為空
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"訂單碼:"
,
prjBean
.
getBillNo
()},
new
Boolean
[]{
false
,
true
},
new
double
[]{
1
,
2
},
0
));
}
}
else
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"外賣"
},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
prjBean
.
getBillNo
()))
{
//訂單碼不為空
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"訂單碼:"
,
prjBean
.
getBillNo
()},
new
Boolean
[]{
false
,
true
},
new
double
[]{
1
,
2
},
0
));
}
}
}
else
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
prjBean
.
getTableName
()},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
}
//落單時間
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"落單時間:"
+
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_MDHM
)},
new
double
[]{
1
},
0
));
//廚房位置
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
key
)
&&
!
key
.
equals
(
"-1"
))
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
key
+
"廚房"
,
" "
+
GsaCloudApplication
.
getMemberName
(
GsaCloudApplication
.
getAppContext
())},
new
double
[]{
1
},
0
));
}
//人數
if
(
prjBean
.
getPerson
()
!=
0
)
{
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"人數:"
+
prjBean
.
getPerson
(),
GsaCloudApplication
.
getMemberName
(
GsaCloudApplication
.
getAppContext
())},
new
double
[]{
1
},
0
));
}
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
getLineBorder
(
""
,
1
,
peparWidth
)},
0
));
for
(
PrjBean
.
DataBean
.
Bean
bean
:
prjBeans
)
{
if
(
bean
.
getParentId
()
==
0
)
{
//沒有父級id,則是第一級食品
bean
.
setItemType
(
1
);
}
//如果父級id不為0,是細項
if
(
bean
.
getParentId
()
!=
0
)
{
bean
.
setItemType
(
2
);
//先設置為細項,再通過下面的遍歷確定是否是第三級細項
//循環遍歷查找父級食品
for
(
PrjBean
.
DataBean
.
Bean
itembean
:
prjBeans
)
{
if
(
bean
.
getParentId
()
==
itembean
.
getOrderDetailsId
())
{
//如果父級是細項,則當前食品就是二級細項
bean
.
setItemType
(
bean
.
getItemType
()
+
1
);
break
;
}
}
}
int
beforeColor
=
0
;
if
(
bean
.
getItemType
()
==
1
)
{
//如果是主食品
beforeColor
=
foodColor
;
}
else
{
//細項
beforeColor
=
modifierColor
;
}
if
(
bean
.
getNumber
()
>
1
&&
numberIsFlip
)
{
//翻轉顏色
if
(
beforeColor
==
0
){
beforeColor
=
2
;
}
else
{
beforeColor
=
0
;
}
}
if
(
bean
.
getItemType
()
==
1
)
{
//主食品
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
bean
.
getNumber
()
+
" "
,
bean
.
getProductName
()},
new
Boolean
[]{
foodIsBold
},
new
Boolean
[]{
foodIsItalic
},
new
int
[]{
beforeColor
},
new
double
[]{
2
},
0
));
}
else
if
(
bean
.
getItemType
()
==
2
)
{
//細項
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
bean
.
getNumber
()
+
" "
,
" "
+
bean
.
getProductName
()},
new
Boolean
[]{
foodItemIsBolde
},
new
Boolean
[]{
modifierIsItalic
},
new
int
[]{
beforeColor
},
new
double
[]{
2
},
0
));
}
else
if
(
bean
.
getItemType
()
==
3
)
{
//二級細項
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
bean
.
getNumber
()
+
" "
,
" "
+
bean
.
getProductName
()},
new
Boolean
[]{
foodItemIsBolde
},
new
Boolean
[]{
modifierIsItalic
},
new
int
[]{
beforeColor
},
new
double
[]{
2
},
0
));
}
}
PrintInfoBean
printInfoBean
=
printInfoBeans
.
get
(
0
);
printInfoBean
.
setGravity
(
1
);
printInfoBeans
.
add
(
printInfoBean
);
return
printInfoBeans
;
}
private
static
String
getLineBorder
(
String
text
,
double
fontSize
,
int
paperWidth
)
{
if
(
fontSize
==
0
)
{
fontSize
=
1
;
}
//中文字符個數,Epson打印機每個中文字符佔1.5格
double
cnCount
=
getChineseValueLength
(
text
);
int
count
=
(
int
)
Math
.
floor
(((
paperWidth
/
fontSize
)
-
cnCount
));
if
(
count
<=
0
)
{
return
text
;
}
StringBuilder
builder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
count
/
2
;
i
++)
{
builder
.
append
(
"-"
);
}
builder
.
append
(
text
);
for
(
int
i
=
0
;
i
<
count
/
2
;
i
++)
{
builder
.
append
(
"-"
);
}
return
builder
.
toString
();
}
private
static
double
getChineseValueLength
(
String
value
)
{
double
valueLength
=
0
;
String
chinese
=
"[\u4e00-\u9fa5]"
;
for
(
int
i
=
0
;
i
<
value
.
length
();
i
++)
{
String
temp
=
value
.
substring
(
i
,
i
+
1
);
if
(
temp
.
matches
(
chinese
))
{
valueLength
+=
1.5
;
}
else
{
valueLength
+=
1
;
}
}
return
valueLength
;
}
}
print-module/src/main/java/com/joe/print/mvp/model/bean/PrjBean.java
View file @
c1d4845a
...
...
@@ -70,15 +70,15 @@ public class PrjBean {
private
int
type
;
private
int
printerType
;
private
Long
printerTime
;
private
String
number
;
private
int
number
;
private
String
productId
;
private
Long
createTime
;
private
int
requests
;
private
int
actualPrinterDeviceId
;
private
String
takeFoodCode
;
private
String
billNo
;
private
int
orderType
;
private
String
takeFoodCode
;
//取餐碼
private
String
billNo
;
//訂單碼
private
int
orderType
;
//訂單類型
/***
* 層級
* 1:主食品
...
...
@@ -211,11 +211,11 @@ public class PrjBean {
this
.
printerTime
=
printerTime
;
}
public
String
getNumber
()
{
public
int
getNumber
()
{
return
number
;
}
public
void
setNumber
(
String
number
)
{
public
void
setNumber
(
int
number
)
{
this
.
number
=
number
;
}
...
...
print-module/src/main/java/com/joe/print/mvp/model/server/GetPrintInfoService.java
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
model
.
server
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
io.reactivex.Observable
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
retrofit2.http.GET
;
...
...
print-module/src/main/java/com/joe/print/mvp/model/server/PrintInfoService.java
View file @
c1d4845a
...
...
@@ -2,13 +2,13 @@ package com.joe.print.mvp.model.server;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
io.reactivex.Observable
;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.GET
;
import
retrofit2.http.Headers
;
import
retrofit2.http.POST
;
import
retrofit2.http.Query
;
...
...
@@ -35,5 +35,9 @@ public interface PrintInfoService {
@GET
(
"printerModel/list?"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
getPrinterModelList
(
@Query
(
"restaurantId"
)
int
restaurantId
);
@GET
(
"printerComplexionConfig/list?"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
PublicBean
>
getCurrencyPrenterList
(
@Query
(
"restaurantId"
)
String
restaurantId
);
@POST
(
"printerComplexionConfig/insert"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
PublicBean
>
addCurrencyPrenter
(
@Body
RequestBody
requestBody
);
}
print-module/src/main/java/com/joe/print/mvp/presenter/LocalPrintPresenter.java
View file @
c1d4845a
...
...
@@ -2,15 +2,24 @@ package com.joe.print.mvp.presenter;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.jess.arms.di.scope.FragmentScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.joe.print.mvp.contract.LocalPrintContract
;
import
java.util.List
;
import
javax.inject.Inject
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
@FragmentScope
...
...
@@ -37,4 +46,27 @@ public class LocalPrintPresenter extends BasePresenter<LocalPrintContract.Model,
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
public
void
getPrinterCurrencyList
(
int
restaurant
)
{
mModel
.
getPrinterCurrencyList
(
restaurant
+
""
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
""
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
PublicBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
PublicBean
baseResult
)
{
if
(
baseResult
!=
null
)
{
List
<
PrintCurrencyBean
>
printCurrencyBeans
=
JsonUtils
.
parseArray
(
baseResult
.
getData
(),
PrintCurrencyBean
.
class
);
mRootView
.
loadView
(
printCurrencyBeans
);
}
else
{
mRootView
.
loadView
(
null
);
}
}
});
}
}
print-module/src/main/java/com/joe/print/mvp/presenter/PrintAddCurrencyPresenter.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
io.reactivex.Scheduler
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.schedulers.Schedulers
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
me.jessyan.rxerrorhandler.handler.ErrorHandleSubscriber
;
import
okhttp3.FormBody
;
import
okhttp3.MediaType
;
import
okhttp3.RequestBody
;
import
javax.inject.Inject
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.joe.print.mvp.contract.PrintAddCurrencyContract
;
import
java.util.List
;
@ActivityScope
public
class
PrintAddCurrencyPresenter
extends
BasePresenter
<
PrintAddCurrencyContract
.
Model
,
PrintAddCurrencyContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
PrintAddCurrencyPresenter
(
PrintAddCurrencyContract
.
Model
model
,
PrintAddCurrencyContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
public
void
addCurrencyPresenter
(
PrintCurrencyBean
printCurrencyBean
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
JsonUtils
.
toJson
(
printCurrencyBean
));
mModel
.
addPrinterCurrency
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
""
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
PublicBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
PublicBean
s
)
{
if
(
s
!=
null
)
{
mRootView
.
addSuccess
(
s
.
isSuccess
());
}
else
{
mRootView
.
addSuccess
(
false
);
}
}
});
}
private
RequestBody
getRequestBody
(
PrintCurrencyBean
printCurrencyBean
)
{
FormBody
.
Builder
builder
=
new
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
printCurrencyBean
.
getRestaurantId
()
+
""
)
.
add
(
"type"
,
printCurrencyBean
.
getType
()
+
""
)
.
add
(
"foodComplexion"
,
printCurrencyBean
.
getFoodComplexion
()
+
""
)
.
add
(
"modifierComplexion"
,
printCurrencyBean
.
getModifierComplexion
()
+
""
)
.
add
(
"uid"
,
printCurrencyBean
.
getUid
()
+
""
)
.
add
(
"foodIsBold"
,
printCurrencyBean
.
getFoodIsBold
()
+
""
)
.
add
(
"foodFont"
,
printCurrencyBean
.
getFoodFont
()
+
""
)
.
add
(
"foodIsItalic"
,
printCurrencyBean
.
getFoodIsItalic
()
+
""
)
.
add
(
"modifierIsBold"
,
printCurrencyBean
.
getModifierIsBold
()
+
""
)
.
add
(
"modifierFont"
,
printCurrencyBean
.
getModifierFont
()
+
""
)
.
add
(
"modifierIsItalic"
,
printCurrencyBean
.
getModifierIsItalic
()
+
""
)
.
add
(
"numberIsFlip"
,
printCurrencyBean
.
getNumberIsFlip
()
+
""
);
return
builder
.
build
();
}
}
print-module/src/main/java/com/joe/print/mvp/presenter/PrinterAddPresenter.java
View file @
c1d4845a
...
...
@@ -142,7 +142,14 @@ public class PrinterAddPresenter extends BasePresenter<PrinterAddContract.Model,
.
add
(
"port"
,
printerDeviceBean
.
getPort
()
+
""
)
.
add
(
"printerModelId"
,
printerDeviceBean
.
getPrinterModelId
()
+
""
)
.
add
(
"type"
,
printerDeviceBean
.
getType
()
+
""
)
.
add
(
"id"
,
printerDeviceBean
.
getId
()
+
""
);
.
add
(
"id"
,
printerDeviceBean
.
getId
()
+
""
)
.
add
(
"foodIsBold"
,
printerDeviceBean
.
getFoodIsBold
()
+
""
)
.
add
(
"foodFont"
,
printerDeviceBean
.
getFoodFont
()
+
""
)
.
add
(
"foodIsItalic"
,
printerDeviceBean
.
getFoodIsItalic
()
+
""
)
.
add
(
"modifierIsBold"
,
printerDeviceBean
.
getModifierIsBold
()
+
""
)
.
add
(
"modifierFont"
,
printerDeviceBean
.
getModifierFont
()
+
""
)
.
add
(
"modifierIsItalic"
,
printerDeviceBean
.
getModifierIsItalic
()
+
""
)
.
add
(
"numberIsFlip"
,
printerDeviceBean
.
getNumberIsFlip
()
+
""
);
if
(
printerDeviceBean
.
getFlyPrinterDeviceId
()
!=
null
)
{
builder
.
add
(
"flyPrinterDeviceId"
,
printerDeviceBean
.
getFlyPrinterDeviceId
()
+
""
);
}
...
...
print-module/src/main/java/com/joe/print/mvp/print/EpsonPrint.java
View file @
c1d4845a
...
...
@@ -94,8 +94,6 @@ public class EpsonPrint implements ReceiveListener {
mPrinter
=
null
;
}
private
int
lineCount
=
42
;
/**
* 創建打印數據
*
...
...
@@ -241,7 +239,7 @@ public class EpsonPrint implements ReceiveListener {
private
String
ipAddress
;
private
List
<
Bitmap
>
bitmaps
=
new
ArrayList
<>();
public
void
putPrintString
(
String
ip
,
List
<
PrintInfoBean
>
printInfoBeans
)
{
public
void
putPrintString
(
String
ip
,
int
paperWidth
,
List
<
PrintInfoBean
>
printInfoBeans
)
{
if
(
mPrinter
==
null
)
{
return
;
}
...
...
@@ -260,7 +258,7 @@ public class EpsonPrint implements ReceiveListener {
}
//如果打印多列內容,並且字體大小配置多個,則每一列取自己對應的字體大小
for
(
int
i
=
0
;
i
<
printInfoBean
.
getContent
().
length
;
i
++)
{
print
(
printInfoBean
,
i
);
print
(
printInfoBean
,
i
,
paperWidth
);
}
mPrinter
.
addFeedLine
(
1
);
}
...
...
@@ -274,42 +272,120 @@ public class EpsonPrint implements ReceiveListener {
}
private
int
location
=
0
;
private
void
print
(
PrintInfoBean
printInfoBean
,
int
i
)
throws
Epos2Exception
{
private
void
print
(
PrintInfoBean
printInfoBean
,
int
i
,
int
paperWidth
)
throws
Epos2Exception
{
if
(
i
==
0
)
{
location
=
0
;
}
int
color
;
int
textSize
;
int
isItalic
;
if
(
printInfoBean
.
getColor
().
length
==
1
)
{
color
=
printInfoBean
.
getColor
()[
0
];
}
else
{
color
=
printInfoBean
.
getColor
()[
i
];
}
if
(
color
>
4
)
{
color
=
4
;
}
if
(
printInfoBean
.
getIsItalic
().
length
==
1
)
{
isItalic
=
printInfoBean
.
getIsItalic
()[
0
]
?
1
:
0
;
}
else
{
isItalic
=
printInfoBean
.
getIsItalic
()[
i
]
?
1
:
0
;
}
if
(
printInfoBean
.
getIsBold
().
length
==
1
)
{
mPrinter
.
addTextStyle
(
0
,
0
,
printInfoBean
.
getIsBold
()[
0
]
?
1
:
0
,
Printer
.
COLOR_1
);
mPrinter
.
addTextStyle
(
0
,
isItalic
,
printInfoBean
.
getIsBold
()[
0
]
?
1
:
0
,
color
);
}
else
{
if
(
printInfoBean
.
getIsBold
()[
i
])
{
mPrinter
.
addTextStyle
(
0
,
0
,
0
,
Printer
.
COLOR_1
);
mPrinter
.
addTextStyle
(
0
,
isItalic
,
0
,
color
);
}
else
{
mPrinter
.
addTextStyle
(
0
,
0
,
1
,
Printer
.
COLOR_1
);
mPrinter
.
addTextStyle
(
0
,
isItalic
,
1
,
color
);
}
}
StringBuilder
space
=
new
StringBuilder
();
if
(
printInfoBean
.
getSize
().
length
==
1
)
{
for
(
int
j
=
0
;
j
<
location
/
printInfoBean
.
getSize
()[
0
];
j
++)
{
for
(
int
j
=
0
;
j
<
location
/
printInfoBean
.
getSize
()[
0
];
j
++)
{
space
.
append
(
" "
);
}
mPrinter
.
addTextSize
((
int
)
printInfoBean
.
getSize
()[
0
],
(
int
)
printInfoBean
.
getSize
()[
0
]);
location
+=
printInfoBean
.
getContent
()[
i
].
length
()
*
printInfoBean
.
getSize
()[
0
];
textSize
=
(
int
)
printInfoBean
.
getSize
()[
0
];
mPrinter
.
addTextSize
(
textSize
,
textSize
);
location
+=
getChineseValueLength
(
printInfoBean
.
getContent
()[
i
])
*
printInfoBean
.
getSize
()[
0
];
}
else
{
for
(
int
j
=
0
;
j
<
location
/
printInfoBean
.
getSize
()[
i
];
j
++)
{
for
(
int
j
=
0
;
j
<
location
/
printInfoBean
.
getSize
()[
i
];
j
++)
{
space
.
append
(
" "
);
}
mPrinter
.
addTextSize
((
int
)
printInfoBean
.
getSize
()[
i
],
(
int
)
printInfoBean
.
getSize
()[
i
]);
location
+=
printInfoBean
.
getContent
()[
i
].
length
()
*
printInfoBean
.
getSize
()[
i
];
textSize
=
(
int
)
printInfoBean
.
getSize
()[
i
];
mPrinter
.
addTextSize
(
textSize
,
textSize
);
location
+=
getChineseValueLength
(
printInfoBean
.
getContent
()[
i
])
*
printInfoBean
.
getSize
()[
i
];
}
if
(
printInfoBean
.
getLanguage
().
length
==
1
)
{
setLanguage
(
printInfoBean
.
getLanguage
()[
0
]);
}
else
{
setLanguage
(
printInfoBean
.
getLanguage
()[
i
]);
}
mPrinter
.
addText
(
space
+
printInfoBean
.
getContent
()[
i
]
);
mPrinter
.
addText
(
getFormatText
(
space
+
printInfoBean
.
getContent
()[
i
],
paperWidth
/
textSize
)
);
// mPrinter.addLineSpace(100);//行間距
}
private
static
String
abc
=
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
;
/**
* 如果超過紙張寬度的英文,換行時,要截取得當
* 23
*
* @return
*/
private
static
String
getFormatText
(
String
content
,
int
paperWidth
)
{
if
(
content
.
length
()
>
paperWidth
)
{
int
lastIndex
=
0
;
//上次截取時最後的下標
StringBuilder
stringBuilder
=
new
StringBuilder
();
while
(
true
)
{
if
(
lastIndex
+
paperWidth
>=
content
.
length
())
{
String
footStr
=
content
.
substring
(
lastIndex
);
stringBuilder
.
append
(
footStr
);
return
stringBuilder
.
toString
();
}
else
{
String
headerStr
=
content
.
substring
(
lastIndex
,
lastIndex
+
paperWidth
);
String
nextContext
=
content
.
substring
(
lastIndex
+
paperWidth
,
lastIndex
+
paperWidth
+
1
);
if
(
abc
.
contains
(
headerStr
.
charAt
(
headerStr
.
length
()
-
1
)
+
""
)
&&
abc
.
contains
(
nextContext
))
{
//如果最後一位是英文單詞,往前找找到空格或者不是英文的,然後換行
for
(
int
j
=
headerStr
.
length
()
-
1
;
j
>=
0
;
j
--)
{
String
tchar
=
headerStr
.
charAt
(
j
)
+
""
;
if
(
j
==
0
)
{
//循環完了都沒找到,就不管了
stringBuilder
.
append
(
headerStr
);
stringBuilder
.
append
(
"\n"
);
lastIndex
+=
paperWidth
;
break
;
}
if
(!
abc
.
contains
(
tchar
))
{
//找到不是英文的那個
String
newHeaderStr
=
headerStr
.
substring
(
0
,
j
+
1
);
stringBuilder
.
append
(
newHeaderStr
);
stringBuilder
.
append
(
"\n"
);
lastIndex
+=
j
+
1
;
break
;
}
}
}
else
{
lastIndex
+=
paperWidth
;
stringBuilder
.
append
(
headerStr
);
stringBuilder
.
append
(
"\n"
);
}
}
}
}
else
{
return
content
;
}
}
public
static
void
main
(
String
[]
args
)
{
String
str
=
"asd asdfa asdf sdjn sdf0"
;
System
.
out
.
println
(
getFormatText
(
str
,
20
));
}
private
void
setLanguage
(
String
language
)
throws
Epos2Exception
{
if
(
"en"
.
equals
(
language
))
{
//切換對應語言
...
...
@@ -369,6 +445,9 @@ public class EpsonPrint implements ReceiveListener {
return
0
;
}
connectByIp
(
ip
,
mPrinter
.
getStatus
());
if
(
mPrinter
==
null
)
{
return
0
;
}
PrinterStatusInfo
statusInfo
=
mPrinter
.
getStatus
();
// if (statusInfo.getConnection() != 1) {
// if (resetCount > 0) {
...
...
@@ -448,7 +527,6 @@ public class EpsonPrint implements ReceiveListener {
if
(
ipAddress
!=
null
&&
!
ipAddress
.
equals
(
ip
))
{
Log
.
e
(
TAG
,
"不是上次的ip,斷開重連"
);
disconnectPrinter
();
finalizeObject
();
if
(
connectPrinter
(
ip
))
{
ipAddress
=
ip
;
}
...
...
@@ -490,6 +568,7 @@ public class EpsonPrint implements ReceiveListener {
Log
.
e
(
TAG
,
"連接打印機報錯"
+
e
.
getMessage
()
+
e
.
getClass
().
getName
());
e
.
printStackTrace
();
disconnectPrinter
();
finalizeObject
();
return
false
;
}
return
true
;
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrder.java
View file @
c1d4845a
...
...
@@ -219,15 +219,23 @@ public class PrintOtherOrder extends PrinterRoot {
setText
(
view
,
R
.
id
.
tv_order_type
,
data
.
getOrder_type
()
==
2
?
"外送"
:
"自取"
);
// 訂單號
setText
(
view
,
R
.
id
.
tv_order_number
,
"單號:"
+
data
.
getORDER_NO
());
if
(
data
.
getTakeFoodCode
()
!=
null
&&
!
data
.
getTakeFoodCode
().
equals
(
"0"
))
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"取餐碼:#"
+
data
.
getTakeFoodCode
());
if
(
data
.
getOrder_type
()
==
7
)
{
//自取 顯示 取餐碼+訂單碼
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
data
.
getTakeFoodCode
()))
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"取餐碼:"
+
data
.
getTakeFoodCode
());
}
}
else
{
//外送 顯示訂單碼
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"訂單碼:"
+
data
.
getTakeFoodCode
());
}
if
(
data
.
getTakeFoodCode
()
==
null
||
data
.
getTakeFoodCode
().
equals
(
"0"
))
{
view
.
findViewById
(
R
.
id
.
tv_order_take_food_code
).
setVisibility
(
View
.
GONE
);
}
if
(
data
.
getBillNo
()
==
null
||
data
.
getBillNo
().
length
()
<=
0
)
{
tvBillNumber
.
setVisibility
(
View
.
GONE
);
}
else
{
tvBillNumber
.
setText
(
"訂單
號
:"
+
data
.
getBillNo
());
tvBillNumber
.
setText
(
"訂單
碼
:"
+
data
.
getBillNo
());
}
//訂單創建時間
setText
(
view
,
R
.
id
.
tv_order_create
,
context
.
getString
(
R
.
string
.
create_order_time
)
+
TimeUtils
.
parseTimeRepeat
(
data
.
getCREATE_TIME
(),
TimeUtils
.
DEFAULT_DATE_FORMAT
));
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintOtherOrderClosing.java
View file @
c1d4845a
...
...
@@ -62,7 +62,6 @@ public class PrintOtherOrderClosing extends PrinterRoot {
private
Bitmap
initPrintView
(
Context
context
,
OrderDetails
.
DataBean
data
)
{
View
view
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
print_confirm_order_view
,
null
,
false
);
TextView
tvMemberNum
=
view
.
findViewById
(
R
.
id
.
tv_member_number
);
//會員號碼
TextView
tvMemberName
=
view
.
findViewById
(
R
.
id
.
tv_member_name
);
//會員名稱
TextView
tvMemberPhone
=
view
.
findViewById
(
R
.
id
.
tv_member_phone
);
//會員電話
...
...
@@ -76,19 +75,26 @@ public class PrintOtherOrderClosing extends PrinterRoot {
setText
(
view
,
R
.
id
.
tv_brand_name
,
GsaCloudApplication
.
getBrandName
(
context
));
//餐廳名
setText
(
view
,
R
.
id
.
tv_restaurant_name
,
GsaCloudApplication
.
getRestaurantName
(
context
));
// 訂單類型
setText
(
view
,
R
.
id
.
tv_order_type
,
data
.
getOrder_type
()
==
2
?
"外送"
:
"自取"
);
// 訂單號
setText
(
view
,
R
.
id
.
tv_order_number
,
"單號:"
+
data
.
getORDER_NO
());
if
(
data
.
getTakeFoodCode
()
!=
null
&&
!
data
.
getTakeFoodCode
().
equals
(
"0"
))
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"取餐碼:#"
+
data
.
getTakeFoodCode
());
}
else
{
view
.
findViewById
(
R
.
id
.
tv_order_take_food_code
).
setVisibility
(
View
.
GONE
);
}
if
(
data
.
getBillNo
()
==
null
||
data
.
getBillNo
().
length
()
<=
0
)
{
tvBillNumber
.
setVisibility
(
View
.
GONE
);
tvBillNumber
.
setVisibility
(
View
.
GONE
);
if
(
data
.
getOrder_type
()
==
2
)
{
//外送
// 訂單類型
setText
(
view
,
R
.
id
.
tv_order_type
,
"外送"
);
if
(
data
.
getTakeFoodCode
()
!=
null
&&
!
data
.
getTakeFoodCode
().
equals
(
"0"
))
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"訂單碼:"
+
data
.
getTakeFoodCode
());
}
else
if
(
data
.
getBillNo
()
!=
null
&&
data
.
getBillNo
().
length
()
>
0
)
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"訂單碼:"
+
data
.
getTakeFoodCode
());
}
}
else
{
tvBillNumber
.
setText
(
"訂單號:"
+
data
.
getBillNo
());
setText
(
view
,
R
.
id
.
tv_order_type
,
"自取"
);
if
(
data
.
getBillNo
()
!=
null
&&
data
.
getBillNo
().
length
()
>
0
)
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"訂單碼:"
+
data
.
getBillNo
());
}
else
if
(
data
.
getTakeFoodCode
()
!=
null
&&
!
data
.
getTakeFoodCode
().
equals
(
"0"
))
{
setText
(
view
,
R
.
id
.
tv_order_take_food_code
,
"訂單碼:"
+
data
.
getTakeFoodCode
());
}
}
//訂單創建時間
setText
(
view
,
R
.
id
.
tv_order_create
,
context
.
getString
(
R
.
string
.
create_order_time
)
+
TimeUtils
.
parseTimeRepeat
(
data
.
getCREATE_TIME
(),
TimeUtils
.
DEFAULT_DATE_FORMAT
));
...
...
@@ -120,8 +126,8 @@ public class PrintOtherOrderClosing extends PrinterRoot {
//支付金額
setText
(
view
,
R
.
id
.
tv_pay_amount_text
,
data
.
getPayName
()
+
":"
+
amountUnit
+
MoneyUtil
.
sub
(
Double
.
parseDouble
(
data
.
getTOTAL_AMOUNT
()),
data
.
getDiscount_amount
()));
}
else
{
setIsShow
(
view
,
R
.
id
.
tv_pay_amount_text
,
false
);
setIsShow
(
view
,
R
.
id
.
tv_pay_amount_line
,
false
);
setIsShow
(
view
,
R
.
id
.
tv_pay_amount_text
,
false
);
setIsShow
(
view
,
R
.
id
.
tv_pay_amount_line
,
false
);
}
}
else
if
(
data
.
getOrderPayType
()
==
0
)
{
setText
(
view
,
R
.
id
.
tv_pay_type
,
"店內支付"
);
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrintServe.java
View file @
c1d4845a
...
...
@@ -11,6 +11,7 @@ import androidx.recyclerview.widget.RecyclerView;
import
com.gingersoft.gsa.cloud.base.adapter.print.BillAdapter
;
import
com.gingersoft.gsa.cloud.base.adapter.print.FoodAdapter
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BillingBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
...
...
@@ -70,9 +71,10 @@ public class PrintServe extends PrinterRoot {
TextView
checkOutTime
=
view
.
findViewById
(
R
.
id
.
tv_checkout_time
);
TextView
line_food_info
=
view
.
findViewById
(
R
.
id
.
line_food_info
);
TableBean
.
DataBean
tableBean
=
OpenTableManage
.
getDefault
().
getTableBean
();
tableNum
.
setText
(
tableBean
.
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
brandName
.
setText
(
GsaCloudApplication
.
getBrandName
(
context
));
restaurantName
.
setText
(
GsaCloudApplication
.
getRestaurantName
(
context
));
tableNum
.
setText
(
"餐檯:"
+
tableBean
.
getTableName
());
people
.
setText
(
"人數:"
+
OpenTableManage
.
getDefault
().
getPeopleNumber
());
orderData
.
setText
(
TimeUtils
.
getCurrentTimeInString
(
TimeUtils
.
DEFAULT_DATE_FORMAT
));
...
...
@@ -82,13 +84,15 @@ public class PrintServe extends PrinterRoot {
rvFood
.
setAdapter
(
foodAdapter
);
List
<
BillingBean
>
billingBeans
=
new
ArrayList
<>();
if
(
billingBeans
.
size
()
<=
0
)
{
line_food_info
.
setVisibility
(
View
.
GONE
);
}
else
{
BillAdapter
billAdapter
=
new
BillAdapter
(
billingBeans
);
rvBillAmount
.
setLayoutManager
(
new
LinearLayoutManager
(
context
));
rvBillAmount
.
setAdapter
(
billAdapter
);
}
// if (billingBeans.size() <= 0) {
line_food_info
.
setVisibility
(
View
.
GONE
);
rvBillAmount
.
setVisibility
(
View
.
GONE
);
view
.
findViewById
(
R
.
id
.
line_price_info
).
setVisibility
(
View
.
GONE
);
// } else {
// BillAdapter billAdapter = new BillAdapter(billingBeans);
// rvBillAmount.setLayoutManager(new LinearLayoutManager(context));
// rvBillAmount.setAdapter(billAdapter);
// }
if
(
OpenTableManage
.
getDefault
().
getTableBean
()
!=
null
)
{
tableNum
.
setText
(
OpenTableManage
.
getDefault
().
getTableBean
().
getTableName
());
people
.
setText
(
OpenTableManage
.
getDefault
().
getPeopleNumber
()
+
""
);
...
...
@@ -103,6 +107,8 @@ public class PrintServe extends PrinterRoot {
// totalAmount = MoneyUtil.sum(totalAmount, MoneyUtil.priceCalculation(OrderDetail.getPrice(), OrderDetail.getNumber()));
// }
//總金額
view
.
findViewById
(
R
.
id
.
tv_total_amount_text
).
setVisibility
(
View
.
GONE
);
mTvTotalAmount
.
setVisibility
(
View
.
GONE
);
mTvTotalAmount
.
setText
(
MyOrderManage
.
getInstance
().
getTotalAmount
()
+
""
);
//加载条形码
// ImageView ivBarCode = view.findViewById(R.id.iv_bar_code);
...
...
print-module/src/main/java/com/joe/print/mvp/print/PrinterRoot.java
View file @
c1d4845a
...
...
@@ -52,7 +52,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
public
final
static
int
PRINT_BILL
=
2
;
//結賬單
public
final
static
int
PRINT_KITCHEN
=
3
;
//送單,廚房單
public
final
static
int
PRINT_CLEAN_MACHINE
=
4
;
//清機報表
public
final
static
int
PRINT_OTHER_ORDER
=
5
;
//接單內容打印
public
final
static
int
PRINT_OTHER_ORDER
=
5
;
//接單內容打印
外送印單
public
final
static
int
PRINT_INSTRUCTION
=
6
;
//開錢箱
public
final
static
int
PRINT_OTHER_CLOSING
=
7
;
//外賣結賬單
...
...
@@ -436,6 +436,12 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
return
printerDeviceBean
;
}
}
String
printDeviceName
=
(
String
)
SPUtils
.
get
(
mContext
,
"defaultPrint"
,
""
);
for
(
PrinterDeviceBean
printerDeviceBean
:
printerDeviceBeans
)
{
if
(
printDeviceName
!=
null
&&
printDeviceName
.
equals
(
printerDeviceBean
.
getName
()))
{
return
printerDeviceBean
;
}
}
}
return
null
;
}
...
...
@@ -460,6 +466,7 @@ public abstract class PrinterRoot implements PrintSocketHolder.OnStateChangedLis
printListAdapter
.
setOnItemClickListener
((
adapter
,
view
,
position
)
->
{
//用戶選擇的ip打印機打印
ipDevicePrint
(
printerDeviceBeans
.
get
(
position
),
bitmaps
);
SPUtils
.
put
(
mContext
,
"defaultPrint"
,
printerDeviceBeans
.
get
(
position
).
getName
());
dialog
.
dismiss
();
});
}
...
...
print-module/src/main/java/com/joe/print/mvp/print/service/PrjService.java
View file @
c1d4845a
...
...
@@ -11,22 +11,26 @@ import androidx.annotation.Nullable;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtils
;
import
com.gingersoft.gsa.cloud.constans.HttpsConstans
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.utils.PrinterDeviceDaoUtils
;
import
com.gingersoft.gsa.cloud.print.PrintExecutor
;
import
com.gingersoft.gsa.cloud.print.PrintSocketHolder
;
import
com.joe.print.mvp.model.bean.PrintInfoBean
;
import
com.joe.print.mvp.model.bean.PrjBean
;
import
com.joe.print.mvp.print.EpsonPrint
;
import
com.joe.print.mvp.print.PrintPrjKitchen
;
import
com.joe.print.mvp.print.PrinterRoot
;
import
com.joe.print.mvp.print.utils.MyPrintUtils
;
import
org.json.JSONArray
;
import
org.json.JSONException
;
import
org.json.JSONObject
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -137,7 +141,7 @@ public class PrjService extends Service implements PrintSocketHolder.OnStateChan
//請求到數據,停止輪詢,開始打印,在打印完之後再重新開始輪詢
startPrint
(
s
);
//開啟另一個定時,三十秒之後自動請求,避免上面的打印成功或失敗時沒有回調。
if
(
wakeDisposable
!=
null
)
{
if
(
wakeDisposable
!=
null
)
{
wakeDisposable
.
dispose
();
}
Observable
.
timer
(
10
,
TimeUnit
.
SECONDS
)
...
...
@@ -195,6 +199,7 @@ public class PrjService extends Service implements PrintSocketHolder.OnStateChan
if
(
prjBean
==
null
||
prjBean
.
getData
()
==
null
)
{
return
;
}
Map
<
String
,
List
<
PrjBean
.
DataBean
.
Bean
>>
listMap
=
new
HashMap
<>();
try
{
JSONObject
jsonObject
=
new
JSONObject
(
prjBean
.
getData
());
//通过迭代器获取这段json当中所有的key值
...
...
@@ -205,37 +210,59 @@ public class PrjService extends Service implements PrintSocketHolder.OnStateChan
//最后就可以通过刚刚得到的key值去解析后面的json了
JSONArray
dataJson
=
(
JSONArray
)
jsonObject
.
get
(
key
);
List
<
PrjBean
.
DataBean
.
Bean
>
datas
=
JsonUtils
.
parseArray
(
dataJson
.
toString
(),
PrjBean
.
DataBean
.
Bean
.
class
);
// if (key.equals("-1")) {
// PrintPrjKitchen.getPrjMap().put("", datas);
// } else {
Log
.
e
(
"eee"
,
key
+
"打印數據條數:"
+
datas
.
size
());
listMap
.
put
(
key
,
datas
);
//打印位置和需要打印的數據
PrintPrjKitchen
.
getPrjMap
().
put
(
key
,
datas
);
// }
printDatas
.
addAll
(
datas
);
}
}
catch
(
JSONException
e
)
{
e
.
printStackTrace
();
}
// updatePrjState(3);
if
(
printerInIt
==
null
)
{
printerInIt
=
PrinterRoot
.
getPrinterByType
(
PRINT_KITCHEN
);
}
// if(printerInIt != null && printerInIt.getPrintBitmap(this).size() <=0){
// return;
// }
getPrintList
();
for
(
Map
.
Entry
<
String
,
List
<
PrjBean
.
DataBean
.
Bean
>>
prjMap
:
listMap
.
entrySet
())
{
for
(
PrinterDeviceBean
deviceBean
:
printerDeviceBeans
)
{
if
(
prjMap
.
getKey
().
equalsIgnoreCase
(
deviceBean
.
getName
()))
{
if
((
deviceBean
.
getPrinterName
()
!=
null
&&
deviceBean
.
getPrinterName
().
toLowerCase
().
contains
(
"EPSON"
.
toLowerCase
()))
&&
(
deviceBean
.
getModel
()
!=
null
&&
deviceBean
.
getModel
().
toLowerCase
().
contains
(
"TM-U220B"
.
toLowerCase
())))
{
//針式打印
//Epson打印機打印,調用對應的方法
EpsonPrint
mPrinter
=
EpsonPrint
.
getInstance
();
// PrinterStatusInfo status = mPrinter.getStatus();
// if (status != null && status.getPaper() == 2) {
// ToastUtils.show(this, "打印機缺紙");
// }
mPrinter
.
initializeObject
(
GsaCloudApplication
.
getAppContext
(),
null
);
int
paperWidth
=
42
;
if
(
deviceBean
.
getPaperSpecification
()
!=
null
)
{
paperWidth
=
(
int
)
(
Double
.
parseDouble
(
deviceBean
.
getPaperSpecification
())
/
6
);
}
PrintCurrencyBean
printCurrencyBean
=
MyPrintUtils
.
getInstance
().
getPrintCurrencyBeanByType
(
this
,
2
);
List
<
List
<
PrintInfoBean
>>
prjBeans
=
PrintInfoBean
.
transPrjBean
(
prjMap
.
getValue
(),
paperWidth
,
prjMap
.
getKey
(),
deviceBean
,
printCurrencyBean
);
for
(
List
<
PrintInfoBean
>
prjPrintBean
:
prjBeans
)
{
mPrinter
.
putPrintString
(
deviceBean
.
getIp
(),
paperWidth
,
prjPrintBean
);
}
}
}
}
}
if
(
printerInIt
!=
null
)
{
Log
.
e
(
"aaa"
,
"打印機數量:"
+
printerDeviceBeans
.
size
());
printerInIt
.
setmContext
(
this
);
for
(
Map
.
Entry
<
String
,
List
<
Bitmap
>>
entry
:
printerInIt
.
getPrintBitmap
(
this
).
entrySet
())
{
//遍歷所有的需要打印的內容
for
(
int
i
=
0
;
i
<
printerDeviceBeans
.
size
();
i
++
)
{
for
(
PrinterDeviceBean
deviceBean
:
printerDeviceBeans
)
{
//遍歷打印機列表,找到對應的打印機,沒找到的就不打印
if
(
entry
.
getKey
().
equalsIgnoreCase
(
printerDeviceBeans
.
get
(
i
).
getName
()))
{
Log
.
e
(
"eee"
,
entry
.
getKey
()
+
"開始打印IP:"
+
printerDeviceBeans
.
get
(
i
).
getIp
());
printerInIt
.
ipDevicePrint
(
printerDeviceBeans
.
get
(
i
),
entry
.
getValue
(),
this
,
this
);
break
;
if
(
entry
.
getKey
().
equalsIgnoreCase
(
deviceBean
.
getName
()))
{
if
((
deviceBean
.
getPrinterName
()
!=
null
&&
deviceBean
.
getPrinterName
().
toLowerCase
().
contains
(
"EPSON"
.
toLowerCase
()))
&&
(
deviceBean
.
getModel
()
!=
null
&&
deviceBean
.
getModel
().
toLowerCase
().
contains
(
"TM-U220B"
.
toLowerCase
())))
{
//針式打印機在上面處理
}
else
{
Log
.
e
(
"eee"
,
entry
.
getKey
()
+
"開始打印IP:"
+
deviceBean
.
getIp
());
printerInIt
.
ipDevicePrint
(
deviceBean
,
entry
.
getValue
(),
this
,
this
);
break
;
}
}
}
}
...
...
print-module/src/main/java/com/joe/print/mvp/print/utils/MyPrintUtils.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
print
.
utils
;
import
android.content.Context
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.bean.PrinterDeviceBean
;
import
com.gingersoft.gsa.cloud.database.utils.PrintCurrencyDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.PrinterDeviceDaoUtils
;
import
com.joe.print.R
;
import
java.util.List
;
public
class
MyPrintUtils
{
private
final
int
HEADER_TEXTSIZE
=
26
;
private
static
MyPrintUtils
myPrintUtils
;
public
static
MyPrintUtils
getInstance
()
{
if
(
myPrintUtils
==
null
)
{
myPrintUtils
=
new
MyPrintUtils
();
}
return
myPrintUtils
;
}
/**
* 通過類型獲取打印通用配置
*
* @param context
* @param type 1:堂食,2:外送
* @return
*/
public
PrintCurrencyBean
getPrintCurrencyBeanByType
(
Context
context
,
int
type
)
{
PrintCurrencyDaoUtils
printCurrencyDaoUtils
=
new
PrintCurrencyDaoUtils
(
context
);
List
<
PrintCurrencyBean
>
printCurrencyBeans
=
printCurrencyDaoUtils
.
queryAllPrintCurrencyBean
();
for
(
PrintCurrencyBean
printCurrencyBean
:
printCurrencyBeans
)
{
if
(
printCurrencyBean
.
getType
()
==
type
)
{
return
printCurrencyBean
;
}
}
return
null
;
}
/**
* 通過打印位置獲取打印機
*
* @param context
* @param printerDeviceName 打印機名稱:打印機位置
* @return
*/
public
PrinterDeviceBean
getPrinterDeviceByLocation
(
Context
context
,
String
printerDeviceName
)
{
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
context
);
List
<
PrinterDeviceBean
>
printerDeviceBeans
=
printerDeviceDaoUtils
.
queryAllPrinterDeviceBean
();
if
(
printerDeviceBeans
!=
null
&&
printerDeviceBeans
.
size
()
>
0
)
{
for
(
PrinterDeviceBean
printerDevice
:
printerDeviceBeans
)
{
if
(
printerDevice
.
getName
()
!=
null
&&
printerDevice
.
getName
().
equals
(
printerDeviceName
))
{
return
printerDevice
;
}
}
}
printerDeviceDaoUtils
.
closeConnection
();
return
null
;
}
/**
* 獲取默認打印機
*
* @param context
* @return
*/
public
PrinterDeviceBean
getDefaultPrinterDevice
(
Context
context
)
{
PrinterDeviceDaoUtils
printerDeviceDaoUtils
=
new
PrinterDeviceDaoUtils
(
context
);
List
<
PrinterDeviceBean
>
printerDeviceBeans
=
printerDeviceDaoUtils
.
queryAllPrinterDeviceBean
();
if
(
printerDeviceBeans
!=
null
&&
printerDeviceBeans
.
size
()
>
0
)
{
for
(
PrinterDeviceBean
printerDevice
:
printerDeviceBeans
)
{
if
(
printerDevice
.
getPrinterDeviceDefaultId
()
!=
null
)
{
return
printerDevice
;
}
}
}
printerDeviceDaoUtils
.
closeConnection
();
return
null
;
}
public
TextView
getBrandName
(
Context
context
)
{
return
getNormalTextView
(
context
,
GsaCloudApplication
.
getBrandName
(
context
),
HEADER_TEXTSIZE
);
}
public
TextView
getRestaurantName
(
Context
context
)
{
return
getNormalTextView
(
context
,
GsaCloudApplication
.
getRestaurantName
(
context
),
HEADER_TEXTSIZE
);
}
public
TextView
getDashedLine
(
Context
context
)
{
TextView
textView
=
getNormalTextView
(
context
,
context
.
getString
(
R
.
string
.
print_split_line
),
HEADER_TEXTSIZE
);
textView
.
setSingleLine
(
true
);
return
textView
;
}
public
TextView
getNormalTextView
(
Context
context
,
String
text
,
int
textSize
)
{
TextView
textView
=
new
TextView
(
context
);
textView
.
setText
(
text
);
textView
.
setTextSize
(
textSize
);
return
textView
;
}
}
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintAddCurrencyActivity.java
0 → 100644
View file @
c1d4845a
package
com
.
joe
.
print
.
mvp
.
ui
.
activity
;
import
android.app.Dialog
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.Switch
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.joe.print.R
;
import
com.joe.print.R2
;
import
com.joe.print.di.component.DaggerPrintAddCurrencyComponent
;
import
com.joe.print.di.module.PrintAddCurrencyModule
;
import
com.joe.print.mvp.contract.PrintAddCurrencyContract
;
import
com.joe.print.mvp.presenter.PrintAddCurrencyPresenter
;
import
com.gingersoft.gsa.cloud.ui.view.WheelView
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
java.util.ArrayList
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
public
class
PrintAddCurrencyActivity
extends
BaseActivity
<
PrintAddCurrencyPresenter
>
implements
PrintAddCurrencyContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R2
.
id
.
add_printer_currency_topbar
)
QMUITopBar
mTopBar
;
@BindView
(
R2
.
id
.
print_currency_table_mode
)
TextView
tvTableMode
;
@BindView
(
R2
.
id
.
tv_currency_add_food_color
)
TextView
tvFoodColor
;
@BindView
(
R2
.
id
.
tv_currency_add_food_item_color
)
TextView
tvFoodItemColor
;
@BindView
(
R2
.
id
.
tv_currency_add_food_font_size
)
TextView
tvFoodFontSize
;
@BindView
(
R2
.
id
.
tv_currency_add_food_item_font_size
)
TextView
tvFoodFontThickness
;
@BindView
(
R2
.
id
.
switch_currency_add_food_font_thickness
)
Switch
switchFoodFontThickness
;
@BindView
(
R2
.
id
.
switch_currency_add_food_item_font_thickness
)
Switch
switchFoodItemFontThickness
;
@BindView
(
R2
.
id
.
switch_currency_add_food_italic
)
Switch
switchFoodItalic
;
@BindView
(
R2
.
id
.
switch_currency_add_food_item_italic
)
Switch
switchFoodItemItalic
;
@BindView
(
R2
.
id
.
switch_currency_add_color_flip
)
Switch
switchColorFlip
;
private
PrintCurrencyBean
printCurrencyBean
;
private
int
typePosition
=
1
;
//1堂食,2外賣
private
int
foodColorPosition
=
0
;
//食品顏色 0黑色,1紅色,3 綠色
private
int
foodItemColorPosition
=
0
;
//細項顔色 0 黑色 1 紅色
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerPrintAddCurrencyComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
printAddCurrencyModule
(
new
PrintAddCurrencyModule
(
this
))
.
build
()
.
inject
(
this
);
}
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
return
R
.
layout
.
activity_print_add_currency
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
if
(
printCurrencyBean
!=
null
)
{
typePosition
=
printCurrencyBean
.
getType
();
foodColorPosition
=
printCurrencyBean
.
getFoodComplexion
();
foodItemColorPosition
=
printCurrencyBean
.
getModifierComplexion
();
setTableType
();
setFoodColor
();
setFoodItemColor
();
tvFoodFontSize
.
setText
(
printCurrencyBean
.
getFoodFont
());
tvFoodFontThickness
.
setText
(
printCurrencyBean
.
getModifierFont
());
switchFoodFontThickness
.
setChecked
(
printCurrencyBean
.
getFoodIsBold
()
==
1
);
switchFoodItemFontThickness
.
setChecked
(
printCurrencyBean
.
getModifierIsBold
()
==
1
);
switchFoodItalic
.
setChecked
(
printCurrencyBean
.
getFoodIsItalic
()
==
1
);
switchFoodItemItalic
.
setChecked
(
printCurrencyBean
.
getModifierIsItalic
()
==
1
);
switchColorFlip
.
setChecked
(
printCurrencyBean
.
getNumberIsFlip
()
==
1
);
}
else
{
//設置默認值
setTableType
();
setFoodColor
();
setFoodItemColor
();
}
}
private
void
setFoodItemColor
()
{
if
(
foodItemColorPosition
==
0
){
tvFoodItemColor
.
setText
(
"黑色"
);
}
else
if
(
foodItemColorPosition
==
1
){
tvFoodItemColor
.
setText
(
"綠色"
);
}
else
if
(
foodItemColorPosition
==
2
){
tvFoodItemColor
.
setText
(
"紅色"
);
}
}
private
void
setTableType
()
{
tvTableMode
.
setText
(
typePosition
==
1
?
"堂食"
:
"外送"
);
}
private
void
setFoodColor
()
{
if
(
foodColorPosition
==
0
)
{
tvFoodColor
.
setText
(
"黑色"
);
}
else
if
(
foodColorPosition
==
2
)
{
tvFoodColor
.
setText
(
"紅色"
);
}
else
if
(
foodColorPosition
==
1
)
{
tvFoodColor
.
setText
(
"綠色"
);
}
}
@Override
public
void
initIntent
()
{
printCurrencyBean
=
(
PrintCurrencyBean
)
getIntent
().
getSerializableExtra
(
"printCurrencyBean"
);
}
@Override
public
void
initTopBar
()
{
mTopBar
.
setTitle
(
"通用打印設置"
);
mTopBar
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
theme_color
));
mTopBar
.
addLeftImageButton
(
R
.
drawable
.
icon_return
,
R
.
id
.
iv_left_back
).
setOnClickListener
(
v
->
finish
());
}
@Override
public
void
initLanguage
()
{
}
@Override
public
void
initLayoutParams
()
{
}
@Override
public
void
initLayoutVisible
()
{
}
@Override
public
void
showLoading
(
String
message
)
{
}
@Override
public
void
hideLoading
()
{
}
@Override
public
void
showMessage
(
@NonNull
String
message
)
{
checkNotNull
(
message
);
ArmsUtils
.
snackbarText
(
message
);
}
@Override
public
void
launchActivity
(
@NonNull
Intent
intent
)
{
checkNotNull
(
intent
);
ArmsUtils
.
startActivity
(
intent
);
}
@Override
public
void
killMyself
()
{
finish
();
}
private
void
addCurrencyPrinter
()
{
if
(
printCurrencyBean
==
null
)
{
printCurrencyBean
=
new
PrintCurrencyBean
();
printCurrencyBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
this
));
}
printCurrencyBean
.
setUid
(
GsaCloudApplication
.
getMemberId
(
this
));
printCurrencyBean
.
setType
(
typePosition
);
printCurrencyBean
.
setFoodComplexion
(
foodColorPosition
);
printCurrencyBean
.
setModifierComplexion
(
foodItemColorPosition
);
printCurrencyBean
.
setFoodFont
(
tvFoodFontSize
.
getText
().
toString
());
printCurrencyBean
.
setModifierFont
(
tvFoodFontThickness
.
getText
().
toString
());
printCurrencyBean
.
setFoodIsBold
(
switchFoodFontThickness
.
isChecked
()
?
1
:
2
);
printCurrencyBean
.
setModifierIsBold
(
switchFoodItemFontThickness
.
isChecked
()
?
1
:
2
);
printCurrencyBean
.
setFoodIsItalic
(
switchFoodItalic
.
isChecked
()
?
1
:
2
);
printCurrencyBean
.
setModifierIsItalic
(
switchFoodItemItalic
.
isChecked
()
?
1
:
2
);
printCurrencyBean
.
setNumberIsFlip
(
switchColorFlip
.
isChecked
()
?
1
:
2
);
mPresenter
.
addCurrencyPresenter
(
printCurrencyBean
);
}
private
void
showSelectType
()
{
List
<
String
>
types
=
new
ArrayList
<>();
types
.
add
(
"堂食"
);
types
.
add
(
"外賣"
);
DialogUtils
.
showSelectPopop
(
this
,
types
,
"餐檯模式"
,
typePosition
,
i
->
{
typePosition
=
i
;
setTableType
();
});
}
private
void
showSelectFoodColor
()
{
List
<
String
>
types
=
new
ArrayList
<>();
types
.
add
(
"黑色"
);
types
.
add
(
"紅色"
);
// types.add("綠色");
DialogUtils
.
showSelectPopop
(
this
,
types
,
"食品顏色"
,
0
,
i
->
{
if
(
i
==
1
)
{
foodColorPosition
=
2
;
}
else
{
foodColorPosition
=
i
;
}
setFoodColor
();
});
}
private
void
showSelectFoodItemColor
()
{
List
<
String
>
types
=
new
ArrayList
<>();
types
.
add
(
"黑色"
);
types
.
add
(
"紅色"
);
DialogUtils
.
showSelectPopop
(
this
,
types
,
"細項顏色"
,
foodItemColorPosition
,
i
->
{
if
(
i
==
1
)
{
foodItemColorPosition
=
2
;
}
else
{
foodItemColorPosition
=
i
;
}
setFoodItemColor
();
});
}
private
void
showSelectFoodFontSize
(
TextView
view
)
{
List
<
String
>
types
=
new
ArrayList
<>();
types
.
add
(
"1"
);
types
.
add
(
"2"
);
types
.
add
(
"3"
);
types
.
add
(
"4"
);
types
.
add
(
"5"
);
types
.
add
(
"6"
);
DialogUtils
.
showSelectPopop
(
this
,
types
,
"字體大小"
,
0
,
i
->
view
.
setText
(
types
.
get
(
i
)));
}
@OnClick
({
R2
.
id
.
printer_add_currency
,
R2
.
id
.
layout_currency_add_table_mode
,
R2
.
id
.
layout_currency_add_food_color
,
R2
.
id
.
layout_currency_add_food_item_color
,
R2
.
id
.
layout_currency_add_food_font_size
,
R2
.
id
.
layout_currency_add_food_item_font_size
})
@Override
public
void
onClick
(
View
v
)
{
int
viewId
=
v
.
getId
();
if
(
viewId
==
R
.
id
.
printer_add_currency
)
{
//添加通用打印設置
addCurrencyPrinter
();
}
else
if
(
viewId
==
R
.
id
.
layout_currency_add_table_mode
)
{
//選擇模式
showSelectType
();
}
else
if
(
viewId
==
R
.
id
.
layout_currency_add_food_color
)
{
//食品顏色
showSelectFoodColor
();
}
else
if
(
viewId
==
R
.
id
.
layout_currency_add_food_item_color
)
{
//細項顏色
showSelectFoodItemColor
();
}
else
if
(
viewId
==
R
.
id
.
layout_currency_add_food_font_size
)
{
//食品字體大小
showSelectFoodFontSize
(
tvFoodFontSize
);
}
else
if
(
viewId
==
R
.
id
.
layout_currency_add_food_item_font_size
)
{
//細項字體大小
showSelectFoodFontSize
(
tvFoodFontThickness
);
}
}
@Override
public
void
addSuccess
(
boolean
isSuccess
)
{
if
(
isSuccess
)
{
ToastUtils
.
show
(
mContext
,
"保存成功"
);
finish
();
}
else
{
ToastUtils
.
show
(
mContext
,
"保存失敗"
);
}
}
}
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrintTestActivity.java
View file @
c1d4845a
...
...
@@ -35,11 +35,11 @@ public class PrintTestActivity extends AppCompatActivity implements PrintSocketH
// printInfoBeans.add(new PrintInfoBean(new String[]{"測試一行多少個字測試一行多少個字測試一"}, new double[]{1}, new String[]{"tw"}));
// printInfoBeans.add(new PrintInfoBean(new String[]{"asdfskjflsjflsjlfjslfjsldjflsjfsd"}, new double[]{1}, new String[]{"tw"}));
// printInfoBeans.add(new PrintInfoBean(new String[]{"純屬餐廳"}, new double[]{1}, new String[]{"tw"}));
//
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"外賣"
},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"訂單碼:
"
,
"0046"
},
new
Boolean
[]{
false
,
true
},
new
double
[]{
1
,
2
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"落單時間:
"
,
"07-13 19:05"
},
new
double
[]{
1
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"D1廚房
"
,
"BARRY1"
},
new
double
[]{
1
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"訂單碼:"
,
"0046"
},
new
Boolean
[]{
false
,
true
},
new
double
[]{
1
,
2
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"落單時間:"
,
"07-13 19:05"
},
new
double
[]{
1
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"D1廚房"
,
"BARRY1"
},
new
double
[]{
1
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
getLineBorder
(
""
,
1
)},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"1"
,
"食品名稱"
},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
printInfoBeans
.
add
(
new
PrintInfoBean
(
new
String
[]{
"1"
,
" 細項名稱"
},
new
Boolean
[]{
true
},
new
double
[]{
2
},
0
));
...
...
@@ -65,7 +65,7 @@ public class PrintTestActivity extends AppCompatActivity implements PrintSocketH
ToastUtils
.
show
(
this
,
"缺紙了"
);
}
mPrinter
.
initializeObject
(
GsaCloudApplication
.
getAppContext
(),
null
);
mPrinter
.
putPrintString
(
"192.168.1.203"
,
printInfoBeans
);
mPrinter
.
putPrintString
(
"192.168.1.203"
,
42
,
printInfoBeans
);
// new Thread(() -> {
// for (int j = 0; j < finalZoomBitmap.size(); j++) {
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterAddActivity.java
View file @
c1d4845a
...
...
@@ -37,9 +37,11 @@ import com.joe.print.mvp.contract.PrinterAddContract;
import
com.joe.print.mvp.presenter.PrinterAddPresenter
;
import
com.joe.print.mvp.print.PrinterRoot
;
import
com.joe.print.mvp.ui.adapter.SelectPrintAdapter
;
import
com.
joe.print.mvp
.ui.view.WheelView
;
import
com.
gingersoft.gsa.cloud
.ui.view.WheelView
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
org.w3c.dom.Text
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -72,6 +74,20 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
TextView
mTvFailNameTwo
;
@BindView
(
R2
.
id
.
print_device_name
)
TextView
mTvModel
;
@BindView
(
R2
.
id
.
tv_food_font_size
)
TextView
mTvFoodNameSize
;
//食品字體大小
@BindView
(
R2
.
id
.
tv_details_font_size
)
TextView
mTvdetailsFontSize
;
//細項字體大小
@BindView
(
R2
.
id
.
switch_print_device_food_font_thickness
)
Switch
mSwitchFontThickness
;
//食品是否加粗
@BindView
(
R2
.
id
.
switch_food_items_thickness
)
Switch
mSwitchFoodItemsThickness
;
//細項是否加粗
@BindView
(
R2
.
id
.
switch_food_italic
)
Switch
mSwitchFoodItalic
;
//食品是否斜體
@BindView
(
R2
.
id
.
switch_food_items_italic
)
Switch
mSwitchFoodItemsItalic
;
//細項是否斜體
@BindView
(
R2
.
id
.
switch_color_flip
)
Switch
mSwitchColorFlip
;
//是否翻轉
private
List
<
PrinterDeviceBean
>
devicess
;
private
PrinterDeviceBean
printerDeviceBean
;
...
...
@@ -101,7 +117,6 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
String
[]
ips
=
new
String
[
4
];
//如果不為空,則是編輯打印機,初始化信息
if
(
printerDeviceBean
!=
null
)
{
...
...
@@ -139,6 +154,20 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
}
}
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
printerDeviceBean
.
getFoodFont
()))
{
mTvFoodNameSize
.
setText
(
printerDeviceBean
.
getFoodFont
());
}
if
(!
TextUtil
.
isEmptyOrNullOrUndefined
(
printerDeviceBean
.
getModifierFont
()))
{
mTvdetailsFontSize
.
setText
(
printerDeviceBean
.
getModifierFont
());
}
mSwitchFontThickness
.
setChecked
(
printerDeviceBean
.
getFoodIsBold
()
==
1
);
mSwitchFoodItemsThickness
.
setChecked
(
printerDeviceBean
.
getModifierIsBold
()
==
1
);
mSwitchFoodItalic
.
setChecked
(
printerDeviceBean
.
getFoodIsItalic
()
==
1
);
mSwitchFoodItemsItalic
.
setChecked
(
printerDeviceBean
.
getModifierIsItalic
()
==
1
);
mSwitchColorFlip
.
setChecked
(
printerDeviceBean
.
getNumberIsFlip
()
==
1
);
}
else
{
mTvFoodNameSize
.
setText
(
"1"
);
mTvdetailsFontSize
.
setText
(
"1"
);
}
//添加監聽
for
(
int
i
=
0
;
i
<
ipEdits
.
length
;
i
++)
{
...
...
@@ -147,6 +176,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
if
(
ips
.
length
>
i
)
{
ipEdits
[
i
].
setText
(
ips
[
i
]);
}
ipEdits
[
i
].
clearFocus
();
}
}
...
...
@@ -230,51 +260,81 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
finish
();
}
@OnClick
({
R2
.
id
.
printer_add
,
R2
.
id
.
layout_select_fail_one
,
R2
.
id
.
layout_select_fail_two
,
R2
.
id
.
layout_print_device
})
private
void
showSelectFoodFontSize
(
TextView
textView
)
{
List
<
String
>
types
=
new
ArrayList
<>();
types
.
add
(
"1"
);
types
.
add
(
"2"
);
types
.
add
(
"3"
);
types
.
add
(
"4"
);
types
.
add
(
"5"
);
DialogUtils
.
showSelectPopop
(
this
,
types
,
"餐檯模式"
,
0
,
i
->
textView
.
setText
(
types
.
get
(
i
)));
}
@OnClick
({
R2
.
id
.
printer_add
,
R2
.
id
.
layout_select_fail_one
,
R2
.
id
.
layout_select_fail_two
,
R2
.
id
.
layout_print_device
,
R2
.
id
.
layout_print_device_food_font_size
,
R2
.
id
.
layout_print_device_food_item_font_size
})
@Override
public
void
onClick
(
View
v
)
{
int
id
=
v
.
getId
();
if
(
id
==
R
.
id
.
printer_add
||
id
==
R
.
id
.
print_test
)
{
//添加或編輯或測試打印
addOrTestPrint
(
v
);
}
else
if
(
id
==
R
.
id
.
layout_select_fail_one
||
id
==
R
.
id
.
layout_select_fail_two
)
{
if
(
devicess
==
null
||
devicess
.
size
()
<=
0
)
{
showMessage
(
"沒有其他打印機"
);
return
;
}
//選擇飛單
selectFailPrint
(
id
);
}
else
if
(
id
==
R
.
id
.
layout_print_device
)
{
if
(
printModelBeans
==
null
||
printModelBeans
.
size
()
<=
0
)
{
ToastUtils
.
show
(
mContext
,
"請先添加打印機機型"
);
return
;
}
//選擇打印機機型
new
DialogUtils
(
this
,
R
.
layout
.
dialog_select_print_device
)
{
@Override
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
WheelView
wheelView
=
hepler
.
getView
(
R
.
id
.
wv_model
);
wheelView
.
setOffset
(
1
);
if
(
modelPosition
>=
0
)
{
wheelView
.
setSeletion
(
modelPosition
);
}
selectPrintModel
();
}
else
if
(
id
==
R
.
id
.
layout_print_device_food_font_size
)
{
//選擇食品字體大小
showSelectFoodFontSize
(
mTvFoodNameSize
);
}
else
if
(
id
==
R
.
id
.
layout_print_device_food_item_font_size
)
{
//選擇食品細項字體大小
showSelectFoodFontSize
(
mTvdetailsFontSize
);
}
}
wheelView
.
setItems
(
printModelLabels
);
hepler
.
getView
(
R
.
id
.
btn_cancel
).
setOnClickListener
(
v
->
dialog
.
dismiss
());
hepler
.
getView
(
R
.
id
.
btn_confirm
).
setOnClickListener
(
v
->
{
modelPosition
=
wheelView
.
getSeletedIndex
();
mTvModel
.
setText
(
wheelView
.
getSeletedItem
());
mTvModel
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
color_3c
));
dialog
.
dismiss
();
});
/**
* 選擇打印機機型
*/
private
void
selectPrintModel
()
{
if
(
printModelBeans
==
null
||
printModelBeans
.
size
()
<=
0
)
{
ToastUtils
.
show
(
mContext
,
"請先添加打印機機型"
);
return
;
}
new
DialogUtils
(
this
,
R
.
layout
.
dialog_select_print_device
)
{
@Override
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
WheelView
wheelView
=
hepler
.
getView
(
R
.
id
.
wv_model
);
wheelView
.
setOffset
(
1
);
if
(
modelPosition
>=
0
)
{
wheelView
.
setSeletion
(
modelPosition
);
}
wheelView
.
setItems
(
printModelLabels
);
hepler
.
getView
(
R
.
id
.
btn_cancel
).
setOnClickListener
(
v
->
dialog
.
dismiss
());
hepler
.
getView
(
R
.
id
.
btn_confirm
).
setOnClickListener
(
v
->
{
modelPosition
=
wheelView
.
getSeletedIndex
();
mTvModel
.
setText
(
wheelView
.
getSeletedItem
());
mTvModel
.
setTextColor
(
getResources
().
getColor
(
R
.
color
.
color_3c
));
dialog
.
dismiss
();
});
}
.
setWidth
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
)
.
setGravity
(
Gravity
.
BOTTOM
)
.
show
();
}
.
setWidth
(
WindowManager
.
LayoutParams
.
MATCH_PARENT
)
.
setGravity
(
Gravity
.
BOTTOM
)
.
show
();
}
/**
* 選擇飛單
*/
private
void
selectFailPrint
(
int
viewId
)
{
if
(
devicess
==
null
||
devicess
.
size
()
<=
0
)
{
showMessage
(
"沒有其他打印機"
);
return
;
}
// 彈窗,顯示除當前打印機外所有打印機,
new
DialogUtils
(
this
,
R
.
layout
.
dialog_select_print
)
{
@Override
...
...
@@ -316,7 +376,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
* 添加或測試打印機
*/
private
void
addOrTestPrint
(
View
v
)
{
if
(
mEdPrintName
.
getText
()
==
null
||
mEdPrintName
.
getText
().
toString
().
isEmpty
(
))
{
if
(
!
editTextIsNull
(
mEdPrintName
))
{
ToastUtils
.
show
(
mContext
,
"請輸入打印機名稱"
);
return
;
}
...
...
@@ -324,6 +384,7 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
ToastUtils
.
show
(
mContext
,
"打印機名稱禁止輸入%字符"
);
return
;
}
//保存打印機信息
StringBuilder
ipAddress
=
new
StringBuilder
();
for
(
EditText
editText
:
ipEdits
)
{
...
...
@@ -334,76 +395,69 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
ipAddress
.
append
(
editText
.
getText
());
ipAddress
.
append
(
"."
);
}
hideKeyBoard
();
int
paperType
=
1
;
//打印紙類型
// if (rgPaperType.getCheckedRadioButtonId() != R.id.print_paper_size_58) {
// paperType = 2;
// }
String
port
=
etPort
.
getText
().
toString
();
PrinterDeviceBean
deviceBean
;
if
(
printerDeviceBean
!=
null
)
{
deviceBean
=
printerDeviceBean
;
}
else
{
deviceBean
=
new
PrinterDeviceBean
();
if
(
printerDeviceBean
==
null
)
{
printerDeviceBean
=
new
PrinterDeviceBean
();
}
d
eviceBean
.
setName
(
mEdPrintName
.
getText
().
toString
().
trim
());
d
eviceBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
d
eviceBean
.
setIp
(
ipAddress
.
substring
(
0
,
ipAddress
.
lastIndexOf
(
"."
)));
printerD
eviceBean
.
setName
(
mEdPrintName
.
getText
().
toString
().
trim
());
printerD
eviceBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
printerD
eviceBean
.
setIp
(
ipAddress
.
substring
(
0
,
ipAddress
.
lastIndexOf
(
"."
)));
if
(
TextUtil
.
isEmptyOrNullOrUndefined
(
port
))
{
d
eviceBean
.
setPort
(
9100
);
printerD
eviceBean
.
setPort
(
9100
);
}
else
{
d
eviceBean
.
setPort
(
Integer
.
parseInt
(
port
));
printerD
eviceBean
.
setPort
(
Integer
.
parseInt
(
port
));
}
//飛單打印機
if
(
oneFailPosition
!=
-
1
)
{
d
eviceBean
.
setFlyPrinterDeviceId
(
devicess
.
get
(
oneFailPosition
).
getId
());
printerD
eviceBean
.
setFlyPrinterDeviceId
(
devicess
.
get
(
oneFailPosition
).
getId
());
}
if
(
twoFailPosition
!=
-
1
)
{
d
eviceBean
.
setFlyPrinterDeviceId2
(
devicess
.
get
(
twoFailPosition
).
getId
());
printerD
eviceBean
.
setFlyPrinterDeviceId2
(
devicess
.
get
(
twoFailPosition
).
getId
());
}
//是否默認
deviceBean
.
setType
(
mSwitchDefalute
.
isChecked
()
?
2
:
1
);
printerDeviceBean
.
setType
(
mSwitchDefalute
.
isChecked
()
?
2
:
1
);
//打印機機型
if
(
modelPosition
<
0
)
{
//modelPosition小於0,說明用戶沒有選擇機型
if
(
printerDeviceBean
!=
null
)
{
//如果打印機以前的信息不為空,則用之前的機型信息
deviceBean
.
setPrinterModelId
(
printerDeviceBean
.
getPrinterModelId
());
deviceBean
.
setPaperSpecification
(
printerDeviceBean
.
getPaperSpecification
());
}
}
else
{
if
(
modelPosition
>=
0
)
{
//如果用戶選擇了打印機機型,判斷機型數據是否為空,不為空就設置機型信息
if
(
printModelBeans
!=
null
&&
printModelBeans
.
size
()
>
modelPosition
)
{
d
eviceBean
.
setPrinterModelId
((
long
)
printModelBeans
.
get
(
modelPosition
).
getId
());
d
eviceBean
.
setPaperSpecification
(
printModelBeans
.
get
(
modelPosition
).
getPaperSpecification
());
printerD
eviceBean
.
setPrinterModelId
((
long
)
printModelBeans
.
get
(
modelPosition
).
getId
());
printerD
eviceBean
.
setPaperSpecification
(
printModelBeans
.
get
(
modelPosition
).
getPaperSpecification
());
}
}
if
(
d
eviceBean
.
getPrinterModelId
()
==
null
)
{
if
(
printerD
eviceBean
.
getPrinterModelId
()
==
null
)
{
ToastUtils
.
show
(
mContext
,
"請選擇打印機機型"
);
return
;
}
if
(
editTextIsNull
(
mTvFoodNameSize
))
{
printerDeviceBean
.
setFoodFont
(
mTvFoodNameSize
.
getText
().
toString
());
}
if
(
editTextIsNull
(
mTvdetailsFontSize
))
{
printerDeviceBean
.
setModifierFont
(
mTvdetailsFontSize
.
getText
().
toString
());
}
printerDeviceBean
.
setFoodIsBold
(
mSwitchFontThickness
.
isChecked
()
?
1
:
2
);
printerDeviceBean
.
setModifierIsBold
(
mSwitchFoodItemsThickness
.
isChecked
()
?
1
:
2
);
printerDeviceBean
.
setFoodIsItalic
(
mSwitchFoodItalic
.
isChecked
()
?
1
:
2
);
printerDeviceBean
.
setModifierIsItalic
(
mSwitchFoodItemsItalic
.
isChecked
()
?
1
:
2
);
printerDeviceBean
.
setNumberIsFlip
(
mSwitchColorFlip
.
isChecked
()
?
1
:
2
);
//添加打印機
if
(
v
.
getId
()
==
R
.
id
.
printer_add
)
{
if
(
isEditPrinter
&&
printerDeviceBean
!=
null
)
{
deviceBean
.
setId
(
printerDeviceBean
.
getId
());
deviceBean
.
setRestaurantId
(
null
);
deviceBean
.
setUid
((
long
)
GsaCloudApplication
.
getMemberId
(
mContext
));
mPresenter
.
updatePrinterInfo
(
deviceBean
);
if
(
isEditPrinter
)
{
printerDeviceBean
.
setRestaurantId
(
null
);
printerDeviceBean
.
setUid
((
long
)
GsaCloudApplication
.
getMemberId
(
mContext
));
mPresenter
.
updatePrinterInfo
(
printerDeviceBean
);
}
else
{
d
eviceBean
.
setUid
(
null
);
d
eviceBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
mPresenter
.
addPrinter
(
d
eviceBean
);
printerD
eviceBean
.
setUid
(
null
);
printerD
eviceBean
.
setRestaurantId
(
GsaCloudApplication
.
getRestaurantId
(
mContext
));
mPresenter
.
addPrinter
(
printerD
eviceBean
);
}
}
else
if
(
v
.
getId
()
==
R
.
id
.
print_test
)
{
//打印測試
CC
.
obtainBuilder
(
"Component.Print"
)
.
addParam
(
PrintConstans
.
PRINT_TYPE
,
PrinterRoot
.
PRINT_TEST
)
.
addParam
(
"deviceBean"
,
d
eviceBean
)
.
addParam
(
"deviceBean"
,
printerD
eviceBean
)
.
setActionName
(
"printActivity"
)
.
build
()
.
callAsyncCallbackOnMainThread
((
cc
,
result
)
->
{
...
...
@@ -415,6 +469,10 @@ public class PrinterAddActivity extends BaseActivity<PrinterAddPresenter> implem
}
}
private
boolean
editTextIsNull
(
TextView
edit
)
{
return
(
edit
!=
null
&&
edit
.
getText
()
!=
null
&&
!
TextUtil
.
isEmptyOrNullOrUndefined
(
edit
.
getText
().
toString
()));
}
private
void
hideKeyBoard
()
{
//收起鍵盤
InputMethodManager
imm
=
(
InputMethodManager
)
mContext
.
getSystemService
(
Context
.
INPUT_METHOD_SERVICE
);
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterListActivity.java
View file @
c1d4845a
...
...
@@ -85,11 +85,11 @@ public class PrinterListActivity extends BaseFragmentActivity<PrintListPresenter
private
void
initViewPager
()
{
List
<
String
>
titles
=
new
ArrayList
<>();
List
<
Fragment
>
mFragments
=
new
ArrayList
<>();
if
(
PrintUtils
.
isPrintDevice
())
{
titles
.
add
(
"本機打印
"
);
mFragments
.
add
(
LocalPrintFragment
.
newInstance
());
}
titles
.
add
(
"
網絡打印
"
);
//
if (PrintUtils.isPrintDevice()) {
titles
.
add
(
"通用打印設定
"
);
mFragments
.
add
(
LocalPrintFragment
.
newInstance
());
//
}
titles
.
add
(
"
打印機設定
"
);
ipPrintListActivityFragment
=
IpPrintListActivityFragment
.
newInstance
();
mFragments
.
add
(
ipPrintListActivityFragment
);
...
...
@@ -114,8 +114,13 @@ public class PrinterListActivity extends BaseFragmentActivity<PrintListPresenter
topBar
.
setBackgroundColor
(
getResources
().
getColor
(
R
.
color
.
theme_color
));
topBar
.
addLeftImageButton
(
R
.
drawable
.
icon_return
,
R
.
id
.
iv_left_back
).
setOnClickListener
(
v
->
finish
());
topBar
.
addRightImageButton
(
R
.
drawable
.
ic_add
,
R
.
id
.
printer_add
).
setOnClickListener
(
v
->
{
if
(
ipPrintListActivityFragment
!=
null
&&
ipPrintListActivityFragment
.
isAdded
())
{
ipPrintListActivityFragment
.
startToEditPrint
(-
1
);
if
(
mViewPager
.
getCurrentItem
()
==
0
)
{
//添加通用打印
startActivity
(
new
Intent
(
this
,
PrintAddCurrencyActivity
.
class
));
}
else
{
if
(
ipPrintListActivityFragment
!=
null
&&
ipPrintListActivityFragment
.
isAdded
())
{
ipPrintListActivityFragment
.
startToEditPrint
(-
1
);
}
}
});
}
...
...
print-module/src/main/java/com/joe/print/mvp/ui/adapter/DialogPrinterListAdapter.java
View file @
c1d4845a
...
...
@@ -24,7 +24,7 @@ public class DialogPrinterListAdapter extends BaseQuickAdapter<PrinterDeviceBean
@Override
protected
void
convert
(
BaseViewHolder
helper
,
PrinterDeviceBean
item
)
{
helper
.
setText
(
R
.
id
.
tv_printer_name
,
item
.
get
Ip
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_printer_name
,
item
.
get
Name
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_printer_ip
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_ip
),
item
.
getIp
()));
helper
.
setText
(
R
.
id
.
tv_printer_port
,
String
.
format
(
mContext
.
getString
(
R
.
string
.
print_port
),
item
.
getPort
()
+
""
));
}
...
...
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
View file @
c1d4845a
...
...
@@ -6,13 +6,18 @@ import android.os.Message;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.widget.LinearLayout
;
import
android.widget.Switch
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.database.bean.PrintCurrencyBean
;
import
com.gingersoft.gsa.cloud.database.utils.PrintCurrencyDaoUtils
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
...
...
@@ -22,6 +27,10 @@ import com.joe.print.di.component.DaggerLocalPrintComponent;
import
com.joe.print.di.module.LocalPrintModule
;
import
com.joe.print.mvp.contract.LocalPrintContract
;
import
com.joe.print.mvp.presenter.LocalPrintPresenter
;
import
com.joe.print.mvp.print.PrintUtils
;
import
com.joe.print.mvp.ui.activity.PrintAddCurrencyActivity
;
import
java.util.List
;
import
butterknife.BindView
;
...
...
@@ -33,6 +42,10 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
public
class
LocalPrintFragment
extends
BaseFragment
<
LocalPrintPresenter
>
implements
LocalPrintContract
.
View
{
@BindView
(
R2
.
id
.
iv_location_print_btn
)
Switch
ivSetLocationPrintBtn
;
@BindView
(
R2
.
id
.
layout_location_print
)
LinearLayout
mLayoutLocationPrint
;
@BindView
(
R2
.
id
.
layout_currency_content
)
LinearLayout
currencyContent
;
public
static
LocalPrintFragment
newInstance
()
{
LocalPrintFragment
fragment
=
new
LocalPrintFragment
();
...
...
@@ -57,13 +70,15 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
@Override
public
void
onResume
()
{
super
.
onResume
();
mPresenter
.
getPrinterCurrencyList
(
GsaCloudApplication
.
getRestaurantId
(
getActivity
()));
initBtn
();
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
mLayoutLocationPrint
.
setVisibility
(
PrintUtils
.
isPrintDevice
()
?
View
.
VISIBLE
:
View
.
GONE
);
ivSetLocationPrintBtn
.
setOnCheckedChangeListener
((
buttonView
,
isChecked
)
->
{
if
(
isChecked
)
{
if
(
isChecked
)
{
//修改默認打印方式為本地
SPUtils
.
put
(
mContext
,
PrintConstans
.
DEFAULT_PRINT_METHOD
,
PrintConstans
.
LOCAL_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
true
);
...
...
@@ -151,4 +166,45 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
public
void
killMyself
()
{
}
@Override
public
void
loadView
(
List
<
PrintCurrencyBean
>
printCurrencyBeans
)
{
currencyContent
.
removeAllViews
();
PrintCurrencyDaoUtils
printCurrencyDaoUtils
=
new
PrintCurrencyDaoUtils
(
getActivity
());
printCurrencyDaoUtils
.
deleteAll
();
if
(
printCurrencyBeans
!=
null
)
{
printCurrencyDaoUtils
.
insertMultPrintCurrencyBean
(
printCurrencyBeans
);
}
if
(
printCurrencyBeans
!=
null
)
{
for
(
int
i
=
0
;
i
<
printCurrencyBeans
.
size
();
i
++)
{
View
view
=
LayoutInflater
.
from
(
getActivity
()).
inflate
(
R
.
layout
.
print_currency_item
,
null
);
TextView
tvType
=
view
.
findViewById
(
R
.
id
.
tv_currency_print_type
);
TextView
tvFoodColor
=
view
.
findViewById
(
R
.
id
.
tv_currency_print_food_color
);
TextView
tvFoodItemColor
=
view
.
findViewById
(
R
.
id
.
tv_currency_print_food_items_color
);
tvType
.
setText
(
printCurrencyBeans
.
get
(
i
).
getType
()
==
1
?
"堂食"
:
"外送"
);
if
(
printCurrencyBeans
.
get
(
i
).
getFoodComplexion
()
==
0
)
{
tvFoodColor
.
setText
(
"黑色"
);
}
else
if
(
printCurrencyBeans
.
get
(
i
).
getFoodComplexion
()
==
1
)
{
tvFoodColor
.
setText
(
"紅色"
);
}
else
if
(
printCurrencyBeans
.
get
(
i
).
getFoodComplexion
()
==
3
)
{
tvFoodColor
.
setText
(
"綠色"
);
}
tvFoodItemColor
.
setText
(
printCurrencyBeans
.
get
(
i
).
getModifierComplexion
()
==
0
?
"黑色"
:
"紅色"
);
view
.
findViewById
(
R
.
id
.
iv_currency_print_delete
).
setOnClickListener
(
v
->
{
//刪除
});
int
finalI
=
i
;
view
.
setOnClickListener
(
v
->{
//編輯
Intent
intent
=
new
Intent
(
mContext
,
PrintAddCurrencyActivity
.
class
);
intent
.
putExtra
(
"printCurrencyBean"
,
printCurrencyBeans
.
get
(
finalI
));
startActivity
(
intent
);
});
currencyContent
.
addView
(
view
);
}
}
}
}
print-module/src/main/res/layout/activity_ip_print_setting_fragment.xml
deleted
100644 → 0
View file @
786854c5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/activity_print.xml
deleted
100644 → 0
View file @
786854c5
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:orientation=
"vertical"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/activity_print_add_currency.xml
0 → 100644
View file @
c1d4845a
<?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"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
<com.qmuiteam.qmui.widget.QMUITopBar
android:id=
"@+id/add_printer_currency_topbar"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/head_height"
app:qmui_topbar_text_btn_color_state_list=
"@color/theme_white_color"
app:qmui_topbar_title_color=
"@color/theme_white_color"
/>
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:layout_height=
"0dp"
android:layout_weight=
"1"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
>
<RelativeLayout
android:id=
"@+id/layout_currency_add_table_mode"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_currency_table_mode_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"餐檯模式"
/>
<ImageView
android:id=
"@+id/iv_currency_table_mode_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/print_currency_table_mode"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_currency_table_mode_arrow"
android:layout_toRightOf=
"@id/tv_currency_table_mode_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:id=
"@+id/layout_currency_add_food_color"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"食品顏色"
/>
<TextView
android:id=
"@+id/tv_currency_add_food_color"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_weight=
"1"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:id=
"@+id/layout_currency_add_food_item_color"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"細項顏色"
/>
<TextView
android:id=
"@+id/tv_currency_add_food_item_color"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_weight=
"1"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:id=
"@+id/layout_currency_add_food_font_size"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"食品字體大小"
/>
<TextView
android:id=
"@+id/tv_currency_add_food_font_size"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_weight=
"1"
android:gravity=
"right"
android:text=
"2"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:id=
"@+id/layout_currency_add_food_item_font_size"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"細項字體大小"
/>
<TextView
android:id=
"@+id/tv_currency_add_food_item_font_size"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_weight=
"1"
android:gravity=
"right"
android:text=
"2"
android:textColor=
"@color/color_3c"
android:textSize=
"@dimen/dp_16"
/>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:src=
"@drawable/ic_black_next_arrow"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"食品是否加粗"
/>
<Switch
android:id=
"@+id/switch_currency_add_food_font_thickness"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"細項是否加粗"
/>
<Switch
android:id=
"@+id/switch_currency_add_food_item_font_thickness"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"食品斜體"
/>
<Switch
android:id=
"@+id/switch_currency_add_food_italic"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"細項斜體"
/>
<Switch
android:id=
"@+id/switch_currency_add_food_item_italic"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 數量大於1顏色是否翻轉-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"數量大於1顏色是否翻轉"
/>
<Switch
android:id=
"@+id/switch_currency_add_color_flip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/printer_add_currency"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/printer_add_input_paddingLeft"
android:layout_marginRight=
"@dimen/printer_add_input_paddingLeft"
android:layout_marginBottom=
"@dimen/dp_20"
android:background=
"@drawable/shape_app_btn"
android:gravity=
"center"
android:paddingTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
android:text=
"保存"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_16"
/>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/fragment_local_print.xml
View file @
c1d4845a
<?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"
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:gravity=
"center"
android:orientation=
"vertical"
>
<LinearLayout
android:id=
"@+id/layout_location_print"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"wrap_content"
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"默認本機打印"
/>
<Switch
android:id=
"@+id/iv_location_print_btn"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_20"
android:text=
"設置默認打印為本機打印"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
app:layout_constraintBottom_toBottomOf=
"@id/iv_location_print_btn"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"@id/iv_location_print_btn"
/>
<Switch
android:id=
"@+id/iv_location_print_btn"
android:layout_width=
"wrap_content"
android:paddingTop=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_currency_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"類型"
/>
<TextView
style=
"@style/print_currency_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"食品顏色"
/>
<TextView
style=
"@style/print_currency_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"細項顏色"
/>
<TextView
style=
"@style/print_currency_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"操作"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
android:id=
"@+id/layout_currency_content"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/dp_20"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
android:orientation=
"vertical"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/print_confirm_order_view.xml
View file @
c1d4845a
...
...
@@ -6,360 +6,373 @@
android:orientation=
"vertical"
android:paddingBottom=
"@dimen/dp_20"
>
<TextView
android:id=
"@+id/tv_brand_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"品牌名"
/>
<TextView
android:id=
"@+id/tv_restaurant_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"餐廳名"
/>
<RelativeLayout
<ScrollView
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
>
android:layout_height=
"match_parent"
>
<TextView
android:id=
"@+id/tv_order_type"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:text=
'外送'
android:textSize=
"@dimen/dp_35"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_order_type"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_order_type"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_pay_type"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"在線支付:"
/>
<TextView
android:id=
"@+id/tv_delivery_time"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:textColor=
"@color/theme_333_color"
android:textStyle=
"bold"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_order_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'單號:'
/>
<TextView
android:id=
"@+id/tv_bill_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'訂單號:'
/>
<TextView
android:id=
"@+id/tv_order_take_food_code"
style=
"@style/print_other_order_thirty_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/dp_50"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_order_create"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'開單時間'
/>
<TextView
android:id=
"@+id/tv_order_closing"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:visibility=
"gone"
android:layout_height=
"wrap_content"
/>
<TextView
android:id=
"@+id/tv_remark"
style=
"@style/print_other_order_thirty_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:textStyle=
"bold"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tv_application"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:text=
"項目"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_application"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_application"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_order_print_food"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_bill"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
app:layout_constraintTop_toBottomOf=
"@id/tv_total_text"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_total_text"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"總金額:"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_total"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_weight=
"1"
android:gravity=
"right"
android:textStyle=
"bold"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_pay_amount_text"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"支付金額:"
/>
<TextView
android:id=
"@+id/tv_pay_amount_line"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_member_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員號碼:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_member_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員名稱:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_member_phone"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員電話:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_oldPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"上次積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_addPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"本次積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_nowPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"結餘積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/line_member_info"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_address"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"地址:"
android:textSize=
"@dimen/dp_26"
/>
<TextView
android:id=
"@+id/tv_receiver"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"收貨人:"
/>
<TextView
android:id=
"@+id/tv_phone"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"手機號:"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
android:textColor=
"@color/theme_333_color"
android:visibility=
"visible"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"親愛的顧客,祝您用餐愉快,如您遇到任何問題請撥打8200 2022聯繫我們,期待您的下次光臨。"
android:visibility=
"gone"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:visibility=
"gone"
>
<TextView
android:id=
"@+id/tv_bottom_time"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:text=
"2020-04-25 12:00:36 GS Support pos1"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_bottom_time"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_bottom_time_right_line"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_bottom_time"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
</LinearLayout>
android:orientation=
"vertical"
>
<TextView
android:id=
"@+id/tv_brand_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_20"
android:text=
"品牌名"
/>
<TextView
android:id=
"@+id/tv_restaurant_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"餐廳名"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
>
<TextView
android:id=
"@+id/tv_order_type"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:text=
'外送'
android:textSize=
"@dimen/dp_35"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_order_type"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_order_type"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
<TextView
android:id=
"@+id/tv_pay_type"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"在線支付:"
/>
<TextView
android:id=
"@+id/tv_delivery_time"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"盡快送達"
android:textColor=
"@color/theme_333_color"
android:textStyle=
"bold"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_order_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'單號:'
/>
<TextView
android:id=
"@+id/tv_bill_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'訂單號:'
/>
<TextView
android:id=
"@+id/tv_order_take_food_code"
style=
"@style/print_other_order_thirty_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/dp_50"
android:textStyle=
"bold"
/>
<TextView
android:id=
"@+id/tv_order_create"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
'開單時間'
/>
<TextView
android:id=
"@+id/tv_order_closing"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_remark"
style=
"@style/print_other_order_thirty_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:textStyle=
"bold"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
android:id=
"@+id/tv_application"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:text=
"項目"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_application"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_application"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_order_print_food"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_bill"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
app:layout_constraintTop_toBottomOf=
"@id/tv_total_text"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_total_text"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:text=
"總金額:"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<TextView
android:id=
"@+id/tv_total"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_weight=
"1"
android:gravity=
"right"
android:textStyle=
"bold"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_pay_amount_text"
style=
"@style/print_other_order_thirty_bold_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"支付金額:"
/>
<TextView
android:id=
"@+id/tv_pay_amount_line"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_member_number"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員號碼:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_member_name"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員名稱:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_member_phone"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"會員電話:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_oldPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"上次積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_addPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"本次積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_nowPoints"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"結餘積分:"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/line_member_info"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
android:visibility=
"gone"
/>
<TextView
android:id=
"@+id/tv_address"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"地址:"
android:textSize=
"@dimen/dp_26"
/>
<TextView
android:id=
"@+id/tv_receiver"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"收貨人:"
/>
<TextView
android:id=
"@+id/tv_phone"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_5"
android:text=
"手機號:"
/>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
android:textColor=
"@color/theme_333_color"
android:visibility=
"visible"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"親愛的顧客,祝您用餐愉快,如您遇到任何問題請撥打8200 2022聯繫我們,期待您的下次光臨。"
android:visibility=
"visible"
/>
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_10"
android:visibility=
"visible"
>
<TextView
android:id=
"@+id/tv_bottom_time"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:gravity=
"center"
android:text=
"2020-04-25 12:00:36 GS Support pos1"
/>
<TextView
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toLeftOf=
"@id/tv_bottom_time"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
<TextView
android:id=
"@+id/tv_bottom_time_right_line"
style=
"@style/print_other_order_twenty_six_style"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_toRightOf=
"@id/tv_bottom_time"
android:maxLines=
"1"
android:text=
"@string/print_split_line"
/>
</RelativeLayout>
</LinearLayout>
</ScrollView>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/print_currency_item.xml
0 → 100644
View file @
c1d4845a
<?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=
"wrap_content"
android:orientation=
"horizontal"
>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_currency_print_type"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"堂食"
/>
<TextView
android:id=
"@+id/tv_currency_print_food_color"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"黑色"
/>
<TextView
android:id=
"@+id/tv_currency_print_food_items_color"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"紅色"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:gravity=
"center"
android:orientation=
"horizontal"
>
<ImageView
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:src=
"@drawable/ic_edit"
/>
<ImageView
android:id=
"@+id/iv_currency_print_delete"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:paddingLeft=
"@dimen/dp_10"
android:src=
"@drawable/ic_delete"
/>
</LinearLayout>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
</LinearLayout>
\ No newline at end of file
print-module/src/main/res/layout/printer_activity_add.xml
View file @
c1d4845a
...
...
@@ -13,348 +13,575 @@
app:qmui_topbar_text_btn_color_state_list=
"@color/theme_white_color"
app:qmui_topbar_title_color=
"@color/theme_white_color"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
<androidx.core.widget.NestedScrollView
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"名稱"
/>
android:layout_height=
"0dp"
android:layout_weight=
"1"
android:scrollbars=
"vertical"
>
<EditText
android:id=
"@+id/add_printer_ed_name"
android:layout_width=
"0dp"
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_weight=
"0.7"
android:background=
"@null"
android:digits=
"@string/edit_digits_number_words"
android:hint=
"請輸入打印機名稱"
android:maxLength=
"20"
android:singleLine=
"true"
android:textColor=
"@color/normal_color"
android:textColorHint=
"@color/hint_color"
android:textSize=
"@dimen/dp_14"
>
android:orientation=
"vertical"
>
<requestFocus
/>
</EditText>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"打印機IP"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.7"
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/ip_edit_1"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:singleLine=
"true"
android:text=
"192"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_2"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:singleLine=
"true"
android:text=
"168"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_3"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:singleLine=
"true"
android:text=
"125"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_4"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:singleLine=
"true"
android:text=
"075"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"名稱"
/>
<EditText
android:id=
"@+id/add_printer_ed_name"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_weight=
"0.7"
android:background=
"@null"
android:digits=
"@string/edit_digits_number_words"
android:hint=
"請輸入打印機名稱"
android:maxLength=
"20"
android:singleLine=
"true"
android:textColor=
"@color/normal_color"
android:textColorHint=
"@color/hint_color"
android:textSize=
"@dimen/dp_14"
>
<requestFocus
/>
</EditText>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"打印機IP"
/>
<LinearLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.7"
android:focusable=
"true"
android:focusableInTouchMode=
"true"
android:orientation=
"horizontal"
>
<EditText
android:id=
"@+id/ip_edit_1"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:nextFocusDown=
"@id/ip_edit_2"
android:singleLine=
"true"
android:text=
"192"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_1"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_2"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:nextFocusDown=
"@id/ip_edit_3"
android:singleLine=
"true"
android:text=
"168"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_2"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_3"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:nextFocusDown=
"@id/ip_edit_4"
android:singleLine=
"true"
android:text=
"125"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
<TextView
android:id=
"@+id/dot_3"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"true"
android:text=
"."
android:textColor=
"#000"
android:textSize=
"@dimen/dp_20"
android:textStyle=
"bold"
/>
<EditText
android:id=
"@+id/ip_edit_4"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"bottom|center_horizontal"
android:hint=
"0"
android:inputType=
"number"
android:maxLength=
"3"
android:minWidth=
"@dimen/dp_30"
android:singleLine=
"true"
android:text=
"075"
android:textColor=
"@color/normal_color"
android:textCursorDrawable=
"@null"
android:textSize=
"@dimen/dp_15"
/>
</LinearLayout>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"端口號"
/>
<EditText
android:id=
"@+id/add_printer_ed_port"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_weight=
"0.7"
android:background=
"@null"
android:hint=
"請輸入端口號,默認9100"
android:inputType=
"number"
android:maxLength=
"4"
android:textColor=
"@color/normal_color"
android:textColorHint=
"@color/hint_color"
android:textSize=
"@dimen/dp_14"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_print_device"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_device_model_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"打印機型號"
/>
<ImageView
android:id=
"@+id/iv_device_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/print_device_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_device_arrow"
android:layout_toRightOf=
"@id/tv_device_model_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"設為默認"
/>
<Switch
android:id=
"@+id/switch_set_default"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_select_fail_one"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_fail_one_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_weight=
"1"
android:text=
"打印失敗由此打印"
/>
<ImageView
android:id=
"@+id/iv_fail_one_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_print_fail_one"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_fail_one_arrow"
android:layout_toRightOf=
"@id/tv_fail_one_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_select_fail_two"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_fail_two_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"打印失敗由此打印"
/>
<ImageView
android:id=
"@+id/iv_fail_two_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_print_fail_two"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_fail_two_arrow"
android:layout_toRightOf=
"@id/tv_fail_two_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 食品字體大小-->
<RelativeLayout
android:id=
"@+id/layout_print_device_food_font_size"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_font_size_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"食品字體大小"
/>
<ImageView
android:id=
"@+id/iv_food_font_size_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_food_font_size"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_food_font_size_arrow"
android:layout_toRightOf=
"@id/tv_food_font_size_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 細項字體大小-->
<RelativeLayout
android:id=
"@+id/layout_print_device_food_item_font_size"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_food_items_font_size_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"細項字體大小"
/>
<ImageView
android:id=
"@+id/iv_details_font_size_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_details_font_size"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_details_font_size_arrow"
android:layout_toRightOf=
"@id/tv_food_items_font_size_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 食品是否加粗-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"食品是否加粗"
/>
<Switch
android:id=
"@+id/switch_print_device_food_font_thickness"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 細項是否加粗-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"細項是否加粗"
/>
<Switch
android:id=
"@+id/switch_food_items_thickness"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 食品斜體-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"食品斜體"
/>
<Switch
android:id=
"@+id/switch_food_italic"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 細項斜體-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"細項斜體"
/>
<Switch
android:id=
"@+id/switch_food_items_italic"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<!-- 數量大於1顏色是否翻轉-->
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"數量大於1顏色是否翻轉"
/>
<Switch
android:id=
"@+id/switch_color_flip"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"0.3"
android:text=
"端口號"
/>
<EditText
android:id=
"@+id/add_printer_ed_port"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_weight=
"0.7"
android:background=
"@null"
android:hint=
"請輸入端口號,默認9100"
android:inputType=
"number"
android:maxLength=
"4"
android:textColor=
"@color/normal_color"
android:textColorHint=
"@color/hint_color"
android:textSize=
"@dimen/dp_14"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_print_device"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_device_model_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"打印機型號"
/>
<ImageView
android:id=
"@+id/iv_device_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/print_device_name"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_device_arrow"
android:layout_toRightOf=
"@id/tv_device_model_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<LinearLayout
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
style=
"@style/print_add_title_textStyle"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:text=
"設為默認"
/>
<Switch
android:id=
"@+id/switch_set_default"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:thumb=
"@drawable/shape_thumb_on"
android:track=
"@drawable/selector_switch_track"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</LinearLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_select_fail_one"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_fail_one_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_weight=
"1"
android:text=
"打印失敗由此打印"
/>
<ImageView
android:id=
"@+id/iv_fail_one_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_print_fail_one"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_fail_one_arrow"
android:layout_toRightOf=
"@id/tv_fail_one_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<RelativeLayout
android:id=
"@+id/layout_select_fail_two"
style=
"@style/print_add_printer_input_style"
android:layout_width=
"match_parent"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
>
<TextView
android:id=
"@+id/tv_fail_two_text"
style=
"@style/print_add_title_textStyle"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:text=
"打印失敗由此打印"
/>
<ImageView
android:id=
"@+id/iv_fail_two_arrow"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_centerVertical=
"true"
android:src=
"@drawable/ic_black_next_arrow"
/>
<TextView
android:id=
"@+id/tv_print_fail_two"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerVertical=
"true"
android:layout_marginLeft=
"@dimen/dp_7"
android:layout_marginRight=
"@dimen/dp_7"
android:layout_toLeftOf=
"@id/iv_fail_two_arrow"
android:layout_toRightOf=
"@id/tv_fail_two_text"
android:gravity=
"right"
android:text=
"請選擇"
android:textColor=
"@color/color_c9"
android:textSize=
"@dimen/dp_16"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
</RelativeLayout>
<include
layout=
"@layout/include_horizontal_color_ccc_dividing_line"
/>
<View
android:layout_width=
"wrap_content"
android:layout_height=
"0dp"
android:layout_weight=
"1"
/>
</androidx.core.widget.NestedScrollView>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/printer_add"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/printer_add_input_paddingLeft"
android:layout_marginTop=
"@dimen/dp_30"
android:layout_marginRight=
"@dimen/printer_add_input_paddingLeft"
android:layout_marginBottom=
"@dimen/dp_20"
android:background=
"@drawable/shape_app_btn"
...
...
print-module/src/main/res/values/styles.xml
View file @
c1d4845a
...
...
@@ -52,4 +52,9 @@
<item
name=
"android:textSize"
>
@dimen/dp_16
</item>
<item
name=
"android:textColor"
>
@color/normal_color
</item>
</style>
<style
name=
"print_currency_title_textStyle"
>
<item
name=
"android:textSize"
>
@dimen/dp_16
</item>
<item
name=
"android:textColor"
>
@color/theme_color
</item>
</style>
</resources>
\ No newline at end of file
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