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
f01b18c5
Commit
f01b18c5
authored
Jun 13, 2020
by
宁斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1、餐檯管理調整
parent
39e33787
Show whitespace changes
Inline
Side-by-side
Showing
53 changed files
with
2133 additions
and
472 deletions
+2133
-472
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/TableBean.java
+37
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/recylcler/event/RecyItemTouchHelperCallback.java
+26
-10
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/TriangleLabelView.java
+374
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/qm/QDShadowAdjustLayout.java
+69
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/section/QDSectionHeaderView.java
+2
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/CommonTipDialog.java
+60
-13
base-module/src/main/res/drawable/shape_triangle_table_type.xml
+16
-0
base-module/src/main/res/drawable/table_shape_table_nomal.xml
+0
-0
base-module/src/main/res/drawable/table_shape_table_print.xml
+0
-0
base-module/src/main/res/drawable/table_shape_table_send.xml
+0
-0
base-module/src/main/res/drawable/table_shape_table_use.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_default.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_default_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_glassgreen.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_glassgreen_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_red.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_red_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_skyblue.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_skyblue_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_splite.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_splite_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_splitetable.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_violet.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_violet_new.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_yellow.xml
+0
-0
base-module/src/main/res/drawable/tablebutton_yellow_new.xml
+0
-0
base-module/src/main/res/values/attrs.xml
+45
-0
base-module/src/main/res/values/ids.xml
+2
-1
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
+17
-20
main-module/src/main/res/layout/main_home_management_funcation_item.xml
+0
-1
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/contract/TableListContract.java
+5
-0
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/contract/TableManageContract.java
+9
-0
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/TableManageModel.java
+37
-0
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/bean/TableItem.java
+62
-3
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/bean/request/TableRequest.java
+107
-8
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/service/TableManageService.java
+9
-0
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/presenter/TableListPresenter.java
+40
-2
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/presenter/TableManagePresenter.java
+186
-10
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/activity/TableManageActivity.java
+77
-9
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/AreaManageAdapter.java
+25
-11
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
+188
-5
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/AddTableFragment.java
+187
-121
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/AreaListFragment.java
+117
-21
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/TableListFragment.java
+178
-60
manager-module/src/main/res/drawable/manage_shape_add_btn_oval.xml
+2
-1
manager-module/src/main/res/layout/activity_table_manage.xml
+0
-54
manager-module/src/main/res/layout/fragment_area_list.xml
+81
-44
manager-module/src/main/res/layout/fragment_table_list.xml
+34
-41
manager-module/src/main/res/layout/manager_item_manage_area.xml
+42
-12
manager-module/src/main/res/layout/manager_item_manage_table.xml
+98
-17
manager-module/src/main/res/mipmap-xxhdpi/ic_table_open_time.png
+0
-0
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/fragment/StateTableFragment.java
+0
-1
table-module/src/main/res/layout/table_fragment_all_table.xml
+1
-3
No files found.
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/TableBean.java
View file @
f01b18c5
...
@@ -81,6 +81,10 @@ public class TableBean {
...
@@ -81,6 +81,10 @@ public class TableBean {
private
Long
orderId
;
private
Long
orderId
;
private
String
qrCode
;
private
String
qrCode
;
private
int
seatCount
;
private
int
seatCount
;
/**最大就餐人數*/
private
Integer
maxSeatCount
;
/**最小就餐人數*/
private
Integer
minSeatCount
;
private
String
createTime
;
private
String
createTime
;
private
String
createBy
;
private
String
createBy
;
private
String
qrCodeImg
;
private
String
qrCodeImg
;
...
@@ -108,6 +112,12 @@ public class TableBean {
...
@@ -108,6 +112,12 @@ public class TableBean {
* 排序
* 排序
*/
*/
private
int
sort
;
private
int
sort
;
/**
0#堂食
1#外賣
2#自取
*/
private
int
type
;
public
DataBean
()
{
public
DataBean
()
{
...
@@ -120,6 +130,8 @@ public class TableBean {
...
@@ -120,6 +130,8 @@ public class TableBean {
this
.
restaurantId
=
dataBean
.
restaurantId
;
this
.
restaurantId
=
dataBean
.
restaurantId
;
this
.
qrCode
=
dataBean
.
qrCode
;
this
.
qrCode
=
dataBean
.
qrCode
;
this
.
seatCount
=
dataBean
.
seatCount
;
this
.
seatCount
=
dataBean
.
seatCount
;
this
.
maxSeatCount
=
dataBean
.
maxSeatCount
;
this
.
minSeatCount
=
dataBean
.
minSeatCount
;
this
.
createTime
=
dataBean
.
createTime
;
this
.
createTime
=
dataBean
.
createTime
;
this
.
createBy
=
dataBean
.
createBy
;
this
.
createBy
=
dataBean
.
createBy
;
this
.
qrCodeImg
=
dataBean
.
qrCodeImg
;
this
.
qrCodeImg
=
dataBean
.
qrCodeImg
;
...
@@ -130,6 +142,7 @@ public class TableBean {
...
@@ -130,6 +142,7 @@ public class TableBean {
this
.
person
=
dataBean
.
person
;
this
.
person
=
dataBean
.
person
;
this
.
useStatus
=
dataBean
.
useStatus
;
this
.
useStatus
=
dataBean
.
useStatus
;
this
.
sort
=
dataBean
.
sort
;
this
.
sort
=
dataBean
.
sort
;
this
.
type
=
dataBean
.
type
;
}
}
public
int
getPerson
()
{
public
int
getPerson
()
{
...
@@ -196,6 +209,22 @@ public class TableBean {
...
@@ -196,6 +209,22 @@ public class TableBean {
this
.
seatCount
=
seatCount
;
this
.
seatCount
=
seatCount
;
}
}
public
Integer
getMaxSeatCount
()
{
return
maxSeatCount
;
}
public
void
setMaxSeatCount
(
Integer
maxSeatCount
)
{
this
.
maxSeatCount
=
maxSeatCount
;
}
public
Integer
getMinSeatCount
()
{
return
minSeatCount
;
}
public
void
setMinSeatCount
(
Integer
minSeatCount
)
{
this
.
minSeatCount
=
minSeatCount
;
}
public
String
getCreateTime
()
{
public
String
getCreateTime
()
{
return
createTime
;
return
createTime
;
}
}
...
@@ -259,5 +288,13 @@ public class TableBean {
...
@@ -259,5 +288,13 @@ public class TableBean {
public
void
setSort
(
int
sort
)
{
public
void
setSort
(
int
sort
)
{
this
.
sort
=
sort
;
this
.
sort
=
sort
;
}
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
}
}
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/recylcler/event/RecyItemTouchHelperCallback.java
View file @
f01b18c5
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.ui.recylcler.event;
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.ui.recylcler.event;
import
android.graphics.Color
;
import
android.graphics.Color
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.jess.arms.base.DefaultAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
...
@@ -23,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
...
@@ -23,6 +24,7 @@ import androidx.recyclerview.widget.RecyclerView;
*/
*/
public
class
RecyItemTouchHelperCallback
<
H
extends
QMUISection
.
Model
<
H
>,
T
extends
QMUISection
.
Model
<
T
>>
extends
ItemTouchHelper
.
Callback
{
public
class
RecyItemTouchHelperCallback
<
H
extends
QMUISection
.
Model
<
H
>,
T
extends
QMUISection
.
Model
<
T
>>
extends
ItemTouchHelper
.
Callback
{
private
final
String
TAG
=
getClass
().
getSimpleName
();
RecyclerView
.
Adapter
mAdapter
;
RecyclerView
.
Adapter
mAdapter
;
boolean
isSwipeEnable
;
boolean
isSwipeEnable
;
boolean
isFirstDragUnable
;
boolean
isFirstDragUnable
;
...
@@ -64,10 +66,11 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
...
@@ -64,10 +66,11 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
if
(
mAdapter
instanceof
QMUIStickySectionAdapter
)
{
if
(
mAdapter
instanceof
QMUIStickySectionAdapter
)
{
QMUIStickySectionAdapter
.
ViewHolder
holder
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
QMUIStickySectionAdapter
.
ViewHolder
holder
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
int
pos
=
holder
.
isForStickyHeader
?
i
:
holder
.
getAdapterPosition
();
int
pos
=
holder
.
isForStickyHeader
?
i
:
holder
.
getAdapterPosition
();
int
ItemIndex
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getItemIndex
(
pos
);
int
itemIndex
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getItemIndex
(
pos
);
QMUISection
<
H
,
T
>
qmuiSections
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getSection
(
ItemIndex
);
LogUtil
.
d
(
TAG
,
"fromPosition:"
+
fromPosition
+
" toPosition:"
+
toPosition
+
" itemIndex: "
+
itemIndex
+
" pos: "
+
pos
);
QMUISection
<
H
,
T
>
qmuiSections
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getSection
(
pos
);
List
<?>
list
=
qmuiSections
.
getItemList
();
List
<?>
list
=
qmuiSections
.
getItemList
();
Collections
.
swap
(
list
,
ItemIndex
,
I
temIndex
+
1
);
Collections
.
swap
(
list
,
itemIndex
,
i
temIndex
+
1
);
}
else
{
}
else
{
Collections
.
swap
(((
DefaultAdapter
)
mAdapter
).
getInfos
(),
i
,
i
+
1
);
Collections
.
swap
(((
DefaultAdapter
)
mAdapter
).
getInfos
(),
i
,
i
+
1
);
}
}
...
@@ -77,18 +80,17 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
...
@@ -77,18 +80,17 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
if
(
mAdapter
instanceof
QMUIStickySectionAdapter
)
{
if
(
mAdapter
instanceof
QMUIStickySectionAdapter
)
{
QMUIStickySectionAdapter
.
ViewHolder
holder
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
QMUIStickySectionAdapter
.
ViewHolder
holder
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
int
pos
=
holder
.
isForStickyHeader
?
i
:
holder
.
getAdapterPosition
();
int
pos
=
holder
.
isForStickyHeader
?
i
:
holder
.
getAdapterPosition
();
int
ItemIndex
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getItemIndex
(
pos
);
int
itemIndex
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getItemIndex
(
pos
);
QMUISection
<
H
,
T
>
qmuiSections
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getSection
(
ItemIndex
);
LogUtil
.
d
(
TAG
,
"fromPosition:"
+
fromPosition
+
" toPosition:"
+
toPosition
+
" itemIndex: "
+
itemIndex
+
" pos: "
+
pos
);
QMUISection
<
H
,
T
>
qmuiSections
=
((
QMUIStickySectionAdapter
)
mAdapter
).
getSection
(
pos
);
List
<?>
list
=
qmuiSections
.
getItemList
();
List
<?>
list
=
qmuiSections
.
getItemList
();
Collections
.
swap
(
list
,
ItemIndex
,
I
temIndex
-
1
);
Collections
.
swap
(
list
,
itemIndex
,
i
temIndex
-
1
);
}
else
{
}
else
{
Collections
.
swap
(((
DefaultAdapter
)
mAdapter
).
getInfos
(),
i
,
i
-
1
);
Collections
.
swap
(((
DefaultAdapter
)
mAdapter
).
getInfos
(),
fromPosition
,
toPosition
-
1
);
}
}
}
}
}
}
mAdapter
.
notifyItemMoved
(
fromPosition
,
toPosition
);
mAdapter
.
notifyItemMoved
(
fromPosition
,
toPosition
);
mAdapter
.
notifyItemChanged
(
toPosition
);
mAdapter
.
notifyItemChanged
(
fromPosition
);
return
true
;
return
true
;
}
}
...
@@ -114,7 +116,10 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
...
@@ -114,7 +116,10 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
@Override
@Override
public
void
clearView
(
RecyclerView
recyclerView
,
RecyclerView
.
ViewHolder
viewHolder
)
{
public
void
clearView
(
RecyclerView
recyclerView
,
RecyclerView
.
ViewHolder
viewHolder
)
{
super
.
clearView
(
recyclerView
,
viewHolder
);
super
.
clearView
(
recyclerView
,
viewHolder
);
viewHolder
.
itemView
.
setBackgroundColor
(
Color
.
WHITE
);
// viewHolder.itemView.setBackgroundColor(Color.WHITE);
if
(
onMoveListener
!=
null
)
{
onMoveListener
.
onMoveFinish
();
}
}
}
@Override
@Override
...
@@ -126,4 +131,14 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
...
@@ -126,4 +131,14 @@ public class RecyItemTouchHelperCallback<H extends QMUISection.Model<H>, T exten
public
boolean
isItemViewSwipeEnabled
()
{
public
boolean
isItemViewSwipeEnabled
()
{
return
isSwipeEnable
;
return
isSwipeEnable
;
}
}
private
onMoveListener
onMoveListener
;
public
void
setOnMoveListener
(
RecyItemTouchHelperCallback
.
onMoveListener
onMoveListener
)
{
this
.
onMoveListener
=
onMoveListener
;
}
public
interface
onMoveListener
{
void
onMoveFinish
();
}
}
}
\ No newline at end of file
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/TriangleLabelView.java
0 → 100644
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
view
;
import
android.annotation.SuppressLint
;
import
android.annotation.TargetApi
;
import
android.content.Context
;
import
android.content.res.TypedArray
;
import
android.graphics.Canvas
;
import
android.graphics.Color
;
import
android.graphics.Paint
;
import
android.graphics.Path
;
import
android.graphics.Rect
;
import
android.graphics.Typeface
;
import
android.os.Build
;
import
android.util.AttributeSet
;
import
android.view.View
;
import
com.gingersoft.gsa.cloud.base.R
;
import
androidx.annotation.ColorInt
;
import
androidx.annotation.ColorRes
;
import
androidx.annotation.StringRes
;
import
androidx.core.content.ContextCompat
;
/**
* 作者:ELEGANT_BIN
* 版本:1.6.0
* 创建日期:2020-06-13
* 修订历史:2020-06-13
* 描述:
*/
public
class
TriangleLabelView
extends
View
{
private
static
final
String
TAG
=
TriangleLabelView
.
class
.
getSimpleName
();
private
static
class
PaintHolder
{
String
text
=
""
;
Paint
paint
;
int
color
;
float
size
;
float
height
;
float
width
;
int
style
;
void
initPaint
()
{
paint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
paint
.
setColor
(
color
);
paint
.
setTextAlign
(
Paint
.
Align
.
CENTER
);
paint
.
setTextSize
(
size
);
if
(
style
==
1
)
{
paint
.
setTypeface
(
Typeface
.
SANS_SERIF
);
}
else
if
(
style
==
2
)
{
paint
.
setTypeface
(
Typeface
.
DEFAULT_BOLD
);
}
}
void
resetStatus
()
{
Rect
rectText
=
new
Rect
();
paint
.
getTextBounds
(
text
,
0
,
text
.
length
(),
rectText
);
width
=
rectText
.
width
();
height
=
rectText
.
height
();
}
}
private
PaintHolder
primary
=
new
PaintHolder
();
private
PaintHolder
secondary
=
new
PaintHolder
();
private
float
topPadding
;
private
float
bottomPadding
;
private
float
centerPadding
;
private
Paint
trianglePaint
;
private
int
backGroundColor
;
private
int
width
;
private
int
height
;
private
static
final
int
DEGREES_LEFT
=
-
45
;
private
static
final
int
DEGREES_RIGHT
=
45
;
private
Corner
corner
;
public
enum
Corner
{
TOP_LEFT
(
1
),
TOP_RIGHT
(
2
),
BOTTOM_LEFT
(
3
),
BOTTOM_RIGHT
(
4
),;
private
final
int
type
;
Corner
(
int
type
)
{
this
.
type
=
type
;
}
private
boolean
top
()
{
return
this
==
TOP_LEFT
||
this
==
TOP_RIGHT
;
}
private
boolean
left
()
{
return
this
==
TOP_LEFT
||
this
==
BOTTOM_LEFT
;
}
private
static
Corner
from
(
int
type
)
{
for
(
Corner
c
:
values
())
{
if
(
c
.
type
==
type
)
return
c
;
}
return
Corner
.
TOP_LEFT
;
}
}
public
TriangleLabelView
(
Context
context
)
{
this
(
context
,
null
);
}
public
TriangleLabelView
(
Context
context
,
AttributeSet
attrs
)
{
this
(
context
,
attrs
,
0
);
}
public
TriangleLabelView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
)
{
super
(
context
,
attrs
,
defStyleAttr
);
init
(
context
,
attrs
);
}
@TargetApi
(
Build
.
VERSION_CODES
.
LOLLIPOP
)
public
TriangleLabelView
(
Context
context
,
AttributeSet
attrs
,
int
defStyleAttr
,
int
defStyleRes
)
{
super
(
context
,
attrs
,
defStyleAttr
,
defStyleRes
);
init
(
context
,
attrs
);
}
private
void
init
(
Context
context
,
AttributeSet
attrs
)
{
TypedArray
ta
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
TriangleLabelView
);
this
.
topPadding
=
ta
.
getDimension
(
R
.
styleable
.
TriangleLabelView_labelTopPadding
,
dp2px
(
7
));
this
.
centerPadding
=
ta
.
getDimension
(
R
.
styleable
.
TriangleLabelView_labelCenterPadding
,
dp2px
(
3
));
this
.
bottomPadding
=
ta
.
getDimension
(
R
.
styleable
.
TriangleLabelView_labelBottomPadding
,
dp2px
(
3
));
this
.
backGroundColor
=
ta
.
getColor
(
R
.
styleable
.
TriangleLabelView_backgroundColor
,
Color
.
parseColor
(
"#66000000"
));
this
.
primary
.
color
=
ta
.
getColor
(
R
.
styleable
.
TriangleLabelView_primaryTextColor
,
Color
.
WHITE
);
this
.
secondary
.
color
=
ta
.
getColor
(
R
.
styleable
.
TriangleLabelView_secondaryTextColor
,
Color
.
WHITE
);
this
.
primary
.
size
=
ta
.
getDimension
(
R
.
styleable
.
TriangleLabelView_primaryTextSize
,
sp2px
(
11
));
this
.
secondary
.
size
=
ta
.
getDimension
(
R
.
styleable
.
TriangleLabelView_secondaryTextSize
,
sp2px
(
8
));
final
String
primary
=
ta
.
getString
(
R
.
styleable
.
TriangleLabelView_primaryText
);
if
(
primary
!=
null
)
{
this
.
primary
.
text
=
primary
;
}
final
String
secondary
=
ta
.
getString
(
R
.
styleable
.
TriangleLabelView_secondaryText
);
if
(
secondary
!=
null
)
{
this
.
secondary
.
text
=
secondary
;
}
this
.
primary
.
style
=
ta
.
getInt
(
R
.
styleable
.
TriangleLabelView_primaryTextStyle
,
2
);
this
.
secondary
.
style
=
ta
.
getInt
(
R
.
styleable
.
TriangleLabelView_secondaryTextStyle
,
0
);
this
.
corner
=
Corner
.
from
(
ta
.
getInt
(
R
.
styleable
.
TriangleLabelView_corner
,
1
));
ta
.
recycle
();
this
.
primary
.
initPaint
();
this
.
secondary
.
initPaint
();
trianglePaint
=
new
Paint
(
Paint
.
ANTI_ALIAS_FLAG
);
trianglePaint
.
setColor
(
backGroundColor
);
this
.
primary
.
resetStatus
();
this
.
secondary
.
resetStatus
();
}
public
void
setLabelTopPadding
(
float
dp
)
{
topPadding
=
dp2px
(
dp
);
}
public
float
getLabelTopPadding
()
{
return
topPadding
;
}
public
void
setLabelCenterPadding
(
float
dp
)
{
centerPadding
=
dp2px
(
dp
);
relayout
();
}
public
float
getLabelCenterPadding
()
{
return
centerPadding
;
}
public
void
setLabelBottomPadding
(
float
dp
)
{
bottomPadding
=
dp2px
(
dp
);
relayout
();
}
public
float
getLabelBottomPadding
()
{
return
bottomPadding
;
}
public
void
setPrimaryText
(
String
text
)
{
primary
.
text
=
text
;
primary
.
resetStatus
();
relayout
();
}
public
void
setPrimaryText
(
@StringRes
int
textRes
)
{
primary
.
text
=
getContext
().
getString
(
textRes
);
primary
.
resetStatus
();
relayout
();
}
public
String
getPrimaryText
()
{
return
primary
.
text
;
}
public
void
setSecondaryText
(
String
smallText
)
{
secondary
.
text
=
smallText
;
secondary
.
resetStatus
();
relayout
();
}
public
void
setSecondaryText
(
@StringRes
int
textRes
)
{
secondary
.
text
=
getContext
().
getString
(
textRes
);
secondary
.
resetStatus
();
relayout
();
}
public
String
getSecondaryText
()
{
return
secondary
.
text
;
}
public
void
setPrimaryTextColor
(
@ColorInt
int
color
)
{
primary
.
color
=
color
;
primary
.
initPaint
();
primary
.
resetStatus
();
relayout
();
}
public
void
setPrimaryTextColorResource
(
@ColorRes
int
colorResource
)
{
primary
.
color
=
ContextCompat
.
getColor
(
getContext
(),
colorResource
);
primary
.
initPaint
();
primary
.
resetStatus
();
relayout
();
}
public
void
setSecondaryTextColor
(
@ColorInt
int
color
)
{
secondary
.
color
=
color
;
secondary
.
initPaint
();
secondary
.
resetStatus
();
relayout
();
}
public
void
setSecondaryTextColorResource
(
@ColorRes
int
colorResource
)
{
secondary
.
color
=
ContextCompat
.
getColor
(
getContext
(),
colorResource
);
secondary
.
initPaint
();
secondary
.
resetStatus
();
relayout
();
}
public
void
setPrimaryTextSize
(
float
sp
)
{
primary
.
size
=
sp2px
(
sp
);
relayout
();
}
public
void
setSecondaryTextSize
(
float
sp
)
{
secondary
.
size
=
sp2px
(
sp
);
relayout
();
}
public
float
getPrimaryTextSize
()
{
return
primary
.
size
;
}
public
float
getSecondaryTextSize
()
{
return
secondary
.
size
;
}
public
void
setTriangleBackgroundColor
(
@ColorInt
int
color
)
{
backGroundColor
=
color
;
trianglePaint
.
setColor
(
backGroundColor
);
relayout
();
}
public
void
setTriangleBackgroundColorResource
(
@ColorRes
int
colorResource
)
{
backGroundColor
=
ContextCompat
.
getColor
(
getContext
(),
colorResource
);
trianglePaint
.
setColor
(
backGroundColor
);
relayout
();
}
public
int
getTriangleBackGroundColor
()
{
return
backGroundColor
;
}
public
void
setCorner
(
Corner
corner
)
{
this
.
corner
=
corner
;
relayout
();
}
public
Corner
getCorner
()
{
return
corner
;
}
@Override
protected
void
onDraw
(
Canvas
canvas
)
{
super
.
onDraw
(
canvas
);
canvas
.
save
();
// translate
if
(
corner
.
top
())
{
canvas
.
translate
(
0
,
(
float
)
((
height
*
Math
.
sqrt
(
2
))
-
height
));
}
// rotate
if
(
corner
.
top
())
{
if
(
corner
.
left
())
{
canvas
.
rotate
(
DEGREES_LEFT
,
0
,
height
);
}
else
{
canvas
.
rotate
(
DEGREES_RIGHT
,
width
,
height
);
}
}
else
{
if
(
corner
.
left
())
{
canvas
.
rotate
(
DEGREES_RIGHT
,
0
,
0
);
}
else
{
canvas
.
rotate
(
DEGREES_LEFT
,
width
,
0
);
}
}
// draw triangle
@SuppressLint
(
"DrawAllocation"
)
Path
path
=
new
Path
();
if
(
corner
.
top
())
{
path
.
moveTo
(
0
,
height
);
path
.
lineTo
(
width
/
2
,
0
);
path
.
lineTo
(
width
,
height
);
}
else
{
path
.
moveTo
(
0
,
0
);
path
.
lineTo
(
width
/
2
,
height
);
path
.
lineTo
(
width
,
0
);
}
path
.
close
();
canvas
.
drawPath
(
path
,
trianglePaint
);
// draw secondaryText
if
(
corner
.
top
())
{
canvas
.
drawText
(
secondary
.
text
,
(
width
)
/
2
,
topPadding
+
secondary
.
height
,
secondary
.
paint
);
canvas
.
drawText
(
primary
.
text
,
(
width
)
/
2
,
(
topPadding
+
secondary
.
height
+
centerPadding
+
primary
.
height
),
primary
.
paint
);
}
else
{
canvas
.
drawText
(
secondary
.
text
,
(
width
)
/
2
,
bottomPadding
+
secondary
.
height
+
centerPadding
+
primary
.
height
,
secondary
.
paint
);
canvas
.
drawText
(
primary
.
text
,
(
width
)
/
2
,
(
bottomPadding
+
primary
.
height
),
primary
.
paint
);
}
canvas
.
restore
();
}
@Override
protected
void
onMeasure
(
int
widthMeasureSpec
,
int
heightMeasureSpec
)
{
super
.
onMeasure
(
widthMeasureSpec
,
heightMeasureSpec
);
height
=
(
int
)
(
topPadding
+
centerPadding
+
bottomPadding
+
secondary
.
height
+
primary
.
height
);
width
=
2
*
height
;
int
realHeight
=
(
int
)
(
height
*
Math
.
sqrt
(
2
));
setMeasuredDimension
(
width
,
realHeight
);
}
public
int
dp2px
(
float
dpValue
)
{
final
float
scale
=
getContext
().
getResources
().
getDisplayMetrics
().
density
;
return
(
int
)
(
dpValue
*
scale
+
0.5f
);
}
public
float
sp2px
(
float
spValue
)
{
final
float
scale
=
getContext
().
getResources
().
getDisplayMetrics
().
scaledDensity
;
return
spValue
*
scale
;
}
/**
* Should be called whenever what we're displaying could have changed.
*/
private
void
relayout
()
{
invalidate
();
requestLayout
();
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/qm/QDShadowAdjustLayout.java
0 → 100644
View file @
f01b18c5
/*
* Tencent is pleased to support the open source community by making QMUI_Android available.
*
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
*
* Licensed under the MIT License (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
*
* http://opensource.org/licenses/MIT
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is
* distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
* either express or implied. See the License for the specific language governing permissions and
* limitations under the License.
*/
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
view
.
qm
;
import
android.content.Context
;
import
android.util.AttributeSet
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.qmuiteam.qmui.layout.QMUIFrameLayout
;
import
androidx.customview.widget.ViewDragHelper
;
/**
* Created by cgspine on 2018/3/22.
*/
public
class
QDShadowAdjustLayout
extends
QMUIFrameLayout
{
ViewDragHelper
viewDragHelper
;
public
QDShadowAdjustLayout
(
Context
context
)
{
this
(
context
,
null
);
}
public
QDShadowAdjustLayout
(
Context
context
,
AttributeSet
attrs
)
{
super
(
context
,
attrs
);
viewDragHelper
=
ViewDragHelper
.
create
(
this
,
new
ViewDragHelper
.
Callback
()
{
@Override
public
boolean
tryCaptureView
(
View
child
,
int
pointerId
)
{
return
child
.
getId
()
==
R
.
id
.
layout_for_test
;
}
@Override
public
int
clampViewPositionHorizontal
(
View
child
,
int
left
,
int
dx
)
{
return
left
;
}
@Override
public
int
clampViewPositionVertical
(
View
child
,
int
top
,
int
dy
)
{
return
top
;
}
});
}
@Override
public
boolean
onInterceptTouchEvent
(
MotionEvent
event
)
{
return
viewDragHelper
.
shouldInterceptTouchEvent
(
event
);
}
@Override
public
boolean
onTouchEvent
(
MotionEvent
event
)
{
viewDragHelper
.
processTouchEvent
(
event
);
return
true
;
}
}
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/view/section/QDSectionHeaderView.java
View file @
f01b18c5
...
@@ -54,12 +54,10 @@ public class QDSectionHeaderView extends LinearLayout {
...
@@ -54,12 +54,10 @@ public class QDSectionHeaderView extends LinearLayout {
mTitleTv
.
setTextSize
(
16
);
mTitleTv
.
setTextSize
(
16
);
mTitleTv
.
setTextColor
(
Color
.
BLACK
);
mTitleTv
.
setTextColor
(
Color
.
BLACK
);
mTitleTv
.
setPadding
(
paddingHor
,
0
,
paddingHor
,
0
);
mTitleTv
.
setPadding
(
paddingHor
,
0
,
paddingHor
,
0
);
addView
(
mTitleTv
,
new
LinearLayout
.
LayoutParams
(
addView
(
mTitleTv
,
new
LinearLayout
.
LayoutParams
(
0
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
1
f
));
0
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
,
1
f
));
mArrowView
=
new
AppCompatImageView
(
context
);
mArrowView
=
new
AppCompatImageView
(
context
);
mArrowView
.
setImageDrawable
(
QMUIResHelper
.
getAttrDrawable
(
getContext
(),
mArrowView
.
setImageDrawable
(
QMUIResHelper
.
getAttrDrawable
(
getContext
(),
R
.
attr
.
qmui_common_list_item_chevron
));
R
.
attr
.
qmui_common_list_item_chevron
));
mArrowView
.
setScaleType
(
ImageView
.
ScaleType
.
CENTER
);
mArrowView
.
setScaleType
(
ImageView
.
ScaleType
.
CENTER
);
addView
(
mArrowView
,
new
LinearLayout
.
LayoutParams
(
headerHeight
,
headerHeight
));
addView
(
mArrowView
,
new
LinearLayout
.
LayoutParams
(
headerHeight
,
headerHeight
));
}
}
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/ui/widget/dialog/CommonTipDialog.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
widget
.
dialog
;
package
com
.
gingersoft
.
gsa
.
cloud
.
ui
.
widget
.
dialog
;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.text.InputType
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.gingersoft.gsa.cloud.base.R
;
import
com.gingersoft.gsa.cloud.base.R
;
...
@@ -22,6 +23,7 @@ public class CommonTipDialog {
...
@@ -22,6 +23,7 @@ public class CommonTipDialog {
/**
/**
* 提示dialog 確認后執行對應方法
* 提示dialog 確認后執行對應方法
*
* @param context
* @param context
* @param msg
* @param msg
* @param c
* @param c
...
@@ -30,16 +32,16 @@ public class CommonTipDialog {
...
@@ -30,16 +32,16 @@ public class CommonTipDialog {
* @param parameterTypes
* @param parameterTypes
* @param parameters
* @param parameters
*/
*/
public
static
void
showDoubtDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
public
static
void
showDoubtDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_doubt
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setMessage
(
msg
);
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
R
.
drawable
.
shape_3c_cancel_btn_bg
,
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
R
.
drawable
.
shape_3c_cancel_btn_bg
,
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
}
}
dialogBuilder
.
addAction
(
R
.
drawable
.
shape_red_five_radius_bg
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialogBuilder
.
addAction
(
R
.
drawable
.
shape_red_five_radius_bg
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
if
(
TextUtils
.
isEmpty
(
methodName
))
{
return
;
return
;
}
}
try
{
try
{
...
@@ -59,6 +61,7 @@ public class CommonTipDialog {
...
@@ -59,6 +61,7 @@ public class CommonTipDialog {
/**
/**
* 危險警示dialog 確認后執行對應方法
* 危險警示dialog 確認后執行對應方法
*
* @param context
* @param context
* @param msg
* @param msg
* @param c
* @param c
...
@@ -67,16 +70,16 @@ public class CommonTipDialog {
...
@@ -67,16 +70,16 @@ public class CommonTipDialog {
* @param parameterTypes
* @param parameterTypes
* @param parameters
* @param parameters
*/
*/
public
static
void
showSurpisedDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
public
static
void
showSurpisedDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_surprised
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_surprised
);
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
}
}
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
if
(
TextUtils
.
isEmpty
(
methodName
))
{
return
;
return
;
}
}
try
{
try
{
...
@@ -96,6 +99,7 @@ public class CommonTipDialog {
...
@@ -96,6 +99,7 @@ public class CommonTipDialog {
/**
/**
* 警示dialog 確認后執行對應方法
* 警示dialog 確認后執行對應方法
*
* @param context
* @param context
* @param msg
* @param msg
* @param c
* @param c
...
@@ -104,16 +108,16 @@ public class CommonTipDialog {
...
@@ -104,16 +108,16 @@ public class CommonTipDialog {
* @param parameterTypes
* @param parameterTypes
* @param parameters
* @param parameters
*/
*/
public
static
void
showWarnDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
public
static
void
showWarnDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_warn
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_warn
);
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
}
}
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
if
(
TextUtils
.
isEmpty
(
methodName
))
{
return
;
return
;
}
}
try
{
try
{
...
@@ -133,6 +137,7 @@ public class CommonTipDialog {
...
@@ -133,6 +137,7 @@ public class CommonTipDialog {
/**
/**
* 取消 dialog 確認后執行對應方法
* 取消 dialog 確認后執行對應方法
*
* @param context
* @param context
* @param msg
* @param msg
* @param c
* @param c
...
@@ -141,16 +146,16 @@ public class CommonTipDialog {
...
@@ -141,16 +146,16 @@ public class CommonTipDialog {
* @param parameterTypes
* @param parameterTypes
* @param parameters
* @param parameters
*/
*/
public
static
void
showCancelDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
public
static
void
showCancelDialog
(
Activity
context
,
String
msg
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
context
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setMessage
(
msg
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_cancel
);
dialogBuilder
.
setTitleIcon
(
R
.
drawable
.
qmui_icon_dialog_cancel
);
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
}
}
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
if
(
TextUtils
.
isEmpty
(
methodName
))
{
return
;
return
;
}
}
try
{
try
{
...
@@ -177,4 +182,46 @@ public class CommonTipDialog {
...
@@ -177,4 +182,46 @@ public class CommonTipDialog {
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
/**
* 輸入型 dialog 確認后執行對應方法
*
* @param context
* @param title
* @param placeholder
* @param c
* @param object
* @param methodName
* @param parameterTypes
* @param parameters
*/
public
static
void
showEditTextDialog
(
Activity
context
,
String
title
,
String
placeholder
,
Class
c
,
Object
object
,
String
methodName
,
Class
[]
parameterTypes
,
Object
[]
parameters
)
{
final
QMUIDialog
.
EditTextDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
EditTextDialogBuilder
(
context
);
dialogBuilder
.
setTitle
(
title
);
dialogBuilder
.
setPlaceholder
(
placeholder
);
dialogBuilder
.
setInputType
(
InputType
.
TYPE_CLASS_TEXT
);
if
(!
TextUtils
.
isEmpty
(
methodName
))
{
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
}
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
if
(
TextUtils
.
isEmpty
(
methodName
))
{
return
;
}
try
{
Method
method
=
c
.
getDeclaredMethod
(
methodName
,
parameterTypes
);
method
.
setAccessible
(
true
);
method
.
invoke
(
object
,
parameters
);
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
catch
(
InvocationTargetException
e
)
{
e
.
printStackTrace
();
}
catch
(
NoSuchMethodException
e
)
{
e
.
printStackTrace
();
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
}
}
base-module/src/main/res/drawable/shape_triangle_table_type.xml
0 → 100644
View file @
f01b18c5
<?xml version="1.0" encoding="utf-8"?>
<layer-list
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@+id/shape_id"
>
<!-- 正三角 -->
<rotate
android:fromDegrees=
"45"
android:toDegrees=
"45"
android:pivotX=
"100%"
android:pivotY=
"100%"
>
<shape
android:shape=
"rectangle"
>
<solid
android:color=
"@color/theme_white_color"
/>
</shape>
</rotate>
</item>
</layer-list>
\ No newline at end of file
tabl
e-module/src/main/res/drawable/table_shape_table_nomal.xml
→
bas
e-module/src/main/res/drawable/table_shape_table_nomal.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/table_shape_table_print.xml
→
bas
e-module/src/main/res/drawable/table_shape_table_print.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/table_shape_table_send.xml
→
bas
e-module/src/main/res/drawable/table_shape_table_send.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/table_shape_table_use.xml
→
bas
e-module/src/main/res/drawable/table_shape_table_use.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_default.xml
→
bas
e-module/src/main/res/drawable/tablebutton_default.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_default_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_default_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_glassgreen.xml
→
bas
e-module/src/main/res/drawable/tablebutton_glassgreen.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_glassgreen_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_glassgreen_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_red.xml
→
bas
e-module/src/main/res/drawable/tablebutton_red.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_red_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_red_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_skyblue.xml
→
bas
e-module/src/main/res/drawable/tablebutton_skyblue.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_skyblue_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_skyblue_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_splite.xml
→
bas
e-module/src/main/res/drawable/tablebutton_splite.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_splite_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_splite_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_splitetable.xml
→
bas
e-module/src/main/res/drawable/tablebutton_splitetable.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_violet.xml
→
bas
e-module/src/main/res/drawable/tablebutton_violet.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_violet_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_violet_new.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_yellow.xml
→
bas
e-module/src/main/res/drawable/tablebutton_yellow.xml
View file @
f01b18c5
File moved
tabl
e-module/src/main/res/drawable/tablebutton_yellow_new.xml
→
bas
e-module/src/main/res/drawable/tablebutton_yellow_new.xml
View file @
f01b18c5
File moved
base-module/src/main/res/values/attrs.xml
View file @
f01b18c5
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<resources>
<declare-styleable
name=
"AvatarView"
>
<attr
name=
"showLabel"
format=
"boolean"
/>
<attr
name=
"avatarSize"
format=
"dimension"
/>
<attr
name=
"avatarSrc"
format=
"reference"
/>
<attr
name=
"labelSrc"
format=
"reference"
/>
</declare-styleable>
<declare-styleable
name=
"TriangleLabelView"
>
<attr
name=
"backgroundColor"
format=
"color"
/>
<attr
name=
"primaryTextColor"
format=
"color"
/>
<attr
name=
"secondaryTextColor"
format=
"color"
/>
<attr
name=
"primaryText"
format=
"string"
/>
<attr
name=
"secondaryText"
format=
"string"
/>
<attr
name=
"primaryTextSize"
format=
"dimension"
/>
<attr
name=
"secondaryTextSize"
format=
"dimension"
/>
<attr
name=
"labelTopPadding"
format=
"dimension"
/>
<attr
name=
"labelCenterPadding"
format=
"dimension"
/>
<attr
name=
"labelBottomPadding"
format=
"dimension"
/>
<attr
name=
"primaryTextStyle"
>
<enum
name=
"normal"
value=
"0"
/>
<enum
name=
"italic"
value=
"1"
/>
<enum
name=
"bold"
value=
"2"
/>
</attr>
<attr
name=
"secondaryTextStyle"
>
<enum
name=
"normal"
value=
"0"
/>
<enum
name=
"italic"
value=
"1"
/>
<enum
name=
"bold"
value=
"2"
/>
</attr>
<attr
name=
"corner"
>
<enum
name=
"leftTop"
value=
"1"
/>
<enum
name=
"rightTop"
value=
"2"
/>
<enum
name=
"leftBottom"
value=
"3"
/>
<enum
name=
"rightBottom"
value=
"4"
/>
</attr>
</declare-styleable>
<declare-styleable
name=
"SwipeBackLayout"
>
<declare-styleable
name=
"SwipeBackLayout"
>
<attr
name=
"edge_flag"
>
<attr
name=
"edge_flag"
>
<enum
name=
"left"
value=
"0"
/>
<enum
name=
"left"
value=
"0"
/>
...
...
base-module/src/main/res/values/ids.xml
View file @
f01b18c5
...
@@ -22,5 +22,5 @@
...
@@ -22,5 +22,5 @@
<item
name=
"topbar_right_change_button"
type=
"id"
/>
<item
name=
"topbar_right_change_button"
type=
"id"
/>
<item
name=
"layout_for_test"
type=
"id"
/>
</resources>
</resources>
\ No newline at end of file
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/NewMainActivity.java
View file @
f01b18c5
...
@@ -235,34 +235,31 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
...
@@ -235,34 +235,31 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
// }
// }
List
<
Function
>
functions
=
new
ArrayList
<>();
List
<
Function
>
functions
=
new
ArrayList
<>();
if
(!
BuildConfig
.
DEBUG
)
{
// if (!BuildConfig.DEBUG) {
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.order, "order"));
functions
.
add
(
new
Function
((
long
)
150
,
0
,
5
,
"點餐"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
150
,
0
,
5
,
"點餐"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
138
,
150
,
5
,
"餐檯模式"
,
R
.
drawable
.
ic_dining_table_mode
,
0
));
functions
.
add
(
new
Function
((
long
)
138
,
150
,
5
,
"餐檯模式"
,
R
.
drawable
.
ic_dining_table_mode
,
0
));
functions
.
add
(
new
Function
((
long
)
139
,
150
,
5
,
"外送模式"
,
R
.
drawable
.
ic_delivery_mode_close
,
0
));
functions
.
add
(
new
Function
((
long
)
139
,
150
,
5
,
"外送模式"
,
R
.
drawable
.
ic_delivery_mode_close
,
0
));
functions
.
add
(
new
Function
((
long
)
140
,
150
,
5
,
"外賣模式"
,
R
.
drawable
.
ic_outsourcing_model_close
,
0
));
functions
.
add
(
new
Function
((
long
)
140
,
150
,
5
,
"外賣模式"
,
R
.
drawable
.
ic_outsourcing_model_close
,
0
));
functions
.
add
(
new
Function
((
long
)
141
,
150
,
5
,
"預點餐模式"
,
R
.
drawable
.
ic_pre_order_mode_close
,
1
));
functions
.
add
(
new
Function
((
long
)
141
,
150
,
5
,
"預點餐模式"
,
R
.
drawable
.
ic_pre_order_mode_close
,
1
));
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.manager, "manager"));
functions
.
add
(
new
Function
((
long
)
151
,
0
,
5
,
"管理"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
151
,
0
,
5
,
"管理"
,
0
,
0
));
////
functions.add(new Function((long) 142, 151, 5, "賬單管理", R.drawable.ic_meals_menu_management, 0));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"賬單管理"
,
R
.
drawable
.
ic_meals_menu_management
,
0
));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"外賣接單"
,
R
.
drawable
.
ic_takeaway_orders
,
0
));
functions
.
add
(
new
Function
((
long
)
142
,
151
,
5
,
"外賣接單"
,
R
.
drawable
.
ic_takeaway_orders
,
0
));
// functions.add(new Function((long) 143, 151, 5, "餐臺
管理", R.drawable.ic_dining_table_management, 0));
functions
.
add
(
new
Function
((
long
)
143
,
151
,
5
,
"餐檯
管理"
,
R
.
drawable
.
ic_dining_table_management
,
0
));
functions
.
add
(
new
Function
((
long
)
144
,
151
,
5
,
"打印管理"
,
R
.
drawable
.
ic_print_management
,
0
));
functions
.
add
(
new
Function
((
long
)
144
,
151
,
5
,
"打印管理"
,
R
.
drawable
.
ic_print_management
,
0
));
//// functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management_close, 1));
//// functions.add(new Function((long) 145, 151, 5, "支付管理", R.drawable.ic_pay_management_close, 1));
//// functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management_close, 1));
//// functions.add(new Function((long) 146, 151, 5, "折扣管理", R.drawable.ic_discount_management_close, 1));
////
functions.add(new Function((long) 147, 151, 5, "沽清管理", R.drawable.ic_sell_off_manger, 0));
functions
.
add
(
new
Function
((
long
)
147
,
151
,
5
,
"沽清管理"
,
R
.
drawable
.
ic_sell_off_manger
,
0
));
// functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.employee, "employee"));
functions
.
add
(
new
Function
((
long
)
152
,
0
,
5
,
"員工"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
152
,
0
,
5
,
"員工"
,
0
,
0
));
functions
.
add
(
new
Function
((
long
)
147
,
152
,
5
,
"員工管理"
,
R
.
drawable
.
ic_staff_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
147
,
152
,
5
,
"員工管理"
,
R
.
drawable
.
ic_staff_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
148
,
152
,
5
,
"權限管理"
,
R
.
drawable
.
ic_authority_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
148
,
152
,
5
,
"權限管理"
,
R
.
drawable
.
ic_authority_management_close
,
1
));
functions
.
add
(
new
Function
((
long
)
149
,
152
,
5
,
"操作記錄"
,
R
.
drawable
.
ic_operation_record_close
,
1
));
functions
.
add
(
new
Function
((
long
)
149
,
152
,
5
,
"操作記錄"
,
R
.
drawable
.
ic_operation_record_close
,
1
));
}
else
{
//
} else {
functions
.
addAll
(
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
ComponentMain
.
main
.
class
,
ComponentMain
.
main
.
order
,
"order"
));
//
functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.order, "order"));
functions
.
addAll
(
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
ComponentMain
.
main
.
class
,
ComponentMain
.
main
.
manager
,
"manager"
));
//
functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.manager, "manager"));
functions
.
addAll
(
FunctionManager
.
getDefault
().
getFunctionByResModule
(
this
,
ComponentMain
.
main
.
class
,
ComponentMain
.
main
.
employee
,
"employee"
));
//
functions.addAll(FunctionManager.getDefault().getFunctionByResModule(this, ComponentMain.main.class, ComponentMain.main.employee, "employee"));
}
//
}
//將功能列表數據分組
//將功能列表數據分組
SparseArray
<
String
>
parents
=
new
SparseArray
<>();
SparseArray
<
String
>
parents
=
new
SparseArray
<>();
...
@@ -303,14 +300,14 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
...
@@ -303,14 +300,14 @@ public class NewMainActivity extends BaseFragmentActivity<NewMainPresenter> impl
}
}
private
void
functionClick
(
String
name
,
int
status
)
{
private
void
functionClick
(
String
name
,
int
status
)
{
switch
(
status
){
//
switch (status){
case
STATUS_NONACTIVATED:
//
case STATUS_NONACTIVATED:
ToastUtils
.
show
(
mContext
,
"服務暫未開通,請前往開通"
);
//
ToastUtils.show(mContext, "服務暫未開通,請前往開通");
return
;
//
return;
case
STATUS_TIME_LIMIT:
//
case STATUS_TIME_LIMIT:
ToastUtils
.
show
(
mContext
,
"服務已到期,請前往續費"
);
//
ToastUtils.show(mContext, "服務已到期,請前往續費");
return
;
//
return;
}
//
}
if
(
name
.
equals
(
"餐檯模式"
))
{
if
(
name
.
equals
(
"餐檯模式"
))
{
CC
.
obtainBuilder
(
"Component.Table"
)
CC
.
obtainBuilder
(
"Component.Table"
)
.
setActionName
(
"showTableActivity"
)
.
setActionName
(
"showTableActivity"
)
...
...
main-module/src/main/res/layout/main_home_management_funcation_item.xml
View file @
f01b18c5
...
@@ -19,7 +19,6 @@
...
@@ -19,7 +19,6 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginTop=
"@dimen/dp_8"
android:layout_marginTop=
"@dimen/dp_8"
android:singleLine=
"true"
android:text=
"餐檯模式"
android:text=
"餐檯模式"
android:textColor=
"@color/normal_color"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_12"
/>
android:textSize=
"@dimen/sp_12"
/>
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/contract/TableListContract.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
contract
;
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
import
com.jess.arms.mvp.IModel
;
import
java.util.List
;
/**
/**
* ================================================
* ================================================
...
@@ -20,6 +23,8 @@ public interface TableListContract {
...
@@ -20,6 +23,8 @@ public interface TableListContract {
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
interface
View
extends
IView
{
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
);
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
);
List
<
TableItem
>
getTableList
();
}
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/contract/TableManageContract.java
View file @
f01b18c5
...
@@ -34,6 +34,10 @@ public interface TableManageContract {
...
@@ -34,6 +34,10 @@ public interface TableManageContract {
void
queryTablesSuccess
(
List
<
TableItem
>
tables
,
int
type
);
void
queryTablesSuccess
(
List
<
TableItem
>
tables
,
int
type
);
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
);
void
showEmptyView
(
boolean
isSuccess
,
int
size
,
Throwable
t
);
void
onStartRefreshTableData
();
void
onPauseRefreshTableData
();
}
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
@@ -55,5 +59,10 @@ public interface TableManageContract {
...
@@ -55,5 +59,10 @@ public interface TableManageContract {
Observable
<
BaseResult
>
queryTables
();
Observable
<
BaseResult
>
queryTables
();
Observable
<
BaseResult
>
changeAreaSort
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
changeTableSort
(
RequestBody
requestBody
);
Observable
<
BaseResult
>
updateTableServiceCharge
(
RequestBody
requestBody
);
}
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/TableManageModel.java
View file @
f01b18c5
...
@@ -158,4 +158,40 @@ public class TableManageModel extends BaseModel implements TableManageContract.M
...
@@ -158,4 +158,40 @@ public class TableManageModel extends BaseModel implements TableManageContract.M
.
queryTable
(
restaurantId
);
.
queryTable
(
restaurantId
);
}
}
@Override
public
Observable
<
BaseResult
>
changeAreaSort
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableManageService
.
class
)
.
changeAreaSort
(
requestBody
);
}
@Override
public
Observable
<
BaseResult
>
changeTableSort
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableManageService
.
class
)
.
changeTableSort
(
requestBody
)
.
flatMap
(
new
Function
<
BaseResult
,
Observable
<
BaseResult
>>()
{
@Override
public
Observable
<
BaseResult
>
apply
(
BaseResult
info
)
throws
Exception
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
return
queryTables
();
}
return
null
;
}
});
}
@Override
public
Observable
<
BaseResult
>
updateTableServiceCharge
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
TableManageService
.
class
)
.
updateTableServiceCharge
(
requestBody
)
.
flatMap
(
new
Function
<
BaseResult
,
Observable
<
BaseResult
>>()
{
@Override
public
Observable
<
BaseResult
>
apply
(
BaseResult
info
)
throws
Exception
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
return
queryTables
();
}
return
null
;
}
});
}
}
}
\ No newline at end of file
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/bean/TableItem.java
View file @
f01b18c5
...
@@ -34,7 +34,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -34,7 +34,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
* regionId : 1
* regionId : 1
*/
*/
private
int
id
;
private
long
id
;
/**區域ID*/
/**區域ID*/
private
int
regionId
;
private
int
regionId
;
/**區域名稱*/
/**區域名稱*/
...
@@ -43,7 +43,12 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -43,7 +43,12 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
private
int
restaurantId
;
private
int
restaurantId
;
private
Long
orderId
;
private
Long
orderId
;
private
String
qrCode
;
private
String
qrCode
;
/**默認就餐人數*/
private
int
seatCount
;
private
int
seatCount
;
/**最大就餐人數*/
private
int
maxSeatCount
;
/**最小就餐人數*/
private
int
minSeatCount
;
private
String
createTime
;
private
String
createTime
;
private
String
createBy
;
private
String
createBy
;
private
String
qrCodeImg
;
private
String
qrCodeImg
;
...
@@ -71,10 +76,29 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -71,10 +76,29 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
* 排序
* 排序
*/
*/
private
int
sort
;
private
int
sort
;
/**
0:堂食
1:外賣
2:自取
*/
private
int
type
=
-
1
;
public
static
final
int
TABLE_TYPE_CANTEEN
=
0
;
public
static
final
int
TABLE_TYPE_TAKEAWAY
=
1
;
public
static
final
int
TABLE_TYPE_SELF_FETCHING
=
2
;
/**
* 自定義字段
*/
/**是否選中*/
/**是否選中*/
private
boolean
isChecked
=
false
;
private
boolean
isChecked
=
false
;
/**
* UI类型:
* 餐台 0
* 新增(+) 1
*/
private
int
layoutType
=
0
;
public
TableItem
()
{
public
TableItem
()
{
}
}
...
@@ -88,6 +112,8 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -88,6 +112,8 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this
.
restaurantId
=
dataBean
.
restaurantId
;
this
.
restaurantId
=
dataBean
.
restaurantId
;
this
.
qrCode
=
dataBean
.
qrCode
;
this
.
qrCode
=
dataBean
.
qrCode
;
this
.
seatCount
=
dataBean
.
seatCount
;
this
.
seatCount
=
dataBean
.
seatCount
;
this
.
maxSeatCount
=
dataBean
.
maxSeatCount
;
this
.
minSeatCount
=
dataBean
.
minSeatCount
;
this
.
createTime
=
dataBean
.
createTime
;
this
.
createTime
=
dataBean
.
createTime
;
this
.
createBy
=
dataBean
.
createBy
;
this
.
createBy
=
dataBean
.
createBy
;
this
.
qrCodeImg
=
dataBean
.
qrCodeImg
;
this
.
qrCodeImg
=
dataBean
.
qrCodeImg
;
...
@@ -98,6 +124,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -98,6 +124,7 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this
.
person
=
dataBean
.
person
;
this
.
person
=
dataBean
.
person
;
this
.
useStatus
=
dataBean
.
useStatus
;
this
.
useStatus
=
dataBean
.
useStatus
;
this
.
sort
=
dataBean
.
sort
;
this
.
sort
=
dataBean
.
sort
;
this
.
type
=
dataBean
.
type
;
this
.
isChecked
=
dataBean
.
isChecked
;
this
.
isChecked
=
dataBean
.
isChecked
;
}
}
...
@@ -117,11 +144,11 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -117,11 +144,11 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this
.
useStatus
=
useStatus
;
this
.
useStatus
=
useStatus
;
}
}
public
int
getId
()
{
public
long
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
int
id
)
{
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
...
@@ -181,6 +208,30 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -181,6 +208,30 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
this
.
seatCount
=
seatCount
;
this
.
seatCount
=
seatCount
;
}
}
public
int
getMaxSeatCount
()
{
return
maxSeatCount
;
}
public
void
setMaxSeatCount
(
int
maxSeatCount
)
{
this
.
maxSeatCount
=
maxSeatCount
;
}
public
int
getMinSeatCount
()
{
return
minSeatCount
;
}
public
void
setMinSeatCount
(
int
minSeatCount
)
{
this
.
minSeatCount
=
minSeatCount
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
String
getCreateTime
()
{
public
String
getCreateTime
()
{
return
createTime
;
return
createTime
;
}
}
...
@@ -253,6 +304,14 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
...
@@ -253,6 +304,14 @@ public class TableItem implements Serializable, QMUISection.Model<TableItem>{
isChecked
=
checked
;
isChecked
=
checked
;
}
}
public
int
getLayoutType
()
{
return
layoutType
;
}
public
void
setLayoutType
(
int
layoutType
)
{
this
.
layoutType
=
layoutType
;
}
@Override
@Override
public
TableItem
cloneForDiff
()
{
public
TableItem
cloneForDiff
()
{
return
null
;
return
null
;
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/bean/request/TableRequest.java
View file @
f01b18c5
...
@@ -16,13 +16,22 @@ public class TableRequest {
...
@@ -16,13 +16,22 @@ public class TableRequest {
private
int
regionId
;
private
int
regionId
;
/**餐檯名*/
/**餐檯名*/
private
String
tableName
;
private
String
tableName
;
/**座位数*/
/**默認就餐人數*/
private
int
seatCount
;
private
Integer
seatCount
;
/**最大就餐人數*/
private
Integer
maxSeatCount
;
/**最小就餐人數*/
private
Integer
minSeatCount
;
/**服務費*/
/**服務費*/
private
Double
serviceCharge
;
private
Double
serviceCharge
;
/**排序*/
/**排序*/
private
int
sort
;
private
int
sort
;
/**
0#堂食
1#外賣
2#自取
*/
private
int
type
;
public
int
getRestaurantId
()
{
public
int
getRestaurantId
()
{
return
restaurantId
;
return
restaurantId
;
...
@@ -56,6 +65,34 @@ public class TableRequest {
...
@@ -56,6 +65,34 @@ public class TableRequest {
this
.
seatCount
=
seatCount
;
this
.
seatCount
=
seatCount
;
}
}
public
void
setSeatCount
(
Integer
seatCount
)
{
this
.
seatCount
=
seatCount
;
}
public
Integer
getMaxSeatCount
()
{
return
maxSeatCount
;
}
public
void
setMaxSeatCount
(
Integer
maxSeatCount
)
{
this
.
maxSeatCount
=
maxSeatCount
;
}
public
Integer
getMinSeatCount
()
{
return
minSeatCount
;
}
public
void
setMinSeatCount
(
Integer
minSeatCount
)
{
this
.
minSeatCount
=
minSeatCount
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
Double
getServiceCharge
()
{
public
Double
getServiceCharge
()
{
return
serviceCharge
;
return
serviceCharge
;
}
}
...
@@ -75,26 +112,36 @@ public class TableRequest {
...
@@ -75,26 +112,36 @@ public class TableRequest {
public
static
class
Update
{
public
static
class
Update
{
private
int
id
;
private
long
id
;
private
int
restaurantId
;
private
int
restaurantId
;
/**區域ID*/
/**區域ID*/
private
int
regionId
;
private
int
regionId
;
/**餐檯名*/
/**餐檯名*/
private
String
tableName
;
private
String
tableName
;
/**座位数*/
/**默認就餐人數*/
private
int
seatCount
;
private
Integer
seatCount
;
/**最大就餐人數*/
private
Integer
maxSeatCount
;
/**最小就餐人數*/
private
Integer
minSeatCount
;
/**服務費*/
/**服務費*/
private
Double
serviceCharge
;
private
Double
serviceCharge
;
/**排序*/
/**排序*/
private
int
sort
;
private
int
sort
;
/**
0:堂食
1:外賣
2:自取
*/
private
int
type
=
-
1
;
public
int
getId
()
{
public
long
getId
()
{
return
id
;
return
id
;
}
}
public
void
setId
(
int
id
)
{
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
this
.
id
=
id
;
}
}
...
@@ -130,6 +177,34 @@ public class TableRequest {
...
@@ -130,6 +177,34 @@ public class TableRequest {
this
.
seatCount
=
seatCount
;
this
.
seatCount
=
seatCount
;
}
}
public
void
setSeatCount
(
Integer
seatCount
)
{
this
.
seatCount
=
seatCount
;
}
public
Integer
getMaxSeatCount
()
{
return
maxSeatCount
;
}
public
void
setMaxSeatCount
(
Integer
maxSeatCount
)
{
this
.
maxSeatCount
=
maxSeatCount
;
}
public
Integer
getMinSeatCount
()
{
return
minSeatCount
;
}
public
void
setMinSeatCount
(
Integer
minSeatCount
)
{
this
.
minSeatCount
=
minSeatCount
;
}
public
int
getType
()
{
return
type
;
}
public
void
setType
(
int
type
)
{
this
.
type
=
type
;
}
public
Double
getServiceCharge
()
{
public
Double
getServiceCharge
()
{
return
serviceCharge
;
return
serviceCharge
;
}
}
...
@@ -147,4 +222,28 @@ public class TableRequest {
...
@@ -147,4 +222,28 @@ public class TableRequest {
}
}
}
}
public
static
class
UpdateServiceCharge
{
private
long
id
;
/**服務費*/
private
Double
serviceCharge
;
public
long
getId
()
{
return
id
;
}
public
void
setId
(
long
id
)
{
this
.
id
=
id
;
}
public
Double
getServiceCharge
()
{
return
serviceCharge
;
}
public
void
setServiceCharge
(
Double
serviceCharge
)
{
this
.
serviceCharge
=
serviceCharge
;
}
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/model/service/TableManageService.java
View file @
f01b18c5
...
@@ -51,4 +51,13 @@ public interface TableManageService {
...
@@ -51,4 +51,13 @@ public interface TableManageService {
@POST
(
"restaurant/exchangeSort"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
changeAreaSort
(
@Body
RequestBody
requestBody
);
@POST
(
"restaurantTable/exchangeSort"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
changeTableSort
(
@Body
RequestBody
requestBody
);
@POST
(
"restaurantTable/updateRestaurantTableBatch"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BaseResult
>
updateTableServiceCharge
(
@Body
RequestBody
requestBody
);
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/presenter/TableListPresenter.java
View file @
f01b18c5
...
@@ -90,9 +90,22 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
...
@@ -90,9 +90,22 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
/**
/**
* 組合區域集合
* 組合區域集合
*/
*/
public
List
<
TableArea
>
assembleAreaList
(
List
<
TableItem
>
tableList
)
{
public
List
<
TableArea
>
assembleAreaList
(
List
<
TableArea
>
areaList
,
List
<
TableItem
>
tableList
)
{
removeOtherAreaItem
(
areaList
);
if
(
areaList
.
size
()
>
0
)
{
for
(
TableItem
table
:
tableList
)
{
if
(
table
.
getRegionId
()
==
-
1
)
{
//將沒有區域的檯 放到其他下面
TableArea
newArea
=
new
TableArea
();
newArea
.
setId
(-
1
);
newArea
.
setRegionName
(
"其他"
);
areaList
.
add
(
newArea
);
break
;
}
}
return
areaList
;
}
boolean
addOther
=
false
;
boolean
addOther
=
false
;
List
<
TableArea
>
areaList
=
new
ArrayList
<>();
for
(
TableItem
table
:
tableList
)
{
for
(
TableItem
table
:
tableList
)
{
if
(
table
.
getRegionId
()
!=
-
1
)
{
if
(
table
.
getRegionId
()
!=
-
1
)
{
if
(!
equalsAreaId
(
areaList
,
table
.
getRegionId
()))
{
if
(!
equalsAreaId
(
areaList
,
table
.
getRegionId
()))
{
...
@@ -124,6 +137,14 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
...
@@ -124,6 +137,14 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
return
false
;
return
false
;
}
}
private
void
removeOtherAreaItem
(
List
<
TableArea
>
areaList
)
{
for
(
int
i
=
areaList
.
size
()
-
1
;
i
>=
0
;
i
--)
{
if
(
areaList
.
get
(
i
).
getRegionName
().
equals
(
"其他"
))
{
areaList
.
remove
(
i
);
}
}
}
public
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
tableAreaTransformToSection
(
List
<
TableArea
>
mItems
)
{
public
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
tableAreaTransformToSection
(
List
<
TableArea
>
mItems
)
{
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
qmuiSections
=
new
ArrayList
<>();
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
qmuiSections
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
mItems
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mItems
.
size
();
i
++)
{
...
@@ -139,6 +160,23 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
...
@@ -139,6 +160,23 @@ public class TableListPresenter extends BasePresenter<TableListContract.Model, T
if
(
Objects
.
requireNonNull
(
tableArea
.
getTableItemList
().
size
())
>
0
)
{
if
(
Objects
.
requireNonNull
(
tableArea
.
getTableItemList
().
size
())
>
0
)
{
contents
.
addAll
(
tableArea
.
getTableItemList
());
contents
.
addAll
(
tableArea
.
getTableItemList
());
}
}
contents
.
add
(
createAddTableItem
(
tableArea
));
return
new
QMUISection
(
header
,
contents
,
false
);
return
new
QMUISection
(
header
,
contents
,
false
);
}
}
/**
* 创建+按钮
*
* @return
*/
private
TableItem
createAddTableItem
(
TableArea
tableArea
)
{
TableItem
item
=
new
TableItem
();
item
.
setLayoutType
(
1
);
item
.
setStatus
(
0
);
item
.
setRegionId
(
tableArea
.
getId
());
item
.
setRegionName
(
tableArea
.
getRegionName
());
return
item
;
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/presenter/TableManagePresenter.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
presenter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
presenter
;
import
android.app.Application
;
import
android.app.Application
;
import
android.os.CountDownTimer
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.BaseResult
;
import
com.gingersoft.gsa.cloud.base.common.bean.FoodBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.FoodBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.constans.GoldConstants
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
...
@@ -35,8 +39,11 @@ import com.gingersoft.gsa.cloud.manager.mvp.contract.TableManageContract;
...
@@ -35,8 +39,11 @@ import com.gingersoft.gsa.cloud.manager.mvp.contract.TableManageContract;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
base
.
common
.
bean
.
OrderDetail
.
DISCOUNT_TYPE
;
/**
/**
* ================================================
* ================================================
...
@@ -61,10 +68,16 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
...
@@ -61,10 +68,16 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
@Inject
@Inject
AppManager
mAppManager
;
AppManager
mAppManager
;
//定时获取餐台 定时器
private
GetTableTimer
tableTimer
;
private
Disposable
mGetTablesDataDisposable
;
private
TableManageActivity
IActivity
;
@Inject
@Inject
public
TableManagePresenter
(
TableManageContract
.
Model
model
,
TableManageContract
.
View
rootView
)
{
public
TableManagePresenter
(
TableManageContract
.
Model
model
,
TableManageContract
.
View
rootView
)
{
super
(
model
,
rootView
);
super
(
model
,
rootView
);
this
.
IActivity
=
(
TableManageActivity
)
rootView
;
}
}
@Override
@Override
...
@@ -155,11 +168,11 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
...
@@ -155,11 +168,11 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
});
});
}
}
public
void
queryAreas
(
RefreshLayout
refreshLayout
)
{
public
void
queryAreas
(
RefreshLayout
refreshLayout
,
boolean
showLoading
)
{
mModel
.
queryAreas
()
mModel
.
queryAreas
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
{
.
doOnSubscribe
(
disposable
->
{
if
(
refreshLayout
==
null
)
{
if
(
refreshLayout
==
null
&&
showLoading
)
{
mRootView
.
showLoading
(
null
);
mRootView
.
showLoading
(
null
);
}
}
})
})
...
@@ -291,20 +304,14 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
...
@@ -291,20 +304,14 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
mRootView
.
showMessage
(
"更新失敗"
);
mRootView
.
showMessage
(
"更新失敗"
);
}
}
}
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
}
});
});
}
}
public
void
queryTables
(
RefreshLayout
refreshLayout
)
{
public
void
queryTables
(
RefreshLayout
refreshLayout
,
boolean
showLoading
)
{
mModel
.
queryTables
()
mModel
.
queryTables
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
{
.
doOnSubscribe
(
disposable
->
{
if
(
refreshLayout
==
null
)
{
if
(
refreshLayout
==
null
&&
showLoading
)
{
mRootView
.
showLoading
(
null
);
mRootView
.
showLoading
(
null
);
}
}
})
})
...
@@ -315,6 +322,12 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
...
@@ -315,6 +322,12 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
@Override
public
void
onSubscribe
(
Disposable
d
)
{
super
.
onSubscribe
(
d
);
mGetTablesDataDisposable
=
d
;
}
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
if
(
info
.
getData
()
!=
null
)
{
...
@@ -355,5 +368,168 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
...
@@ -355,5 +368,168 @@ public class TableManagePresenter extends BasePresenter<TableManageContract.Mode
});
});
}
}
public
void
changeAreaSort
(
long
id
,
long
sort
,
long
targetId
,
long
targetSort
)
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"id"
,
String
.
valueOf
(
id
))
.
add
(
"sort"
,
String
.
valueOf
(
sort
))
.
add
(
"targetId"
,
String
.
valueOf
(
targetId
))
.
add
(
"targetSort"
,
String
.
valueOf
(
targetSort
))
.
build
();
LogUtil
.
d
(
TAG
,
"changeAreaSort "
+
" id:"
+
id
+
" sort:"
+
sort
+
" targetId:"
+
targetId
+
" targetSort:"
+
targetSort
);
mModel
.
changeAreaSort
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
List
<
TableItem
>
tableItems
=
JsonUtils
.
parseArray
(
info
.
getData
(),
TableItem
.
class
);
if
(
tableItems
.
size
()
>
0
)
{
mRootView
.
queryTablesSuccess
(
tableItems
,
TableManageActivity
.
CHANGE_AREA_SORT
);
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showMessage
(
"更新失敗"
);
}
}
});
}
public
void
changeTableSort
()
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"restaurantId"
,
String
.
valueOf
(
GsaCloudApplication
.
getRestaurantId
(
mApplication
)))
.
add
(
"ids"
,
getTableIds
())
.
build
();
mModel
.
changeTableSort
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
// .doOnSubscribe(disposable -> mRootView.showLoading(null))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
// .doAfterTerminate(() -> mRootView.hideLoading())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
List
<
TableItem
>
tableItems
=
JsonUtils
.
parseArray
(
info
.
getData
(),
TableItem
.
class
);
if
(
tableItems
.
size
()
>
0
)
{
mRootView
.
queryTablesSuccess
(
tableItems
,
TableManageActivity
.
CHANGE_TABLE_SORT
);
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showMessage
(
"更新失敗"
);
}
}
});
}
private
String
getTableIds
()
{
StringBuilder
builder
=
new
StringBuilder
();
for
(
TableItem
tableItem
:
IActivity
.
getTableList
())
{
builder
.
append
(
tableItem
.
getId
());
builder
.
append
(
","
);
}
String
str
=
builder
.
toString
();
if
(
str
.
endsWith
(
","
))
{
str
=
str
.
substring
(
0
,
str
.
length
()
-
1
);
}
return
str
;
}
public
void
updateTableServiceCharge
(
List
<
TableRequest
.
UpdateServiceCharge
>
request
)
{
RequestBody
requestBody
=
RequestBody
.
create
(
MediaType
.
parse
(
"application/json"
),
GsonUtils
.
GsonString
(
request
));
String
json
=
GsonUtils
.
GsonString
(
request
);
mModel
.
updateTableServiceCharge
(
requestBody
)
.
subscribeOn
(
Schedulers
.
io
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
null
))
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
BaseResult
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
BaseResult
info
)
{
if
(
info
!=
null
&&
info
.
isSuccess
())
{
if
(
info
.
getData
()
!=
null
)
{
List
<
TableItem
>
tableItems
=
JsonUtils
.
parseArray
(
info
.
getData
(),
TableItem
.
class
);
if
(
tableItems
.
size
()
>
0
)
{
mRootView
.
queryTablesSuccess
(
tableItems
,
TableManageActivity
.
UPDATE_TABLE_SERVICE_CHARGE
);
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showEmptyView
(
true
,
0
,
null
);
}
}
else
{
mRootView
.
showMessage
(
"更新失敗"
);
}
}
});
}
public
void
initGetTableTimer
()
{
if
(
tableTimer
==
null
)
{
tableTimer
=
new
GetTableTimer
(
GoldConstants
.
refreshTime
*
1000
,
GoldConstants
.
refreshTime
*
1000
);
}
TableManageActivity
.
isRefreshData
=
true
;
tableTimer
.
start
();
}
public
void
startTableTimer
()
{
if
(
tableTimer
!=
null
)
{
tableTimer
.
start
();
}
}
public
void
cancelTableTimer
()
{
if
(
tableTimer
!=
null
)
{
tableTimer
.
cancel
();
}
}
/**
* 计时器类 定時更新餐台数据
*/
private
class
GetTableTimer
extends
CountDownTimer
{
public
GetTableTimer
(
long
millisInFuture
,
long
countDownInterval
)
{
super
(
millisInFuture
,
countDownInterval
);
// 参数依次为总时长,和计时的时间间隔
}
@Override
public
void
onFinish
()
{
// 计时完毕时触发
if
(
TableManageActivity
.
isRefreshData
)
{
queryAreas
(
null
,
false
);
queryTables
(
null
,
false
);
}
this
.
start
();
}
@Override
public
void
onTick
(
long
millisUntilFinished
)
{
// 计时过程显示
}
}
public
Disposable
getGetTablesDataDisposable
()
{
return
mGetTablesDataDisposable
;
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/activity/TableManageActivity.java
View file @
f01b18c5
...
@@ -79,6 +79,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
...
@@ -79,6 +79,11 @@ import static com.jess.arms.utils.Preconditions.checkNotNull;
*/
*/
public
class
TableManageActivity
extends
BaseFragmentActivity
<
TableManagePresenter
>
implements
TableManageContract
.
View
{
public
class
TableManageActivity
extends
BaseFragmentActivity
<
TableManagePresenter
>
implements
TableManageContract
.
View
{
/**
* 輪訓刷新餐檯數據
*/
public
static
boolean
isRefreshData
=
true
;
public
static
final
int
ADD_TABLE_RESULT_SUCCESS
=
100
;
public
static
final
int
ADD_TABLE_RESULT_SUCCESS
=
100
;
public
static
final
int
ADD_AREA_RESULT_SUCCESS
=
200
;
public
static
final
int
ADD_AREA_RESULT_SUCCESS
=
200
;
...
@@ -92,7 +97,14 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -92,7 +97,14 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
public
static
final
byte
UPDATE_TABLE_SUCCESS
=
22
;
public
static
final
byte
UPDATE_TABLE_SUCCESS
=
22
;
public
static
final
byte
QUERY_TABLE_SUCCESS
=
23
;
public
static
final
byte
QUERY_TABLE_SUCCESS
=
23
;
public
static
final
byte
CHANGE_AREA_SORT
=
30
;
public
static
final
byte
CHANGE_TABLE_SORT
=
31
;
public
static
final
byte
UPDATE_TABLE_SERVICE_CHARGE
=
32
;
private
List
<
TableArea
>
mTableAreaList
=
new
ArrayList
<>();
private
List
<
TableArea
>
mTableAreaList
=
new
ArrayList
<>();
private
List
<
TableItem
>
mTableList
=
new
ArrayList
<>();
@Override
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
...
@@ -115,6 +127,11 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -115,6 +127,11 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
if
(
findFragment
(
TableListFragment
.
class
)
==
null
)
{
if
(
findFragment
(
TableListFragment
.
class
)
==
null
)
{
loadRootFragment
(
R
.
id
.
fl_container
,
TableListFragment
.
newInstance
());
loadRootFragment
(
R
.
id
.
fl_container
,
TableListFragment
.
newInstance
());
}
}
}
public
void
initGetTableTimer
()
{
mPresenter
.
initGetTableTimer
();
}
}
@Override
@Override
...
@@ -142,7 +159,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -142,7 +159,7 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
}
}
public
void
queryAreas
(
RefreshLayout
refreshLayout
)
{
public
void
queryAreas
(
RefreshLayout
refreshLayout
)
{
mPresenter
.
queryAreas
(
refreshLayout
);
mPresenter
.
queryAreas
(
refreshLayout
,
true
);
}
}
public
void
addTable
(
TableRequest
.
Add
request
)
{
public
void
addTable
(
TableRequest
.
Add
request
)
{
...
@@ -158,7 +175,19 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -158,7 +175,19 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
}
}
public
void
queryTables
(
RefreshLayout
refreshLayout
)
{
public
void
queryTables
(
RefreshLayout
refreshLayout
)
{
mPresenter
.
queryTables
(
refreshLayout
);
mPresenter
.
queryTables
(
refreshLayout
,
true
);
}
public
void
changeAreaSort
(
long
id
,
long
sort
,
long
targetId
,
long
targetSort
)
{
mPresenter
.
changeAreaSort
(
id
,
sort
,
targetId
,
targetSort
);
}
public
void
changeTableSort
()
{
mPresenter
.
changeTableSort
();
}
public
void
updateTableServiceCharge
(
List
<
TableRequest
.
UpdateServiceCharge
>
request
)
{
mPresenter
.
updateTableServiceCharge
(
request
);
}
}
@Override
@Override
...
@@ -233,11 +262,15 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -233,11 +262,15 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
switch
(
type
)
{
switch
(
type
)
{
case
ADD_AREA_SUCCESS:
case
ADD_AREA_SUCCESS:
case
UPDATE_AREA_SUCCESS:
case
UPDATE_AREA_SUCCESS:
AddAreaFragment
addAreaFragment
=
(
AddAreaFragment
)
fragment
;
AreaListFragment
areaListFragment
=
(
AreaListFragment
)
fragment
;
addAreaFragment
.
pop
();
AreaListFragment
areaListFragment
=
findFragment
(
AreaListFragment
.
class
);
if
(
areaListFragment
!=
null
)
{
if
(
areaListFragment
!=
null
)
{
areaListFragment
.
updateAreaData
(
areas
);
if
(
type
==
ADD_AREA_SUCCESS
)
{
areaListFragment
.
addSuccess
();
}
}
TableListFragment
tableListFragment
=
findFragment
(
TableListFragment
.
class
);
if
(
tableListFragment
!=
null
){
tableListFragment
.
updateTableData
(
mTableAreaList
,
mTableList
);
}
}
break
;
break
;
case
DELETE_AREA_SUCCESS:
case
DELETE_AREA_SUCCESS:
...
@@ -246,29 +279,43 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -246,29 +279,43 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
case
QUERY_AREA_SUCCESS:
case
QUERY_AREA_SUCCESS:
break
;
break
;
case
CHANGE_AREA_SORT:
break
;
}
}
}
}
}
}
@Override
@Override
public
void
queryTablesSuccess
(
List
<
TableItem
>
tables
,
int
type
)
{
public
void
queryTablesSuccess
(
List
<
TableItem
>
tables
,
int
type
)
{
if
(
mTableList
.
size
()
>
0
)
{
mTableList
.
clear
();
}
this
.
mTableList
.
addAll
(
tables
);
ISupportFragment
fragment
=
getTopFragment
();
ISupportFragment
fragment
=
getTopFragment
();
if
(
fragment
!=
null
)
{
if
(
fragment
!=
null
)
{
if
(
fragment
instanceof
TableListFragment
)
{
if
(
fragment
instanceof
TableListFragment
)
{
TableListFragment
tableListFragment
=
(
TableListFragment
)
fragment
;
TableListFragment
tableListFragment
=
(
TableListFragment
)
fragment
;
tableListFragment
.
updateTableData
(
tables
);
tableListFragment
.
updateTableData
(
mTableAreaList
,
tables
);
}
}
TableListFragment
tableListFragment
=
findFragment
(
TableListFragment
.
class
);
switch
(
type
)
{
switch
(
type
)
{
case
ADD_TABLE_SUCCESS:
case
ADD_TABLE_SUCCESS:
case
UPDATE_TABLE_SUCCESS:
case
UPDATE_TABLE_SUCCESS:
AddTableFragment
addTableFragment
=
(
AddTableFragment
)
fragment
;
AddTableFragment
addTableFragment
=
(
AddTableFragment
)
fragment
;
addTableFragment
.
pop
();
addTableFragment
.
pop
();
TableListFragment
tableListFragment
=
findFragment
(
TableListFragment
.
class
);
if
(
tableListFragment
!=
null
)
{
if
(
tableListFragment
!=
null
)
{
tableListFragment
.
updateTableData
(
tables
);
tableListFragment
.
updateTableData
(
mTableAreaList
,
tables
);
}
}
break
;
break
;
case
DELETE_TABLE_SUCCESS:
case
DELETE_TABLE_SUCCESS:
case
UPDATE_TABLE_SERVICE_CHARGE:
if
(
fragment
instanceof
TableListFragment
)
{
tableListFragment
.
backEdit
();
}
break
;
case
CHANGE_TABLE_SORT:
break
;
break
;
case
QUERY_TABLE_SUCCESS:
case
QUERY_TABLE_SUCCESS:
...
@@ -290,8 +337,29 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
...
@@ -290,8 +337,29 @@ public class TableManageActivity extends BaseFragmentActivity<TableManagePresent
}
}
}
}
@Override
public
void
onStartRefreshTableData
()
{
isRefreshData
=
true
;
mPresenter
.
startTableTimer
();
mPresenter
.
queryTables
(
null
,
false
);
}
@Override
public
void
onPauseRefreshTableData
()
{
isRefreshData
=
false
;
mPresenter
.
cancelTableTimer
();
//立刻停止獲取餐檯接口
if
(
mPresenter
.
getGetTablesDataDisposable
()
!=
null
&&
!
mPresenter
.
getGetTablesDataDisposable
().
isDisposed
())
{
mPresenter
.
getGetTablesDataDisposable
().
dispose
();
}
}
public
List
<
TableArea
>
getTableAreaList
()
{
public
List
<
TableArea
>
getTableAreaList
()
{
return
mTableAreaList
;
return
mTableAreaList
;
}
}
public
List
<
TableItem
>
getTableList
()
{
return
mTableList
;
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/AreaManageAdapter.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
adapter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.content.Context
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
import
android.widget.EditText
;
import
android.widget.RadioButton
;
import
android.widget.RadioButton
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -50,12 +53,12 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
...
@@ -50,12 +53,12 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
return
R
.
layout
.
manager_item_manage_area
;
return
R
.
layout
.
manager_item_manage_area
;
}
}
class
TopTableAreaItemHolder
extends
BaseHolder
<
TableArea
>
{
public
class
TopTableAreaItemHolder
extends
BaseHolder
<
TableArea
>
{
@BindView
(
R2
.
id
.
tv
_name
)
@BindView
(
R2
.
id
.
ed
_name
)
TextView
tv
_name
;
EditText
ed
_name
;
// @BindView(R2.id.tv_edit
)
// @BindView(R2.id.ed_input_name
)
// TextView
tv_edit
;
// TextView
ed_input_name
;
@BindView
(
R2
.
id
.
cb_checked
)
@BindView
(
R2
.
id
.
cb_checked
)
CheckBox
cb_checked
;
CheckBox
cb_checked
;
...
@@ -65,7 +68,18 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
...
@@ -65,7 +68,18 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
@Override
@Override
public
void
setData
(
TableArea
datasBean
,
int
position
)
{
public
void
setData
(
TableArea
datasBean
,
int
position
)
{
tv_name
.
setText
(
datasBean
.
getRegionName
());
ed_name
.
setText
(
datasBean
.
getRegionName
());
ed_name
.
setOnFocusChangeListener
(
new
View
.
OnFocusChangeListener
()
{
@Override
public
void
onFocusChange
(
View
v
,
boolean
hasFocus
)
{
if
(!
hasFocus
)
{
String
name
=
ed_name
.
getText
().
toString
();
if
(
onTextChangedListener
!=
null
&&
!
name
.
equals
(
datasBean
.
getRegionName
()))
{
onTextChangedListener
.
afterTextChanged
(
datasBean
,
name
);
}
}
}
});
// tv_edit.setOnClickListener(new View.OnClickListener() {
// tv_edit.setOnClickListener(new View.OnClickListener() {
// @Override
// @Override
// public void onClick(View v) {
// public void onClick(View v) {
...
@@ -92,15 +106,15 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
...
@@ -92,15 +106,15 @@ public class AreaManageAdapter extends DefaultAdapter<TableArea> {
isRadioEdit
=
radioEdit
;
isRadioEdit
=
radioEdit
;
}
}
private
On
ClickListener
onClick
Listener
;
private
On
TextChangedListener
onTextChanged
Listener
;
public
void
setOnClickListener
(
OnClickListener
onClick
Listener
)
{
public
void
addTextChangedListener
(
OnTextChangedListener
onTextChanged
Listener
)
{
this
.
on
ClickListener
=
onClick
Listener
;
this
.
on
TextChangedListener
=
onTextChanged
Listener
;
}
}
public
interface
On
Click
Listener
{
public
interface
On
TextChanged
Listener
{
void
onItemClick
(
View
v
,
TableArea
function
);
void
afterTextChanged
(
TableArea
datasBean
,
String
s
);
}
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/adapter/TableManageSectiontAdapter.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
adapter
;
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
adapter
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.CompoundButton
;
import
android.widget.FrameLayout
;
import
android.widget.LinearLayout
;
import
android.widget.RadioButton
;
import
android.widget.RadioButton
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.aspectj.XClickUtil
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
;
import
com.gingersoft.gsa.cloud.manager.R
;
import
com.gingersoft.gsa.cloud.manager.R
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.view.TriangleLabelView
;
import
com.gingersoft.gsa.cloud.ui.view.qm.QDLoadingItemView
;
import
com.gingersoft.gsa.cloud.ui.view.qm.QDLoadingItemView
;
import
com.gingersoft.gsa.cloud.ui.view.section.QDSectionHeaderView
;
import
com.gingersoft.gsa.cloud.ui.view.section.QDSectionHeaderView
;
import
com.jess.arms.utils.DeviceUtils
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
;
import
com.qmuiteam.qmui.layout.QMUIFrameLayout
;
import
com.qmuiteam.qmui.layout.QMUILinearLayout
;
import
com.qmuiteam.qmui.layout.QMUIRelativeLayout
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIDefaultStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
java.util.Date
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.core.content.ContextCompat
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.ButterKnife
;
import
butterknife.ButterKnife
;
...
@@ -34,10 +53,28 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
...
@@ -34,10 +53,28 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
private
Context
context
;
private
Context
context
;
private
boolean
isRadioEdit
=
false
;
private
boolean
isRadioEdit
=
false
;
//Item行数(行数根据数据自动计算)
private
int
ItemRowCount
=
6
;
//Item高度
private
int
ItemColHeight
;
private
int
mRadius
;
private
float
mShadowAlpha
=
0.25f
;
private
int
mShadowElevationDp
=
14
;
public
void
initItemDispalyHeight
()
{
float
screenHeight
=
DeviceUtils
.
getScreenHeight
(
context
)
-
75
-
75
;
ItemColHeight
=
(
int
)
Math
.
ceil
((
double
)
screenHeight
/
(
double
)
(
ItemRowCount
));
ItemColHeight
=
ItemColHeight
-
3
;
}
@NonNull
@NonNull
@Override
@Override
protected
QMUIStickySectionAdapter
.
ViewHolder
onCreateSectionHeaderViewHolder
(
@NonNull
ViewGroup
viewGroup
)
{
protected
QMUIStickySectionAdapter
.
ViewHolder
onCreateSectionHeaderViewHolder
(
@NonNull
ViewGroup
viewGroup
)
{
this
.
context
=
viewGroup
.
getContext
();
this
.
context
=
viewGroup
.
getContext
();
this
.
mRadius
=
QMUIDisplayHelper
.
dp2px
(
context
,
5
);
initItemDispalyHeight
();
return
new
QMUIStickySectionAdapter
.
ViewHolder
(
new
QDSectionHeaderView
(
viewGroup
.
getContext
()));
return
new
QMUIStickySectionAdapter
.
ViewHolder
(
new
QDSectionHeaderView
(
viewGroup
.
getContext
()));
}
}
...
@@ -76,14 +113,32 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
...
@@ -76,14 +113,32 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
TableItem
tableItem
=
section
.
getItemAt
(
itemIndex
);
TableItem
tableItem
=
section
.
getItemAt
(
itemIndex
);
viewHolder
.
tv_name
.
setText
(
tableItem
.
getTableName
());
if
(
tableItem
.
getLayoutType
()
==
1
)
{
viewHolder
.
fl_add_table
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
rl_table
.
setVisibility
(
View
.
GONE
);
initAddItemDispalyMetrics
(
viewHolder
);
viewHolder
.
ll_container
.
setBackgroundColor
(
Color
.
parseColor
(
"#FFFFFFFF"
));
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
);
}
else
{
viewHolder
.
rl_table
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
fl_add_table
.
setVisibility
(
View
.
GONE
);
initTableItemData
(
viewHolder
,
tableItem
);
initTableItemDispalyMetrics
(
viewHolder
);
initTableBackground
(
viewHolder
,
tableItem
);
if
(
tableItem
.
getServiceCharge
()
>
0
)
{
if
(
tableItem
.
getServiceCharge
()
>
0
)
{
viewHolder
.
tv_service_fee
.
setText
(
tableItem
.
getServiceCharge
()
+
"%"
);
viewHolder
.
tv_service_fee
.
setText
(
tableItem
.
getServiceCharge
()
+
"%"
);
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
INVISIBLE
);
viewHolder
.
tv_service_fee
.
setVisibility
(
View
.
INVISIBLE
);
}
}
if
(
isRadioEdit
)
{
if
(
isRadioEdit
&&
tableItem
.
getUseStatus
()
==
0
)
{
viewHolder
.
cb_checked
.
setChecked
(
tableItem
.
isChecked
());
viewHolder
.
cb_checked
.
setChecked
(
tableItem
.
isChecked
());
viewHolder
.
cb_checked
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
cb_checked
.
setVisibility
(
View
.
VISIBLE
);
viewHolder
.
cb_checked
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
viewHolder
.
cb_checked
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
...
@@ -96,26 +151,153 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
...
@@ -96,26 +151,153 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
viewHolder
.
cb_checked
.
setVisibility
(
View
.
GONE
);
viewHolder
.
cb_checked
.
setVisibility
(
View
.
GONE
);
}
}
}
}
viewHolder
.
ll_container
.
setRadiusAndShadow
(
mRadius
,
QMUIDisplayHelper
.
dp2px
(
context
,
mShadowElevationDp
),
mShadowAlpha
);
}
private
void
initTableItemData
(
ViewHolder
viewHolder
,
TableItem
item
)
{
viewHolder
.
tv_table
.
setText
(
item
.
getTableName
());
if
(
item
.
getStatus
()
!=
0
)
{
viewHolder
.
tv_people
.
setVisibility
(
View
.
VISIBLE
);
if
(
item
.
getMinSeatCount
()
!=
0
||
item
.
getMaxSeatCount
()
!=
0
)
{
viewHolder
.
tv_people
.
setText
(
item
.
getMinSeatCount
()
+
"-"
+
item
.
getMaxSeatCount
()
+
"人"
);
}
else
{
viewHolder
.
tv_people
.
setText
(
""
);
}
viewHolder
.
tv_table
.
setMaxLines
(
1
);
}
else
{
//未開檯空間足夠可換行顯示
viewHolder
.
tv_table
.
setMaxLines
(
2
);
viewHolder
.
tv_people
.
setVisibility
(
View
.
GONE
);
}
if
(
item
.
getStatus
()
!=
0
)
{
switch
(
item
.
getType
())
{
case
TableItem
.
TABLE_TYPE_CANTEEN
:
viewHolder
.
tlv_table_type
.
setPrimaryText
(
"堂"
);
viewHolder
.
tlv_table_type
.
setPrimaryTextColor
(
Color
.
parseColor
(
"#249B65"
));
break
;
case
TableItem
.
TABLE_TYPE_TAKEAWAY
:
viewHolder
.
tlv_table_type
.
setPrimaryText
(
"外"
);
viewHolder
.
tlv_table_type
.
setPrimaryTextColor
(
Color
.
parseColor
(
"#FF720A"
));
break
;
case
TableItem
.
TABLE_TYPE_SELF_FETCHING
:
viewHolder
.
tlv_table_type
.
setPrimaryText
(
"自"
);
viewHolder
.
tlv_table_type
.
setPrimaryTextColor
(
Color
.
parseColor
(
"#00479D"
));
break
;
}
viewHolder
.
tlv_table_type
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
viewHolder
.
tlv_table_type
.
setVisibility
(
View
.
GONE
);
}
}
private
void
initTableBackground
(
ViewHolder
viewHolder
,
TableItem
item
)
{
// if (item.getSplitStatus() != 0) {
// setBackGroundWork(item, "888", R.drawable.tablebutton_splite, R.drawable.tablebutton_splite_new, R.color.black);
// } else {
viewHolder
.
ll_container
.
setBackgroundColor
(
Color
.
parseColor
(
"#FFFFFFFF"
));
if
(
item
.
getUseStatus
()
==
1
)
{
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFD14141"
),
R
.
color
.
theme_white_color
);
}
else
{
switch
(
item
.
getStatus
())
{
case
0
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFFFFFFF"
),
R
.
color
.
black
);
break
;
case
1
:
// setBackGroundWork(item, "2", R.drawable.table_shape_table_send, R.drawable.tablebutton_glassgreen_new, R.color.theme_white_color); break;
case
2
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FF249B65"
),
R
.
color
.
theme_white_color
);
break
;
case
3
:
setBackGroundWork
(
viewHolder
,
Color
.
parseColor
(
"#FFE5AC00"
),
R
.
color
.
theme_white_color
);
break
;
case
4
:
setBackGroundWork
(
viewHolder
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
Violet
),
R
.
color
.
theme_white_color
);
break
;
case
5
:
setBackGroundWork
(
viewHolder
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
Violet
),
R
.
color
.
theme_white_color
);
break
;
case
6
:
setBackGroundWork
(
viewHolder
,
ContextCompat
.
getColor
(
context
,
R
.
color
.
Violet
),
R
.
color
.
theme_white_color
);
break
;
}
}
}
private
void
initTableItemDispalyMetrics
(
ViewHolder
viewHolder
)
{
if
(
viewHolder
.
tv_table
.
getGravity
()
!=
Gravity
.
CENTER
)
{
viewHolder
.
rl_table
.
setGravity
(
Gravity
.
CENTER
);
RelativeLayout
.
LayoutParams
lp
=
(
RelativeLayout
.
LayoutParams
)
viewHolder
.
rl_table
.
getLayoutParams
();
lp
.
height
=
ItemColHeight
;
viewHolder
.
rl_table
.
setLayoutParams
(
lp
);
}
viewHolder
.
rl_table
.
setMinimumHeight
(
ItemColHeight
);
RelativeLayout
.
LayoutParams
relativeLayout
=
new
RelativeLayout
.
LayoutParams
(
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
,
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
);
relativeLayout
.
height
=
ItemColHeight
;
viewHolder
.
rl_table
.
setLayoutParams
(
relativeLayout
);
}
private
void
setBackGroundWork
(
ViewHolder
viewHolder
,
int
defaultMainback
,
int
defaultFontColor
)
{
if
(
defaultMainback
!=
-
1
)
{
viewHolder
.
ll_container
.
setBackgroundColor
(
defaultMainback
);
}
viewHolder
.
tv_table
.
setTextColor
(
context
.
getResources
().
getColor
(
defaultFontColor
));
}
private
void
initAddItemDispalyMetrics
(
ViewHolder
viewHolder
)
{
RelativeLayout
.
LayoutParams
lp
=
(
RelativeLayout
.
LayoutParams
)
viewHolder
.
fl_add_table
.
getLayoutParams
();
viewHolder
.
fl_add_table
.
setLayoutParams
(
lp
);
viewHolder
.
fl_add_table
.
setMinimumHeight
(
ItemColHeight
);
RelativeLayout
.
LayoutParams
relativeLayout
=
new
RelativeLayout
.
LayoutParams
(
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
,
RelativeLayout
.
LayoutParams
.
MATCH_PARENT
);
relativeLayout
.
height
=
ItemColHeight
;
viewHolder
.
fl_add_table
.
setLayoutParams
(
relativeLayout
);
}
public
void
setRadioEdit
(
boolean
radioEdit
)
{
public
void
setRadioEdit
(
boolean
radioEdit
)
{
isRadioEdit
=
radioEdit
;
isRadioEdit
=
radioEdit
;
}
}
public
class
ViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
public
class
ViewHolder
extends
QMUIStickySectionAdapter
.
ViewHolder
{
@BindView
(
R2
.
id
.
tv_name
)
TextView
tv_name
;
@BindView
(
R2
.
id
.
ll_container
)
QMUIRelativeLayout
ll_container
;
@BindView
(
R2
.
id
.
rl_table
)
RelativeLayout
rl_table
;
@BindView
(
R2
.
id
.
tv_table
)
TextView
tv_table
;
@BindView
(
R2
.
id
.
tv_people
)
TextView
tv_people
;
// @BindView(R2.id.btn_showMain)
// Button btn_showMain;
// @BindView(R2.id.iv_vip)
// ImageView iv_vip;
// @BindView(R2.id.tv_scan_flag)
// TextView tv_scan_flag;
@BindView
(
R2
.
id
.
tv_service_fee
)
@BindView
(
R2
.
id
.
tv_service_fee
)
TextView
tv_service_fee
;
TextView
tv_service_fee
;
@BindView
(
R2
.
id
.
cb_checked
)
@BindView
(
R2
.
id
.
cb_checked
)
CheckBox
cb_checked
;
CheckBox
cb_checked
;
@BindView
(
R2
.
id
.
fl_add_table
)
FrameLayout
fl_add_table
;
@BindView
(
R2
.
id
.
tlv_table_type
)
TriangleLabelView
tlv_table_type
;
public
ViewHolder
(
View
itemView
)
{
public
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
super
(
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
}
}
public
TextView
getTvName
()
{
public
TextView
getTvName
()
{
return
tv_
nam
e
;
return
tv_
tabl
e
;
}
}
public
TextView
getTvServiceFee
()
{
public
TextView
getTvServiceFee
()
{
...
@@ -126,6 +308,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
...
@@ -126,6 +308,7 @@ public class TableManageSectiontAdapter extends QMUIDefaultStickySectionAdapter<
TableItem
item
=
getSectionItem
(
position
);
TableItem
item
=
getSectionItem
(
position
);
return
item
;
return
item
;
}
}
}
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/AddTableFragment.java
View file @
f01b18c5
...
@@ -3,13 +3,18 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.fragment;
...
@@ -3,13 +3,18 @@ package com.gingersoft.gsa.cloud.manager.mvp.ui.fragment;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.Gravity
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup.MarginLayoutParams
;
import
android.view.inputmethod.EditorInfo
;
import
android.view.inputmethod.EditorInfo
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.FrameLayout
;
import
android.widget.LinearLayout
;
import
android.widget.PopupWindow
;
import
android.widget.PopupWindow
;
import
android.widget.RelativeLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
...
@@ -39,6 +44,7 @@ import java.util.List;
...
@@ -39,6 +44,7 @@ import java.util.List;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
@@ -66,15 +72,21 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -66,15 +72,21 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
private
TableManageActivity
mActivity
;
private
TableManageActivity
mActivity
;
private
QMUIPopup
mNormalPopup
;
private
QMUICommonListItemView
tableTypeItemView
;
private
QMUICommonListItemView
areaItemView
;
private
EditText
tableNameEditText
,
peopleMixNumberEditText
,
peopleMaxNumberEditText
,
defalutPeopleNumberEditText
,
serverchargeEditText
;
private
EditText
tableNameEditText
,
peopleNumberEditText
,
serverchargeEditText
,
tableSortEditText
;
private
static
final
String
TABLE_AREA
=
"table"
;
private
static
final
String
TABLE_AREA
=
"table"
;
private
TableItem
mTableItem
;
private
TableItem
mTableItem
;
private
int
currentAreaId
;
private
int
currentAreaId
;
/**
* 餐檯類型
*/
private
String
[]
tableTypes
=
{
"堂食"
,
"外賣"
,
"自取"
};
private
int
tableType
=
-
1
;
public
static
AddTableFragment
newInstance
(
TableItem
item
)
{
public
static
AddTableFragment
newInstance
(
TableItem
item
)
{
AddTableFragment
fragment
=
new
AddTableFragment
();
AddTableFragment
fragment
=
new
AddTableFragment
();
if
(
item
!=
null
)
{
if
(
item
!=
null
)
{
...
@@ -119,7 +131,7 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -119,7 +131,7 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
Button
rightButton
=
mTopBar
.
addRightTextButton
(
"保存"
,
R
.
id
.
qmui_dialog_edit_right_icon
);
Button
rightButton
=
mTopBar
.
addRightTextButton
(
"保存"
,
R
.
id
.
qmui_dialog_edit_right_icon
);
rightButton
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
rightButton
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
rightButton
.
setOnClickListener
(
v
->
{
rightButton
.
setOnClickListener
(
v
->
{
if
(
mTableItem
!=
null
)
{
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
//修改
//修改
mActivity
.
updateTable
(
createUpdateTableRequest
(
mTableItem
.
getId
()));
mActivity
.
updateTable
(
createUpdateTableRequest
(
mTableItem
.
getId
()));
}
else
{
}
else
{
...
@@ -129,7 +141,7 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -129,7 +141,7 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
}
}
});
});
mTopBar
.
setBackgroundResource
(
R
.
color
.
theme_color
);
mTopBar
.
setBackgroundResource
(
R
.
color
.
theme_color
);
if
(
mTableItem
!=
null
)
{
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
mTopBar
.
setTitle
(
"修改餐檯"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
mTopBar
.
setTitle
(
"修改餐檯"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
}
else
{
}
else
{
mTopBar
.
setTitle
(
"添加餐檯"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
mTopBar
.
setTitle
(
"添加餐檯"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
...
@@ -140,101 +152,179 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -140,101 +152,179 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
int
height
=
QMUIResHelper
.
getAttrDimen
(
mContext
,
com
.
qmuiteam
.
qmui
.
R
.
attr
.
qmui_list_item_height
);
int
height
=
QMUIResHelper
.
getAttrDimen
(
mContext
,
com
.
qmuiteam
.
qmui
.
R
.
attr
.
qmui_list_item_height
);
areaItemView
=
mGroupListView
.
createItemView
(
null
,
/**
"區域"
,
* 區域,餐檯名稱
getAreaName
(),
*/
QMUICommonListItemView
.
HORIZONTAL
,
QMUICommonListItemView
tableAreaItemView
=
mGroupListView
.
createItemView
(
"區域"
);
QMUICommonListItemView
.
ACCESSORY_TYPE_CHEVRON
,
tableAreaItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
height
);
TextView
textView
=
new
TextView
(
mContext
);
areaItemView
.
setTipPosition
(
QMUICommonListItemView
.
TIP_POSITION_RIGHT
);
textView
.
setText
(
getAreaName
());
textView
.
setTextSize
(
16
);
textView
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_grey_color
));
tableAreaItemView
.
addAccessoryCustomView
(
textView
);
QMUICommonListItemView
tableNameItemView
=
mGroupListView
.
createItemView
(
"餐檯名稱"
);
QMUICommonListItemView
tableNameItemView
=
mGroupListView
.
createItemView
(
"餐檯名稱"
);
tableNameItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
tableNameItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
tableNameEditText
=
new
EditText
(
mContext
);
tableNameEditText
=
new
EditText
(
mContext
);
tableNameEditText
.
setHint
(
"必填"
);
tableNameEditText
.
setHint
(
"必填"
);
if
(
mTableItem
!=
null
)
{
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
tableNameEditText
.
setText
(
mTableItem
.
getTableName
());
tableNameEditText
.
setText
(
mTableItem
.
getTableName
());
}
}
tableNameEditText
.
setWidth
(
QMUIDisplayHelper
.
dp2px
(
mActivity
,
75
));
//
tableNameEditText.setWidth(QMUIDisplayHelper.dp2px(mActivity, 75));
tableNameEditText
.
setTextSize
(
16
);
tableNameEditText
.
setTextSize
(
16
);
tableNameEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
tableNameEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
tableNameItemView
.
addAccessoryCustomView
(
tableNameEditText
);
tableNameItemView
.
addAccessoryCustomView
(
tableNameEditText
);
int
size
=
QMUIDisplayHelper
.
dp2px
(
mContext
,
20
);
QMUIGroupListView
.
newSection
(
mContext
)
.
setLeftIconSize
(
size
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
.
addItemView
(
tableAreaItemView
,
null
)
.
addItemView
(
tableNameItemView
,
null
)
.
setMiddleSeparatorInset
(
QMUIDisplayHelper
.
dp2px
(
mContext
,
16
),
0
)
.
addTo
(
mGroupListView
);
/**
* 就餐人數範圍,默認人數
*/
QMUICommonListItemView
peopleNumberItemView
=
mGroupListView
.
createItemView
(
"就餐人數"
);
QMUICommonListItemView
peopleNumberItemView
=
mGroupListView
.
createItemView
(
"就餐人數"
);
peopleNumberItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
peopleNumberItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
peopleNumberEditText
=
new
EditText
(
mContext
);
peopleNumberEditText
.
setHint
(
"必填"
);
if
(
mTableItem
!=
null
)
{
peopleNumberEditText
.
setText
(
mTableItem
.
getSeatCount
()
+
""
);
}
peopleNumberEditText
.
setWidth
(
QMUIDisplayHelper
.
dp2px
(
mActivity
,
75
));
peopleNumberEditText
.
setTextSize
(
16
);
peopleNumberEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
peopleNumberEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
peopleNumberItemView
.
addAccessoryCustomView
(
peopleNumberEditText
);
peopleMixNumberEditText
=
new
EditText
(
mContext
);
peopleMixNumberEditText
.
setHint
(
"最少人數"
);
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
peopleMixNumberEditText
.
setText
(
mTableItem
.
getMinSeatCount
()
+
""
);
}
peopleMixNumberEditText
.
setGravity
(
Gravity
.
CENTER
);
peopleMixNumberEditText
.
setTextSize
(
13
);
peopleMixNumberEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
peopleMixNumberEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
peopleMixNumberEditText
.
setBackground
(
ArmsUtils
.
getDrawablebyResource
(
mContext
,
R
.
drawable
.
shape_delivery_item_btn_normal
));
TextView
tv_line
=
new
TextView
(
mContext
);
tv_line
.
setGravity
(
Gravity
.
CENTER
);
tv_line
.
setText
(
"一"
);
tv_line
.
setTextSize
(
14
);
tv_line
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_black
));
peopleMaxNumberEditText
=
new
EditText
(
mContext
);
peopleMaxNumberEditText
.
setHint
(
"最多人數"
);
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
peopleMaxNumberEditText
.
setText
(
mTableItem
.
getMaxSeatCount
()
+
""
);
}
peopleMaxNumberEditText
.
setGravity
(
Gravity
.
CENTER
);
peopleMaxNumberEditText
.
setTextSize
(
13
);
peopleMaxNumberEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
peopleMaxNumberEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
peopleMaxNumberEditText
.
setBackground
(
ArmsUtils
.
getDrawablebyResource
(
mContext
,
R
.
drawable
.
shape_delivery_item_btn_normal
));
peopleNumberItemView
.
addAccessoryCustomView
(
peopleMixNumberEditText
);
peopleNumberItemView
.
addAccessoryCustomView
(
tv_line
);
peopleNumberItemView
.
addAccessoryCustomView
(
peopleMaxNumberEditText
);
FrameLayout
.
LayoutParams
params
=
new
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
);
params
.
gravity
=
Gravity
.
CENTER
|
Gravity
.
RIGHT
;
params
.
width
=
130
;
peopleMixNumberEditText
.
setLayoutParams
(
params
);
FrameLayout
.
LayoutParams
params2
=
new
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
);
params2
.
gravity
=
Gravity
.
CENTER
|
Gravity
.
RIGHT
;
params2
.
width
=
30
;
params2
.
rightMargin
=
150
;
tv_line
.
setLayoutParams
(
params2
);
FrameLayout
.
LayoutParams
params3
=
new
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
);
params3
.
gravity
=
Gravity
.
CENTER
|
Gravity
.
RIGHT
;
params3
.
width
=
130
;
params3
.
rightMargin
=
200
;
peopleMaxNumberEditText
.
setLayoutParams
(
params3
);
QMUICommonListItemView
defalutPeopleNumberItemView
=
mGroupListView
.
createItemView
(
"默認人數"
);
defalutPeopleNumberItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
defalutPeopleNumberEditText
=
new
EditText
(
mContext
);
defalutPeopleNumberEditText
.
setHint
(
"0"
);
if
(
mTableItem
.
getLayoutType
()
==
0
)
{
defalutPeopleNumberEditText
.
setText
(
mTableItem
.
getSeatCount
()
+
""
);
}
defalutPeopleNumberEditText
.
setTextSize
(
16
);
defalutPeopleNumberEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
defalutPeopleNumberEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
defalutPeopleNumberItemView
.
addAccessoryCustomView
(
defalutPeopleNumberEditText
);
TextView
tv_people
=
new
TextView
(
mContext
);
tv_people
.
setGravity
(
Gravity
.
CENTER
);
tv_people
.
setText
(
"人"
);
tv_people
.
setTextSize
(
14
);
tv_people
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_black
));
defalutPeopleNumberItemView
.
addAccessoryCustomView
(
tv_people
);
FrameLayout
.
LayoutParams
params5
=
new
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
);
params5
.
gravity
=
Gravity
.
CENTER_VERTICAL
|
Gravity
.
RIGHT
;
tv_people
.
setLayoutParams
(
params5
);
FrameLayout
.
LayoutParams
params6
=
new
FrameLayout
.
LayoutParams
(
FrameLayout
.
LayoutParams
.
WRAP_CONTENT
,
FrameLayout
.
LayoutParams
.
MATCH_PARENT
);
params6
.
gravity
=
Gravity
.
CENTER_VERTICAL
|
Gravity
.
RIGHT
;
params6
.
rightMargin
=
60
;
defalutPeopleNumberEditText
.
setLayoutParams
(
params6
);
QMUIGroupListView
.
newSection
(
getContext
())
.
setLeftIconSize
(
size
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
.
addItemView
(
peopleNumberItemView
,
null
)
.
addItemView
(
defalutPeopleNumberItemView
,
null
)
.
setMiddleSeparatorInset
(
QMUIDisplayHelper
.
dp2px
(
getContext
(),
16
),
0
)
.
addTo
(
mGroupListView
);
/**
* 餐桌類型
*/
tableTypeItemView
=
mGroupListView
.
createItemView
(
null
,
"餐桌類型"
,
getTableType
(),
QMUICommonListItemView
.
HORIZONTAL
,
QMUICommonListItemView
.
ACCESSORY_TYPE_CHEVRON
,
height
);
tableTypeItemView
.
setTipPosition
(
QMUICommonListItemView
.
TIP_POSITION_RIGHT
);
QMUIGroupListView
.
newSection
(
getContext
())
.
setLeftIconSize
(
size
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
.
addItemView
(
tableTypeItemView
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showTableTypeBottomSheetList
(
true
,
true
,
false
,
"餐檯類型"
,
tableTypes
,
true
,
false
);
}
})
.
setMiddleSeparatorInset
(
QMUIDisplayHelper
.
dp2px
(
getContext
(),
16
),
0
)
.
addTo
(
mGroupListView
);
/**
* 服務費
*/
QMUICommonListItemView
serverchargeItemView
=
mGroupListView
.
createItemView
(
"服務費%"
);
QMUICommonListItemView
serverchargeItemView
=
mGroupListView
.
createItemView
(
"服務費%"
);
serverchargeItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
serverchargeItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
serverchargeEditText
=
new
EditText
(
mContext
);
serverchargeEditText
=
new
EditText
(
mContext
);
serverchargeEditText
.
setHint
(
"
0
"
);
serverchargeEditText
.
setHint
(
"
请输入服务费
"
);
if
(
mTableItem
!=
null
)
{
if
(
mTableItem
.
getLayoutType
()
==
0
&&
mTableItem
.
getServiceCharge
()
!=
0
)
{
serverchargeEditText
.
setText
(
mTableItem
.
getServiceCharge
()
+
""
);
serverchargeEditText
.
setText
(
mTableItem
.
getServiceCharge
()
+
""
);
}
}
serverchargeEditText
.
setWidth
(
QMUIDisplayHelper
.
dp2px
(
mActivity
,
75
));
serverchargeEditText
.
setTextSize
(
16
);
serverchargeEditText
.
setTextSize
(
16
);
serverchargeEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
serverchargeEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
serverchargeEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
serverchargeEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
serverchargeItemView
.
addAccessoryCustomView
(
serverchargeEditText
);
serverchargeItemView
.
addAccessoryCustomView
(
serverchargeEditText
);
QMUIGroupListView
.
newSection
(
getContext
())
QMUICommonListItemView
tableSortItemView
=
mGroupListView
.
createItemView
(
"餐桌排序"
);
tableSortItemView
.
setAccessoryType
(
QMUICommonListItemView
.
ACCESSORY_TYPE_CUSTOM
);
tableSortEditText
=
new
EditText
(
mContext
);
// tableSortEditText.setHint("100");
if
(
mTableItem
!=
null
)
{
tableSortEditText
.
setText
(
mTableItem
.
getSort
()
+
""
);
}
else
{
tableSortEditText
.
setText
(
"100"
);
}
tableSortEditText
.
setWidth
(
QMUIDisplayHelper
.
dp2px
(
mActivity
,
75
));
tableSortEditText
.
setTextSize
(
16
);
tableSortEditText
.
setBackgroundColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
trans
));
tableSortEditText
.
setInputType
(
EditorInfo
.
TYPE_CLASS_NUMBER
);
tableSortItemView
.
addAccessoryCustomView
(
tableSortEditText
);
tableSortItemView
.
showNewTip
(
true
);
tableSortItemView
.
setNewTipImage
(
R
.
drawable
.
question_prompt
);
tableSortItemView
.
setNewTipClick
(
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showSortTip
(
v
);
}
});
int
size
=
QMUIDisplayHelper
.
dp2px
(
mContext
,
20
);
QMUIGroupListView
.
newSection
(
mContext
)
.
setLeftIconSize
(
size
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
.
setLeftIconSize
(
size
,
ViewGroup
.
LayoutParams
.
WRAP_CONTENT
)
.
addItemView
(
areaItemView
,
new
View
.
OnClickListener
()
{
@Override
public
void
onClick
(
View
v
)
{
showAreaBottomSheetList
(
true
,
true
,
false
,
"所在區域"
,
mActivity
.
getTableAreaList
(),
true
,
false
);
}
})
.
addItemView
(
tableNameItemView
,
null
)
.
addItemView
(
peopleNumberItemView
,
null
)
.
addItemView
(
serverchargeItemView
,
null
)
.
addItemView
(
serverchargeItemView
,
null
)
.
addItemView
(
tableSortItemView
,
null
)
.
setMiddleSeparatorInset
(
QMUIDisplayHelper
.
dp2px
(
getContext
(),
16
),
0
)
.
setMiddleSeparatorInset
(
QMUIDisplayHelper
.
dp2px
(
mContext
,
16
),
0
)
.
addTo
(
mGroupListView
);
.
addTo
(
mGroupListView
);
}
}
private
void
show
Area
BottomSheetList
(
boolean
gravityCenter
,
private
void
show
TableType
BottomSheetList
(
boolean
gravityCenter
,
boolean
addCancelBtn
,
boolean
addCancelBtn
,
boolean
withIcon
,
boolean
withIcon
,
CharSequence
title
,
CharSequence
title
,
List
<
TableArea
>
area
List
,
String
[]
tableType
List
,
boolean
allowDragDismiss
,
boolean
allowDragDismiss
,
boolean
withMark
)
{
boolean
withMark
)
{
QMUIBottomSheet
.
BottomListSheetBuilder
builder
=
new
QMUIBottomSheet
.
BottomListSheetBuilder
(
getActivity
());
QMUIBottomSheet
.
BottomListSheetBuilder
builder
=
new
QMUIBottomSheet
.
BottomListSheetBuilder
(
getActivity
());
...
@@ -246,63 +336,33 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -246,63 +336,33 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
.
setOnSheetItemClickListener
(
new
QMUIBottomSheet
.
BottomListSheetBuilder
.
OnSheetItemClickListener
()
{
.
setOnSheetItemClickListener
(
new
QMUIBottomSheet
.
BottomListSheetBuilder
.
OnSheetItemClickListener
()
{
@Override
@Override
public
void
onClick
(
QMUIBottomSheet
dialog
,
View
itemView
,
int
position
,
String
tag
)
{
public
void
onClick
(
QMUIBottomSheet
dialog
,
View
itemView
,
int
position
,
String
tag
)
{
currentAreaId
=
areaList
.
get
(
position
).
getId
()
;
tableType
=
position
;
areaItemView
.
setDetailText
(
tag
);
tableTypeItemView
.
setDetailText
(
tableTypeList
[
position
]
);
dialog
.
dismiss
();
dialog
.
dismiss
();
}
}
});
});
if
(
withMark
)
{
if
(
withMark
)
{
builder
.
setCheckedIndex
(
40
);
builder
.
setCheckedIndex
(
40
);
}
}
for
(
TableArea
item
:
area
List
)
{
for
(
String
item
:
tableType
List
)
{
builder
.
addItem
(
item
.
getRegionName
()
);
builder
.
addItem
(
item
);
}
}
builder
.
build
().
show
();
builder
.
build
().
show
();
}
}
private
void
showSortTip
(
View
v
)
{
TextView
textView
=
new
TextView
(
mContext
);
textView
.
setLineSpacing
(
QMUIDisplayHelper
.
dp2px
(
mContext
,
4
),
1.0f
);
int
padding
=
QMUIDisplayHelper
.
dp2px
(
mContext
,
20
);
textView
.
setPadding
(
padding
,
padding
,
padding
,
padding
);
textView
.
setText
(
"默認值為100,數字越小排序\n"
+
"越靠前!"
);
int
color
=
QMUIResHelper
.
getAttrColor
(
mContext
,
R
.
attr
.
app_skin_common_title_text_color
);
textView
.
setTextColor
(
ArmsUtils
.
getColor
(
mContext
,
R
.
color
.
theme_black
));
// QMUISkinValueBuilder builder = QMUISkinValueBuilder.acquire();
// builder.textColor(R.attr.app_skin_common_title_text_color);
// QMUISkinHelper.setSkinValue(textView, builder);
// builder.release();
mNormalPopup
=
QMUIPopups
.
popup
(
mContext
,
QMUIDisplayHelper
.
dp2px
(
mContext
,
250
))
.
preferredDirection
(
QMUIPopup
.
DIRECTION_BOTTOM
)
.
view
(
textView
)
.
edgeProtection
(
QMUIDisplayHelper
.
dp2px
(
mContext
,
20
))
.
dimAmount
(
0.6f
)
.
animStyle
(
QMUIPopup
.
ANIM_GROW_FROM_CENTER
)
.
onDismiss
(
new
PopupWindow
.
OnDismissListener
()
{
@Override
public
void
onDismiss
()
{
}
})
.
show
(
v
);
}
private
String
getAreaName
()
{
private
String
getAreaName
()
{
String
areaName
=
""
;
String
areaName
=
mTableItem
.
getRegionName
();
if
(
mTableItem
!=
null
)
{
//修改操作
areaName
=
mTableItem
.
getRegionName
();
currentAreaId
=
mTableItem
.
getRegionId
();
currentAreaId
=
mTableItem
.
getRegionId
();
}
else
{
return
areaName
;
//添加操作
if
(
mActivity
.
getTableAreaList
().
size
()
>
0
)
{
areaName
=
mActivity
.
getTableAreaList
().
get
(
0
).
getRegionName
();
currentAreaId
=
mActivity
.
getTableAreaList
().
get
(
0
).
getId
();
}
else
{
areaName
=
"其他"
;
}
}
private
String
getTableType
()
{
String
tableType
=
""
;
if
(
mTableItem
!=
null
&&
mTableItem
.
getType
()
!=
-
1
)
{
//修改操作
tableType
=
tableTypes
[
mTableItem
.
getType
()];
}
}
return
areaNam
e
;
return
tableTyp
e
;
}
}
@Override
@Override
...
@@ -348,16 +408,20 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -348,16 +408,20 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
if
(!
TextUtils
.
isEmpty
(
serverchargeEditText
.
getText
().
toString
()))
{
if
(!
TextUtils
.
isEmpty
(
serverchargeEditText
.
getText
().
toString
()))
{
addTableRequest
.
setServiceCharge
(
Double
.
parseDouble
(
serverchargeEditText
.
getText
().
toString
()));
addTableRequest
.
setServiceCharge
(
Double
.
parseDouble
(
serverchargeEditText
.
getText
().
toString
()));
}
}
if
(!
TextUtils
.
isEmpty
(
peopleNumberEditText
.
getText
().
toString
()))
{
if
(!
TextUtils
.
isEmpty
(
defalutPeopleNumberEditText
.
getText
().
toString
()))
{
addTableRequest
.
setSeatCount
(
Integer
.
parseInt
(
peopleNumberEditText
.
getText
().
toString
()));
addTableRequest
.
setSeatCount
(
Integer
.
parseInt
(
defalutPeopleNumberEditText
.
getText
().
toString
()));
}
if
(!
TextUtils
.
isEmpty
(
peopleMaxNumberEditText
.
getText
().
toString
()))
{
addTableRequest
.
setMaxSeatCount
(
Integer
.
parseInt
(
peopleMaxNumberEditText
.
getText
().
toString
()));
}
}
if
(!
TextUtils
.
isEmpty
(
tableSort
EditText
.
getText
().
toString
()))
{
if
(!
TextUtils
.
isEmpty
(
peopleMixNumber
EditText
.
getText
().
toString
()))
{
addTableRequest
.
set
Sort
(
Integer
.
parseInt
(
tableSort
EditText
.
getText
().
toString
()));
addTableRequest
.
set
MinSeatCount
(
Integer
.
parseInt
(
peopleMixNumber
EditText
.
getText
().
toString
()));
}
}
addTableRequest
.
setType
(
tableType
);
return
addTableRequest
;
return
addTableRequest
;
}
}
public
TableRequest
.
Update
createUpdateTableRequest
(
int
id
)
{
public
TableRequest
.
Update
createUpdateTableRequest
(
long
id
)
{
TableRequest
.
Update
update
=
new
TableRequest
.
Update
();
TableRequest
.
Update
update
=
new
TableRequest
.
Update
();
update
.
setId
(
id
);
update
.
setId
(
id
);
update
.
setRegionId
(
currentAreaId
);
update
.
setRegionId
(
currentAreaId
);
...
@@ -366,11 +430,8 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -366,11 +430,8 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
if
(!
TextUtils
.
isEmpty
(
serverchargeEditText
.
getText
().
toString
()))
{
if
(!
TextUtils
.
isEmpty
(
serverchargeEditText
.
getText
().
toString
()))
{
update
.
setServiceCharge
(
Double
.
parseDouble
(
serverchargeEditText
.
getText
().
toString
()));
update
.
setServiceCharge
(
Double
.
parseDouble
(
serverchargeEditText
.
getText
().
toString
()));
}
}
if
(!
TextUtils
.
isEmpty
(
peopleNumberEditText
.
getText
().
toString
()))
{
if
(!
TextUtils
.
isEmpty
(
defalutPeopleNumberEditText
.
getText
().
toString
()))
{
update
.
setSeatCount
(
Integer
.
parseInt
(
peopleNumberEditText
.
getText
().
toString
()));
update
.
setSeatCount
(
Integer
.
parseInt
(
defalutPeopleNumberEditText
.
getText
().
toString
()));
}
if
(!
TextUtils
.
isEmpty
(
tableSortEditText
.
getText
().
toString
()))
{
update
.
setSort
(
Integer
.
parseInt
(
tableSortEditText
.
getText
().
toString
()));
}
}
return
update
;
return
update
;
}
}
...
@@ -380,10 +441,15 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
...
@@ -380,10 +441,15 @@ public class AddTableFragment extends BaseFragment<AddTablePresenter> implements
showMessage
(
"請輸入餐檯名稱"
);
showMessage
(
"請輸入餐檯名稱"
);
return
false
;
return
false
;
}
}
if
(
TextUtils
.
isEmpty
(
peopleNumberEditText
.
getText
().
toString
()))
{
// if (TextUtils.isEmpty(defalutPeopleNumberEditText.getText().toString())) {
showMessage
(
"請輸入就餐人數"
);
// showMessage("請輸入就餐人數");
// return false;
// }
if
(
tableType
==
-
1
)
{
showMessage
(
"請選擇餐桌類型"
);
return
false
;
return
false
;
}
}
return
true
;
return
true
;
}
}
}
}
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/AreaListFragment.java
View file @
f01b18c5
...
@@ -5,14 +5,22 @@ import android.graphics.Color;
...
@@ -5,14 +5,22 @@ import android.graphics.Color;
import
android.net.ParseException
;
import
android.net.ParseException
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.os.Message
;
import
android.os.Message
;
import
android.text.Editable
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.BaseAdapter
;
import
android.widget.BaseAdapter
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.constans.PrintConstans
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.manager.R2
;
...
@@ -22,6 +30,8 @@ import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest;
...
@@ -22,6 +30,8 @@ import com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.AreaRequest;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.adapter.AreaManageAdapter
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.adapter.AreaManageAdapter
;
import
com.gingersoft.gsa.cloud.ui.recylcler.decorator.DividerItemDecoration
;
import
com.gingersoft.gsa.cloud.ui.recylcler.decorator.DividerItemDecoration
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.OnRecyclerItemClickListener
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.RecyItemTouchHelperCallback
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.google.gson.JsonIOException
;
import
com.google.gson.JsonIOException
;
...
@@ -40,6 +50,7 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout;
...
@@ -40,6 +50,7 @@ import com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUITopBarLayout
;
import
com.qmuiteam.qmui.widget.QMUITopBarLayout
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.api.RefreshLayout
;
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
;
import
com.scwang.smartrefresh.layout.listener.OnLoadMoreListener
;
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
;
import
com.scwang.smartrefresh.layout.listener.OnRefreshListener
;
...
@@ -63,6 +74,7 @@ import androidx.annotation.NonNull;
...
@@ -63,6 +74,7 @@ import androidx.annotation.NonNull;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.content.ContextCompat
;
import
androidx.core.view.ViewCompat
;
import
androidx.core.view.ViewCompat
;
import
androidx.recyclerview.widget.ItemTouchHelper
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
@@ -97,14 +109,22 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -97,14 +109,22 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
@BindView
(
R2
.
id
.
fl_add_area
)
@BindView
(
R2
.
id
.
fl_add_area
)
QMUIAlphaFrameLayout
fl_add_area
;
QMUIAlphaFrameLayout
fl_add_area
;
@BindView
(
R2
.
id
.
ll_add_area_layout
)
LinearLayout
ll_add_area_layout
;
@BindView
(
R2
.
id
.
ll_bottom_operat
)
@BindView
(
R2
.
id
.
ll_bottom_operat
)
LinearLayout
ll_bottom_operat
;
LinearLayout
ll_bottom_operat
;
@BindView
(
R2
.
id
.
ed_area_name
)
EditText
ed_area_name
;
@BindView
(
R2
.
id
.
cb_all_select
)
CheckBox
cb_all_select
;
private
TableManageActivity
mActivity
;
private
TableManageActivity
mActivity
;
private
AreaManageAdapter
mAreaManageAdapter
;
private
AreaManageAdapter
mAreaManageAdapter
;
private
List
<
TableArea
>
mTableAreaList
=
new
ArrayList
<>();
private
List
<
TableArea
>
mTableAreaList
=
new
ArrayList
<>();
private
boolean
isSave
=
false
;
private
boolean
isRadioEdit
;
private
boolean
isRadioEdit
;
public
static
AreaListFragment
newInstance
()
{
public
static
AreaListFragment
newInstance
()
{
...
@@ -135,6 +155,16 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -135,6 +155,16 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
initAdapter
();
initAdapter
();
initRefreshLayout
();
initRefreshLayout
();
mActivity
.
queryAreas
(
null
);
mActivity
.
queryAreas
(
null
);
cb_all_select
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
for
(
int
i
=
0
;
i
<
mTableAreaList
.
size
();
i
++)
{
mTableAreaList
.
get
(
i
).
setChecked
(
isChecked
);
}
mAreaManageAdapter
.
notifyDataSetChanged
();
}
});
}
}
@Override
@Override
...
@@ -176,6 +206,26 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -176,6 +206,26 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
}
}
});
});
RecyItemTouchHelperCallback
itemTouchHelperCallback
=
new
RecyItemTouchHelperCallback
(
mAreaManageAdapter
);
final
ItemTouchHelper
itemTouchHelper
=
new
ItemTouchHelper
(
itemTouchHelperCallback
);
itemTouchHelper
.
attachToRecyclerView
(
recycler_area
);
recycler_area
.
addOnItemTouchListener
(
new
OnRecyclerItemClickListener
(
recycler_area
)
{
@Override
public
void
onItemClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
}
@Override
public
void
onLongClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
AreaManageAdapter
.
TopTableAreaItemHolder
viewHolder1
=
(
AreaManageAdapter
.
TopTableAreaItemHolder
)
viewHolder
;
Toast
.
makeText
(
mActivity
,
"長按:"
+
viewHolder1
.
getAdapterPosition
(),
Toast
.
LENGTH_SHORT
).
show
();
if
(
viewHolder
.
getLayoutPosition
()
!=
0
)
{
itemTouchHelper
.
startDrag
(
viewHolder
);
}
}
});
}
}
private
void
initAdapter
()
{
private
void
initAdapter
()
{
...
@@ -185,13 +235,20 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -185,13 +235,20 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
mAreaManageAdapter
.
setOnItemClickListener
(
new
DefaultAdapter
.
OnRecyclerViewItemClickListener
()
{
mAreaManageAdapter
.
setOnItemClickListener
(
new
DefaultAdapter
.
OnRecyclerViewItemClickListener
()
{
@Override
@Override
public
void
onItemClick
(
View
view
,
int
viewType
,
Object
data
,
int
position
)
{
public
void
onItemClick
(
View
view
,
int
viewType
,
Object
data
,
int
position
)
{
if
(
isRadioEdit
)
{
// if (isRadioEdit) {
TableArea
tableArea
=
(
TableArea
)
data
;
// TableArea tableArea = (TableArea) data;
tableArea
.
setChecked
(!
tableArea
.
isChecked
());
// tableArea.setChecked(!tableArea.isChecked());
mAreaManageAdapter
.
notifyDataSetChanged
();
// mAreaManageAdapter.notifyDataSetChanged();
}
else
{
// } else {
start
(
AddAreaFragment
.
newInstance
((
TableArea
)
data
));
// start(AddAreaFragment.newInstance((TableArea) data));
// }
}
}
});
mAreaManageAdapter
.
addTextChangedListener
(
new
AreaManageAdapter
.
OnTextChangedListener
()
{
@Override
public
void
afterTextChanged
(
TableArea
datasBean
,
String
name
)
{
mActivity
.
updateArea
(
createUpateAreaRequest
(
datasBean
.
getId
(),
name
));
}
}
});
});
}
}
...
@@ -207,11 +264,15 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -207,11 +264,15 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
recycler_area
.
setVisibility
(
View
.
VISIBLE
);
recycler_area
.
setVisibility
(
View
.
VISIBLE
);
}
}
public
void
addSuccess
(){
ed_area_name
.
setText
(
""
);
}
@Override
@Override
public
void
setData
(
@Nullable
Object
data
)
{
public
void
setData
(
@Nullable
Object
data
)
{
}
}
private
void
initCheckedStatus
(){
private
void
initCheckedStatus
()
{
for
(
int
i
=
0
;
i
<
mTableAreaList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mTableAreaList
.
size
();
i
++)
{
mTableAreaList
.
get
(
i
).
setChecked
(
false
);
mTableAreaList
.
get
(
i
).
setChecked
(
false
);
}
}
...
@@ -220,26 +281,37 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -220,26 +281,37 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
@OnClick
(
R2
.
id
.
fl_add_area
)
@OnClick
(
R2
.
id
.
fl_add_area
)
void
onClickAddArea
()
{
void
onClickAddArea
()
{
startForResult
(
AddAreaFragment
.
newInstance
(
null
),
ADD_AREA_RESULT_SUCCESS
);
if
(
ll_add_area_layout
.
getVisibility
()
==
View
.
GONE
){
ll_add_area_layout
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
ll_add_area_layout
.
setVisibility
(
View
.
GONE
);
}
}
@OnClick
(
R2
.
id
.
btn_all_select
)
void
onClickAddSelect
()
{
for
(
int
i
=
0
;
i
<
mTableAreaList
.
size
();
i
++)
{
mTableAreaList
.
get
(
i
).
setChecked
(
true
);
}
mAreaManageAdapter
.
notifyDataSetChanged
();
}
}
@OnClick
(
R2
.
id
.
btn_anti_select
)
@OnClick
(
R2
.
id
.
btn_save_area
)
void
onClickAntiSelect
()
{
void
onClickSaveArea
()
{
for
(
int
i
=
0
;
i
<
mTableAreaList
.
size
();
i
++)
{
if
(
addCondition
())
{
TableArea
tableArea
=
mTableAreaList
.
get
(
i
);
mActivity
.
addArea
(
createAddAreaRequest
());
tableArea
.
setChecked
(!
tableArea
.
isChecked
());
}
}
mAreaManageAdapter
.
notifyDataSetChanged
();
}
}
// @OnClick(R2.id.cb_all_select)
// void onClickAddSelect() {
// for (int i = 0; i < mTableAreaList.size(); i++) {
// mTableAreaList.get(i).setChecked(true);
// }
// mAreaManageAdapter.notifyDataSetChanged();
// }
// @OnClick(R2.id.btn_anti_select)
// void onClickAntiSelect() {
// for (int i = 0; i < mTableAreaList.size(); i++) {
// TableArea tableArea = mTableAreaList.get(i);
// tableArea.setChecked(!tableArea.isChecked());
// }
// mAreaManageAdapter.notifyDataSetChanged();
// }
@OnClick
(
R2
.
id
.
btn_sure
)
@OnClick
(
R2
.
id
.
btn_sure
)
void
onClickSure
()
{
void
onClickSure
()
{
String
ids
=
getDeleteIds
();
String
ids
=
getDeleteIds
();
...
@@ -344,6 +416,30 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
...
@@ -344,6 +416,30 @@ public class AreaListFragment extends BaseFragment<AreaListPresenter> implements
recycler_area
.
setAdapter
(
adapter
);
recycler_area
.
setAdapter
(
adapter
);
}
}
public
boolean
addCondition
()
{
if
(
TextUtils
.
isEmpty
(
ed_area_name
.
getText
().
toString
()))
{
showMessage
(
"請輸入區域名稱"
);
return
false
;
}
return
true
;
}
public
AreaRequest
.
Add
createAddAreaRequest
()
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
(
mContext
);
AreaRequest
.
Add
areaRequest
=
new
AreaRequest
.
Add
();
areaRequest
.
setRestaurantId
(
restaurantId
);
areaRequest
.
setRegionName
(
ed_area_name
.
getText
().
toString
());
// areaRequest.setSort(Integer.parseInt(ed_area_sort.getText().toString()));
return
areaRequest
;
}
public
AreaRequest
.
Update
createUpateAreaRequest
(
int
id
,
String
name
)
{
AreaRequest
.
Update
areaRequest
=
new
AreaRequest
.
Update
();
areaRequest
.
setId
(
id
);
areaRequest
.
setRegionName
(
name
);
// areaRequest.setSort(Integer.parseInt(ed_area_sort.getText().toString()));
return
areaRequest
;
}
private
void
showRadioEdit
()
{
private
void
showRadioEdit
()
{
if
(
isRadioEdit
)
{
if
(
isRadioEdit
)
{
...
...
manager-module/src/main/java/com/gingersoft/gsa/cloud/manager/mvp/ui/fragment/TableListFragment.java
View file @
f01b18c5
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
fragment
;
package
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
fragment
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.graphics.Rect
;
import
android.graphics.Rect
;
import
android.net.ParseException
;
import
android.net.ParseException
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.
os.Messag
e
;
import
android.
text.InputTyp
e
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.MotionEvent
;
import
android.view.MotionEvent
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Button
;
import
android.widget.Button
;
import
android.widget.CheckBox
;
import
android.widget.CompoundButton
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.TableBean
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.manager.R2
;
import
com.gingersoft.gsa.cloud.manager.di.component.DaggerTableListComponent
;
import
com.gingersoft.gsa.cloud.manager.di.component.DaggerTableListComponent
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableArea
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.TableItem
;
import
com.gingersoft.gsa.cloud.manager.mvp.model.bean.request.TableRequest
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.activity.TableManageActivity
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.adapter.AreaManageAdapter
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.adapter.TableManageSectiontAdapter
;
import
com.gingersoft.gsa.cloud.manager.mvp.ui.adapter.TableManageSectiontAdapter
;
import
com.gingersoft.gsa.cloud.ui.adapter.BasTextSectiontAdapter
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionHeader
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.OnRecyclerItemClickListener
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.OnRecyclerItemClickListener
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.RecyItemTouchHelperCallback
;
import
com.gingersoft.gsa.cloud.ui.recylcler.event.RecyItemTouchHelperCallback
;
import
com.gingersoft.gsa.cloud.ui.utils.AnimateUtils
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.CommonTipDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.google.gson.JsonIOException
;
import
com.google.gson.JsonIOException
;
...
@@ -43,10 +39,11 @@ import com.gingersoft.gsa.cloud.manager.mvp.presenter.TableListPresenter;
...
@@ -43,10 +39,11 @@ import com.gingersoft.gsa.cloud.manager.mvp.presenter.TableListPresenter;
import
com.gingersoft.gsa.cloud.manager.R
;
import
com.gingersoft.gsa.cloud.manager.R
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaTextView
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.util.QMUIDisplayHelper
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUIEmptyView
;
import
com.qmuiteam.qmui.widget.QMUITopBarLayout
;
import
com.qmuiteam.qmui.widget.QMUITopBarLayout
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialogAction
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUISection
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionAdapter
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
;
import
com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
;
...
@@ -60,7 +57,6 @@ import java.net.SocketTimeoutException;
...
@@ -60,7 +57,6 @@ import java.net.SocketTimeoutException;
import
java.net.UnknownHostException
;
import
java.net.UnknownHostException
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -72,9 +68,10 @@ import androidx.recyclerview.widget.RecyclerView;
...
@@ -72,9 +68,10 @@ import androidx.recyclerview.widget.RecyclerView;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
base
.
common
.
bean
.
OrderDetail
.
DISCOUNT_TYPE
;
import
static
android
.
widget
.
AbsListView
.
OnScrollListener
.
SCROLL_STATE_IDLE
;
import
static
androidx
.
recyclerview
.
widget
.
RecyclerView
.
SCROLL_STATE_DRAGGING
;
import
static
androidx
.
recyclerview
.
widget
.
RecyclerView
.
SCROLL_STATE_SETTLING
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
activity
.
TableManageActivity
.
ADD_AREA_RESULT_SUCCESS
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
activity
.
TableManageActivity
.
ADD_AREA_RESULT_SUCCESS
;
import
static
com
.
gingersoft
.
gsa
.
cloud
.
manager
.
mvp
.
ui
.
activity
.
TableManageActivity
.
ADD_TABLE_RESULT_SUCCESS
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
...
@@ -103,11 +100,13 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -103,11 +100,13 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
@BindView
(
R2
.
id
.
fl_add_table
)
@BindView
(
R2
.
id
.
fl_add_table
)
QMUIAlphaFrameLayout
fl_add_table
;
QMUIAlphaFrameLayout
fl_add_table
;
@BindView
(
R2
.
id
.
tv_area
)
QMUIAlphaTextView
tv_area
;
@BindView
(
R2
.
id
.
ll_bottom_operat
)
@BindView
(
R2
.
id
.
ll_bottom_operat
)
LinearLayout
ll_bottom_operat
;
LinearLayout
ll_bottom_operat
;
@BindView
(
R2
.
id
.
cb_all_select
)
CheckBox
cb_all_select
;
private
Button
rightButton
;
private
TableManageActivity
mActivity
;
private
TableManageActivity
mActivity
;
...
@@ -117,6 +116,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -117,6 +116,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
private
TableManageSectiontAdapter
mAdapter
;
private
TableManageSectiontAdapter
mAdapter
;
private
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
mTableAreaSectionList
=
new
ArrayList
<>();
private
List
<
QMUISection
<
SectionHeader
,
TableItem
>>
mTableAreaSectionList
=
new
ArrayList
<>();
private
boolean
initLoad
=
false
;
/**
/**
* 是否編輯
* 是否編輯
*/
*/
...
@@ -161,14 +161,42 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -161,14 +161,42 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
initTopbar
();
initTopbar
();
initRefreshLayout
();
initRefreshLayout
();
initStickyLayout
();
initStickyLayout
();
// initRecycleScrollListener();
mActivity
.
queryAreas
(
null
);
mActivity
.
queryAreas
(
null
);
mActivity
.
queryTables
(
null
);
mActivity
.
queryTables
(
null
);
// mActivity.initGetTableTimer();
cb_all_select
.
setOnCheckedChangeListener
(
new
CompoundButton
.
OnCheckedChangeListener
()
{
@Override
public
void
onCheckedChanged
(
CompoundButton
buttonView
,
boolean
isChecked
)
{
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
TableItem
tableItem
=
mTableList
.
get
(
i
);
if
(
tableItem
.
getStatus
()
==
0
)
{
mTableList
.
get
(
i
).
setChecked
(
isChecked
);
}
}
mAdapter
.
notifyDataSetChanged
();
}
});
}
}
@Override
@Override
public
void
onResume
()
{
public
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
hideSoftInput
();
hideSoftInput
();
//開始刷新餐檯數據
// mActivity.onStartRefreshTableData();
}
@Override
public
void
onPause
()
{
super
.
onPause
();
//停止刷新餐檯數據
// mActivity.onPauseRefreshTableData();
}
@Override
public
void
setData
(
@Nullable
Object
data
)
{
}
}
private
void
initTopbar
()
{
private
void
initTopbar
()
{
...
@@ -176,20 +204,28 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -176,20 +204,28 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
mTopBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
mTopBar
.
addLeftBackImageButton
().
setOnClickListener
(
v
->
killMyself
());
mTopBar
.
setTitle
(
"餐檯管理"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
mTopBar
.
setTitle
(
"餐檯管理"
).
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
Button
rightButton
=
mTopBar
.
addRightTextButton
(
"編輯"
,
R
.
id
.
qmui_dialog_edit_right_icon
);
rightButton
=
mTopBar
.
addRightTextButton
(
"編輯"
,
R
.
id
.
qmui_dialog_edit_right_icon
);
rightButton
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
rightButton
.
setTextColor
(
ContextCompat
.
getColor
(
mContext
,
R
.
color
.
theme_white_color
));
rightButton
.
setOnClickListener
(
v
->
{
rightButton
.
setOnClickListener
(
v
->
{
clickEdit
(
rightButton
);
});
}
private
void
clickEdit
(
Button
rightButton
)
{
isRadioEdit
=
!
isRadioEdit
;
isRadioEdit
=
!
isRadioEdit
;
if
(
isRadioEdit
)
{
if
(
isRadioEdit
)
{
initCheckedStatus
();
initCheckedStatus
();
if
(
rightButton
!=
null
)
{
rightButton
.
setText
(
"取消"
);
rightButton
.
setText
(
"取消"
);
}
}
else
{
}
else
{
if
(
rightButton
!=
null
)
{
rightButton
.
setText
(
"編輯"
);
rightButton
.
setText
(
"編輯"
);
}
}
}
showRadioEdit
();
showRadioEdit
();
mAdapter
.
setRadioEdit
(
isRadioEdit
);
mAdapter
.
setRadioEdit
(
isRadioEdit
);
mAdapter
.
notifyDataSetChanged
();
mAdapter
.
notifyDataSetChanged
();
});
}
}
private
void
initRefreshLayout
()
{
private
void
initRefreshLayout
()
{
...
@@ -223,13 +259,17 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -223,13 +259,17 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
TableManageSectiontAdapter
.
ViewHolder
viewHolder
=
(
TableManageSectiontAdapter
.
ViewHolder
)
holder
;
TableManageSectiontAdapter
.
ViewHolder
viewHolder
=
(
TableManageSectiontAdapter
.
ViewHolder
)
holder
;
if
(
viewHolder
.
getTvName
().
getText
()
!=
null
)
{
if
(
viewHolder
.
getTvName
().
getText
()
!=
null
)
{
TableItem
item
=
viewHolder
.
getTableItem
(
position
);
TableItem
item
=
viewHolder
.
getTableItem
(
position
);
if
(
isRadioEdit
){
if
(
item
.
getLayoutType
()
==
1
)
{
start
(
AddTableFragment
.
newInstance
(
item
));
}
else
{
if
(
isRadioEdit
)
{
item
.
setChecked
(!
item
.
isChecked
());
item
.
setChecked
(!
item
.
isChecked
());
mAdapter
.
notifyDataSetChanged
();
mAdapter
.
notifyDataSetChanged
();
}
else
{
}
else
{
start
(
AddTableFragment
.
newInstance
(
item
));
start
(
AddTableFragment
.
newInstance
(
item
));
}
}
}
}
}
}
else
{
}
else
{
//點擊的頭部,折疊
//點擊的頭部,折疊
}
}
...
@@ -247,7 +287,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -247,7 +287,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
int
margin
=
QMUIDisplayHelper
.
dp2px
(
getContext
(),
10
);
int
margin
=
QMUIDisplayHelper
.
dp2px
(
getContext
(),
10
);
outRect
.
set
(
margin
,
margin
,
margin
,
margin
);
outRect
.
set
(
margin
,
margin
,
margin
,
margin
);
}
else
{
}
else
{
outRect
.
set
(
0
,
0
,
0
,
0
);
outRect
.
set
(
5
,
5
,
5
,
5
);
}
}
}
}
});
});
...
@@ -260,25 +300,31 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -260,25 +300,31 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
@Override
@Override
public
void
onItemClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
public
void
onItemClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
QMUIStickySectionAdapter
.
ViewHolder
viewHolder1
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
Toast
.
makeText
(
mActivity
,
"點擊了:"
+
viewHolder1
.
getAdapterPosition
(),
Toast
.
LENGTH_SHORT
).
show
();
}
}
@Override
@Override
public
void
onLongClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
public
void
onLongClick
(
RecyclerView
.
ViewHolder
viewHolder
)
{
QMUIStickySectionAdapter
.
ViewHolder
viewHolder1
=
(
QMUIStickySectionAdapter
.
ViewHolder
)
viewHolder
;
//
QMUIStickySectionAdapter.ViewHolder viewHolder1 = (QMUIStickySectionAdapter.ViewHolder) viewHolder;
Toast
.
makeText
(
mActivity
,
"長按:"
+
viewHolder1
.
getAdapterPosition
(),
Toast
.
LENGTH_SHORT
).
show
();
//
Toast.makeText(mActivity, "長按:" + viewHolder1.getAdapterPosition(), Toast.LENGTH_SHORT).show();
if
(
viewHolder
.
getLayoutPosition
()
!=
0
)
{
if
(
viewHolder
.
getLayoutPosition
()
!=
0
)
{
itemTouchHelper
.
startDrag
(
viewHolder
);
itemTouchHelper
.
startDrag
(
viewHolder
);
}
}
}
}
});
});
itemTouchHelperCallback
.
setOnMoveListener
(
new
RecyItemTouchHelperCallback
.
onMoveListener
()
{
@Override
public
void
onMoveFinish
()
{
mAdapter
.
notifyDataSetChanged
();
mActivity
.
changeTableSort
();
}
});
mSectionLayout
.
setAdapter
(
mAdapter
,
true
);
mSectionLayout
.
setAdapter
(
mAdapter
,
true
);
}
}
private
RecyclerView
.
LayoutManager
createLayoutManager
()
{
private
RecyclerView
.
LayoutManager
createLayoutManager
()
{
final
GridLayoutManager
layoutManager
=
new
GridLayoutManager
(
getContext
(),
3
);
final
GridLayoutManager
layoutManager
=
new
GridLayoutManager
(
getContext
(),
4
,
LinearLayoutManager
.
VERTICAL
,
false
);
layoutManager
.
setSpanSizeLookup
(
new
GridLayoutManager
.
SpanSizeLookup
()
{
layoutManager
.
setSpanSizeLookup
(
new
GridLayoutManager
.
SpanSizeLookup
()
{
@Override
@Override
public
int
getSpanSize
(
int
i
)
{
public
int
getSpanSize
(
int
i
)
{
...
@@ -295,7 +341,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -295,7 +341,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
mAreaList
.
addAll
(
tableAreaList
);
mAreaList
.
addAll
(
tableAreaList
);
}
}
public
void
updateTableData
(
List
<
TableItem
>
tableItemList
)
{
public
void
updateTableData
(
List
<
Table
Area
>
tableAreaList
,
List
<
Table
Item
>
tableItemList
)
{
initParms
();
initParms
();
...
@@ -306,13 +352,22 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -306,13 +352,22 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
item
.
setRegionId
(-
1
);
item
.
setRegionId
(-
1
);
}
}
}
}
mTableAreaSectionList
.
addAll
(
mPresenter
.
tableAreaTransformToSection
(
mPresenter
.
assembleTableArea
(
mPresenter
.
assembleAreaList
(
mTableList
),
mTableList
)));
mTableAreaSectionList
.
addAll
(
mPresenter
.
tableAreaTransformToSection
(
mPresenter
.
assembleTableArea
(
mPresenter
.
assembleAreaList
(
tableAreaList
,
mTableList
),
mTableList
)));
// if (!initLoad) {
mAdapter
.
setData
(
mTableAreaSectionList
);
mAdapter
.
setData
(
mTableAreaSectionList
);
// } else {
// mAdapter.notifyDataSetChanged();
// }
mEmptyView
.
hide
();
mEmptyView
.
hide
();
mSectionLayout
.
setVisibility
(
View
.
VISIBLE
);
mSectionLayout
.
setVisibility
(
View
.
VISIBLE
);
initLoad
=
true
;
}
}
private
void
initParms
()
{
private
void
initParms
()
{
if
(
mTableList
.
size
()
>
0
)
{
if
(
mTableList
.
size
()
>
0
)
{
mTableList
.
clear
();
mTableList
.
clear
();
...
@@ -325,12 +380,11 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -325,12 +380,11 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
}
}
}
}
@Override
public
void
backEdit
()
{
public
void
setData
(
@Nullable
Object
data
)
{
clickEdit
(
rightButton
);
}
}
private
void
initCheckedStatus
(){
private
void
initCheckedStatus
()
{
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
mTableAreaSectionList
.
get
(
i
).
getItemAt
(
j
).
setChecked
(
false
);
mTableAreaSectionList
.
get
(
i
).
getItemAt
(
j
).
setChecked
(
false
);
...
@@ -339,40 +393,25 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -339,40 +393,25 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
mAdapter
.
setData
(
mTableAreaSectionList
);
mAdapter
.
setData
(
mTableAreaSectionList
);
}
}
@OnClick
(
R2
.
id
.
tv_area
)
void
onClickToArea
()
{
startForResult
(
AreaListFragment
.
newInstance
(),
ADD_AREA_RESULT_SUCCESS
);
}
@OnClick
(
R2
.
id
.
fl_add_table
)
@OnClick
(
R2
.
id
.
fl_add_table
)
void
onClickAddTable
()
{
void
onClickAddTable
()
{
startForResult
(
AddTableFragment
.
newInstance
(
null
),
ADD_TABLE_RESULT_SUCCESS
);
startForResult
(
AreaListFragment
.
newInstance
(),
ADD_AREA_RESULT_SUCCESS
);
}
@OnClick
(
R2
.
id
.
btn_all_select
)
void
onClickAddSelect
()
{
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
mTableAreaSectionList
.
get
(
i
).
getItemAt
(
j
).
setChecked
(
true
);
}
}
mAdapter
.
setData
(
mTableAreaSectionList
);
}
}
@OnClick
(
R2
.
id
.
btn_anti_select
)
@OnClick
(
R2
.
id
.
btn_modify_serviceCharge
)
void
onClickAntiSelect
()
{
void
onClickModifyServiceCharge
()
{
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
String
ids
=
getSelectedIds
();
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
if
(
TextUtils
.
isEmpty
(
ids
))
{
TableItem
tableItem
=
mTableAreaSectionList
.
get
(
i
).
getItemAt
(
j
);
showMessage
(
"請選擇餐檯"
);
tableItem
.
setChecked
(!
tableItem
.
isChecked
());
return
;
}
}
}
mAdapter
.
setData
(
mTableAreaSectionList
);
showEditTextDialog
(
mActivity
,
"批量修改服務費"
,
"請輸入服務費"
);
}
}
@OnClick
(
R2
.
id
.
btn_
sur
e
)
@OnClick
(
R2
.
id
.
btn_
delet
e
)
void
onClickSure
()
{
void
onClickSure
()
{
String
ids
=
get
Delete
Ids
();
String
ids
=
get
Selected
Ids
();
if
(
TextUtils
.
isEmpty
(
ids
))
{
if
(
TextUtils
.
isEmpty
(
ids
))
{
showMessage
(
"請選擇餐檯"
);
showMessage
(
"請選擇餐檯"
);
return
;
return
;
...
@@ -382,8 +421,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -382,8 +421,7 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
CommonTipDialog
.
showSurpisedDialog
(
mActivity
,
"是否刪除所選餐檯"
,
TableManageActivity
.
class
,
mActivity
,
"deleteTable"
,
parameterTypes
,
parameters
);
CommonTipDialog
.
showSurpisedDialog
(
mActivity
,
"是否刪除所選餐檯"
,
TableManageActivity
.
class
,
mActivity
,
"deleteTable"
,
parameterTypes
,
parameters
);
}
}
private
String
getSelectedIds
()
{
private
String
getDeleteIds
()
{
StringBuilder
builder
=
new
StringBuilder
();
StringBuilder
builder
=
new
StringBuilder
();
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
mTableAreaSectionList
.
size
();
i
++)
{
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
for
(
int
j
=
0
;
j
<
mTableAreaSectionList
.
get
(
i
).
getItemCount
();
j
++)
{
...
@@ -401,6 +439,37 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -401,6 +439,37 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
return
str
;
return
str
;
}
}
private
List
<
TableRequest
.
UpdateServiceCharge
>
getModifyServiceChargeList
(
double
modifyServiceCharge
)
{
List
<
TableRequest
.
UpdateServiceCharge
>
updateServiceCharges
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
mTableList
.
size
();
i
++)
{
TableItem
tableItem
=
mTableList
.
get
(
i
);
if
(
tableItem
.
isChecked
())
{
TableRequest
.
UpdateServiceCharge
updateServiceCharge
=
new
TableRequest
.
UpdateServiceCharge
();
updateServiceCharge
.
setId
(
tableItem
.
getId
());
updateServiceCharge
.
setServiceCharge
(
modifyServiceCharge
);
updateServiceCharges
.
add
(
updateServiceCharge
);
}
}
return
updateServiceCharges
;
}
public
void
showEditTextDialog
(
Activity
context
,
String
title
,
String
placeholder
)
{
final
QMUIDialog
.
EditTextDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
EditTextDialogBuilder
(
context
);
dialogBuilder
.
setTitle
(
title
);
dialogBuilder
.
setPlaceholder
(
placeholder
);
dialogBuilder
.
setInputType
(
InputType
.
TYPE_CLASS_NUMBER
);
dialogBuilder
.
addAction
(
"取消"
,
(
dialog
,
index
)
->
dialog
.
dismiss
());
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
dialog
.
dismiss
();
CharSequence
text
=
dialogBuilder
.
getEditText
().
getText
();
if
(
text
!=
null
&&
text
.
length
()
>
0
)
{
mActivity
.
updateTableServiceCharge
(
getModifyServiceChargeList
(
Double
.
parseDouble
(
text
.
toString
())));
}
else
{
showMessage
(
"請輸入服務費比例"
);
}
});
dialogBuilder
.
create
(
R
.
style
.
MyDialogTheme2
).
show
();
}
@Override
@Override
public
void
showLoading
(
String
message
)
{
public
void
showLoading
(
String
message
)
{
...
@@ -474,15 +543,64 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
...
@@ -474,15 +543,64 @@ public class TableListFragment extends BaseFragment<TableListPresenter> implemen
mSectionLayout
.
setVisibility
(
View
.
VISIBLE
);
mSectionLayout
.
setVisibility
(
View
.
VISIBLE
);
}
}
private
void
initRecycleScrollListener
()
{
mSectionLayout
.
getRecyclerView
().
addOnScrollListener
(
new
RecyclerView
.
OnScrollListener
()
{
@Override
public
void
onScrollStateChanged
(
RecyclerView
recyclerView
,
int
newState
)
{
switch
(
newState
)
{
case
SCROLL_STATE_IDLE:
//停止滚动
if
(
mActivity
!=
null
)
{
mActivity
.
onStartRefreshTableData
();
}
break
;
case
SCROLL_STATE_DRAGGING:
//正在被外部拖拽,一般为用户正在用手指滚动
case
SCROLL_STATE_SETTLING:
//自动滚动开始
if
(
mActivity
!=
null
)
{
mActivity
.
onPauseRefreshTableData
();
}
break
;
}
}
});
mSectionLayout
.
getRecyclerView
().
setOnTouchListener
(
new
View
.
OnTouchListener
()
{
@Override
public
boolean
onTouch
(
View
v
,
MotionEvent
event
)
{
int
action
=
event
.
getAction
();
switch
(
action
)
{
case
MotionEvent
.
ACTION_DOWN
:
case
MotionEvent
.
ACTION_MOVE
:
//用户滑动 先停止刷新餐台数据
if
(
mActivity
!=
null
)
{
mActivity
.
onPauseRefreshTableData
();
}
break
;
case
MotionEvent
.
ACTION_UP
:
case
MotionEvent
.
ACTION_CANCEL
:
if
(
mActivity
!=
null
)
{
mActivity
.
onStartRefreshTableData
();
}
//用户手抬起是 继续刷新餐台数据
break
;
}
return
false
;
}
});
}
private
void
showRadioEdit
()
{
private
void
showRadioEdit
()
{
if
(
isRadioEdit
)
{
if
(
isRadioEdit
)
{
fl_add_table
.
setVisibility
(
View
.
GONE
);
fl_add_table
.
setVisibility
(
View
.
GONE
);
tv_area
.
setVisibility
(
View
.
GONE
);
ll_bottom_operat
.
setVisibility
(
View
.
VISIBLE
);
ll_bottom_operat
.
setVisibility
(
View
.
VISIBLE
);
}
else
{
}
else
{
fl_add_table
.
setVisibility
(
View
.
VISIBLE
);
fl_add_table
.
setVisibility
(
View
.
VISIBLE
);
tv_area
.
setVisibility
(
View
.
VISIBLE
);
ll_bottom_operat
.
setVisibility
(
View
.
GONE
);
ll_bottom_operat
.
setVisibility
(
View
.
GONE
);
}
}
}
}
@Override
public
List
<
TableItem
>
getTableList
()
{
return
mTableList
;
}
}
}
manager-module/src/main/res/drawable/manage_shape_add_btn_oval.xml
View file @
f01b18c5
...
@@ -5,6 +5,6 @@
...
@@ -5,6 +5,6 @@
android:thicknessRatio=
"20"
android:thicknessRatio=
"20"
android:useLevel=
"false"
>
android:useLevel=
"false"
>
<solid
android:color=
"#
FF3333
"
/>
<solid
android:color=
"#
1196DB
"
/>
</shape>
</shape>
\ No newline at end of file
manager-module/src/main/res/layout/activity_table_manage.xml
View file @
f01b18c5
...
@@ -5,57 +5,3 @@
...
@@ -5,57 +5,3 @@
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
android:layout_height=
"match_parent"
/>
<!--<?xml version="1.0" encoding="utf-8"?>-->
<!--<RelativeLayout 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/topbar"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="?attr/qmui_topbar_height"-->
<!-- app:qmui_topbar_title_color="@color/theme_white_color" />-->
<!-- <com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout-->
<!-- android:id="@+id/section_layout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginTop="?attr/qmui_topbar_height"/>-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_area_list"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_toLeftOf="@+id/tv_add_table"-->
<!-- android:layout_marginRight="@dimen/dp_15"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:text="@string/manager_area"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:gravity="center"-->
<!-- android:background="@drawable/ui_shape_theme_oval"/>-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_add_table"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_marginRight="@dimen/dp_20"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:text="@string/manager_add"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- android:gravity="center"-->
<!-- android:background="@drawable/manage_shape_add_btn_oval"/>-->
<!-- <FrameLayout-->
<!-- android:id="@+id/frameLayout"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent"-->
<!-- android:layout_marginTop="?attr/qmui_topbar_height" />-->
<!--</RelativeLayout>-->
manager-module/src/main/res/layout/fragment_area_list.xml
View file @
f01b18c5
...
@@ -10,90 +10,127 @@
...
@@ -10,90 +10,127 @@
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_marginTop=
"?attr/qmui_topbar_height"
>
android:layout_marginTop=
"?attr/qmui_topbar_height"
>
<com.qmuiteam.qmui.widget.QMUIEmptyView
android:id=
"@+id/emptyView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:fitsSystemWindows=
"true"
/>
<com.scwang.smartrefresh.layout.SmartRefreshLayout
<com.scwang.smartrefresh.layout.SmartRefreshLayout
android:id=
"@+id/refreshLayout"
android:id=
"@+id/refreshLayout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
app:srlEnableLoadMore=
"false"
>
app:srlEnableLoadMore=
"false"
>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:orientation=
"vertical"
android:background=
"@color/theme_white_color"
>
<androidx.recyclerview.widget.RecyclerView
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/recycler_area"
android:id=
"@+id/recycler_area"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_par
ent"
android:layout_height=
"wrap_cont
ent"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:layoutManager=
"androidx.recyclerview.widget.LinearLayoutManager"
app:spanCount=
"1"
/>
app:spanCount=
"1"
/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<com.qmuiteam.qmui.widget.QMUIEmptyView
<LinearLayout
android:id=
"@+id/emptyView
"
android:id=
"@+id/ll_add_area_layout
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:fitsSystemWindows=
"true"
/>
android:orientation=
"horizontal"
android:visibility=
"gone"
>
<EditText
android:id=
"@+id/ed_area_name"
android:layout_width=
"0dp"
android:layout_height=
"@dimen/dp_48"
android:layout_weight=
"1"
android:background=
"@null"
android:hint=
"請輸入打區域名稱"
android:maxLength=
"20"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:singleLine=
"true"
android:textColor=
"@color/normal_color"
android:textColorHint=
"@color/hint_color"
android:textSize=
"@dimen/sp_16"
android:visibility=
"visible"
/>
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id=
"@+id/btn_save_area"
android:layout_width=
"@dimen/dp_60"
android:layout_height=
"@dimen/dp_38"
android:layout_marginRight=
"@dimen/dp_10"
android:layout_marginLeft=
"@dimen/dp_10"
android:layout_gravity=
"right|center_vertical"
android:background=
"@color/theme_red_color"
android:text=
"保存"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
app:qmui_backgroundColor=
"@color/theme_color"
app:qmui_radius=
"@dimen/dp_5"
/>
</LinearLayout>
</LinearLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
</FrameLayout>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_bottom_operat"
android:id=
"@+id/ll_bottom_operat"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_4
0
"
android:layout_height=
"@dimen/dp_4
5
"
android:layout_gravity=
"bottom"
android:layout_gravity=
"bottom"
android:background=
"@color/theme_white_color"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:visibility=
"gone"
android:paddingLeft=
"@dimen/dp_15"
android:weightSum=
"3"
>
android:paddingRight=
"@dimen/dp_15"
android:visibility=
"gone"
>
<
com.qmuiteam.qmui.alpha.QMUIAlphaButton
<
CheckBox
android:id=
"@+id/
btn
_all_select"
android:id=
"@+id/
cb
_all_select"
android:layout_width=
"
@dimen/dp_0
"
android:layout_width=
"
0dp
"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:background=
"@color/theme_color"
android:text=
"全選"
android:text=
"全選"
android:textColor=
"@color/theme_
white_color
"
android:textColor=
"@color/theme_
black
"
android:textSize=
"@dimen/sp_14"
/>
android:textSize=
"@dimen/sp_14"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id=
"@+id/btn_anti_select"
android:layout_width=
"@dimen/dp_0"
android:layout_height=
"match_parent"
android:layout_marginLeft=
"@dimen/dp_1"
android:layout_weight=
"1"
android:background=
"@color/theme_color"
android:text=
"反選"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/btn_sure"
android:id=
"@+id/btn_sure"
android:layout_width=
"@dimen/dp_0"
android:layout_width=
"@dimen/dp_60"
android:layout_height=
"match_parent"
android:layout_height=
"@dimen/dp_38"
android:layout_marginLeft=
"@dimen/dp_1"
android:layout_gravity=
"right|center_vertical"
android:layout_weight=
"1"
android:background=
"@color/theme_red_color"
android:background=
"@color/theme_red_color"
android:text=
"刪除"
android:text=
"刪除"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
/>
android:textSize=
"@dimen/sp_14"
app:qmui_backgroundColor=
"@color/theme_color"
app:qmui_radius=
"@dimen/dp_5"
/>
</LinearLayout>
</LinearLayout>
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_add_area"-->
<!-- android:id="@+id/tv_add_area"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_width="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_height="@dimen/dp_65"-->
<!-- android:layout_gravity="bottom|right"-->
<!-- android:layout_gravity="bottom|right"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_marginBottom="@dimen/dp_20"-->
<!-- android:layout_marginRight="@dimen/dp_20"-->
<!-- android:layout_marginRight="@dimen/dp_20"-->
<!-- android:background="@drawable/manage_shape_add_btn_oval"-->
<!-- android:background="@drawable/manage_shape_add_btn_oval"-->
<!-- android:gravity="center"-->
<!-- android:gravity="center"-->
<!-- android:text="+"-->
<!-- android:text="+"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:textSize="@dimen/sp_14" />-->
<!-- android:textSize="@dimen/sp_14" />-->
<com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout
<com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout
android:id=
"@+id/fl_add_area"
android:id=
"@+id/fl_add_area"
android:layout_width=
"@dimen/dp_65"
android:layout_width=
"@dimen/dp_65"
android:layout_height=
"@dimen/dp_65"
android:layout_height=
"@dimen/dp_65"
android:layout_gravity=
"bottom|right"
android:layout_gravity=
"bottom|right"
android:layout_marginBottom=
"@dimen/dp_
20
"
android:layout_marginBottom=
"@dimen/dp_
45
"
android:layout_marginRight=
"@dimen/dp_20"
android:layout_marginRight=
"@dimen/dp_20"
android:background=
"@drawable/manage_shape_add_btn_oval"
>
android:background=
"@drawable/manage_shape_add_btn_oval"
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
manager-module/src/main/res/layout/fragment_table_list.xml
View file @
f01b18c5
...
@@ -28,8 +28,7 @@
...
@@ -28,8 +28,7 @@
<com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
<com.qmuiteam.qmui.widget.section.QMUIStickySectionLayout
android:id=
"@+id/section_table"
android:id=
"@+id/section_table"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
/>
android:layout_marginBottom=
"@dimen/dp_10"
/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</FrameLayout>
</FrameLayout>
...
@@ -48,6 +47,7 @@
...
@@ -48,6 +47,7 @@
android:layout_marginBottom=
"@dimen/dp_15"
android:layout_marginBottom=
"@dimen/dp_15"
android:layout_marginRight=
"@dimen/dp_20"
android:layout_marginRight=
"@dimen/dp_20"
android:background=
"@drawable/manage_shape_add_btn_oval"
>
android:background=
"@drawable/manage_shape_add_btn_oval"
>
<ImageView
<ImageView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -55,60 +55,53 @@
...
@@ -55,60 +55,53 @@
android:src=
"@drawable/add_white"
/>
android:src=
"@drawable/add_white"
/>
</com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout>
</com.qmuiteam.qmui.alpha.QMUIAlphaFrameLayout>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/tv_area"
android:layout_width=
"@dimen/dp_65"
android:layout_height=
"@dimen/dp_65"
android:layout_alignParentBottom=
"true"
android:layout_marginBottom=
"@dimen/dp_15"
android:layout_marginRight=
"@dimen/dp_15"
android:layout_toLeftOf=
"@+id/fl_add_table"
android:background=
"@drawable/ui_shape_theme_oval"
android:gravity=
"center"
android:text=
"@string/manager_area"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
/>
<LinearLayout
<LinearLayout
android:id=
"@+id/ll_bottom_operat"
android:id=
"@+id/ll_bottom_operat"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_40"
android:layout_height=
"@dimen/dp_45"
android:weightSum=
"3"
android:orientation=
"horizontal"
android:orientation=
"horizontal"
android:layout_alignParentBottom=
"true"
android:layout_alignParentBottom=
"true"
android:visibility=
"gone"
>
android:gravity=
"center_vertical"
android:paddingLeft=
"@dimen/dp_15"
android:paddingRight=
"@dimen/dp_15"
android:visibility=
"gone"
android:background=
"@color/theme_white_color"
>
<
com.qmuiteam.qmui.alpha.QMUIAlphaButton
<
CheckBox
android:id=
"@+id/
btn
_all_select"
android:id=
"@+id/
cb
_all_select"
android:layout_width=
"
@dimen/dp_0
"
android:layout_width=
"
0dp
"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_weight=
"1"
android:layout_weight=
"1"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
android:text=
"全選"
android:text=
"全選"
android:background=
"@color/theme_color"
/>
android:textColor=
"@color/theme_black"
android:textSize=
"@dimen/sp_14"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id=
"@+id/btn_anti_select"
android:id=
"@+id/btn_modify_serviceCharge"
android:layout_width=
"@dimen/dp_0"
android:layout_width=
"wrap_content"
android:layout_height=
"match_parent"
android:layout_height=
"@dimen/dp_38"
android:layout_weight=
"1"
android:layout_gravity=
"right|center_vertical"
android:layout_marginLeft=
"@dimen/dp_1"
android:background=
"@color/theme_red_color"
android:text=
"批量修改服務費"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
android:textSize=
"@dimen/sp_14"
android:background=
"@color/theme_color"
android:layout_marginRight=
"@dimen/dp_10"
android:text=
"反選"
/>
android:paddingRight=
"@dimen/dp_8"
android:paddingLeft=
"@dimen/dp_8"
app:qmui_backgroundColor=
"@color/theme_color"
app:qmui_radius=
"@dimen/dp_5"
/>
<com.qmuiteam.qmui.alpha.QMUIAlphaButton
<com.qmuiteam.qmui.widget.roundwidget.QMUIRoundButton
android:id=
"@+id/btn_sure"
android:id=
"@+id/btn_delete"
android:layout_width=
"@dimen/dp_0"
android:layout_width=
"@dimen/dp_60"
android:layout_height=
"match_parent"
android:layout_height=
"@dimen/dp_38"
android:layout_weight=
"1"
android:layout_gravity=
"right|center_vertical"
android:layout_marginLeft=
"@dimen/dp_1"
android:background=
"@color/theme_red_color"
android:text=
"刪除"
android:textColor=
"@color/theme_white_color"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_14"
android:textSize=
"@dimen/sp_14"
a
ndroid:background=
"@color/theme_red
_color"
a
pp:qmui_backgroundColor=
"@color/theme
_color"
a
ndroid:text=
"刪除"
/>
a
pp:qmui_radius=
"@dimen/dp_5"
/>
</LinearLayout>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
...
...
manager-module/src/main/res/layout/manager_item_manage_area.xml
View file @
f01b18c5
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<!--<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"-->
android:orientation=
"horizontal"
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:orientation="vertical"-->
<!-->-->
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_48"
android:layout_height=
"@dimen/dp_48"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
android:orientation=
"horizontal"
android:paddingLeft=
"@dimen/dp_10"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
>
android:paddingRight=
"@dimen/dp_10"
>
<TextView
<EditText
android:id=
"@+id/tv
_name"
android:id=
"@+id/ed
_name"
android:layout_width=
"0dp"
android:layout_width=
"0dp"
android:layout_weight=
"1"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:background=
"@null"
android:maxLength=
"20"
android:singleLine=
"true"
android:text=
"大廳"
android:textColor=
"@color/theme_black"
android:textColor=
"@color/theme_black"
android:textSize=
"@dimen/sp_14"
android:textSize=
"@dimen/sp_16"
/>
android:text=
"大廳"
/>
<CheckBox
<CheckBox
android:id=
"@+id/cb_checked"
android:id=
"@+id/cb_checked"
...
@@ -22,13 +32,33 @@
...
@@ -22,13 +32,33 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginRight=
"@dimen/dp_20"
android:layout_marginRight=
"@dimen/dp_20"
android:visibility=
"gone"
/>
android:visibility=
"gone"
/>
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaTextView-->
<!-- android:id="@+id/tv_edit"-->
<!-- android:id="@+id/tv_edit"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="編輯"-->
<!-- android:textColor="@color/theme_color"-->
<!-- android:textColor="@color/theme_color"-->
<!-- android:textSize="@dimen/sp_14"-->
<!-- android:textSize="@dimen/sp_14" />-->
<!-- android:text="編輯"/>-->
</LinearLayout>
<!-- <View-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_1"-->
<!-- android:background="@color/theme_hint_color"/>-->
</LinearLayout>
<!-- <EditText-->
\ No newline at end of file
<!-- android:id="@+id/ed_input_name"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="@dimen/dp_48"-->
<!-- android:paddingLeft="@dimen/dp_10"-->
<!-- android:paddingRight="@dimen/dp_10"-->
<!-- android:background="@null"-->
<!-- android:hint="請輸入打區域名稱"-->
<!-- android:maxLength="20"-->
<!-- android:singleLine="true"-->
<!-- android:textColor="@color/normal_color"-->
<!-- android:textColorHint="@color/hint_color"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- android:visibility="gone">-->
<!-- </EditText>-->
<!--</LinearLayout>-->
\ No newline at end of file
manager-module/src/main/res/layout/manager_item_manage_table.xml
View file @
f01b18c5
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<com.qmuiteam.qmui.layout.QMUIRelativeLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/ll_container"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/theme_background_color"
>
<LinearLayout
android:layout_width=
"@dimen/dp_100"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:background=
"@drawable/ui_selector_item_background"
android:gravity=
"center"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:padding=
"@dimen/dp_10"
android:background=
"@color/theme_white_color"
>
android:layout_margin=
"@dimen/dp_10"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout
android:id=
"@+id/rl_table"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
>
<TextView
<TextView
android:id=
"@+id/tv_nam
e"
android:id=
"@+id/tv_tabl
e"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:ellipsize=
"end"
android:ellipsize=
"end"
android:maxLines=
"1"
android:maxLines=
"1"
android:text=
"Button"
android:textColor=
"#FF000000"
android:textSize=
"@dimen/dp_22"
/>
<TextView
android:id=
"@+id/tv_people"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/tv_table"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_3"
android:text=
""
android:text=
""
android:textColor=
"@color/theme_black"
android:textColor=
"@color/theme_white_color"
android:textSize=
"@dimen/sp_16"
/>
android:textSize=
"@dimen/sp_13"
android:visibility=
"visible"
/>
<TextView
<TextView
android:id=
"@+id/tv_service_fee"
android:id=
"@+id/tv_service_fee"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_below=
"@+id/tv_people"
android:text=
""
android:text=
""
android:textColor=
"@color/theme_text_pice_color"
android:textColor=
"@color/theme_text_pice_color"
android:textSize=
"@dimen/sp_16"
/>
android:textSize=
"@dimen/sp_16"
/>
<!-- <com.qmuiteam.qmui.alpha.QMUIAlphaButton-->
<!-- android:id="@+id/btn_showMain"-->
<!-- style="@style/ButtonBorderless"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="96dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:layout_alignParentBottom="true"-->
<!-- android:layout_marginLeft="0dp"-->
<!-- android:layout_marginTop="0dp"-->
<!-- android:text="Button"-->
<!-- android:textSize="@dimen/dp_16"-->
<!-- android:visibility="gone" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_vip"-->
<!-- android:layout_width="50dp"-->
<!-- android:layout_height="50dp"-->
<!-- android:layout_alignParentLeft="true"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:scaleType="fitXY"-->
<!-- android:src="@drawable/qmui_icon_tip_new"-->
<!-- android:visibility="gone" />-->
<!-- <TextView-->
<!-- android:id="@+id/tv_scan_flag"-->
<!-- android:layout_width="25dp"-->
<!-- android:layout_height="25dp"-->
<!-- android:layout_alignParentTop="true"-->
<!-- android:layout_alignParentRight="true"-->
<!-- android:text="S"-->
<!-- android:background="@color/orange_700"-->
<!-- android:textColor="@color/theme_white_color"-->
<!-- android:gravity="center"-->
<!-- android:visibility="gone"-->
<!-- android:textSize="@dimen/font_normal2" />-->
<CheckBox
<CheckBox
android:id=
"@+id/cb_checked"
android:id=
"@+id/cb_checked"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_2"
android:layout_centerHorizontal=
"true"
android:visibility=
"gone"
/>
android:layout_below=
"@+id/tv_service_fee"
</LinearLayout>
android:visibility=
"invisible"
/>
</FrameLayout>
</com.qmuiteam.qmui.alpha.QMUIAlphaRelativeLayout>
<com.gingersoft.gsa.cloud.ui.view.TriangleLabelView
android:id=
"@+id/tlv_table_type"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentRight=
"true"
android:layout_alignParentBottom=
"true"
app:backgroundColor=
"@color/theme_white_color"
app:corner=
"rightBottom"
app:primaryText=
"堂"
app:primaryTextColor=
"#249B65"
app:primaryTextSize=
"10sp"
android:visibility=
"gone"
/>
<FrameLayout
android:id=
"@+id/fl_add_table"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:visibility=
"gone"
>
<TextView
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:text=
"+"
android:textColor=
"#ff3c3c3c"
android:textSize=
"31sp"
/>
</FrameLayout>
</com.qmuiteam.qmui.layout.QMUIRelativeLayout>
manager-module/src/main/res/mipmap-xxhdpi/ic_table_open_time.png
0 → 100644
View file @
f01b18c5
744 Bytes
table-module/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/fragment/StateTableFragment.java
View file @
f01b18c5
...
@@ -93,7 +93,6 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
...
@@ -93,7 +93,6 @@ public class StateTableFragment extends BaseFragment<StateTablePresenter> implem
}
else
if
(
mContext
instanceof
OrderContentActivity
){
}
else
if
(
mContext
instanceof
OrderContentActivity
){
mOrderContentActivity
=
(
OrderContentActivity
)
mContext
;
mOrderContentActivity
=
(
OrderContentActivity
)
mContext
;
}
}
initRecycleScrollListener
();
initRecycleScrollListener
();
}
}
...
...
table-module/src/main/res/layout/table_fragment_all_table.xml
View file @
f01b18c5
...
@@ -12,11 +12,9 @@
...
@@ -12,11 +12,9 @@
android:id=
"@+id/recycle_all_table"
android:id=
"@+id/recycle_all_table"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/theme_background_color"
android:background=
"@color/theme_background_color"
/>
android:overScrollMode=
"never"
/>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
</com.scwang.smartrefresh.layout.SmartRefreshLayout>
<com.qmuiteam.qmui.widget.QMUIEmptyView
<com.qmuiteam.qmui.widget.QMUIEmptyView
android:id=
"@+id/emptyView"
android:id=
"@+id/emptyView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
...
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