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
f8ac03e3
Commit
f8ac03e3
authored
Mar 25, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
3-25 啟動圖,引導頁,其他一些小問題
parent
9ae76d77
Show whitespace changes
Inline
Side-by-side
Showing
33 changed files
with
586 additions
and
204 deletions
+586
-204
build.gradle
+3
-3
main/build.gradle
+7
-0
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/FoodRankingAdapter.java
+7
-2
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/PaymentMethodAdapter.java
+9
-3
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/PaymentMethodColorAdapter.java
+4
-8
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/SortNumberingAdapter.java
+5
-0
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
+38
-11
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/PaymentMethodReportFragment.java
+21
-29
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
+14
-11
main/src/main/res/layout/fragment_business_report.xml
+7
-0
main/src/main/res/layout/fragment_main_top.xml
+4
-2
main/src/main/res/layout/fragment_payment_method_report.xml
+11
-4
main/src/main/res/layout/fragment_sales.xml
+10
-3
main/src/main/res/layout/item_main_side_menu.xml
+3
-3
main/src/main/res/layout/main_home_funcation_item.xml
+3
-3
main/src/main/res/layout/main_home_management_funcation_item.xml
+3
-3
main/src/main/res/values/colors.xml
+13
-0
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
+11
-0
print-module/src/main/java/com/joe/print/mvp/print/TestPrintDataMaker.java
+59
-48
print-module/src/main/java/com/joe/print/mvp/ui/activity/IpPrintActivity.java
+7
-0
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterListActivity.java
+7
-3
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
+5
-5
print-module/src/main/res/layout/print_test.xml
+1
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/constans/UserConstans.java
+2
-0
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimePickerUtils.java
+2
-1
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimeUtils.java
+1
-0
public-base/src/main/res/values/attrs.xml
+60
-6
public-base/src/main/res/values/colors.xml
+2
-1
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
+9
-9
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
+9
-5
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/WelcomeActivity.java
+134
-3
user-login/src/main/res/layout/activity_welcome.xml
+113
-36
user-login/src/main/res/layout/user_login_activity_login.xml
+2
-1
No files found.
build.gradle
View file @
f8ac03e3
...
@@ -10,11 +10,11 @@ buildscript {
...
@@ -10,11 +10,11 @@ buildscript {
}
}
dependencies
{
dependencies
{
classpath
'com.android.tools.build:gradle:3.5.
0
'
classpath
'com.android.tools.build:gradle:3.5.
2
'
// classpath 'com.android.tools.build:gradle:3.0.1'
// classpath 'com.android.tools.build:gradle:3.0.1'
classpath
'com.github.dcendents:android-maven-gradle-plugin:
1.5
'
classpath
'com.github.dcendents:android-maven-gradle-plugin:
2.0
'
classpath
'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.
0
'
classpath
'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.
4
'
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath
"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
...
...
main/build.gradle
View file @
f8ac03e3
apply
from:
rootProject
.
file
(
'cc-settings.gradle'
)
apply
from:
rootProject
.
file
(
'cc-settings.gradle'
)
apply
plugin:
'kotlin-android-extensions'
apply
plugin:
'kotlin-android'
apply
plugin:
'com.jakewharton.butterknife'
apply
plugin:
'com.jakewharton.butterknife'
android
{
android
{
...
@@ -55,4 +57,9 @@ dependencies {
...
@@ -55,4 +57,9 @@ dependencies {
implementation
'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation
'com.github.PhilJay:MPAndroidChart:v3.1.0'
implementation
'cn.bingoogolapple:bga-progressbar:1.0.1'
//进度条
implementation
'cn.bingoogolapple:bga-progressbar:1.0.1'
//进度条
implementation
files
(
'libs/nineoldandroids-2.4.0.jar'
)
implementation
files
(
'libs/nineoldandroids-2.4.0.jar'
)
compile
"androidx.core:core-ktx:+"
implementation
"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
repositories
{
mavenCentral
()
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/FoodRankingAdapter.java
View file @
f8ac03e3
...
@@ -31,6 +31,11 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean
...
@@ -31,6 +31,11 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean
}
}
@Override
@Override
public
int
getItemCount
()
{
return
getData
().
size
()
>
11
?
11
:
getData
().
size
();
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
SalesFoodsBean
.
DataBean
.
SalesRankingBean
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
SalesFoodsBean
.
DataBean
.
SalesRankingBean
item
)
{
if
(
helper
.
getAdapterPosition
()
==
0
)
{
if
(
helper
.
getAdapterPosition
()
==
0
)
{
helper
.
setTextColor
(
R
.
id
.
tv_ranking_foodname
,
mContext
.
getResources
().
getColor
(
R
.
color
.
theme_hint_color
));
helper
.
setTextColor
(
R
.
id
.
tv_ranking_foodname
,
mContext
.
getResources
().
getColor
(
R
.
color
.
theme_hint_color
));
...
@@ -58,8 +63,8 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean
...
@@ -58,8 +63,8 @@ public class FoodRankingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBean
helper
.
setText
(
R
.
id
.
tv_ranking_foodname
,
item
.
getProductName
());
helper
.
setText
(
R
.
id
.
tv_ranking_foodname
,
item
.
getProductName
());
helper
.
setText
(
R
.
id
.
tv_ranking_food_sales_num
,
item
.
getNumber
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_ranking_food_sales_num
,
item
.
getNumber
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_ranking_food_sales_amount
,
item
.
getAmount
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_ranking_food_sales_amount
,
item
.
getAmount
()
+
""
);
helper
.
setText
(
R
.
id
.
tv_ranking_proportion_quantity
,
(
MoneyUtil
.
divide
(
item
.
getNumber
(),
totalNum
,
2
,
ROUND_HALF_UP
)
*
100
)
+
"%"
);
helper
.
setText
(
R
.
id
.
tv_ranking_proportion_quantity
,
(
MoneyUtil
.
priceCalculation
(
MoneyUtil
.
divide
(
item
.
getNumber
(),
totalNum
,
2
,
ROUND_HALF_UP
),
100
)
)
+
"%"
);
helper
.
setText
(
R
.
id
.
tv_ranking_ratio_amount
,
(
MoneyUtil
.
divide
(
item
.
getAmount
(),
totalAmount
,
2
,
ROUND_HALF_UP
)
*
100
)
+
"%"
);
helper
.
setText
(
R
.
id
.
tv_ranking_ratio_amount
,
(
MoneyUtil
.
priceCalculation
(
MoneyUtil
.
divide
(
item
.
getAmount
(),
totalAmount
,
2
,
ROUND_HALF_UP
),
100
)
)
+
"%"
);
}
}
}
}
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/PaymentMethodAdapter.java
View file @
f8ac03e3
...
@@ -3,6 +3,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
...
@@ -3,6 +3,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import
android.content.Context
;
import
android.content.Context
;
import
android.os.Build
;
import
android.os.Build
;
import
androidx.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R
;
...
@@ -11,8 +13,6 @@ import com.gingersoft.gsa.cloud.main.mvp.ui.view.MyProgressBar;
...
@@ -11,8 +13,6 @@ import com.gingersoft.gsa.cloud.main.mvp.ui.view.MyProgressBar;
import
java.util.List
;
import
java.util.List
;
import
androidx.annotation.Nullable
;
/**
/**
* Created by Wyh on 2020/2/24.
* Created by Wyh on 2020/2/24.
*/
*/
...
@@ -22,7 +22,13 @@ public class PaymentMethodAdapter extends BaseQuickAdapter<PaymentMethodBean.Dat
...
@@ -22,7 +22,13 @@ public class PaymentMethodAdapter extends BaseQuickAdapter<PaymentMethodBean.Dat
R
.
color
.
payment_method_color2
,
R
.
color
.
payment_method_color3
,
R
.
color
.
payment_method_color2
,
R
.
color
.
payment_method_color3
,
R
.
color
.
payment_method_color4
,
R
.
color
.
payment_method_color5
,
R
.
color
.
payment_method_color4
,
R
.
color
.
payment_method_color5
,
R
.
color
.
payment_method_color6
,
R
.
color
.
payment_method_color7
,
R
.
color
.
payment_method_color6
,
R
.
color
.
payment_method_color7
,
R
.
color
.
payment_method_color8
};
R
.
color
.
payment_method_color8
,
R
.
color
.
payment_method_color9
,
R
.
color
.
payment_method_color10
,
R
.
color
.
payment_method_color11
,
R
.
color
.
payment_method_color12
,
R
.
color
.
payment_method_color13
,
R
.
color
.
payment_method_color14
,
R
.
color
.
payment_method_color15
,
R
.
color
.
payment_method_color16
,
R
.
color
.
payment_method_color17
,
R
.
color
.
payment_method_color18
,
R
.
color
.
payment_method_color19
,
R
.
color
.
payment_method_color20
};
private
Context
context
;
private
Context
context
;
public
PaymentMethodAdapter
(
Context
context
,
@Nullable
List
<
PaymentMethodBean
.
DataBean
>
data
)
{
public
PaymentMethodAdapter
(
Context
context
,
@Nullable
List
<
PaymentMethodBean
.
DataBean
>
data
)
{
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/PaymentMethodColorAdapter.java
View file @
f8ac03e3
...
@@ -3,6 +3,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
...
@@ -3,6 +3,8 @@ package com.gingersoft.gsa.cloud.main.mvp.ui.adapter;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.drawable.GradientDrawable
;
import
android.graphics.drawable.GradientDrawable
;
import
androidx.annotation.Nullable
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.chad.library.adapter.base.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.main.R
;
import
com.gingersoft.gsa.cloud.main.R
;
...
@@ -10,18 +12,12 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
...
@@ -10,18 +12,12 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
import
java.util.List
;
import
java.util.List
;
import
androidx.annotation.Nullable
;
/**
/**
* Created by Wyh on 2020/2/24.
* Created by Wyh on 2020/2/24.
*/
*/
public
class
PaymentMethodColorAdapter
extends
BaseQuickAdapter
<
PaymentMethodBean
.
DataBean
,
BaseViewHolder
>
{
public
class
PaymentMethodColorAdapter
extends
BaseQuickAdapter
<
PaymentMethodBean
.
DataBean
,
BaseViewHolder
>
{
private
int
[]
colors
=
new
int
[]{
R
.
color
.
payment_method_color1
,
R
.
color
.
payment_method_color2
,
R
.
color
.
payment_method_color3
,
R
.
color
.
payment_method_color4
,
R
.
color
.
payment_method_color5
,
R
.
color
.
payment_method_color6
,
R
.
color
.
payment_method_color7
,
R
.
color
.
payment_method_color8
};
private
Context
context
;
private
Context
context
;
public
PaymentMethodColorAdapter
(
Context
context
,
@Nullable
List
<
PaymentMethodBean
.
DataBean
>
data
)
{
public
PaymentMethodColorAdapter
(
Context
context
,
@Nullable
List
<
PaymentMethodBean
.
DataBean
>
data
)
{
super
(
R
.
layout
.
item_payment_color
,
data
);
super
(
R
.
layout
.
item_payment_color
,
data
);
...
@@ -32,7 +28,7 @@ public class PaymentMethodColorAdapter extends BaseQuickAdapter<PaymentMethodBea
...
@@ -32,7 +28,7 @@ public class PaymentMethodColorAdapter extends BaseQuickAdapter<PaymentMethodBea
protected
void
convert
(
BaseViewHolder
helper
,
PaymentMethodBean
.
DataBean
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
PaymentMethodBean
.
DataBean
item
)
{
GradientDrawable
drawable
=
new
GradientDrawable
();
GradientDrawable
drawable
=
new
GradientDrawable
();
drawable
.
setShape
(
GradientDrawable
.
OVAL
);
drawable
.
setShape
(
GradientDrawable
.
OVAL
);
drawable
.
setColor
(
context
.
getResources
().
getColor
(
colors
[
helper
.
getAdapterPosition
()
%
colors
.
length
]));
drawable
.
setColor
(
context
.
getResources
().
getColor
(
PaymentMethodAdapter
.
colors
[
helper
.
getAdapterPosition
()
%
PaymentMethodAdapter
.
colors
.
length
]));
helper
.
getView
(
R
.
id
.
circle_color
).
setBackground
(
drawable
);
helper
.
getView
(
R
.
id
.
circle_color
).
setBackground
(
drawable
);
helper
.
setText
(
R
.
id
.
tv_payment_method
,
item
.
getPayName
());
helper
.
setText
(
R
.
id
.
tv_payment_method
,
item
.
getPayName
());
}
}
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/adapter/SortNumberingAdapter.java
View file @
f8ac03e3
...
@@ -25,6 +25,11 @@ public class SortNumberingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBe
...
@@ -25,6 +25,11 @@ public class SortNumberingAdapter extends BaseQuickAdapter<SalesFoodsBean.DataBe
}
}
@Override
@Override
public
int
getItemCount
()
{
return
getData
().
size
()
>
11
?
11
:
getData
().
size
();
}
@Override
protected
void
convert
(
BaseViewHolder
helper
,
SalesFoodsBean
.
DataBean
.
SalesRankingBean
item
)
{
protected
void
convert
(
BaseViewHolder
helper
,
SalesFoodsBean
.
DataBean
.
SalesRankingBean
item
)
{
helper
.
getView
(
R
.
id
.
iv_ranking_numbering
).
setVisibility
(
View
.
GONE
);
helper
.
getView
(
R
.
id
.
iv_ranking_numbering
).
setVisibility
(
View
.
GONE
);
if
(
helper
.
getAdapterPosition
()
==
0
)
{
if
(
helper
.
getAdapterPosition
()
==
0
)
{
...
...
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/BusinessReportFragment.java
View file @
f8ac03e3
...
@@ -33,12 +33,14 @@ import com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AAChartEnum.AAChar
...
@@ -33,12 +33,14 @@ import com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AAChartEnum.AAChar
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AAChartEnum.AAChartType
;
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AAChartEnum.AAChartType
;
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AATools.AAGradientColor
;
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AATools.AAGradientColor
;
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AATools.AALinearGradientDirection
;
import
com.gingersoft.gsa.cloud.ui.AAChartCore.AAChartCoreLib.AATools.AALinearGradientDirection
;
import
com.gingersoft.gsa.cloud.ui.view.TriangleView
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
java.text.ParseException
;
import
java.text.ParseException
;
import
java.util.Calendar
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -75,8 +77,12 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -75,8 +77,12 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
TextView
mTvStartTime
;
TextView
mTvStartTime
;
@BindView
(
R2
.
id
.
tv_end_time
)
@BindView
(
R2
.
id
.
tv_end_time
)
TextView
mTvEndTime
;
TextView
mTvEndTime
;
@BindView
(
R2
.
id
.
iv_time_triangle
)
TriangleView
triangleView
;
private
BusinessInfoAdapter
businessInfoAdapter
;
private
BusinessInfoAdapter
businessInfoAdapter
;
//查詢多少天的數據
private
int
manyDay
=
2
;
public
static
BusinessReportFragment
newInstance
()
{
public
static
BusinessReportFragment
newInstance
()
{
BusinessReportFragment
fragment
=
new
BusinessReportFragment
();
BusinessReportFragment
fragment
=
new
BusinessReportFragment
();
...
@@ -101,7 +107,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -101,7 +107,7 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
//獲取一段時間內的營業信息,默認獲取七天的數據
//獲取一段時間內的營業信息,默認獲取七天的數據
String
startTime
=
TimeUtils
.
getOldDate
(-
6
);
String
startTime
=
TimeUtils
.
getOldDate
(-
manyDay
);
mPresenter
.
getRestaurantAmount
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
startTime
,
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantAmount
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
startTime
,
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantBusinessInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
startTime
,
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantBusinessInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
startTime
,
TimeUtils
.
getOldDate
(
1
));
...
@@ -185,21 +191,21 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -185,21 +191,21 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
*/
*/
@Override
@Override
public
void
loadChart
(
List
<
MainBusinessBean
.
DataBean
>
data
)
{
public
void
loadChart
(
List
<
MainBusinessBean
.
DataBean
>
data
)
{
Object
[]
chartData
=
new
Object
[
7
];
Object
[]
chartData
=
new
Object
[
manyDay
+
1
];
String
[]
xData
=
new
String
[
7
];
String
[]
xData
=
new
String
[
manyDay
+
1
];
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
for
(
int
i
=
0
;
i
<
=
manyDay
;
i
++)
{
xData
[
i
]
=
TimeUtils
.
getDistanceDate
(-
6
+
i
,
Calendar
.
DATE
,
TimeUtils
.
DEFAULT_DATE_MD
);
xData
[
i
]
=
TimeUtils
.
getDistanceDate
(-
(
manyDay
-
i
)
,
Calendar
.
DATE
,
TimeUtils
.
DEFAULT_DATE_MD
);
}
}
//將數據以 時間為key,數據為value存入map
Map
<
String
,
MainBusinessBean
.
DataBean
>
map
=
new
HashMap
<>();
Map
<
String
,
MainBusinessBean
.
DataBean
>
map
=
new
HashMap
<>();
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
map
.
put
(
data
.
get
(
i
).
getStartingTime
(),
data
.
get
(
i
));
map
.
put
(
data
.
get
(
i
).
getStartingTime
(),
data
.
get
(
i
));
}
}
//y軸 數據間隔
double
yAxisTickInterval
=
0
;
double
yAxisTickInterval
=
0
;
//第一條線
//第一條線
for
(
int
i
=
0
;
i
<
7
;
i
++)
{
for
(
int
i
=
0
;
i
<
=
manyDay
;
i
++)
{
//通過今年年份+月份+日期,獲取對應的對象
//通過今年年份+月份+日期,獲取對應的對象
MainBusinessBean
.
DataBean
bean
=
map
.
get
(
TimeUtils
.
getDistanceDate
(
0
,
Calendar
.
YEAR
,
DEFAULT_DATE_Y
)
+
xData
[
i
]);
MainBusinessBean
.
DataBean
bean
=
map
.
get
(
TimeUtils
.
getDistanceDate
(
0
,
Calendar
.
YEAR
,
DEFAULT_DATE_Y
)
+
xData
[
i
]);
if
(
bean
!=
null
)
{
if
(
bean
!=
null
)
{
...
@@ -280,10 +286,11 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -280,10 +286,11 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
}
}
}
}
@OnClick
({
R2
.
id
.
tv_start_time
})
@OnClick
({
R2
.
id
.
tv_start_time
,
R2
.
id
.
iv_time_triangle
})
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
||
v
.
getId
()
==
R
.
id
.
iv_time_triangle
)
{
triangleView
.
toggle
();
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
try
{
try
{
//設置默認時間為當前的起止時間
//設置默認時間為當前的起止時間
...
@@ -295,9 +302,29 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
...
@@ -295,9 +302,29 @@ public class BusinessReportFragment extends BaseFragment<BusinessReportPresenter
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
{
{
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
setTime
(
date
);
int
month
=
calendar
.
get
(
Calendar
.
MONTH
);
int
day
=
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
);
calendar
.
setTime
(
new
Date
());
//如果不是當前月份,那麼報表最多顯示最近七天
if
(
month
!=
calendar
.
get
(
Calendar
.
MONTH
))
{
manyDay
=
7
;
}
else
{
//如果選中的是當前月份,判斷天數是否大於7
if
(
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)
-
day
>
7
)
{
manyDay
=
7
;
}
else
{
manyDay
=
calendar
.
get
(
Calendar
.
DAY_OF_MONTH
)
-
day
;
if
(
manyDay
<
0
)
{
manyDay
=
0
;
}
}
}
mPresenter
.
getRestaurantAmount
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
(),
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantAmount
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
(),
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantBusinessInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
(),
TimeUtils
.
getOldDate
(
1
));
mPresenter
.
getRestaurantBusinessInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
(),
TimeUtils
.
getOldDate
(
1
));
});
})
.
setOnDismissListener
(
o
->
triangleView
.
toggle
())
;
}
}
}
}
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/PaymentMethodReportFragment.java
View file @
f8ac03e3
...
@@ -27,6 +27,7 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
...
@@ -27,6 +27,7 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.PaymentMethodBean;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.PaymentMethodReportPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.PaymentMethodReportPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.PaymentMethodAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.PaymentMethodAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.PaymentMethodColorAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.PaymentMethodColorAdapter
;
import
com.gingersoft.gsa.cloud.ui.view.TriangleView
;
import
com.github.mikephil.charting.animation.Easing
;
import
com.github.mikephil.charting.animation.Easing
;
import
com.github.mikephil.charting.charts.PieChart
;
import
com.github.mikephil.charting.charts.PieChart
;
import
com.github.mikephil.charting.components.Legend
;
import
com.github.mikephil.charting.components.Legend
;
...
@@ -34,7 +35,6 @@ import com.github.mikephil.charting.data.PieData;
...
@@ -34,7 +35,6 @@ import com.github.mikephil.charting.data.PieData;
import
com.github.mikephil.charting.data.PieDataSet
;
import
com.github.mikephil.charting.data.PieDataSet
;
import
com.github.mikephil.charting.data.PieEntry
;
import
com.github.mikephil.charting.data.PieEntry
;
import
com.github.mikephil.charting.formatter.PercentFormatter
;
import
com.github.mikephil.charting.formatter.PercentFormatter
;
import
com.github.mikephil.charting.utils.MPPointF
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.base.BaseFragment
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
...
@@ -77,6 +77,8 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -77,6 +77,8 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
TextView
mTvStartTime
;
TextView
mTvStartTime
;
@BindView
(
R2
.
id
.
tv_end_time
)
@BindView
(
R2
.
id
.
tv_end_time
)
TextView
mTvEndTime
;
TextView
mTvEndTime
;
@BindView
(
R2
.
id
.
iv_payment_time_triangle
)
TriangleView
triangleView
;
public
static
PaymentMethodReportFragment
newInstance
()
{
public
static
PaymentMethodReportFragment
newInstance
()
{
PaymentMethodReportFragment
fragment
=
new
PaymentMethodReportFragment
();
PaymentMethodReportFragment
fragment
=
new
PaymentMethodReportFragment
();
...
@@ -210,25 +212,26 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -210,25 +212,26 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
//不顯示右側底部小字
//不顯示右側底部小字
chart
.
setUsePercentValues
(
true
);
chart
.
setUsePercentValues
(
true
);
chart
.
getDescription
().
setEnabled
(
false
);
chart
.
getDescription
().
setEnabled
(
false
);
chart
.
setExtraOffsets
(
0
,
0
,
0
,
0
);
//
chart.setExtraOffsets(0, 0, 0, 0);
//滑動摩擦係數
chart
.
setDragDecelerationFrictionCoef
(
0.95f
);
chart
.
setDragDecelerationFrictionCoef
(
0.95f
);
//是否繪製中心圓
chart
.
setDrawHoleEnabled
(
true
);
chart
.
setDrawHoleEnabled
(
true
);
chart
.
setHoleColor
(
Color
.
WHITE
);
chart
.
setHoleColor
(
Color
.
WHITE
);
chart
.
setTransparentCircleColor
(
Color
.
WHITE
);
chart
.
setTransparentCircleColor
(
Color
.
BLACK
);
chart
.
setTransparentCircleAlpha
(
110
);
chart
.
setTransparentCircleAlpha
(
110
);
chart
.
setHoleRadius
(
28
f
);
chart
.
setHoleRadius
(
28
f
);
chart
.
setTransparentCircleRadius
(
0
f
);
chart
.
setTransparentCircleRadius
(
0
f
);
//不繪製中心文字
chart
.
setDrawCenterText
(
false
);
chart
.
setDrawCenterText
(
false
);
//設置旋轉角度
chart
.
setRotationAngle
(
0
);
chart
.
setRotationAngle
(
0
);
//
enable rotation of the chart by touch
//
設置可以觸摸旋轉
chart
.
setRotationEnabled
(
true
);
chart
.
setRotationEnabled
(
true
);
chart
.
setHighlightPerTapEnabled
(
true
);
//
chart.setHighlightPerTapEnabled(true);
//設置單位
// chart.setUnit(" €");
// chart.setUnit(" €");
// chart.setDrawUnitsInChart(true);
// chart.setDrawUnitsInChart(true);
...
@@ -236,12 +239,10 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -236,12 +239,10 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
// chart.setOnChartValueSelectedListener(this);
// chart.setOnChartValueSelectedListener(this);
chart
.
animateY
(
1400
,
Easing
.
EaseInOutQuad
);
chart
.
animateY
(
1400
,
Easing
.
EaseInOutQuad
);
// chart.spin(2000, 0, 360);
Legend
l
=
chart
.
getLegend
();
Legend
l
=
chart
.
getLegend
();
l
.
setVerticalAlignment
(
Legend
.
LegendVerticalAlignment
.
TOP
);
//
l.setVerticalAlignment(Legend.LegendVerticalAlignment.TOP);
l
.
setHorizontalAlignment
(
Legend
.
LegendHorizontalAlignment
.
RIGHT
);
//
l.setHorizontalAlignment(Legend.LegendHorizontalAlignment.RIGHT);
l
.
setOrientation
(
Legend
.
LegendOrientation
.
VERTICAL
);
//
l.setOrientation(Legend.LegendOrientation.VERTICAL);
l
.
setDrawInside
(
false
);
l
.
setDrawInside
(
false
);
l
.
setEnabled
(
false
);
l
.
setEnabled
(
false
);
// entry label styling
// entry label styling
...
@@ -257,24 +258,17 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -257,24 +258,17 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
ArrayList
<
Integer
>
colors
=
new
ArrayList
<>();
ArrayList
<
Integer
>
colors
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
dataBeans
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
dataBeans
.
size
();
i
++)
{
float
percentage
=
Float
.
parseFloat
(
dataBeans
.
get
(
i
).
getPercentage
().
replace
(
"%"
,
""
));
float
percentage
=
Float
.
parseFloat
(
dataBeans
.
get
(
i
).
getPercentage
().
replace
(
"%"
,
""
));
if
(
percentage
>
5
)
{
//比例大於0
才添加
if
(
percentage
>
3
)
{
//比例大於3
才添加
entries
.
add
(
new
PieEntry
(
percentage
,
dataBeans
.
get
(
i
).
getPayName
()));
entries
.
add
(
new
PieEntry
(
percentage
,
dataBeans
.
get
(
i
).
getPayName
()));
if
(
i
<
PaymentMethodAdapter
.
colors
.
length
)
{
colors
.
add
(
mContext
.
getResources
().
getColor
(
PaymentMethodAdapter
.
colors
[
i
]));
}
else
{
colors
.
add
(
mContext
.
getResources
().
getColor
(
PaymentMethodAdapter
.
colors
[
i
%
PaymentMethodAdapter
.
colors
.
length
]));
colors
.
add
(
mContext
.
getResources
().
getColor
(
PaymentMethodAdapter
.
colors
[
i
%
PaymentMethodAdapter
.
colors
.
length
]));
}
}
}
}
}
PieDataSet
dataSet
=
new
PieDataSet
(
entries
,
"Election Results"
);
PieDataSet
dataSet
=
new
PieDataSet
(
entries
,
"Election Results"
);
dataSet
.
setColors
(
colors
);
dataSet
.
setColors
(
colors
);
dataSet
.
setDrawIcons
(
false
);
dataSet
.
setDrawIcons
(
false
);
dataSet
.
setSliceSpace
(
1
f
);
dataSet
.
setSliceSpace
(
1
f
);
dataSet
.
setIconsOffset
(
new
MPPointF
(
0
,
40
));
dataSet
.
setSelectionShift
(
10
f
);
dataSet
.
setSelectionShift
(
5
f
);
// add a lot of colors
//dataSet.setSelectionShift(0f);
PieData
data
=
new
PieData
(
dataSet
);
PieData
data
=
new
PieData
(
dataSet
);
data
.
setValueFormatter
(
new
PercentFormatter
(
chart
));
data
.
setValueFormatter
(
new
PercentFormatter
(
chart
));
...
@@ -282,16 +276,14 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -282,16 +276,14 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
data
.
setValueTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
white
));
data
.
setValueTextColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
white
));
chart
.
setData
(
data
);
chart
.
setData
(
data
);
// undo all highlights
chart
.
highlightValues
(
null
);
chart
.
invalidate
();
chart
.
invalidate
();
}
}
@OnClick
({
R2
.
id
.
tv_start_time
})
@OnClick
({
R2
.
id
.
tv_start_time
,
R2
.
id
.
iv_payment_time_triangle
})
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
||
v
.
getId
()
==
R
.
id
.
iv_payment_time_triangle
)
{
triangleView
.
toggle
();
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
try
{
try
{
//設置默認時間為當前的起止時間
//設置默認時間為當前的起止時間
...
@@ -303,7 +295,7 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
...
@@ -303,7 +295,7 @@ public class PaymentMethodReportFragment extends BaseFragment<PaymentMethodRepor
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
{
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
{
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
mPresenter
.
getPaymentInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
());
mPresenter
.
getPaymentInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
());
});
})
.
setOnDismissListener
(
o
->
triangleView
.
toggle
())
;
}
}
}
}
}
}
main/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/fragment/SalesFragment.java
View file @
f8ac03e3
...
@@ -28,6 +28,7 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean;
...
@@ -28,6 +28,7 @@ import com.gingersoft.gsa.cloud.main.mvp.model.bean.SalesFoodsBean;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.SalesPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.presenter.SalesPresenter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.FoodRankingAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.FoodRankingAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.SortNumberingAdapter
;
import
com.gingersoft.gsa.cloud.main.mvp.ui.adapter.SortNumberingAdapter
;
import
com.gingersoft.gsa.cloud.ui.view.TriangleView
;
import
com.github.mikephil.charting.charts.PieChart
;
import
com.github.mikephil.charting.charts.PieChart
;
import
com.github.mikephil.charting.components.Legend
;
import
com.github.mikephil.charting.components.Legend
;
import
com.github.mikephil.charting.data.Entry
;
import
com.github.mikephil.charting.data.Entry
;
...
@@ -80,7 +81,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -80,7 +81,8 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
TextView
mTvStartTime
;
TextView
mTvStartTime
;
@BindView
(
R2
.
id
.
tv_end_time
)
@BindView
(
R2
.
id
.
tv_end_time
)
TextView
mTvEndTime
;
TextView
mTvEndTime
;
@BindView
(
R2
.
id
.
iv_sale_time_triangle
)
TriangleView
triangleView
;
public
static
SalesFragment
newInstance
()
{
public
static
SalesFragment
newInstance
()
{
SalesFragment
fragment
=
new
SalesFragment
();
SalesFragment
fragment
=
new
SalesFragment
();
return
fragment
;
return
fragment
;
...
@@ -226,7 +228,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -226,7 +228,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
private
void
loadChart
(
List
<
SalesFoodsBean
.
DataBean
.
SalesRankingBean
>
info
)
{
private
void
loadChart
(
List
<
SalesFoodsBean
.
DataBean
.
SalesRankingBean
>
info
)
{
//是否以百分比顯示值
//是否以百分比顯示值
salesChart
.
setUsePercentValues
(
tru
e
);
salesChart
.
setUsePercentValues
(
fals
e
);
//不顯示右側底部小字
//不顯示右側底部小字
salesChart
.
getDescription
().
setEnabled
(
false
);
salesChart
.
getDescription
().
setEnabled
(
false
);
//控制轉動速度0為立即停止
//控制轉動速度0為立即停止
...
@@ -239,11 +241,11 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -239,11 +241,11 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
salesChart
.
setHoleColor
(
Color
.
WHITE
);
salesChart
.
setHoleColor
(
Color
.
WHITE
);
salesChart
.
setTransparentCircleColor
(
Color
.
WHITE
);
salesChart
.
setTransparentCircleColor
(
Color
.
WHITE
);
salesChart
.
setTransparentCircleAlpha
(
2
00
);
// salesChart.setTransparentCircleAlpha(1
00);
//中心圓的大小,相當於百分比
//中心圓的大小,相當於百分比
salesChart
.
setHoleRadius
(
24
f
);
salesChart
.
setHoleRadius
(
24
f
);
//中心圓外部的半透明部分,百分比
//中心圓外部的半透明部分,百分比
,需要比HoleRadius大
salesChart
.
setTransparentCircleRadius
(
1
0
f
);
salesChart
.
setTransparentCircleRadius
(
0
f
);
//是否繪製文字
//是否繪製文字
salesChart
.
setDrawCenterText
(
true
);
salesChart
.
setDrawCenterText
(
true
);
...
@@ -293,14 +295,14 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -293,14 +295,14 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
if
(
info
.
get
(
i
)
!=
null
)
{
if
(
info
.
get
(
i
)
!=
null
)
{
//金額佔比
//金額佔比
float
money
=
MoneyUtil
.
divide
(
info
.
get
(
i
).
getAmount
(),
totalAmount
,
2
,
ROUND_HALF_UP
);
float
money
=
MoneyUtil
.
divide
(
info
.
get
(
i
).
getAmount
(),
totalAmount
,
2
,
ROUND_HALF_UP
);
if
(
money
>
0.0
5
)
{
if
(
money
>
0.0
3
)
{
entries
.
add
(
new
PieEntry
(
money
,
info
.
get
(
i
).
getProductName
()));
entries
.
add
(
new
PieEntry
(
money
,
info
.
get
(
i
).
getProductName
()));
}
}
}
}
}
}
}
}
PieDataSet
dataSet
=
new
PieDataSet
(
entries
,
"Election Results"
);
PieDataSet
dataSet
=
new
PieDataSet
(
entries
,
"Election Results"
);
dataSet
.
setSliceSpace
(
3
f
);
//設置餅狀圖空隙
dataSet
.
setSliceSpace
(
1
f
);
//設置餅狀圖空隙
dataSet
.
setSelectionShift
(
5
f
);
//放大時突出多少
dataSet
.
setSelectionShift
(
5
f
);
//放大時突出多少
// add a lot of colors
// add a lot of colors
ArrayList
<
Integer
>
colors
=
new
ArrayList
<>();
ArrayList
<
Integer
>
colors
=
new
ArrayList
<>();
...
@@ -333,7 +335,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -333,7 +335,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
dataSet
.
setXValuePosition
(
PieDataSet
.
ValuePosition
.
OUTSIDE_SLICE
);
dataSet
.
setXValuePosition
(
PieDataSet
.
ValuePosition
.
OUTSIDE_SLICE
);
dataSet
.
setYValuePosition
(
PieDataSet
.
ValuePosition
.
OUTSIDE_SLICE
);
dataSet
.
setYValuePosition
(
PieDataSet
.
ValuePosition
.
OUTSIDE_SLICE
);
dataSet
.
setValueLineColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
lin
e_color
));
dataSet
.
setValueLineColor
(
mContext
.
getResources
().
getColor
(
R
.
color
.
them
e_color
));
PieData
data
=
new
PieData
(
dataSet
);
PieData
data
=
new
PieData
(
dataSet
);
salesChart
.
setUsePercentValues
(
true
);
salesChart
.
setUsePercentValues
(
true
);
...
@@ -347,10 +349,11 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -347,10 +349,11 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
salesChart
.
invalidate
();
salesChart
.
invalidate
();
}
}
@OnClick
({
R2
.
id
.
tv_start_time
})
@OnClick
({
R2
.
id
.
tv_start_time
,
R2
.
id
.
iv_sale_time_triangle
})
@Override
@Override
public
void
onClick
(
View
v
)
{
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
)
{
if
(
v
.
getId
()
==
R
.
id
.
tv_start_time
||
v
.
getId
()
==
R
.
id
.
iv_sale_time_triangle
)
{
triangleView
.
toggle
();
//打開時間選擇器
//打開時間選擇器
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
try
{
try
{
...
@@ -362,7 +365,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
...
@@ -362,7 +365,7 @@ public class SalesFragment extends BaseFragment<SalesPresenter> implements Sales
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
{
TimePickerUtils
.
showReportTimePicker
(
mContext
,
cal
,
(
date
,
v1
)
->
{
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
mTvStartTime
.
setText
(
TimeUtils
.
DATE_FORMAT_DATE
.
format
(
date
));
mPresenter
.
getSalesReportInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
());
mPresenter
.
getSalesReportInfo
(
GsaCloudApplication
.
getRestaurantId
(
mContext
)
+
""
,
mTvStartTime
.
getText
().
toString
());
});
})
.
setOnDismissListener
(
o
->
triangleView
.
toggle
())
;
}
}
}
}
...
...
main/src/main/res/layout/fragment_business_report.xml
View file @
f8ac03e3
...
@@ -55,6 +55,13 @@
...
@@ -55,6 +55,13 @@
android:textColor=
"#181818"
android:textColor=
"#181818"
android:textSize=
"@dimen/sp_10"
/>
android:textSize=
"@dimen/sp_10"
/>
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id=
"@+id/iv_time_triangle"
android:layout_marginLeft=
"@dimen/dp_2"
android:layout_width=
"@dimen/dp_8"
app:trv_direction=
"bottom"
android:layout_height=
"@dimen/dp_5"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
...
main/src/main/res/layout/fragment_main_top.xml
View file @
f8ac03e3
...
@@ -128,11 +128,13 @@
...
@@ -128,11 +128,13 @@
<!-- android:layout_width="match_parent"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="match_parent" />-->
<!-- android:layout_height="match_parent" />-->
<TextView
<
com.qmuiteam.qmui.alpha.QMUIAlpha
TextView
android:id=
"@+id/tv_more_report"
android:id=
"@+id/tv_more_report"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_10"
android:paddingBottom=
"@dimen/dp_10"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:text=
"更多報表 >"
android:text=
"更多報表 >"
android:textColor=
"#3c3c3c"
android:textColor=
"#3c3c3c"
android:textSize=
"@dimen/sp_12"
android:textSize=
"@dimen/sp_12"
...
...
main/src/main/res/layout/fragment_payment_method_report.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
androidx.core.widget.Nested
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.gingersoft.gsa.cloud.ui.view.My
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
@@ -53,6 +53,13 @@
...
@@ -53,6 +53,13 @@
android:textColor=
"#181818"
android:textColor=
"#181818"
android:textSize=
"@dimen/dp_10"
/>
android:textSize=
"@dimen/dp_10"
/>
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id=
"@+id/iv_payment_time_triangle"
android:layout_marginLeft=
"@dimen/dp_2"
android:layout_width=
"@dimen/dp_8"
app:trv_direction=
"bottom"
android:layout_height=
"@dimen/dp_5"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -77,7 +84,7 @@
...
@@ -77,7 +84,7 @@
<com.github.mikephil.charting.charts.PieChart
<com.github.mikephil.charting.charts.PieChart
android:id=
"@+id/report_payment_method_chart"
android:id=
"@+id/report_payment_method_chart"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_1
7
0"
android:layout_height=
"@dimen/dp_1
8
0"
android:layout_marginTop=
"@dimen/dp_10"
android:layout_marginTop=
"@dimen/dp_10"
android:visibility=
"visible"
android:visibility=
"visible"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
...
@@ -167,4 +174,4 @@
...
@@ -167,4 +174,4 @@
android:layout_marginRight=
"@dimen/dp_15"
/>
android:layout_marginRight=
"@dimen/dp_15"
/>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.gingersoft.gsa.cloud.ui.view.MyScrollView>
\ No newline at end of file
\ No newline at end of file
main/src/main/res/layout/fragment_sales.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<
androidx.core.widget.Nested
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.gingersoft.gsa.cloud.ui.view.My
ScrollView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
...
@@ -55,6 +55,13 @@
...
@@ -55,6 +55,13 @@
android:textColor=
"#181818"
android:textColor=
"#181818"
android:textSize=
"@dimen/sp_10"
/>
android:textSize=
"@dimen/sp_10"
/>
<com.gingersoft.gsa.cloud.ui.view.TriangleView
android:id=
"@+id/iv_sale_time_triangle"
android:layout_marginLeft=
"@dimen/dp_2"
android:layout_width=
"@dimen/dp_8"
app:trv_direction=
"bottom"
android:layout_height=
"@dimen/dp_5"
/>
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -139,4 +146,4 @@
...
@@ -139,4 +146,4 @@
</LinearLayout>
</LinearLayout>
</com.lihang.ShadowLayout>
</com.lihang.ShadowLayout>
</LinearLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.gingersoft.gsa.cloud.ui.view.MyScrollView>
\ No newline at end of file
\ No newline at end of file
main/src/main/res/layout/item_main_side_menu.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.qmuiteam.qmui.alpha.QMUIAlpha
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center_vertical"
android:gravity=
"center_vertical"
...
@@ -23,4 +23,4 @@
...
@@ -23,4 +23,4 @@
android:textSize=
"@dimen/sp_17"
/>
android:textSize=
"@dimen/sp_17"
/>
</LinearLayout>
</com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout>
\ No newline at end of file
\ No newline at end of file
main/src/main/res/layout/main_home_funcation_item.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.qmuiteam.qmui.alpha.QMUIAlpha
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:gravity=
"center"
...
@@ -21,4 +21,4 @@
...
@@ -21,4 +21,4 @@
android:textColor=
"@color/normal_color"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_12"
/>
android:textSize=
"@dimen/sp_12"
/>
</LinearLayout>
</com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout>
\ No newline at end of file
\ No newline at end of file
main/src/main/res/layout/main_home_management_funcation_item.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<
com.qmuiteam.qmui.alpha.QMUIAlpha
LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:gravity=
"center"
android:gravity=
"center"
...
@@ -22,4 +22,4 @@
...
@@ -22,4 +22,4 @@
android:textColor=
"@color/normal_color"
android:textColor=
"@color/normal_color"
android:textSize=
"@dimen/sp_12"
/>
android:textSize=
"@dimen/sp_12"
/>
</LinearLayout>
</com.qmuiteam.qmui.alpha.QMUIAlphaLinearLayout>
\ No newline at end of file
\ No newline at end of file
main/src/main/res/values/colors.xml
View file @
f8ac03e3
...
@@ -17,4 +17,17 @@
...
@@ -17,4 +17,17 @@
<color
name=
"payment_method_color6"
>
#00A0E9
</color>
<color
name=
"payment_method_color6"
>
#00A0E9
</color>
<color
name=
"payment_method_color7"
>
#EFE75E
</color>
<color
name=
"payment_method_color7"
>
#EFE75E
</color>
<color
name=
"payment_method_color8"
>
#5358F1
</color>
<color
name=
"payment_method_color8"
>
#5358F1
</color>
<color
name=
"payment_method_color9"
>
#ff2d51
</color>
<color
name=
"payment_method_color10"
>
#426666
</color>
<color
name=
"payment_method_color11"
>
#bce672
</color>
<color
name=
"payment_method_color12"
>
#44cef6
</color>
<color
name=
"payment_method_color13"
>
#ffa631
</color>
<color
name=
"payment_method_color14"
>
#a3d900
</color>
<color
name=
"payment_method_color15"
>
#f00056
</color>
<color
name=
"payment_method_color16"
>
#bf242a
</color>
<color
name=
"payment_method_color17"
>
#a1afc9
</color>
<color
name=
"payment_method_color18"
>
#c89c23
</color>
<color
name=
"payment_method_color19"
>
#e4c6d0
</color>
<color
name=
"payment_method_color20"
>
#103371
</color>
</resources>
</resources>
print-module/src/main/java/com/joe/print/mvp/print/PrintUtils.java
View file @
f8ac03e3
...
@@ -2,6 +2,7 @@ package com.joe.print.mvp.print;
...
@@ -2,6 +2,7 @@ package com.joe.print.mvp.print;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
android.graphics.Bitmap
;
import
android.os.Build
;
import
android.view.View
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
...
@@ -366,4 +367,14 @@ public class PrintUtils {
...
@@ -366,4 +367,14 @@ public class PrintUtils {
//580為程序支持的打印紙最大寬度
//580為程序支持的打印紙最大寬度
return
ImageUtils
.
zoomDrawable
(
LayoutToBitmapUtils
.
loadBitmapFromView
(
view
),
paperWidth
);
//将view轉bitmap
return
ImageUtils
.
zoomDrawable
(
LayoutToBitmapUtils
.
loadBitmapFromView
(
view
),
paperWidth
);
//将view轉bitmap
}
}
/**
* 當前設備是不是打印設備
*
* @return
*/
public
static
boolean
isPrintDevice
()
{
return
GsaCloudApplication
.
mV2
.
contains
(
Build
.
MODEL
)
||
GsaCloudApplication
.
mN5
.
contains
(
Build
.
MODEL
);
}
}
}
print-module/src/main/java/com/joe/print/mvp/print/TestPrintDataMaker.java
View file @
f8ac03e3
package
com
.
joe
.
print
.
mvp
.
print
;
package
com
.
joe
.
print
.
mvp
.
print
;
import
android.content.Context
;
import
android.content.Context
;
import
android.graphics.Bitmap
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.print.PrintDataMaker
;
import
com.gingersoft.gsa.cloud.print.PrintDataMaker
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter58mm
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter58mm
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter80mm
;
import
com.gingersoft.gsa.cloud.print.PrinterWriter80mm
;
import
com.joe.print.R
;
import
com.joe.print.R
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Locale
;
/**
/**
* 测试数据生成
* 测试数据生成
...
@@ -21,7 +20,7 @@ import java.util.Locale;
...
@@ -21,7 +20,7 @@ import java.util.Locale;
public
class
TestPrintDataMaker
implements
PrintDataMaker
{
public
class
TestPrintDataMaker
implements
PrintDataMaker
{
private
Context
context
;
private
Context
context
;
// private String qr;
// private String qr;
private
int
width
;
private
int
width
;
private
int
height
;
private
int
height
;
...
@@ -40,57 +39,69 @@ public class TestPrintDataMaker implements PrintDataMaker {
...
@@ -40,57 +39,69 @@ public class TestPrintDataMaker implements PrintDataMaker {
printer
=
type
==
PrinterWriter58mm
.
TYPE_58
?
new
PrinterWriter58mm
(
height
,
width
)
:
new
PrinterWriter80mm
(
height
,
width
);
printer
=
type
==
PrinterWriter58mm
.
TYPE_58
?
new
PrinterWriter58mm
(
height
,
width
)
:
new
PrinterWriter80mm
(
height
,
width
);
printer
.
setAlignCenter
();
printer
.
setAlignCenter
();
data
.
add
(
printer
.
getDataAndReset
());
data
.
add
(
printer
.
getDataAndReset
());
ArrayList
<
byte
[]>
image
1
=
printer
.
getImageByte
(
context
.
getResources
(),
R
.
mipmap
.
ic_logo
);
ArrayList
<
byte
[]>
image
=
printer
.
getImageByte
(
context
.
getResources
(),
R
.
mipmap
.
ic_logo
);
data
.
addAll
(
image
1
);
data
.
addAll
(
image
);
printer
.
setAlignLeft
();
List
<
Bitmap
>
bitmaps
=
PrintUtils
.
getPrintBitmap
(
context
,
-
1
,
width
);
//根據打印類型獲得不同的bitmap
printer
.
printLine
();
if
(
bitmaps
.
size
()
<=
0
)
{
printer
.
printLineFeed
();
ToastUtils
.
show
(
context
,
"打印失敗"
);
return
null
;
printer
.
printLineFeed
();
}
printer
.
setAlignCenter
();
for
(
int
i
=
0
;
i
<
bitmaps
.
size
();
i
++)
{
printer
.
setEmphasizedOn
();
ArrayList
<
byte
[]>
image1
=
printer
.
getImageByte
(
bitmaps
.
get
(
i
));
printer
.
setFontSize
(
1
);
data
.
addAll
(
image1
);
//draw2PxPoint2(bitmaps.get(i)
printer
.
print
(
"Selftest"
);
printer
.
printLineFeed
();
printer
.
setFontSize
(
0
);
printer
.
setEmphasizedOff
();
printer
.
printLineFeed
();
printer
.
print
(
"Gingersoft"
);
printer
.
printLineFeed
();
printer
.
print
(
"客服电话:××××××××"
);
printer
.
printLineFeed
();
printer
.
setAlignLeft
();
printer
.
printLineFeed
();
printer
.
print
(
"订单号:88888888888888888"
);
printer
.
printLineFeed
();
printer
.
print
(
"预计送达:"
+
new
SimpleDateFormat
(
"yyyy/MM/dd HH:mm"
,
Locale
.
getDefault
())
.
format
(
new
Date
(
System
.
currentTimeMillis
())));
printer
.
printLineFeed
();
printer
.
setEmphasizedOn
();
printer
.
print
(
"#8(已付款)"
);
printer
.
printLineFeed
();
printer
.
print
(
"××区××路×××大厦××楼×××室"
);
printer
.
printLineFeed
();
printer
.
setEmphasizedOff
();
// printer.print("13843211234");
// printer.print("(张某某)");
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
print
(
"备注:多加点辣椒,多加点香菜,多加点酸萝卜,多送点一次性手套"
);
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
printLine
();
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
printLineFeed
();
printer
.
feedPaperCutPartial
();
printer
.
feedPaperCutPartial
();
}
data
.
add
(
printer
.
getDataAndReset
());
// printer.setAlignLeft();
// printer.printLine();
// printer.printLineFeed();
//
// printer.printLineFeed();
// printer.setAlignCenter();
// printer.setEmphasizedOn();
// printer.setFontSize(1);
// printer.print("Selftest");
// printer.printLineFeed();
// printer.setFontSize(0);
// printer.setEmphasizedOff();
// printer.printLineFeed();
//
// printer.print("Gingersoft");
// printer.printLineFeed();
// printer.print("客服电话:××××××××");
// printer.printLineFeed();
//
// printer.setAlignLeft();
// printer.printLineFeed();
//
// printer.print("订单号:88888888888888888");
// printer.printLineFeed();
//
// printer.print("预计送达:" +
// new SimpleDateFormat("yyyy/MM/dd HH:mm", Locale.getDefault())
// .format(new Date(System.currentTimeMillis())));
// printer.printLineFeed();
//
// printer.setEmphasizedOn();
// printer.print("#8(已付款)");
// printer.printLineFeed();
// printer.print("××区××路×××大厦××楼×××室");
// printer.printLineFeed();
// printer.setEmphasizedOff();
// printer.printLineFeed();
// printer.print("备注:多加点辣椒,多加点香菜,多加点酸萝卜,多送点一次性手套");
// printer.printLineFeed();
//
// printer.printLine();
// printer.printLineFeed();
// printer.printLineFeed();
// printer.printLineFeed();
data
.
add
(
printer
.
getDataAndClose
());
data
.
add
(
printer
.
getDataAndClose
());
return
data
;
return
data
;
...
...
print-module/src/main/java/com/joe/print/mvp/ui/activity/IpPrintActivity.java
View file @
f8ac03e3
...
@@ -241,4 +241,11 @@ public class IpPrintActivity extends Activity implements PrintSocketHolder.OnSta
...
@@ -241,4 +241,11 @@ public class IpPrintActivity extends Activity implements PrintSocketHolder.OnSta
public
void
onDismiss
(
DialogInterface
dialog
)
{
public
void
onDismiss
(
DialogInterface
dialog
)
{
finish
();
finish
();
}
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
if
(
executor
!=
null
)
executor
.
closeSocket
();
}
}
}
print-module/src/main/java/com/joe/print/mvp/ui/activity/PrinterListActivity.java
View file @
f8ac03e3
...
@@ -18,6 +18,7 @@ import com.joe.print.R2;
...
@@ -18,6 +18,7 @@ import com.joe.print.R2;
import
com.joe.print.di.component.DaggerPrintListComponent
;
import
com.joe.print.di.component.DaggerPrintListComponent
;
import
com.joe.print.mvp.contract.PrintListContract
;
import
com.joe.print.mvp.contract.PrintListContract
;
import
com.joe.print.mvp.presenter.PrintListPresenter
;
import
com.joe.print.mvp.presenter.PrintListPresenter
;
import
com.joe.print.mvp.print.PrintUtils
;
import
com.joe.print.mvp.ui.fragment.IpPrintListActivityFragment
;
import
com.joe.print.mvp.ui.fragment.IpPrintListActivityFragment
;
import
com.joe.print.mvp.ui.fragment.LocalPrintFragment
;
import
com.joe.print.mvp.ui.fragment.LocalPrintFragment
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
...
@@ -79,12 +80,15 @@ public class PrinterListActivity extends BaseActivity<PrintListPresenter> implem
...
@@ -79,12 +80,15 @@ public class PrinterListActivity extends BaseActivity<PrintListPresenter> implem
*/
*/
private
void
initViewPager
()
{
private
void
initViewPager
()
{
List
<
String
>
titles
=
new
ArrayList
<>();
List
<
String
>
titles
=
new
ArrayList
<>();
List
<
Fragment
>
mFragments
=
new
ArrayList
<>();
mFragments
.
add
(
IpPrintListActivityFragment
.
newInstance
());
if
(
PrintUtils
.
isPrintDevice
())
{
titles
.
add
(
"本機打印"
);
titles
.
add
(
"本機打印"
);
mFragments
.
add
(
LocalPrintFragment
.
newInstance
());
}
titles
.
add
(
"網絡打印"
);
titles
.
add
(
"網絡打印"
);
List
<
Fragment
>
mFragments
=
new
ArrayList
<>();
mFragments
.
add
(
LocalPrintFragment
.
newInstance
());
mFragments
.
add
(
IpPrintListActivityFragment
.
newInstance
());
//实例化适配器
//实例化适配器
mTabFragmentAdapter
=
new
TabFragmentAdapter
(
getSupportFragmentManager
(),
1
);
mTabFragmentAdapter
=
new
TabFragmentAdapter
(
getSupportFragmentManager
(),
1
);
//设置加载的Fragment集合
//设置加载的Fragment集合
...
...
print-module/src/main/java/com/joe/print/mvp/ui/fragment/LocalPrintFragment.java
View file @
f8ac03e3
...
@@ -63,14 +63,14 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
...
@@ -63,14 +63,14 @@ public class LocalPrintFragment extends BaseFragment<LocalPrintPresenter> implem
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
ivSetLocationPrintBtn
.
setOnCheckedChangeListener
((
buttonView
,
isChecked
)
->
{
ivSetLocationPrintBtn
.
setOnCheckedChangeListener
((
buttonView
,
isChecked
)
->
{
if
(
SPUtils
.
get
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
""
).
equals
(
Constans
.
LOCAL_PRINT
))
{
if
(
isChecked
){
//如果默認打印方式為本地,修改為IP打印
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
false
);
}
else
{
//修改默認打印方式為本地
//修改默認打印方式為本地
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
LOCAL_PRINT
);
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
LOCAL_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
true
);
ivSetLocationPrintBtn
.
setChecked
(
true
);
}
else
{
//如果默認打印方式為本地,修改為IP打印
SPUtils
.
put
(
mContext
,
Constans
.
DEFAULT_PRINT_METHOD
,
Constans
.
IP_PRINT
);
ivSetLocationPrintBtn
.
setChecked
(
false
);
}
}
});
});
}
}
...
...
print-module/src/main/res/layout/print_test.xml
View file @
f8ac03e3
...
@@ -10,7 +10,7 @@
...
@@ -10,7 +10,7 @@
<TextView
<TextView
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"打印測試"
android:text=
"打印測試
打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打印測試打
"
android:textColor=
"@color/theme_333_color"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_25"
/>
android:textSize=
"@dimen/dp_25"
/>
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/constans/UserConstans.java
View file @
f8ac03e3
...
@@ -8,6 +8,8 @@ public class UserConstans {
...
@@ -8,6 +8,8 @@ public class UserConstans {
public
final
static
String
LOGIN_PASSWORD
=
"login_password"
;
public
final
static
String
LOGIN_PASSWORD
=
"login_password"
;
public
final
static
String
AUTO_LOGIN
=
"auto_login"
;
public
final
static
String
AUTO_LOGIN
=
"auto_login"
;
public
final
static
String
IS_GUIDE
=
"is_guide"
;
public
static
String
memberId
=
"member_id"
;
public
static
String
memberId
=
"member_id"
;
public
static
String
memberName
=
"member_name"
;
public
static
String
memberName
=
"member_name"
;
...
...
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimePickerUtils.java
View file @
f8ac03e3
...
@@ -19,7 +19,7 @@ public class TimePickerUtils {
...
@@ -19,7 +19,7 @@ public class TimePickerUtils {
* @param defaultTime 默認選中時間
* @param defaultTime 默認選中時間
* @param onTimeSelectListener 選中時間回調
* @param onTimeSelectListener 選中時間回調
*/
*/
public
static
void
showReportTimePicker
(
Context
mContext
,
Calendar
defaultTime
,
TimePickerView
.
OnTimeSelectListener
onTimeSelectListener
)
{
public
static
TimePickerView
showReportTimePicker
(
Context
mContext
,
Calendar
defaultTime
,
TimePickerView
.
OnTimeSelectListener
onTimeSelectListener
)
{
//獲取今年第一天的日期
//獲取今年第一天的日期
Calendar
cal
=
Calendar
.
getInstance
();
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
set
(
Calendar
.
DAY_OF_YEAR
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_YEAR
));
cal
.
set
(
Calendar
.
DAY_OF_YEAR
,
cal
.
getActualMinimum
(
Calendar
.
DAY_OF_YEAR
));
...
@@ -49,6 +49,7 @@ public class TimePickerUtils {
...
@@ -49,6 +49,7 @@ public class TimePickerUtils {
//設置默認選中時間
//設置默認選中時間
pvTime
.
setDate
(
defaultTime
);
//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
pvTime
.
setDate
(
defaultTime
);
//注:根据需求来决定是否使用该方法(一般是精确到秒的情况),此项可以在弹出选择器的时候重新设置当前时间,避免在初始化之后由于时间已经设定,导致选中时间与当前时间不匹配的问题。
pvTime
.
show
();
pvTime
.
show
();
return
pvTime
;
}
}
}
}
public-base/src/main/java/com/gingersoft/gsa/cloud/base/utils/time/TimeUtils.java
View file @
f8ac03e3
...
@@ -447,6 +447,7 @@ public class TimeUtils {
...
@@ -447,6 +447,7 @@ public class TimeUtils {
try
{
try
{
date
=
new
Date
(
time
);
date
=
new
Date
(
time
);
}
catch
(
IllegalArgumentException
e
)
{
}
catch
(
IllegalArgumentException
e
)
{
e
.
printStackTrace
();
try
{
try
{
date
=
dateFormat
.
parse
(
time
);
date
=
dateFormat
.
parse
(
time
);
}
catch
(
ParseException
ex
)
{
}
catch
(
ParseException
ex
)
{
...
...
public-base/src/main/res/values/attrs.xml
View file @
f8ac03e3
...
@@ -7,16 +7,16 @@
...
@@ -7,16 +7,16 @@
<enum
name=
"bottom"
value=
"2"
/>
<enum
name=
"bottom"
value=
"2"
/>
<enum
name=
"all"
value=
"3"
/>
<enum
name=
"all"
value=
"3"
/>
</attr>
</attr>
<attr
name=
"shadow_left"
format=
"reference"
/>
<attr
name=
"shadow_left"
format=
"reference"
/>
<attr
name=
"shadow_right"
format=
"reference"
/>
<attr
name=
"shadow_right"
format=
"reference"
/>
<attr
name=
"shadow_bottom"
format=
"reference"
/>
<attr
name=
"shadow_bottom"
format=
"reference"
/>
</declare-styleable>
</declare-styleable>
<attr
name=
"SwipeBackLayoutStyle"
format=
"reference"
/>
<attr
name=
"SwipeBackLayoutStyle"
format=
"reference"
/>
<!-- QMUI-->
<!-- QMUI-->
<attr
name=
"app_primary_color"
format=
"color"
/>
<!-- topbar -->
<attr
name=
"app_primary_color"
format=
"color"
/>
<!-- topbar -->
<attr
name=
"app_content_bg_color"
format=
"color"
/>
<!-- content-->
<attr
name=
"app_content_bg_color"
format=
"color"
/>
<!-- content-->
<declare-styleable
name=
"MaxHeightRecyclerView"
>
<declare-styleable
name=
"MaxHeightRecyclerView"
>
<attr
name=
"maxHeight"
format=
"dimension"
/>
<attr
name=
"maxHeight"
format=
"dimension"
/>
...
@@ -356,4 +356,57 @@
...
@@ -356,4 +356,57 @@
<!-- <attr name="initPosition" format="integer"/>-->
<!-- <attr name="initPosition" format="integer"/>-->
<!-- <attr name="drawItemCount" format="integer"/>-->
<!-- <attr name="drawItemCount" format="integer"/>-->
<!-- </declare-styleable>-->
<!-- </declare-styleable>-->
<declare-styleable
name=
"Indicator"
>
<!--未选中的指示器颜色-->
<attr
name=
"normal_color"
format=
"reference|color"
/>
<!--选中的指示器颜色-->
<attr
name=
"selected_color"
format=
"reference|color"
/>
<!--指示器每个item之间的间距-->
<attr
name=
"spacing"
format=
"dimension"
/>
<!--指示器排列方向-->
<attr
name=
"orientation"
format=
"enum"
>
<enum
name=
"horizontal"
value=
"0"
/>
<enum
name=
"vertical"
value=
"1"
/>
</attr>
<!--指示器类型 命名规则:未选中样式_选中样式-->
<attr
name=
"style"
format=
"enum"
>
<!--都是圆点-->
<enum
name=
"circle_circle"
value=
"0"
/>
<!--都是方形-->
<enum
name=
"rect_rect"
value=
"1"
/>
<!--未选中是圆点,选中是方形-->
<enum
name=
"circle_rect"
value=
"2"
/>
</attr>
<!--都是圆点指示器半径大小-->
<attr
name=
"circle_circle_radius"
format=
"dimension"
/>
<!--都是方形指示器长度-->
<attr
name=
"rect_rect_itemWidth"
format=
"dimension"
/>
<!--都是方形指示器高度-->
<attr
name=
"rect_rect_itemHeight"
format=
"dimension"
/>
<!--都是方形指示器圆角-->
<attr
name=
"rect_rect_corner"
format=
"dimension"
/>
<!--circle_rect 模式圆点半径-->
<attr
name=
"circle_rect_radius"
format=
"dimension"
/>
<!--circle_rect 模式方形宽度-->
<attr
name=
"circle_rect_itemWidth"
format=
"dimension"
/>
<!--circle_rect 模式方形高度-->
<attr
name=
"circle_rect_itemHeight"
format=
"dimension"
/>
<!--circle_rect 模式方形圆角-->
<attr
name=
"circle_rect_corner"
format=
"dimension"
/>
</declare-styleable>
<declare-styleable
name=
"TriangleView"
>
<attr
name=
"trv_color"
format=
"color"
/>
<attr
name=
"trv_direction"
>
<enum
name=
"top"
value=
"0"
/>
<enum
name=
"bottom"
value=
"1"
/>
<enum
name=
"right"
value=
"2"
/>
<enum
name=
"left"
value=
"3"
/>
</attr>
</declare-styleable>
</resources>
</resources>
\ No newline at end of file
public-base/src/main/res/values/colors.xml
View file @
f8ac03e3
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
<!-- <color name="theme_color">#BF1C42</color>-->
<!-- <color name="theme_color">#BF1C42</color>-->
<color
name=
"theme_color"
>
#398BED
</color>
<color
name=
"theme_color"
>
#398BED
</color>
<color
name=
"normal_color"
>
#333333
</color>
<color
name=
"normal_color"
>
#333333
</color>
<!-- 統一頁面背景色-->
<!-- 統一頁面背景色-->
<color
name=
"theme_bg_color"
>
#F0edf1
</color>
<color
name=
"theme_bg_color"
>
#F0edf1
</color>
...
@@ -439,6 +439,7 @@
...
@@ -439,6 +439,7 @@
<color
name=
"line_color2"
>
#F0F0F0
</color>
<color
name=
"line_color2"
>
#F0F0F0
</color>
<color
name=
"scroll_bar_color"
>
#CACACA
</color>
<color
name=
"scroll_bar_color"
>
#CACACA
</color>
<color
name=
"color_c8"
>
#c8c8c8
</color>
<color
name=
"hint_color"
>
#676767
</color>
<color
name=
"hint_color"
>
#676767
</color>
<color
name=
"main_home_function_head_bg"
>
#F4F4F4
</color>
<color
name=
"main_home_function_head_bg"
>
#F4F4F4
</color>
...
...
table-mode/src/main/java/com/gingersoft/gsa/cloud/table/mvp/ui/activity/orderManager/OrderDetailActivity.java
View file @
f8ac03e3
...
@@ -9,6 +9,12 @@ import android.widget.LinearLayout;
...
@@ -9,6 +9,12 @@ import android.widget.LinearLayout;
import
android.widget.ScrollView
;
import
android.widget.ScrollView
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.billy.cc.core.component.CC
;
import
com.billy.cc.core.component.CC
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderBean
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
import
com.gingersoft.gsa.cloud.base.common.bean.OrderDetail
;
...
@@ -18,7 +24,10 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
...
@@ -18,7 +24,10 @@ import com.gingersoft.gsa.cloud.base.common.bean.mealManage.MyOrderManage;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.common.bean.mealManage.OpenTableManage
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.LanguageUtils
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.R2
;
import
com.gingersoft.gsa.cloud.table.di.component.DaggerOrderDetailComponent
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderDetailContract
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.OrderDetailItem
;
import
com.gingersoft.gsa.cloud.table.mvp.model.bean.OrderDetailItem
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil
;
import
com.gingersoft.gsa.cloud.table.mvp.model.utils.OrderAssemblyUtil
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.OrderDetailPresenter
;
import
com.gingersoft.gsa.cloud.table.mvp.presenter.OrderDetailPresenter
;
...
@@ -28,12 +37,8 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.OrderDetailPayMethodAdapter
...
@@ -28,12 +37,8 @@ import com.gingersoft.gsa.cloud.table.mvp.ui.adapter.OrderDetailPayMethodAdapter
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3
;
import
com.gingersoft.gsa.cloud.ui.bean.view.SectionTextItem3
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.base.delegate.IActivity
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.gingersoft.gsa.cloud.table.di.component.DaggerOrderDetailComponent
;
import
com.gingersoft.gsa.cloud.table.mvp.contract.OrderDetailContract
;
import
com.gingersoft.gsa.cloud.table.R
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.alpha.QMUIAlphaButton
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.QMUITopBar
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
import
com.qmuiteam.qmui.widget.dialog.QMUIDialog
;
...
@@ -43,11 +48,6 @@ import java.util.ArrayList;
...
@@ -43,11 +48,6 @@ import java.util.ArrayList;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.core.content.ContextCompat
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
butterknife.OnClick
;
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/LoginActivity.java
View file @
f8ac03e3
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.user.login.mvp.ui.activity;
...
@@ -2,6 +2,7 @@ package com.gingersoft.gsa.cloud.user.login.mvp.ui.activity;
import
android.app.Activity
;
import
android.app.Activity
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.text.Editable
;
import
android.text.Editable
;
import
android.text.TextWatcher
;
import
android.text.TextWatcher
;
...
@@ -12,6 +13,7 @@ import android.view.WindowManager;
...
@@ -12,6 +13,7 @@ import android.view.WindowManager;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.EditText
;
import
android.widget.EditText
;
import
android.widget.ImageView
;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
...
@@ -21,9 +23,6 @@ import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
...
@@ -21,9 +23,6 @@ import com.gingersoft.gsa.cloud.base.utils.encryption.Aes;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.base.utils.log.LogUtil
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.base.utils.other.TextUtil
;
import
com.gingersoft.gsa.cloud.base.utils.toast.ToastUtils
;
import
com.gingersoft.gsa.cloud.database.bean.Food
;
import
com.gingersoft.gsa.cloud.database.utils.FoodDaoUtils
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.LoadingDialog
;
...
@@ -36,7 +35,6 @@ import com.gingersoft.gsa.cloud.user.login.mvp.presenter.LoginPresenter;
...
@@ -36,7 +35,6 @@ import com.gingersoft.gsa.cloud.user.login.mvp.presenter.LoginPresenter;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.tbruyelle.rxpermissions2.RxPermissions
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
...
@@ -80,6 +78,8 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
...
@@ -80,6 +78,8 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
CheckBox
mRbAutoLogin
;
CheckBox
mRbAutoLogin
;
@BindView
(
R2
.
id
.
ic_look_pwd
)
@BindView
(
R2
.
id
.
ic_look_pwd
)
ImageView
mIvSeePwd
;
ImageView
mIvSeePwd
;
@BindView
(
R2
.
id
.
tv_app_version
)
TextView
mTvVersion
;
private
boolean
passwrodVisibility
=
false
;
private
boolean
passwrodVisibility
=
false
;
...
@@ -101,8 +101,12 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
...
@@ -101,8 +101,12 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
@Override
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
try
{
mTvVersion
.
setText
(
"v"
+
getPackageManager
().
getPackageInfo
(
getPackageName
(),
0
).
versionName
);
}
catch
(
PackageManager
.
NameNotFoundException
e
)
{
e
.
printStackTrace
();
}
mPresenter
.
requestExternalStoragePermission
();
mPresenter
.
requestExternalStoragePermission
();
findViewById
(
R
.
id
.
tv_gsa_user_login
).
setOnClickListener
(
this
);
if
(!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
),
""
))
{
if
(!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
),
""
))
{
edAccount
.
setText
(
""
+
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
));
edAccount
.
setText
(
""
+
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
));
mRbRememberPwd
.
setChecked
(
true
);
mRbRememberPwd
.
setChecked
(
true
);
...
...
user-login/src/main/java/com/gingersoft/gsa/cloud/user/login/mvp/ui/activity/WelcomeActivity.java
View file @
f8ac03e3
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
;
package
com
.
gingersoft
.
gsa
.
cloud
.
user
.
login
.
mvp
.
ui
.
activity
;
import
android.animation.AnimatorSet
;
import
android.animation.ObjectAnimator
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.view.View
;
import
android.view.animation.Animation
;
import
android.view.animation.Animation
;
import
android.view.animation.AnimationUtils
;
import
android.view.animation.DecelerateInterpolator
;
import
android.view.animation.ScaleAnimation
;
import
android.view.animation.ScaleAnimation
;
import
android.widget.TextView
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.annotation.Nullable
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.viewpager2.widget.ViewPager2
;
import
com.gingersoft.gsa.cloud.base.utils.constans.UserConstans
;
import
com.gingersoft.gsa.cloud.base.utils.constans.UserConstans
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Aes
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Aes
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.R
;
import
com.gingersoft.gsa.cloud.user.login.R2
;
import
com.gingersoft.gsa.cloud.user.login.di.component.DaggerWelcomeComponent
;
import
com.gingersoft.gsa.cloud.user.login.di.component.DaggerWelcomeComponent
;
import
com.gingersoft.gsa.cloud.user.login.di.module.WelcomeModule
;
import
com.gingersoft.gsa.cloud.user.login.di.module.WelcomeModule
;
import
com.gingersoft.gsa.cloud.user.login.mvp.bean.GuideBean
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginInterfaceImpl
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.LoginInterfaceImpl
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.WelcomeContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.contract.WelcomeContract
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.WelcomePresenter
;
import
com.gingersoft.gsa.cloud.user.login.mvp.presenter.WelcomePresenter
;
import
com.gingersoft.gsa.cloud.user.login.mvp.ui.adapter.GuideAdapter
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.jess.arms.utils.ArmsUtils
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
import
butterknife.OnClick
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
public
class
WelcomeActivity
extends
LoginInterfaceImpl
<
WelcomePresenter
>
implements
WelcomeContract
.
View
{
public
class
WelcomeActivity
extends
LoginInterfaceImpl
<
WelcomePresenter
>
implements
WelcomeContract
.
View
,
View
.
OnClickListener
{
@BindView
(
R
.
id
.
content_view
)
@BindView
(
R
2
.
id
.
content_view
)
ConstraintLayout
contentView
;
ConstraintLayout
contentView
;
@BindView
(
R2
.
id
.
cl_guide_layout
)
ConstraintLayout
guideView
;
@BindView
(
R2
.
id
.
vp2_guide
)
ViewPager2
mVpGuide
;
@BindView
(
R2
.
id
.
guide_magic_indicator
)
UIndicator
magicIndicator
;
@BindView
(
R2
.
id
.
tv_guide_title
)
TextView
mTvGuideTitle
;
@BindView
(
R2
.
id
.
tv_guide_details
)
TextView
mTvGuideDetails
;
List
<
GuideBean
>
guideBeanList
=
new
ArrayList
<>();
private
final
long
ANIMATION_TIME
=
1300
;
@Override
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerWelcomeComponent
//如找不到该类,请编译一下项目
DaggerWelcomeComponent
//如找不到该类,请编译一下项目
...
@@ -63,22 +91,115 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
...
@@ -63,22 +91,115 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
@Override
@Override
public
void
onAnimationEnd
(
Animation
animation
)
{
public
void
onAnimationEnd
(
Animation
animation
)
{
// startActivity(new Intent(mContext, LoginActivity.class));
if
((
boolean
)
SPUtils
.
get
(
mContext
,
UserConstans
.
IS_GUIDE
,
true
))
{
//是第一次進入,顯示引導頁
showGuide
();
}
else
{
if
((
boolean
)
SPUtils
.
get
(
mContext
,
UserConstans
.
AUTO_LOGIN
,
false
))
{
if
((
boolean
)
SPUtils
.
get
(
mContext
,
UserConstans
.
AUTO_LOGIN
,
false
))
{
//自動登陸
//自動登陸
String
pwd
=
Aes
.
aesDecrypt
((
String
)
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_PASSWORD
,
""
));
String
pwd
=
Aes
.
aesDecrypt
((
String
)
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_PASSWORD
,
""
));
mPresenter
.
login
(
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
)
+
""
,
pwd
);
mPresenter
.
login
(
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
)
+
""
,
pwd
);
}
else
{
}
else
{
killMyself
();
startActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
startActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
}
}
}
}
}
@Override
public
void
onAnimationRepeat
(
Animation
animation
)
{
}
});
guideBeanList
.
add
(
new
GuideBean
(
"多终端云同步,轻松管理所有"
,
"為您搭建優良高效管理平台"
,
getResources
().
getDrawable
(
R
.
mipmap
.
pic_guide_one
)));
guideBeanList
.
add
(
new
GuideBean
(
"數據分析可視化"
,
"數據統計一目了然,直觀看到數據變化趨勢"
,
getResources
().
getDrawable
(
R
.
mipmap
.
pic_guide_two
)));
guideBeanList
.
add
(
new
GuideBean
(
"多種點餐方式"
,
"提供方便快捷的點餐服務,減低落錯單機會"
,
getResources
().
getDrawable
(
R
.
mipmap
.
pic_guide_three
)));
GuideAdapter
adapter
=
new
GuideAdapter
(
mContext
,
guideBeanList
);
mVpGuide
.
setAdapter
(
adapter
);
//设置一个缩放动画
mVpGuide
.
setPageTransformer
(
mAnimator
);
mVpGuide
.
registerOnPageChangeCallback
(
new
ViewPager2
.
OnPageChangeCallback
()
{
@Override
public
void
onPageSelected
(
int
position
)
{
super
.
onPageSelected
(
position
);
updateUI
(
position
);
}
});
mVpGuide
.
setScrollBarFadeDuration
((
int
)
ANIMATION_TIME
);
magicIndicator
.
attachToViewPager
(
mVpGuide
);
}
private
void
updateUI
(
int
position
)
{
mTvGuideTitle
.
setText
(
guideBeanList
.
get
(
position
).
getTitle
());
mTvGuideDetails
.
setText
(
guideBeanList
.
get
(
position
).
getDetails
());
setAnimator
();
}
private
void
setAnimator
()
{
ObjectAnimator
translationAnim
=
ObjectAnimator
.
ofFloat
(
mTvGuideTitle
,
"translationX"
,
-
120
f
,
0
f
);
translationAnim
.
setDuration
(
ANIMATION_TIME
);
translationAnim
.
setInterpolator
(
new
DecelerateInterpolator
());
ObjectAnimator
translationAnim2
=
ObjectAnimator
.
ofFloat
(
mTvGuideDetails
,
"translationX"
,
-
120
f
,
0
f
);
translationAnim2
.
setDuration
(
ANIMATION_TIME
);
translationAnim2
.
setInterpolator
(
new
DecelerateInterpolator
());
ObjectAnimator
alphaAnimator
=
ObjectAnimator
.
ofFloat
(
mTvGuideTitle
,
"alpha"
,
0
f
,
1
f
);
alphaAnimator
.
setDuration
(
ANIMATION_TIME
);
ObjectAnimator
alphaAnimator1
=
ObjectAnimator
.
ofFloat
(
mTvGuideDetails
,
"alpha"
,
0
f
,
1
f
);
alphaAnimator1
.
setDuration
(
ANIMATION_TIME
);
AnimatorSet
animatorSet
=
new
AnimatorSet
();
animatorSet
.
playTogether
(
translationAnim
,
alphaAnimator
,
translationAnim2
,
alphaAnimator1
);
animatorSet
.
start
();
}
/**
* 顯示引導圖
*/
private
void
showGuide
()
{
Animation
hideAnim
=
AnimationUtils
.
loadAnimation
(
mContext
,
R
.
anim
.
anim_alpha_hide
);
hideAnim
.
setAnimationListener
(
new
Animation
.
AnimationListener
()
{
@Override
public
void
onAnimationStart
(
Animation
animation
)
{
guideView
.
startAnimation
(
AnimationUtils
.
loadAnimation
(
mContext
,
R
.
anim
.
anim_alpha_show
));
guideView
.
setVisibility
(
View
.
VISIBLE
);
}
@Override
public
void
onAnimationEnd
(
Animation
animation
)
{
contentView
.
setVisibility
(
View
.
GONE
);
guideView
.
setVisibility
(
View
.
VISIBLE
);
}
@Override
@Override
public
void
onAnimationRepeat
(
Animation
animation
)
{
public
void
onAnimationRepeat
(
Animation
animation
)
{
}
}
});
});
contentView
.
startAnimation
(
hideAnim
);
}
ViewPager2
.
PageTransformer
mAnimator
=
(
page
,
position
)
->
{
Float
absPos
=
Math
.
abs
(
position
);
Float
scaleX
;
Float
scaleY
;
if
(
absPos
>
1
)
{
scaleX
=
0
F
;
scaleY
=
0
F
;
}
else
{
scaleX
=
1
-
absPos
;
scaleY
=
1
-
absPos
;
}
}
page
.
setScaleX
(
scaleX
);
page
.
setScaleY
(
scaleY
);
// page.setRotationX(scaleX);
};
@Override
@Override
public
void
initIntent
()
{
public
void
initIntent
()
{
...
@@ -157,6 +278,16 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
...
@@ -157,6 +278,16 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
})
})
.
build
()
.
build
()
.
show
();
.
show
();
}
@OnClick
({
R2
.
id
.
iv_guide_close
})
@Override
public
void
onClick
(
View
v
)
{
if
(
v
.
getId
()
==
R
.
id
.
iv_guide_close
)
{
//去登陸頁,設置下次不顯示引導頁
SPUtils
.
put
(
mContext
,
UserConstans
.
IS_GUIDE
,
false
);
startActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
killMyself
();
}
}
}
}
}
user-login/src/main/res/layout/activity_welcome.xml
View file @
f8ac03e3
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
>
android:layout_height=
"match_parent"
>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@color/white"
android:visibility=
"visible"
>
<ImageView
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:src=
"@mipmap/img_start"
/>
<!-- <TextView-->
<!-- android:id="@+id/tv_welcome_title"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:text="多功能管理,讓管理更輕鬆"-->
<!-- android:textColor="@color/theme_color"-->
<!-- android:textSize="@dimen/sp_16"-->
<!-- app:layout_constraintBottom_toTopOf="@id/iv_welcome_center"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toTopOf="parent"-->
<!-- app:layout_constraintVertical_chainStyle="packed" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_center"-->
<!-- android:layout_width="@dimen/dp_203"-->
<!-- android:layout_height="@dimen/dp_256"-->
<!-- android:layout_marginTop="@dimen/dp_36"-->
<!-- android:src="@mipmap/png_welcome_center"-->
<!-- app:layout_constraintBottom_toTopOf="@id/iv_welcome_logo"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/tv_welcome_title"-->
<!-- app:layout_constraintVertical_bias="0.6" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_logo"-->
<!-- android:layout_width="@dimen/dp_56"-->
<!-- android:layout_height="@dimen/dp_56"-->
<!-- android:layout_marginTop="@dimen/dp_16"-->
<!-- android:src="@mipmap/ic_logo"-->
<!-- app:layout_constraintBottom_toBottomOf="parent"-->
<!-- app:layout_constraintLeft_toLeftOf="parent"-->
<!-- app:layout_constraintRight_toRightOf="parent"-->
<!-- app:layout_constraintTop_toBottomOf="@id/iv_welcome_center" />-->
<!-- <ImageView-->
<!-- android:id="@+id/iv_welcome_bottom"-->
<!-- android:layout_width="match_parent"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:src="@mipmap/png_welcome_bottom"-->
<!-- app:layout_constraintBottom_toBottomOf="parent" />-->
</androidx.constraintlayout.widget.ConstraintLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_guide_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:background=
"@mipmap/pic_guide_bg"
android:visibility=
"gone"
>
<androidx.viewpager2.widget.ViewPager2
android:id=
"@+id/vp2_guide"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<TextView
<TextView
android:id=
"@+id/tv_welcom
e_title"
android:id=
"@+id/tv_guid
e_title"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:text=
"多功能管理,讓管理更輕鬆"
android:layout_marginLeft=
"@dimen/dp_18"
android:textColor=
"@color/theme_color"
android:text=
"多终端云同步,轻松管理所有"
android:textSize=
"@dimen/sp_16"
android:textColor=
"@color/white"
app:layout_constraintVertical_chainStyle=
"packed"
android:textSize=
"@dimen/dp_19"
app:layout_constraintBottom_toTopOf=
"@id/iv_welcome_center"
app:layout_constraintBottom_toTopOf=
"@id/tv_guide_details"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
android:id=
"@+id/iv_welcome_center"
android:layout_width=
"@dimen/dp_203"
android:layout_height=
"@dimen/dp_256"
android:layout_marginTop=
"@dimen/dp_36"
android:src=
"@mipmap/png_welcome_center"
app:layout_constraintVertical_bias=
"0.6"
app:layout_constraintBottom_toTopOf=
"@id/iv_welcome_logo"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/tv_welcome_title"
/>
app:layout_constraintVertical_bias=
"0.12"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/tv_guide_details"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginTop=
"@dimen/dp_14"
android:text=
"為您搭建優良高效管理平台"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_13"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"@id/tv_guide_title"
app:layout_constraintTop_toBottomOf=
"@id/tv_guide_title"
/>
<ImageView
<ImageView
android:id=
"@+id/iv_welcome_logo"
android:id=
"@+id/iv_guide_close"
android:layout_width=
"@dimen/dp_56"
android:layout_width=
"@dimen/dp_42"
android:layout_height=
"@dimen/dp_56"
android:layout_height=
"@dimen/dp_42"
android:layout_marginTop=
"@dimen/dp_16"
android:padding=
"@dimen/dp_12"
android:src=
"@mipmap/ic_logo"
android:src=
"@drawable/ic_guide_close"
app:layout_constraintBottom_toTopOf=
"@id/iv_welcome_bottom"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/iv_welcome_center"
/>
app:layout_constraintTop_toTopOf=
"parent"
/>
<ImageView
<com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
android:id=
"@+id/iv_welcome_bottom"
android:id=
"@+id/guide_magic_indicator"
android:layout_width=
"match_parent"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"@dimen/dp_5"
android:src=
"@mipmap/png_welcome_bottom"
android:layout_gravity=
"bottom|center_horizontal"
android:layout_marginBottom=
"@dimen/dp_10"
app:circle_rect_corner=
"@dimen/dp_3"
app:circle_rect_itemHeight=
"@dimen/dp_5"
app:circle_rect_itemWidth=
"@dimen/dp_14"
app:circle_rect_radius=
"@dimen/dp_3"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_goneMarginBottom=
"@dimen/dp_15"
app:normal_color=
"@color/white"
app:selected_color=
"@color/white"
app:spacing=
"@dimen/dp_5"
app:style=
"circle_rect"
/>
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
user-login/src/main/res/layout/user_login_activity_login.xml
View file @
f8ac03e3
...
@@ -177,7 +177,7 @@
...
@@ -177,7 +177,7 @@
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toBottomOf=
"@id/rb_remember_password"
/>
app:layout_constraintTop_toBottomOf=
"@id/rb_remember_password"
/>
<
TextView
<
com.qmuiteam.qmui.alpha.QMUIAlphaButton
android:id=
"@+id/tv_gsa_user_login"
android:id=
"@+id/tv_gsa_user_login"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
...
@@ -194,6 +194,7 @@
...
@@ -194,6 +194,7 @@
<TextView
<TextView
android:id=
"@+id/tv_app_version"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_10"
android:layout_marginBottom=
"@dimen/dp_10"
...
...
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