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
a8ba4a08
Commit
a8ba4a08
authored
Aug 08, 2020
by
Wyh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
8.8 最大登陸數限制
Signed-off-by: Wyh <1239658231>
parent
f920b567
Hide whitespace changes
Inline
Side-by-side
Showing
40 changed files
with
1730 additions
and
356 deletions
+1730
-356
arms/src/main/java/com/jess/arms/base/BaseActivity.java
+0
-4
arms/src/main/java/com/jess/arms/utils/StatusBarUtil.java
+750
-0
arms/src/main/res/values/ids.xml
+8
-0
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
+2
-2
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/RestaurantInfoUtils.java
+14
-4
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/gson/GsonUtils.java
+29
-7
base-module/src/main/java/com/gingersoft/gsa/cloud/base/widget/DialogUtils.java
+7
-5
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyGlobalHttpHandler.java
+5
-4
base-module/src/main/res/values/ids.xml
+0
-3
login-module/src/main/debug/AndroidManifest.xml
+41
-42
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/bean/LoginLimitBean.java
+41
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/BaseLoginContract.java
+13
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/LoginInterfaceImpl.java
+81
-56
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/BaseLoginModel.java
+61
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/LoginModel.java
+1
-37
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/WelcomeModel.java
+1
-35
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/presenter/BaseLoginPresenter.java
+81
-3
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/server/LoginService.java
+9
-3
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/di/component/ChooseRestaurantComponent.java
+16
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/di/module/ChooseRestaurantModule.java
+36
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/contract/ChooseRestaurantContract.java
+16
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/model/ChooseRestaurantModel.java
+33
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/presenter/ChooseRestaurantPresenter.java
+40
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/ChooseRestaurantActivity.java
+95
-0
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
+15
-6
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
+0
-3
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/adapter/LoginLimitAdapter.java
+26
-0
login-module/src/main/res/drawable/shape_topleft_topright.xml
+9
-0
login-module/src/main/res/layout/activity_choose_restaurant.xml
+10
-0
login-module/src/main/res/layout/activity_welcome.xml
+135
-135
login-module/src/main/res/layout/login_limit_dialog_layout.xml
+63
-0
login-module/src/main/res/layout/login_limit_item.xml
+52
-0
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
+2
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/MessageBean.kt
+4
-0
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
+2
-2
other_order_mode/src/main/res/layout/activity_order_details.xml
+1
-1
other_order_mode/src/main/res/layout/item_orderdetails_bill_info.xml
+29
-0
other_order_mode/src/main/res/layout/layout_order_info_dialog.xml
+1
-1
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
+1
-1
qm-skin-maker/src/main/res/values/theme.xml
+0
-2
No files found.
arms/src/main/java/com/jess/arms/base/BaseActivity.java
View file @
a8ba4a08
...
...
@@ -32,13 +32,10 @@ import com.jess.arms.integration.lifecycle.ActivityLifecycleable;
import
com.jess.arms.mvp.IPresenter
;
import
com.jess.arms.utils.AndroidWorkaround
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.qmuiteam.qmui.arch.QMUIActivity
;
import
com.qmuiteam.qmui.skin.QMUISkinManager
;
import
com.trello.rxlifecycle2.android.ActivityEvent
;
import
javax.inject.Inject
;
import
androidx.lifecycle.Lifecycle
;
import
butterknife.ButterKnife
;
import
butterknife.Unbinder
;
import
io.reactivex.subjects.BehaviorSubject
;
...
...
@@ -84,7 +81,6 @@ public abstract class BaseActivity<P extends IPresenter> extends AppCompatActivi
@Override
public
View
onCreateView
(
String
name
,
Context
context
,
AttributeSet
attrs
)
{
View
view
=
convertAutoView
(
name
,
context
,
attrs
);
return
view
==
null
?
super
.
onCreateView
(
name
,
context
,
attrs
)
:
view
;
}
...
...
arms/src/main/java/com/jess/arms/utils/StatusBarUtil.java
0 → 100644
View file @
a8ba4a08
package
com
.
jess
.
arms
.
utils
;
import
android.annotation.TargetApi
;
import
android.app.Activity
;
import
android.content.Context
;
import
android.graphics.Color
;
import
android.os.Build
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.Window
;
import
android.view.WindowManager
;
import
android.widget.LinearLayout
;
import
androidx.annotation.ColorInt
;
import
androidx.annotation.IntRange
;
import
androidx.annotation.NonNull
;
import
androidx.coordinatorlayout.widget.CoordinatorLayout
;
import
androidx.drawerlayout.widget.DrawerLayout
;
import
com.jess.arms.R
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Method
;
/**
* Created by Jaeger on 16/2/14.
* <p>
* Email: chjie.jaeger@gmail.com
* GitHub: https://github.com/laobie
*/
public
class
StatusBarUtil
{
public
static
final
int
DEFAULT_STATUS_BAR_ALPHA
=
112
;
private
static
final
int
FAKE_STATUS_BAR_VIEW_ID
=
R
.
id
.
statusbarutil_fake_status_bar_view
;
private
static
final
int
FAKE_TRANSLUCENT_VIEW_ID
=
R
.
id
.
statusbarutil_translucent_view
;
private
static
final
int
TAG_KEY_HAVE_SET_OFFSET
=
-
123
;
/**
* 设置状态栏颜色
*
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
*/
public
static
void
setColor
(
Activity
activity
,
@ColorInt
int
color
)
{
setColor
(
activity
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
/**
* 设置状态栏颜色
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColor
(
Activity
activity
,
@ColorInt
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
activity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
activity
.
getWindow
().
setStatusBarColor
(
calculateStatusColor
(
color
,
statusBarAlpha
));
if
(
isLightColor
(
color
)){
setLightMode
(
activity
);
}
else
{
setDarkMode
(
activity
);
}
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
ViewGroup
decorView
=
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
();
View
fakeStatusBarView
=
decorView
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
));
}
else
{
decorView
.
addView
(
createStatusBarView
(
activity
,
color
,
statusBarAlpha
));
}
setRootView
(
activity
);
if
(
isLightColor
(
color
)){
setLightMode
(
activity
);
}
else
{
setDarkMode
(
activity
);
}
}
}
public
static
boolean
isLightColor
(
int
color
)
{
double
darkness
=
1
-
(
0.299
*
Color
.
red
(
color
)
+
0.587
*
Color
.
green
(
color
)
+
0.114
*
Color
.
blue
(
color
))
/
255
;
if
(
darkness
<
0.5
)
{
return
true
;
// It's a light color
}
else
{
return
false
;
// It's a dark color
}
}
/**
* 为滑动返回界面设置状态栏颜色
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
*/
public
static
void
setColorForSwipeBack
(
Activity
activity
,
int
color
)
{
setColorForSwipeBack
(
activity
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
/**
* 为滑动返回界面设置状态栏颜色
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColorForSwipeBack
(
Activity
activity
,
@ColorInt
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
ViewGroup
contentView
=
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
));
View
rootView
=
contentView
.
getChildAt
(
0
);
int
statusBarHeight
=
getStatusBarHeight
(
activity
);
if
(
rootView
!=
null
&&
rootView
instanceof
CoordinatorLayout
)
{
final
CoordinatorLayout
coordinatorLayout
=
(
CoordinatorLayout
)
rootView
;
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
coordinatorLayout
.
setFitsSystemWindows
(
false
);
contentView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
));
boolean
isNeedRequestLayout
=
contentView
.
getPaddingTop
()
<
statusBarHeight
;
if
(
isNeedRequestLayout
)
{
contentView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
);
coordinatorLayout
.
post
(
new
Runnable
()
{
@Override
public
void
run
()
{
coordinatorLayout
.
requestLayout
();
}
});
}
}
else
{
coordinatorLayout
.
setStatusBarBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
));
}
}
else
{
contentView
.
setPadding
(
0
,
statusBarHeight
,
0
,
0
);
contentView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
statusBarAlpha
));
}
setTransparentForWindow
(
activity
);
}
}
/**
* 设置状态栏纯色 不加半透明效果
*
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
*/
public
static
void
setColorNoTranslucent
(
Activity
activity
,
@ColorInt
int
color
)
{
setColor
(
activity
,
color
,
0
);
}
/**
* 设置状态栏颜色(5.0以下无半透明效果,不建议使用)
*
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
*/
@Deprecated
public
static
void
setColorDiff
(
Activity
activity
,
@ColorInt
int
color
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
transparentStatusBar
(
activity
);
ViewGroup
contentView
=
(
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
);
// 移除半透明矩形,以免叠加
View
fakeStatusBarView
=
contentView
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
color
);
}
else
{
contentView
.
addView
(
createStatusBarView
(
activity
,
color
));
}
setRootView
(
activity
);
}
/**
* 使状态栏半透明
* <p>
* 适用于图片作为背景的界面,此时需要图片填充到状态栏
*
* @param activity 需要设置的activity
*/
public
static
void
setTranslucent
(
Activity
activity
)
{
setTranslucent
(
activity
,
DEFAULT_STATUS_BAR_ALPHA
);
}
/**
* 使状态栏半透明
* <p>
* 适用于图片作为背景的界面,此时需要图片填充到状态栏
*
* @param activity 需要设置的activity
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setTranslucent
(
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
setTransparent
(
activity
);
addTranslucentView
(
activity
,
statusBarAlpha
);
}
/**
* 针对根布局是 CoordinatorLayout, 使状态栏半透明
* <p>
* 适用于图片作为背景的界面,此时需要图片填充到状态栏
*
* @param activity 需要设置的activity
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setTranslucentForCoordinatorLayout
(
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
transparentStatusBar
(
activity
);
addTranslucentView
(
activity
,
statusBarAlpha
);
}
/**
* 设置状态栏全透明
*
* @param activity 需要设置的activity
*/
public
static
void
setTransparent
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
transparentStatusBar
(
activity
);
setRootView
(
activity
);
}
/**
* 使状态栏透明(5.0以上半透明效果,不建议使用)
* <p>
* 适用于图片作为背景的界面,此时需要图片填充到状态栏
*
* @param activity 需要设置的activity
*/
@Deprecated
public
static
void
setTranslucentDiff
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
// 设置状态栏透明
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
setRootView
(
activity
);
}
}
/**
* 为DrawerLayout 布局设置状态栏变色
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
*/
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
setColorForDrawerLayout
(
activity
,
drawerLayout
,
color
,
DEFAULT_STATUS_BAR_ALPHA
);
}
/**
* 为DrawerLayout 布局设置状态栏颜色,纯色
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
*/
public
static
void
setColorNoTranslucentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
setColorForDrawerLayout
(
activity
,
drawerLayout
,
color
,
0
);
}
/**
* 为DrawerLayout 布局设置状态栏变色
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
* @param statusBarAlpha 状态栏透明度
*/
public
static
void
setColorForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
activity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
activity
.
getWindow
().
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
// 生成一个状态栏大小的矩形
// 添加 statusBarView 到布局中
ViewGroup
contentLayout
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
0
);
View
fakeStatusBarView
=
contentLayout
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
color
);
}
else
{
contentLayout
.
addView
(
createStatusBarView
(
activity
,
color
),
0
);
}
// 内容布局不是 LinearLayout 时,设置padding top
if
(!(
contentLayout
instanceof
LinearLayout
)
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
)
.
setPadding
(
contentLayout
.
getPaddingLeft
(),
getStatusBarHeight
(
activity
)
+
contentLayout
.
getPaddingTop
(),
contentLayout
.
getPaddingRight
(),
contentLayout
.
getPaddingBottom
());
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
);
addTranslucentView
(
activity
,
statusBarAlpha
);
}
/**
* 设置 DrawerLayout 属性
*
* @param drawerLayout DrawerLayout
* @param drawerLayoutContentLayout DrawerLayout 的内容布局
*/
private
static
void
setDrawerLayoutProperty
(
DrawerLayout
drawerLayout
,
ViewGroup
drawerLayoutContentLayout
)
{
ViewGroup
drawer
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
1
);
drawerLayout
.
setFitsSystemWindows
(
false
);
drawerLayoutContentLayout
.
setFitsSystemWindows
(
false
);
drawerLayoutContentLayout
.
setClipToPadding
(
true
);
drawer
.
setFitsSystemWindows
(
false
);
}
/**
* 为DrawerLayout 布局设置状态栏变色(5.0以下无半透明效果,不建议使用)
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
* @param color 状态栏颜色值
*/
@Deprecated
public
static
void
setColorForDrawerLayoutDiff
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@ColorInt
int
color
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
// 生成一个状态栏大小的矩形
ViewGroup
contentLayout
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
0
);
View
fakeStatusBarView
=
contentLayout
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
if
(
fakeStatusBarView
.
getVisibility
()
==
View
.
GONE
)
{
fakeStatusBarView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeStatusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
DEFAULT_STATUS_BAR_ALPHA
));
}
else
{
// 添加 statusBarView 到布局中
contentLayout
.
addView
(
createStatusBarView
(
activity
,
color
),
0
);
}
// 内容布局不是 LinearLayout 时,设置padding top
if
(!(
contentLayout
instanceof
LinearLayout
)
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
);
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
);
}
}
/**
* 为 DrawerLayout 布局设置状态栏透明
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
*/
public
static
void
setTranslucentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
)
{
setTranslucentForDrawerLayout
(
activity
,
drawerLayout
,
DEFAULT_STATUS_BAR_ALPHA
);
}
/**
* 为 DrawerLayout 布局设置状态栏透明
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
*/
public
static
void
setTranslucentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
setTransparentForDrawerLayout
(
activity
,
drawerLayout
);
addTranslucentView
(
activity
,
statusBarAlpha
);
}
/**
* 为 DrawerLayout 布局设置状态栏透明
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
*/
public
static
void
setTransparentForDrawerLayout
(
Activity
activity
,
DrawerLayout
drawerLayout
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
activity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
activity
.
getWindow
().
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
ViewGroup
contentLayout
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
0
);
// 内容布局不是 LinearLayout 时,设置padding top
if
(!(
contentLayout
instanceof
LinearLayout
)
&&
contentLayout
.
getChildAt
(
1
)
!=
null
)
{
contentLayout
.
getChildAt
(
1
).
setPadding
(
0
,
getStatusBarHeight
(
activity
),
0
,
0
);
}
// 设置属性
setDrawerLayoutProperty
(
drawerLayout
,
contentLayout
);
}
/**
* 为 DrawerLayout 布局设置状态栏透明(5.0以上半透明效果,不建议使用)
*
* @param activity 需要设置的activity
* @param drawerLayout DrawerLayout
*/
@Deprecated
public
static
void
setTranslucentForDrawerLayoutDiff
(
Activity
activity
,
DrawerLayout
drawerLayout
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
// 设置状态栏透明
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
// 设置内容布局属性
ViewGroup
contentLayout
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
0
);
contentLayout
.
setFitsSystemWindows
(
true
);
contentLayout
.
setClipToPadding
(
true
);
// 设置抽屉布局属性
ViewGroup
vg
=
(
ViewGroup
)
drawerLayout
.
getChildAt
(
1
);
vg
.
setFitsSystemWindows
(
false
);
// 设置 DrawerLayout 属性
drawerLayout
.
setFitsSystemWindows
(
false
);
}
}
/**
* 为头部是 ImageView 的界面设置状态栏全透明
*
* @param activity 需要设置的activity
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTransparentForImageView
(
Activity
activity
,
View
needOffsetView
)
{
setTranslucentForImageView
(
activity
,
0
,
needOffsetView
);
}
/**
* 为头部是 ImageView 的界面设置状态栏透明(使用默认透明度)
*
* @param activity 需要设置的activity
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTranslucentForImageView
(
Activity
activity
,
View
needOffsetView
)
{
setTranslucentForImageView
(
activity
,
DEFAULT_STATUS_BAR_ALPHA
,
needOffsetView
);
}
/**
* 为头部是 ImageView 的界面设置状态栏透明
*
* @param activity 需要设置的activity
* @param statusBarAlpha 状态栏透明度
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTranslucentForImageView
(
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
,
View
needOffsetView
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
KITKAT
)
{
return
;
}
setTransparentForWindow
(
activity
);
addTranslucentView
(
activity
,
statusBarAlpha
);
if
(
needOffsetView
!=
null
)
{
Object
haveSetOffset
=
needOffsetView
.
getTag
(
TAG_KEY_HAVE_SET_OFFSET
);
if
(
haveSetOffset
!=
null
&&
(
Boolean
)
haveSetOffset
)
{
return
;
}
ViewGroup
.
MarginLayoutParams
layoutParams
=
(
ViewGroup
.
MarginLayoutParams
)
needOffsetView
.
getLayoutParams
();
layoutParams
.
setMargins
(
layoutParams
.
leftMargin
,
layoutParams
.
topMargin
+
getStatusBarHeight
(
activity
),
layoutParams
.
rightMargin
,
layoutParams
.
bottomMargin
);
needOffsetView
.
setTag
(
TAG_KEY_HAVE_SET_OFFSET
,
true
);
}
}
/**
* 为 fragment 头部是 ImageView 的设置状态栏透明
*
* @param activity fragment 对应的 activity
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTranslucentForImageViewInFragment
(
Activity
activity
,
View
needOffsetView
)
{
setTranslucentForImageViewInFragment
(
activity
,
DEFAULT_STATUS_BAR_ALPHA
,
needOffsetView
);
}
/**
* 为 fragment 头部是 ImageView 的设置状态栏透明
*
* @param activity fragment 对应的 activity
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTransparentForImageViewInFragment
(
Activity
activity
,
View
needOffsetView
)
{
setTranslucentForImageViewInFragment
(
activity
,
0
,
needOffsetView
);
}
/**
* 为 fragment 头部是 ImageView 的设置状态栏透明
*
* @param activity fragment 对应的 activity
* @param statusBarAlpha 状态栏透明度
* @param needOffsetView 需要向下偏移的 View
*/
public
static
void
setTranslucentForImageViewInFragment
(
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
,
View
needOffsetView
)
{
setTranslucentForImageView
(
activity
,
statusBarAlpha
,
needOffsetView
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
&&
Build
.
VERSION
.
SDK_INT
<
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
clearPreviousSetting
(
activity
);
}
}
/**
* 隐藏伪状态栏 View
*
* @param activity 调用的 Activity
*/
public
static
void
hideFakeStatusBarView
(
Activity
activity
)
{
ViewGroup
decorView
=
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
();
View
fakeStatusBarView
=
decorView
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
fakeStatusBarView
.
setVisibility
(
View
.
GONE
);
}
View
fakeTranslucentView
=
decorView
.
findViewById
(
FAKE_TRANSLUCENT_VIEW_ID
);
if
(
fakeTranslucentView
!=
null
)
{
fakeTranslucentView
.
setVisibility
(
View
.
GONE
);
}
}
@TargetApi
(
Build
.
VERSION_CODES
.
M
)
public
static
void
setLightMode
(
Activity
activity
)
{
setMIUIStatusBarDarkIcon
(
activity
,
true
);
setMeizuStatusBarDarkIcon
(
activity
,
true
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LIGHT_STATUS_BAR
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
}
@TargetApi
(
Build
.
VERSION_CODES
.
M
)
public
static
void
setDarkMode
(
Activity
activity
)
{
setMIUIStatusBarDarkIcon
(
activity
,
false
);
setMeizuStatusBarDarkIcon
(
activity
,
false
);
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
M
)
{
activity
.
getWindow
().
getDecorView
().
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
}
/**
* 修改 MIUI V6 以上状态栏颜色
*/
private
static
void
setMIUIStatusBarDarkIcon
(
@NonNull
Activity
activity
,
boolean
darkIcon
)
{
Class
<?
extends
Window
>
clazz
=
activity
.
getWindow
().
getClass
();
try
{
Class
<?>
layoutParams
=
Class
.
forName
(
"android.view.MiuiWindowManager$LayoutParams"
);
Field
field
=
layoutParams
.
getField
(
"EXTRA_FLAG_STATUS_BAR_DARK_MODE"
);
int
darkModeFlag
=
field
.
getInt
(
layoutParams
);
Method
extraFlagField
=
clazz
.
getMethod
(
"setExtraFlags"
,
int
.
class
,
int
.
class
);
extraFlagField
.
invoke
(
activity
.
getWindow
(),
darkIcon
?
darkModeFlag
:
0
,
darkModeFlag
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
}
}
/**
* 修改魅族状态栏字体颜色 Flyme 4.0
*/
private
static
void
setMeizuStatusBarDarkIcon
(
@NonNull
Activity
activity
,
boolean
darkIcon
)
{
try
{
WindowManager
.
LayoutParams
lp
=
activity
.
getWindow
().
getAttributes
();
Field
darkFlag
=
WindowManager
.
LayoutParams
.
class
.
getDeclaredField
(
"MEIZU_FLAG_DARK_STATUS_BAR_ICON"
);
Field
meizuFlags
=
WindowManager
.
LayoutParams
.
class
.
getDeclaredField
(
"meizuFlags"
);
darkFlag
.
setAccessible
(
true
);
meizuFlags
.
setAccessible
(
true
);
int
bit
=
darkFlag
.
getInt
(
null
);
int
value
=
meizuFlags
.
getInt
(
lp
);
if
(
darkIcon
)
{
value
|=
bit
;
}
else
{
value
&=
~
bit
;
}
meizuFlags
.
setInt
(
lp
,
value
);
activity
.
getWindow
().
setAttributes
(
lp
);
}
catch
(
Exception
e
)
{
//e.printStackTrace();
}
}
///////////////////////////////////////////////////////////////////////////////////
@TargetApi
(
Build
.
VERSION_CODES
.
KITKAT
)
private
static
void
clearPreviousSetting
(
Activity
activity
)
{
ViewGroup
decorView
=
(
ViewGroup
)
activity
.
getWindow
().
getDecorView
();
View
fakeStatusBarView
=
decorView
.
findViewById
(
FAKE_STATUS_BAR_VIEW_ID
);
if
(
fakeStatusBarView
!=
null
)
{
decorView
.
removeView
(
fakeStatusBarView
);
ViewGroup
rootView
=
(
ViewGroup
)
((
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
)).
getChildAt
(
0
);
rootView
.
setPadding
(
0
,
0
,
0
,
0
);
}
}
/**
* 添加半透明矩形条
*
* @param activity 需要设置的 activity
* @param statusBarAlpha 透明值
*/
private
static
void
addTranslucentView
(
Activity
activity
,
@IntRange
(
from
=
0
,
to
=
255
)
int
statusBarAlpha
)
{
ViewGroup
contentView
=
(
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
);
View
fakeTranslucentView
=
contentView
.
findViewById
(
FAKE_TRANSLUCENT_VIEW_ID
);
if
(
fakeTranslucentView
!=
null
)
{
if
(
fakeTranslucentView
.
getVisibility
()
==
View
.
GONE
)
{
fakeTranslucentView
.
setVisibility
(
View
.
VISIBLE
);
}
fakeTranslucentView
.
setBackgroundColor
(
Color
.
argb
(
statusBarAlpha
,
0
,
0
,
0
));
}
else
{
contentView
.
addView
(
createTranslucentStatusBarView
(
activity
,
statusBarAlpha
));
}
}
/**
* 生成一个和状态栏大小相同的彩色矩形条
*
* @param activity 需要设置的 activity
* @param color 状态栏颜色值
* @return 状态栏矩形条
*/
private
static
View
createStatusBarView
(
Activity
activity
,
@ColorInt
int
color
)
{
return
createStatusBarView
(
activity
,
color
,
0
);
}
/**
* 生成一个和状态栏大小相同的半透明矩形条
*
* @param activity 需要设置的activity
* @param color 状态栏颜色值
* @param alpha 透明值
* @return 状态栏矩形条
*/
private
static
View
createStatusBarView
(
Activity
activity
,
@ColorInt
int
color
,
int
alpha
)
{
// 绘制一个和状态栏一样高的矩形
View
statusBarView
=
new
View
(
activity
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
getStatusBarHeight
(
activity
));
statusBarView
.
setLayoutParams
(
params
);
statusBarView
.
setBackgroundColor
(
calculateStatusColor
(
color
,
alpha
));
statusBarView
.
setId
(
FAKE_STATUS_BAR_VIEW_ID
);
return
statusBarView
;
}
/**
* 设置根布局参数
*/
private
static
void
setRootView
(
Activity
activity
)
{
ViewGroup
parent
=
(
ViewGroup
)
activity
.
findViewById
(
android
.
R
.
id
.
content
);
for
(
int
i
=
0
,
count
=
parent
.
getChildCount
();
i
<
count
;
i
++)
{
View
childView
=
parent
.
getChildAt
(
i
);
if
(
childView
instanceof
ViewGroup
)
{
childView
.
setFitsSystemWindows
(
true
);
((
ViewGroup
)
childView
).
setClipToPadding
(
true
);
}
}
}
/**
* 设置透明
*/
private
static
void
setTransparentForWindow
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
setStatusBarColor
(
Color
.
TRANSPARENT
);
activity
.
getWindow
()
.
getDecorView
()
.
setSystemUiVisibility
(
View
.
SYSTEM_UI_FLAG_LAYOUT_STABLE
|
View
.
SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
);
}
else
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
KITKAT
)
{
activity
.
getWindow
()
.
setFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
,
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
}
/**
* 使状态栏透明
*/
@TargetApi
(
Build
.
VERSION_CODES
.
KITKAT
)
private
static
void
transparentStatusBar
(
Activity
activity
)
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
LOLLIPOP
)
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS
);
activity
.
getWindow
().
clearFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_NAVIGATION
);
activity
.
getWindow
().
setStatusBarColor
(
Color
.
TRANSPARENT
);
}
else
{
activity
.
getWindow
().
addFlags
(
WindowManager
.
LayoutParams
.
FLAG_TRANSLUCENT_STATUS
);
}
}
/**
* 创建半透明矩形 View
*
* @param alpha 透明值
* @return 半透明 View
*/
private
static
View
createTranslucentStatusBarView
(
Activity
activity
,
int
alpha
)
{
// 绘制一个和状态栏一样高的矩形
View
statusBarView
=
new
View
(
activity
);
LinearLayout
.
LayoutParams
params
=
new
LinearLayout
.
LayoutParams
(
ViewGroup
.
LayoutParams
.
MATCH_PARENT
,
getStatusBarHeight
(
activity
));
statusBarView
.
setLayoutParams
(
params
);
statusBarView
.
setBackgroundColor
(
Color
.
argb
(
alpha
,
0
,
0
,
0
));
statusBarView
.
setId
(
FAKE_TRANSLUCENT_VIEW_ID
);
return
statusBarView
;
}
/**
* 获取状态栏高度
*
* @param context context
* @return 状态栏高度
*/
private
static
int
getStatusBarHeight
(
Context
context
)
{
// 获得状态栏高度
int
resourceId
=
context
.
getResources
().
getIdentifier
(
"status_bar_height"
,
"dimen"
,
"android"
);
return
context
.
getResources
().
getDimensionPixelSize
(
resourceId
);
}
/**
* 计算状态栏颜色
*
* @param color color值
* @param alpha alpha值
* @return 最终的状态栏颜色
*/
private
static
int
calculateStatusColor
(
@ColorInt
int
color
,
int
alpha
)
{
if
(
alpha
==
0
)
{
return
color
;
}
float
a
=
1
-
alpha
/
255
f
;
int
red
=
color
>>
16
&
0xff
;
int
green
=
color
>>
8
&
0xff
;
int
blue
=
color
&
0xff
;
red
=
(
int
)
(
red
*
a
+
0.5
);
green
=
(
int
)
(
green
*
a
+
0.5
);
blue
=
(
int
)
(
blue
*
a
+
0.5
);
return
0xff
<<
24
|
red
<<
16
|
green
<<
8
|
blue
;
}
}
arms/src/main/res/values/ids.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<resources>
<item
type=
"id"
name=
"statusbarutil_fake_status_bar_view"
/>
<item
type=
"id"
name=
"statusbarutil_translucent_view"
/>
</resources>
\ No newline at end of file
base-module/src/main/java/com/gingersoft/gsa/cloud/base/common/bean/OrderDetail.java
View file @
a8ba4a08
...
...
@@ -704,14 +704,14 @@ public class OrderDetail implements Serializable {
if
(
productnameBean
.
getChild
()
!=
null
)
{
for
(
OrderDetails
.
DataBean
.
PRODUCTNAMEBean
.
ChildBeanX
childBeanX
:
productnameBean
.
getChild
())
{
if
(
childBeanX
!=
null
)
{
//判斷是否
打印
,為true的時候會同時打印主項
//判斷是否
選擇了打印至賬單
,為true的時候會同時打印主項
if
(
childBeanX
.
getPrintToBill
()
==
1
)
{
isCheck
=
true
;
break
;
}
if
(
childBeanX
.
getChild
()
!=
null
)
{
for
(
OrderDetails
.
DataBean
.
PRODUCTNAMEBean
.
ChildBeanX
.
ChildBean
childBean
:
childBeanX
.
getChild
())
{
//判斷是否
打印,為true的時候會同時打印主
項
//判斷是否
選擇了打印至賬單,為true的時候會同時打印上一項細
項
if
(
childBean
.
getPrintToBill
()
==
1
)
{
isCheck2
=
true
;
break
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/RestaurantInfoUtils.java
View file @
a8ba4a08
...
...
@@ -30,7 +30,7 @@ public class RestaurantInfoUtils {
public
static
int
getRestaurantSize
(
Context
context
)
{
int
size
=
0
;
List
<
BrandsBean
.
BrandsData
>
brandsBeans
=
getBrandList
(
context
);
if
(
brandsBeans
==
null
)
{
if
(
brandsBeans
==
null
)
{
return
0
;
}
for
(
int
i
=
0
;
i
<
brandsBeans
.
size
();
i
++)
{
...
...
@@ -40,12 +40,22 @@ public class RestaurantInfoUtils {
return
size
;
}
public
static
int
getRestaurantSize
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
if
(
brands
==
null
)
{
return
0
;
}
int
size
=
0
;
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
size
+=
brands
.
get
(
i
).
getRestaurants
().
size
();
}
return
size
;
}
public
static
BrandsBean
.
BrandsData
getOnlyBrand
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
{
for
(
int
j
=
0
;
j
<
brands
.
get
(
i
).
getRestaurants
().
size
();
j
++)
{
return
brands
.
get
(
i
);
}
return
brands
.
get
(
i
);
}
}
return
null
;
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/utils/gson/GsonUtils.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
base
.
utils
.
gson
;
import
com.google.gson.Gson
;
import
com.google.gson.JsonArray
;
import
com.google.gson.JsonElement
;
import
com.google.gson.JsonParser
;
import
com.google.gson.reflect.TypeToken
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -55,19 +59,37 @@ public class GsonUtils {
return
t
;
}
// 有問題,轉換出來的類型不對
// /**
// * 转成list
// *
// * @param gsonString
// * @param cls
// * @return
// */
// public static <T> List<T> GsonToList(String gsonString, Class<T> cls) {
// List<T> list = null;
// if (gson != null) {
// list = gson.fromJson(gsonString, new TypeToken<List<T>>() {
// }.getType());
// }
// return list;
// }
/**
* 转成list
*
json字符串
转成list
*
* @param gsonString
* @param cls
* @return
*/
public
static
<
T
>
List
<
T
>
GsonToList
(
String
gsonString
,
Class
<
T
>
cls
)
{
List
<
T
>
list
=
null
;
if
(
gson
!=
null
)
{
list
=
gson
.
fromJson
(
gsonString
,
new
TypeToken
<
List
<
T
>>()
{}.
getType
());
public
static
<
T
>
List
<
T
>
jsonToList
(
String
json
,
Class
<
T
>
cls
)
{
ArrayList
<
T
>
mList
=
new
ArrayList
<>();
JsonArray
array
=
new
JsonParser
().
parse
(
json
).
getAsJsonArray
();
for
(
final
JsonElement
elem
:
array
)
{
mList
.
add
(
gson
.
fromJson
(
elem
,
cls
));
}
return
l
ist
;
return
mL
ist
;
}
/**
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/base/widget/DialogUtils.java
View file @
a8ba4a08
...
...
@@ -17,6 +17,10 @@ import android.view.WindowManager;
import
android.widget.ImageView
;
import
android.widget.TextView
;
import
androidx.lifecycle.Lifecycle
;
import
androidx.lifecycle.LifecycleObserver
;
import
androidx.lifecycle.OnLifecycleEvent
;
import
com.bumptech.glide.Glide
;
import
com.bumptech.glide.load.engine.DiskCacheStrategy
;
import
com.bumptech.glide.load.resource.bitmap.RoundedCorners
;
...
...
@@ -29,13 +33,10 @@ import java.util.List;
/**
* Created by Wyh on 2019/11/1.
*/
public
abstract
class
DialogUtils
{
// private Context mContext;
public
abstract
class
DialogUtils
implements
LifecycleObserver
{
private
static
Dialog
dialog
;
private
View
view
;
private
int
style
=
R
.
style
.
PhotoDialog
;
// private int mWidth = WindowManager.LayoutParams.WRAP_CONTENT;
// private int mHeight = WindowManager.LayoutParams.WRAP_CONTENT;
private
ViewHepler
viewHepler
;
public
DialogUtils
(
Context
mContext
,
int
xmlLayout
)
{
...
...
@@ -44,7 +45,7 @@ public abstract class DialogUtils {
}
private
void
init
(
Context
context
)
{
dismiss
();
//
dismiss();
dialog
=
new
Dialog
(
context
);
viewHepler
=
getViewHepler
(
context
);
initLayout
(
viewHepler
,
dialog
);
...
...
@@ -150,6 +151,7 @@ public abstract class DialogUtils {
return
dialog
;
}
@OnLifecycleEvent
(
Lifecycle
.
Event
.
ON_PAUSE
)
public
DialogUtils
dismiss
()
{
if
(
dialog
!=
null
)
dialog
.
dismiss
();
...
...
base-module/src/main/java/com/gingersoft/gsa/cloud/globalconfig/applyOptions/MyGlobalHttpHandler.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
globalconfig
.
applyOptions
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Aes
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.jess.arms.http.GlobalHttpHandler
;
import
com.jess.arms.utils.DeviceUtils
;
import
okhttp3.Headers
;
import
okhttp3.Interceptor
;
import
okhttp3.Request
;
...
...
@@ -46,9 +45,11 @@ public class MyGlobalHttpHandler implements GlobalHttpHandler {
Headers
headers
=
request
.
headers
();
for
(
int
i
=
0
;
i
<
headers
.
size
();
i
++)
{
builder
.
set
(
headers
.
name
(
i
),
headers
.
value
(
i
));
}
if
(
GsaCloudApplication
.
isLogin
)
if
(
GsaCloudApplication
.
isLogin
){
builder
.
set
(
"token"
,
token
);
}
// builder.set("Domain-Name", "common");
return
chain
.
request
().
newBuilder
()
.
headers
(
builder
.
build
())
...
...
base-module/src/main/res/values/ids.xml
View file @
a8ba4a08
...
...
@@ -25,6 +25,4 @@
<item
name=
"layout_for_test"
type=
"id"
/>
<item
name=
"topbar_heart_disconnect"
type=
"id"
/>
<item
type=
"id"
name=
"statusbarutil_fake_status_bar_view"
/>
<item
type=
"id"
name=
"statusbarutil_translucent_view"
/>
</resources>
\ No newline at end of file
login-module/src/main/debug/AndroidManifest.xml
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:tools=
"http://schemas.android.com/tools"
package=
"com.gingersoft.gsa.cloud.login"
>
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android=
"http://schemas.android.com/apk/res/android"
package=
"com.gingersoft.gsa.cloud.login"
>
<application
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:roundIcon=
"@mipmap/ic_launcher"
android:label=
"@string/user_login_name"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<application
android:name=
"com.gingersoft.gsa.cloud.base.application.GsaCloudApplication"
android:allowBackup=
"true"
android:icon=
"@mipmap/ic_launcher"
android:roundIcon=
"@mipmap/ic_launcher"
android:label=
"@string/user_login_name"
android:supportsRtl=
"true"
android:theme=
"@style/AppTheme"
>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.LoginActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.WelcomeActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.LoginActivity"
android:launchMode=
"singleTop"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.SwitchServerActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.WelcomeActivity"
>
<intent-filter>
<action
android:name=
"android.intent.action.MAIN"
/>
<action
android:name=
"android.intent.action.VIEW"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.LoginOutActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity"
/>
<category
android:name=
"android.intent.category.LAUNCHER"
/>
</intent-filter>
</activity>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.ChooseRestaurantActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.LoginOutActivity"
/>
<activity
android:name=
".mvp.ui.activity.mvp.ui.activity.RecoverPasswordActivity"
/>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
<meta-data
android:name=
"design_width_in_dp"
android:value=
"360"
/>
<meta-data
android:name=
"design_height_in_dp"
android:value=
"640"
/>
</application>
<meta-data
android:name=
"com.gingersoft.gsa.cloud.globalconfig.GlobalConfiguration"
android:value=
"ConfigModule"
/>
<meta-data
android:name=
"design_width_in_dp"
android:value=
"360"
/>
<meta-data
android:name=
"design_height_in_dp"
android:value=
"640"
/>
</application>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.INTERNET"
/>
<uses-permission
android:name=
"android.permission.ACCESS_NETWORK_STATE"
/>
<uses-permission
android:name=
"android.permission.WAKE_LOCK"
/>
<uses-permission
android:name=
"android.permission.READ_PHONE_STATE"
/>
<uses-permission
android:name=
"android.permission.WRITE_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.READ_EXTERNAL_STORAGE"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
<uses-permission
android:name=
"android.permission.RECEIVE_USER_PRESENT"
/>
</manifest>
\ No newline at end of file
</manifest>
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/bean/LoginLimitBean.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
bean
;
public
class
LoginLimitBean
{
private
int
userId
;
private
String
userName
;
private
long
dateTime
;
public
LoginLimitBean
()
{
}
public
LoginLimitBean
(
int
userId
,
String
userName
,
long
dateTime
)
{
this
.
userId
=
userId
;
this
.
userName
=
userName
;
this
.
dateTime
=
dateTime
;
}
public
int
getUserId
()
{
return
userId
;
}
public
void
setUserId
(
int
userId
)
{
this
.
userId
=
userId
;
}
public
String
getUserName
()
{
return
userName
;
}
public
void
setUserName
(
String
userName
)
{
this
.
userName
=
userName
;
}
public
long
getDateTime
()
{
return
dateTime
;
}
public
void
setDateTime
(
long
dateTime
)
{
this
.
dateTime
=
dateTime
;
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/BaseLoginContract.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
contract
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.jess.arms.mvp.IModel
;
...
...
@@ -33,6 +35,12 @@ public interface BaseLoginContract {
void
saveRestaurantListInfo
(
List
<
BrandsBean
.
BrandsData
>
brands
);
void
showChooseRestaurantDialog
(
List
<
BrandsBean
.
BrandsData
>
brandsBean
,
List
<
BrandsBean
.
BrandsData
>
brands
);
void
jumpMainActivity
();
void
jumpDownloadActivity
();
void
showLoginLimit
(
List
<
LoginLimitBean
>
loginLimitBeans
);
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
...
...
@@ -40,5 +48,10 @@ public interface BaseLoginContract {
Observable
<
LoginBean
>
login
(
RequestBody
requestBody
);
Observable
<
BrandsBean
>
getRestaurantList
();
Observable
<
PublicBean
>
getLoginLimit
(
int
restaurantId
);
Observable
<
Object
>
loginOut
(
int
userId
,
RequestBody
requestBody
);
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/contract/LoginInterfaceImpl.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
contract
;
import
android.app.Dialog
;
import
android.content.DialogInterface
;
import
android.content.Intent
;
import
android.util.Log
;
import
android.view.Gravity
;
import
android.view.View
;
import
android.widget.LinearLayout
;
import
androidx.annotation.NonNull
;
import
androidx.recyclerview.widget.LinearLayoutManager
;
import
androidx.recyclerview.widget.RecyclerView
;
import
com.billy.cc.core.component.CC
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.listener.OnItemChildClickListener
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.JsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.RestaurantInfoUtils
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.base.widget.DialogUtils
;
import
com.gingersoft.gsa.cloud.constans.UserConstans
;
import
com.gingersoft.gsa.cloud.login.R
;
import
com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean
;
import
com.gingersoft.gsa.cloud.login.mvp.presenter.BaseLoginPresenter
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity.SwitchServerActivity
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.adapter.LoginLimitAdapter
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.ui.widget.dialog.ChooseRestaurantDialog
;
...
...
@@ -30,27 +48,30 @@ public abstract class LoginInterfaceImpl<P extends BaseLoginPresenter> extends B
if
(
brands
!=
null
)
{
String
brandRestaurantInfos
=
JsonUtils
.
toJson
(
brands
);
GsaCloudApplication
.
setBrandRestaurantInfos
(
mContext
,
brandRestaurantInfos
);
restaurantSize
=
getRestaurantSize
(
brands
);
restaurantSize
=
RestaurantInfoUtils
.
getRestaurantSize
(
brands
);
brandsBeans
.
addAll
(
brands
);
}
boolean
autoLogin
=
(
boolean
)
SPUtils
.
get
(
mContext
,
UserConstans
.
AUTO_LOGIN
,
false
);
if
(
autoLogin
)
{
int
restaurantId
=
GsaCloudApplication
.
getRestaurantId
(
this
);
if
(
restaurantId
!=
0
)
{
//有選擇餐廳,直接跳轉首頁
jumpMainActivity
();
//上一次進入app有選擇餐廳,通過餐廳ID獲取允許的最大登陸數
mPresenter
.
getLoginLimit
(
restaurantId
,
false
);
// jumpMainActivity();
return
;
}
}
if
(
restaurantSize
==
1
)
{
//只有一個品牌是直接進下載頁面
BrandsBean
.
BrandsData
brandsBean
=
getOnlyBrand
(
brands
);
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
=
getOnlyRestaurant
(
brands
);
BrandsBean
.
BrandsData
brandsBean
=
RestaurantInfoUtils
.
getOnlyBrand
(
brands
);
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
=
RestaurantInfoUtils
.
getOnlyRestaurant
(
brands
);
if
(
brandsBean
!=
null
)
{
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
restaurantsBean
);
//通過餐廳ID獲取允許的最大登陸數
mPresenter
.
getLoginLimit
(
restaurantsBean
.
getRestaurantId
(),
true
);
}
jumpDownloadActivity
();
//
jumpDownloadActivity();
}
else
{
showChooseRestaurantDialog
(
brandsBeans
,
brands
);
}
...
...
@@ -75,67 +96,26 @@ public abstract class LoginInterfaceImpl<P extends BaseLoginPresenter> extends B
}
protected
void
ChooseRestaurantItemClick
(
List
<
BrandsBean
.
BrandsData
>
brands
,
ChooseRestaurantDialog
dialog
,
BrandsBean
.
BrandsData
.
RestaurantsBean
item
)
{
BrandsBean
.
BrandsData
brandsBean
=
getBrandByRestaurantId
(
brands
,
item
.
getRestaurantId
());
BrandsBean
.
BrandsData
brandsBean
=
RestaurantInfoUtils
.
getBrandByRestaurantId
(
brands
,
item
.
getRestaurantId
());
if
(
brandsBean
!=
null
)
{
saveBrandAndRestaurantInfo
(
brandsBean
.
getBrandId
(),
brandsBean
.
getBrandName
(),
item
);
mPresenter
.
getLoginLimit
(
item
.
getRestaurantId
(),
true
);
}
dialog
.
dismiss
();
jumpDownloadActivity
();
//
jumpDownloadActivity();
}
protected
void
saveBrandAndRestaurantInfo
(
int
brandId
,
String
brandName
,
BrandsBean
.
BrandsData
.
RestaurantsBean
restaurantsBean
)
{
GsaCloudApplication
.
setBrandId
(
mContext
,
brandId
);
GsaCloudApplication
.
setBrandName
(
mContext
,
brandName
);
GsaCloudApplication
.
setRestaurantId
(
mContext
,
restaurantsBean
.
getRestaurantId
());
GsaCloudApplication
.
setRestaurantName
(
mContext
,
restaurantsBean
.
getRestaurantName
());
GsaCloudApplication
.
setGsPosShopId
(
mContext
,
restaurantsBean
.
getGsPosShopId
());
}
private
int
getRestaurantSize
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
int
size
=
0
;
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
size
+=
brands
.
get
(
i
).
getRestaurants
().
size
();
}
return
size
;
}
private
BrandsBean
.
BrandsData
getOnlyBrand
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
{
for
(
int
j
=
0
;
j
<
brands
.
get
(
i
).
getRestaurants
().
size
();
j
++)
{
return
brands
.
get
(
i
);
}
}
}
return
null
;
}
private
BrandsBean
.
BrandsData
.
RestaurantsBean
getOnlyRestaurant
(
List
<
BrandsBean
.
BrandsData
>
brands
)
{
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
{
for
(
int
j
=
0
;
j
<
brands
.
get
(
i
).
getRestaurants
().
size
();
j
++)
{
return
brands
.
get
(
i
).
getRestaurants
().
get
(
j
);
}
}
}
return
null
;
}
private
BrandsBean
.
BrandsData
getBrandByRestaurantId
(
List
<
BrandsBean
.
BrandsData
>
brands
,
int
restaurantId
)
{
for
(
int
i
=
0
;
i
<
brands
.
size
();
i
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
()
!=
null
)
{
for
(
int
j
=
0
;
j
<
brands
.
get
(
i
).
getRestaurants
().
size
();
j
++)
{
if
(
brands
.
get
(
i
).
getRestaurants
().
get
(
j
).
getRestaurantId
()
==
restaurantId
)
{
return
brands
.
get
(
i
);
}
}
}
if
(
restaurantsBean
!=
null
)
{
GsaCloudApplication
.
setRestaurantId
(
mContext
,
restaurantsBean
.
getRestaurantId
());
GsaCloudApplication
.
setRestaurantName
(
mContext
,
restaurantsBean
.
getRestaurantName
());
GsaCloudApplication
.
setGsPosShopId
(
mContext
,
restaurantsBean
.
getGsPosShopId
());
}
return
null
;
}
p
rivate
void
jumpDownloadActivity
()
{
p
ublic
void
jumpDownloadActivity
()
{
CC
.
obtainBuilder
(
"Component.Download"
)
.
setActionName
(
"showDownloadActivity"
)
.
addParam
(
"fromPage"
,
1
)
...
...
@@ -144,11 +124,56 @@ public abstract class LoginInterfaceImpl<P extends BaseLoginPresenter> extends B
killMyself
();
}
p
rivate
void
jumpMainActivity
()
{
p
ublic
void
jumpMainActivity
()
{
CC
.
obtainBuilder
(
"Component.Main"
)
.
setActionName
(
"showMainActivity"
)
.
build
()
.
call
();
killMyself
();
}
private
DialogUtils
dialogUtils
;
public
void
showLoginLimit
(
List
<
LoginLimitBean
>
loginLimitBeans
)
{
if
(
loginLimitBeans
!=
null
)
{
dialogUtils
=
new
DialogUtils
(
mContext
,
R
.
layout
.
login_limit_dialog_layout
)
{
@Override
public
void
initLayout
(
ViewHepler
hepler
,
Dialog
dialog
)
{
hepler
.
setOnClickListenter
(
R
.
id
.
iv_login_limit_back
,
v
->
{
dialog
.
dismiss
();
});
RecyclerView
loginLimit
=
hepler
.
getView
(
R
.
id
.
rv_login_limit
);
loginLimit
.
setLayoutManager
(
new
LinearLayoutManager
(
mContext
));
LoginLimitAdapter
loginLimitAdapter
=
new
LoginLimitAdapter
(
loginLimitBeans
);
loginLimitAdapter
.
setOnItemChildClickListener
((
adapter
,
view
,
position
)
->
{
if
(
position
<
loginLimitBeans
.
size
())
{
mPresenter
.
loginOut
(
loginLimitBeans
.
get
(
position
).
getUserId
());
loginLimitBeans
.
remove
(
position
);
loginLimitAdapter
.
notifyDataSetChanged
();
Log
.
e
(
"eee"
,
"踢出第"
+
position
+
"個"
);
}
});
loginLimit
.
setAdapter
(
loginLimitAdapter
);
}
}.
setWidth
(
LinearLayout
.
LayoutParams
.
MATCH_PARENT
).
setOnDismissListener
(
dialog
->
{
//不管有沒有踢出人,彈窗消失回到登陸頁面
startActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
}).
setGravity
(
Gravity
.
BOTTOM
).
show
();
}
else
{
showMessage
(
"獲取登陸人數失敗"
);
launchActivity
(
new
Intent
(
mContext
,
LoginActivity
.
class
));
}
}
@Override
protected
void
onPause
()
{
super
.
onPause
();
if
(
dialogUtils
!=
null
){
dialogUtils
.
dismiss
();
}
}
@Override
protected
void
onDestroy
()
{
super
.
onDestroy
();
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/BaseLoginModel.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.login.mvp.contract.BaseLoginContract
;
import
com.gingersoft.gsa.cloud.login.mvp.server.LoginService
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
public
class
BaseLoginModel
extends
BaseModel
implements
BaseLoginContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
BaseLoginModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
LoginBean
>
login
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
login
(
requestBody
);
}
@Override
public
Observable
<
BrandsBean
>
getRestaurantList
()
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
getRestaurantList
();
}
@Override
public
Observable
<
PublicBean
>
getLoginLimit
(
int
restaurantId
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
getLoginLimit
(
restaurantId
);
}
@Override
public
Observable
<
Object
>
loginOut
(
int
userId
,
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
loginOut
(
userId
,
requestBody
);
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/LoginModel.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.login.mvp.contract.LoginContract
;
import
com.gingersoft.gsa.cloud.login.mvp.server.LoginService
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
/**
* ================================================
...
...
@@ -30,34 +20,9 @@ import okhttp3.RequestBody;
* ================================================
*/
@ActivityScope
public
class
LoginModel
extends
BaseModel
implements
LoginContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
public
class
LoginModel
extends
BaseLoginModel
implements
LoginContract
.
Model
{
@Inject
public
LoginModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
LoginBean
>
login
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
login
(
requestBody
);
}
@Override
public
Observable
<
BrandsBean
>
getRestaurantList
()
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
getRestaurantList
();
}
}
\ No newline at end of file
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/model/WelcomeModel.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
model
;
import
android.app.Application
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.gingersoft.gsa.cloud.login.mvp.contract.WelcomeContract
;
import
com.gingersoft.gsa.cloud.login.mvp.server.LoginService
;
import
com.google.gson.Gson
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
javax.inject.Inject
;
import
io.reactivex.Observable
;
import
okhttp3.RequestBody
;
@ActivityScope
public
class
WelcomeModel
extends
BaseModel
implements
WelcomeContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
public
class
WelcomeModel
extends
BaseLoginModel
implements
WelcomeContract
.
Model
{
@Inject
public
WelcomeModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
@Override
public
Observable
<
LoginBean
>
login
(
RequestBody
requestBody
)
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
login
(
requestBody
);
}
@Override
public
Observable
<
BrandsBean
>
getRestaurantList
()
{
return
mRepositoryManager
.
obtainRetrofitService
(
LoginService
.
class
)
.
getRestaurantList
();
}
}
\ No newline at end of file
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/presenter/BaseLoginPresenter.java
View file @
a8ba4a08
...
...
@@ -3,22 +3,31 @@ package com.gingersoft.gsa.cloud.login.mvp.presenter;
import
android.app.Activity
;
import
android.app.Application
;
import
android.content.Intent
;
import
android.util.Log
;
import
com.gingersoft.gsa.cloud.base.application.GsaCloudApplication
;
import
com.gingersoft.gsa.cloud.base.utils.gson.GsonUtils
;
import
com.gingersoft.gsa.cloud.base.utils.okhttpUtils.OkHttp3Utils
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.constans.AppConstans
;
import
com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean
;
import
com.gingersoft.gsa.cloud.login.mvp.contract.BaseLoginContract
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity.LoginActivity
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.utils.RxLifecycleUtils
;
import
java.util.List
;
import
javax.inject.Inject
;
import
io.reactivex.Scheduler
;
import
io.reactivex.android.schedulers.AndroidSchedulers
;
import
io.reactivex.annotations.NonNull
;
import
io.reactivex.schedulers.Schedulers
;
...
...
@@ -97,7 +106,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_LOGIN_ERROR
,
"登陸報錯:"
+
t
.
getMessage
());
OkHttp3Utils
.
noticePersonnel
(
AppConstans
.
RP_LOGIN_ERROR
,
"登陸報錯:"
+
t
.
getMessage
());
if
(
IAcitivity
instanceof
LoginActivity
)
{
}
else
{
mRootView
.
launchActivity
(
new
Intent
(
IAcitivity
,
LoginActivity
.
class
));
...
...
@@ -107,7 +116,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
}
public
void
getRestaurantList
(){
public
void
getRestaurantList
()
{
mModel
.
getRestaurantList
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
...
...
@@ -119,7 +128,7 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
@Override
public
void
onNext
(
@NonNull
BrandsBean
info
)
{
if
(
info
!=
null
)
{
if
(
info
!=
null
)
{
mRootView
.
saveRestaurantListInfo
(
info
.
getData
());
}
else
{
mRootView
.
saveRestaurantListInfo
(
null
);
...
...
@@ -134,5 +143,74 @@ public class BaseLoginPresenter<M extends BaseLoginContract.Model, V extends Bas
});
}
/**
* @param restaurantId 餐廳ID
* @param isDownload 是否去下載頁面
*/
public
void
getLoginLimit
(
int
restaurantId
,
boolean
isDownload
)
{
mModel
.
getLoginLimit
(
restaurantId
)
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
AndroidSchedulers
.
mainThread
())
.
doOnSubscribe
(
disposable
->
mRootView
.
showLoading
(
"獲取登錄人數"
))
.
observeOn
(
AndroidSchedulers
.
mainThread
())
.
doAfterTerminate
(()
->
mRootView
.
hideLoading
())
.
compose
(
RxLifecycleUtils
.
bindToLifecycle
(
mRootView
))
.
subscribe
(
new
ErrorHandleSubscriber
<
PublicBean
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
PublicBean
s
)
{
if
(
s
!=
null
&&
s
.
isSuccess
())
{
List
<
LoginLimitBean
>
loginLimitBeans
=
new
Gson
().
fromJson
(
GsonUtils
.
GsonString
(
s
.
getData
()),
new
TypeToken
<
List
<
LoginLimitBean
>>()
{}.
getType
());
// List<LoginLimitBean> logins = GsonUtils.GsonToList("", LoginLimitBean.class);
if
(
loginLimitBeans
==
null
||
loginLimitBeans
.
size
()
<=
0
)
{
if
(
isDownload
)
{
mRootView
.
jumpDownloadActivity
();
}
else
{
mRootView
.
jumpMainActivity
();
}
}
else
{
//已達上限,彈出彈窗
mRootView
.
showLoginLimit
(
loginLimitBeans
);
}
}
else
{
mRootView
.
showMessage
(
"獲取登陸人數失敗"
);
mRootView
.
launchActivity
(
new
Intent
(
IAcitivity
,
LoginActivity
.
class
));
}
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
mRootView
.
showLoginLimit
(
null
);
// mRootView.launchActivity(new Intent(IAcitivity, LoginActivity.class));
// mRootView.jumpDownloadActivity();
}
});
}
/**
* 踢出用戶
*/
public
void
loginOut
(
int
userId
)
{
RequestBody
requestBody
=
new
FormBody
.
Builder
()
.
add
(
"type"
,
"2"
)
.
build
();
mModel
.
loginOut
(
userId
,
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
<
Object
>(
mErrorHandler
)
{
@Override
public
void
onNext
(
@NonNull
Object
info
)
{
}
@Override
public
void
onError
(
Throwable
t
)
{
super
.
onError
(
t
);
}
});
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/server/LoginService.java
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
server
;
import
com.gingersoft.gsa.cloud.bean.PublicBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.BrandsBean
;
import
com.gingersoft.gsa.cloud.ui.bean.mode.LoginBean
;
...
...
@@ -8,7 +9,10 @@ import io.reactivex.Observable;
import
me.jessyan.retrofiturlmanager.RetrofitUrlManager
;
import
okhttp3.RequestBody
;
import
retrofit2.http.Body
;
import
retrofit2.http.Field
;
import
retrofit2.http.FormUrlEncoded
;
import
retrofit2.http.GET
;
import
retrofit2.http.Header
;
import
retrofit2.http.Headers
;
import
retrofit2.http.POST
;
...
...
@@ -17,9 +21,6 @@ import retrofit2.http.POST;
*/
public
interface
LoginService
{
// @POST("gsa/login" + RetrofitUrlManager.IDENTIFICATION_PATH_SIZE + 2)
// Observable<LoginBean> login(@Body RequestBody requestBody);
@Headers
({
"Domain-Name: system_url"
})
@POST
(
"public/user/login"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
LoginBean
>
login
(
@Body
RequestBody
requestBody
);
...
...
@@ -27,5 +28,10 @@ public interface LoginService {
@GET
(
"user/brand/get"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
BrandsBean
>
getRestaurantList
();
@FormUrlEncoded
@POST
(
"user/restrictions"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
PublicBean
>
getLoginLimit
(
@Field
(
"restaurantId"
)
int
restaurantId
);
@POST
(
"user/logout"
+
RetrofitUrlManager
.
IDENTIFICATION_PATH_SIZE
+
2
)
Observable
<
Object
>
loginOut
(
@Header
(
"uid"
)
int
userId
,
@Body
RequestBody
requestBody
);
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/di/component/ChooseRestaurantComponent.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
di
.
component
;
import
dagger.Component
;
import
com.jess.arms.di.component.AppComponent
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.di.module.ChooseRestaurantModule
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.ui.activity.ChooseRestaurantActivity
;
@ActivityScope
@Component
(
modules
=
ChooseRestaurantModule
.
class
,
dependencies
=
AppComponent
.
class
)
public
interface
ChooseRestaurantComponent
{
void
inject
(
ChooseRestaurantActivity
activity
);
}
\ No newline at end of file
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/di/module/ChooseRestaurantModule.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
di
.
module
;
import
com.jess.arms.di.scope.ActivityScope
;
import
dagger.Module
;
import
dagger.Provides
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.contract.ChooseRestaurantContract
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.model.ChooseRestaurantModel
;
@Module
public
class
ChooseRestaurantModule
{
private
ChooseRestaurantContract
.
View
view
;
/**
* 构建ChooseRestaurantModule时,将View的实现类传进来,这样就可以提供View的实现类给presenter
* @param view
*/
public
ChooseRestaurantModule
(
ChooseRestaurantContract
.
View
view
)
{
this
.
view
=
view
;
}
@ActivityScope
@Provides
ChooseRestaurantContract
.
View
provideChooseRestaurantView
(){
return
this
.
view
;
}
@ActivityScope
@Provides
ChooseRestaurantContract
.
Model
provideChooseRestaurantModel
(
ChooseRestaurantModel
model
){
return
model
;
}
}
\ No newline at end of file
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/contract/ChooseRestaurantContract.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
mvp
.
contract
;
import
com.jess.arms.mvp.IView
;
import
com.jess.arms.mvp.IModel
;
public
interface
ChooseRestaurantContract
{
//对于经常使用的关于UI的方法可以定义到IView中,如显示隐藏进度条,和显示文字消息
interface
View
extends
IView
{
}
//Model层定义接口,外部只需关心Model返回的数据,无需关心内部细节,即是否使用缓存
interface
Model
extends
IModel
{
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/model/ChooseRestaurantModel.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
mvp
.
model
;
import
android.app.Application
;
import
com.google.gson.Gson
;
import
com.jess.arms.integration.IRepositoryManager
;
import
com.jess.arms.mvp.BaseModel
;
import
com.jess.arms.di.scope.ActivityScope
;
import
javax.inject.Inject
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.contract.ChooseRestaurantContract
;
@ActivityScope
public
class
ChooseRestaurantModel
extends
BaseModel
implements
ChooseRestaurantContract
.
Model
{
@Inject
Gson
mGson
;
@Inject
Application
mApplication
;
@Inject
public
ChooseRestaurantModel
(
IRepositoryManager
repositoryManager
)
{
super
(
repositoryManager
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mGson
=
null
;
this
.
mApplication
=
null
;
}
}
\ No newline at end of file
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/presenter/ChooseRestaurantPresenter.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
mvp
.
presenter
;
import
android.app.Application
;
import
com.jess.arms.integration.AppManager
;
import
com.jess.arms.di.scope.ActivityScope
;
import
com.jess.arms.mvp.BasePresenter
;
import
com.jess.arms.http.imageloader.ImageLoader
;
import
me.jessyan.rxerrorhandler.core.RxErrorHandler
;
import
javax.inject.Inject
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.contract.ChooseRestaurantContract
;
@ActivityScope
public
class
ChooseRestaurantPresenter
extends
BasePresenter
<
ChooseRestaurantContract
.
Model
,
ChooseRestaurantContract
.
View
>
{
@Inject
RxErrorHandler
mErrorHandler
;
@Inject
Application
mApplication
;
@Inject
ImageLoader
mImageLoader
;
@Inject
AppManager
mAppManager
;
@Inject
public
ChooseRestaurantPresenter
(
ChooseRestaurantContract
.
Model
model
,
ChooseRestaurantContract
.
View
rootView
)
{
super
(
model
,
rootView
);
}
@Override
public
void
onDestroy
()
{
super
.
onDestroy
();
this
.
mErrorHandler
=
null
;
this
.
mAppManager
=
null
;
this
.
mImageLoader
=
null
;
this
.
mApplication
=
null
;
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/ChooseRestaurantActivity.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
activity
.
mvp
.
ui
.
activity
;
import
android.content.Intent
;
import
android.os.Bundle
;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.gsa.cloud.login.R
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.di.component.DaggerChooseRestaurantComponent
;
import
com.jess.arms.base.BaseActivity
;
import
com.jess.arms.di.component.AppComponent
;
import
com.jess.arms.utils.ArmsUtils
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.di.module.ChooseRestaurantModule
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.contract.ChooseRestaurantContract
;
import
com.gingersoft.gsa.cloud.login.mvp.ui.activity.mvp.presenter.ChooseRestaurantPresenter
;
import
static
com
.
jess
.
arms
.
utils
.
Preconditions
.
checkNotNull
;
public
class
ChooseRestaurantActivity
extends
BaseActivity
<
ChooseRestaurantPresenter
>
implements
ChooseRestaurantContract
.
View
{
@Override
public
void
setupActivityComponent
(
@NonNull
AppComponent
appComponent
)
{
DaggerChooseRestaurantComponent
//如找不到该类,请编译一下项目
.
builder
()
.
appComponent
(
appComponent
)
.
chooseRestaurantModule
(
new
ChooseRestaurantModule
(
this
))
.
build
()
.
inject
(
this
);
}
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
return
R
.
layout
.
activity_choose_restaurant
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
}
@Override
public
void
initIntent
()
{
}
@Override
public
void
initTopBar
()
{
}
@Override
public
void
initLanguage
()
{
}
@Override
public
void
initLayoutParams
()
{
}
@Override
public
void
initLayoutVisible
()
{
}
@Override
public
void
showLoading
(
String
message
)
{
}
@Override
public
void
hideLoading
()
{
}
@Override
public
void
showMessage
(
@NonNull
String
message
)
{
checkNotNull
(
message
);
ArmsUtils
.
snackbarText
(
message
);
}
@Override
public
void
launchActivity
(
@NonNull
Intent
intent
)
{
checkNotNull
(
intent
);
ArmsUtils
.
startActivity
(
intent
);
}
@Override
public
void
killMyself
()
{
finish
();
}
}
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/LoginActivity.java
View file @
a8ba4a08
...
...
@@ -7,6 +7,7 @@ import android.text.Editable;
import
android.text.TextWatcher
;
import
android.text.method.HideReturnsTransformationMethod
;
import
android.text.method.PasswordTransformationMethod
;
import
android.util.Log
;
import
android.view.View
;
import
android.view.WindowManager
;
import
android.widget.CheckBox
;
...
...
@@ -15,7 +16,6 @@ import android.widget.ImageView;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
com.gingersoft.gsa.cloud.base.utils.StatusBarUtil
;
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.other.SPUtils
;
...
...
@@ -96,15 +96,15 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
StatusBarUtil
.
setTransparent
(
this
);
StatusBarUtil
.
setDarkMode
(
this
);
//
StatusBarUtil.setTransparent(this);
//
StatusBarUtil.setDarkMode(this);
getWindow
().
setSoftInputMode
(
WindowManager
.
LayoutParams
.
SOFT_INPUT_ADJUST_PAN
);
//SOFT_INPUT_ADJUST_NOTHING
return
R
.
layout
.
user_login_activity_login
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
@Override
public
void
initData
(
@Nullable
Bundle
savedInstanceState
)
{
((
ImageView
)
findViewById
(
R
.
id
.
iv_top_bg
)).
setAdjustViewBounds
(
true
);
((
ImageView
)
findViewById
(
R
.
id
.
iv_top_bg
)).
setAdjustViewBounds
(
true
);
mPresenter
.
requestExternalStoragePermission
();
//顯示記住的登錄名
if
(!
Objects
.
equals
(
SPUtils
.
get
(
mContext
,
UserConstans
.
LOGIN_USERNAME
,
""
),
""
))
{
...
...
@@ -169,7 +169,7 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
@Override
public
void
onTextChanged
(
CharSequence
s
,
int
start
,
int
before
,
int
count
)
{
if
(
edPwd
.
getText
()
!=
null
&&
edAccount
.
getText
().
toString
().
equals
(
""
))
{
if
(
edPwd
.
getText
()
!=
null
&&
edAccount
.
getText
()
!=
null
&&
edAccount
.
getText
()
.
toString
().
equals
(
""
))
{
icClearAccount
.
setVisibility
(
View
.
GONE
);
}
else
{
icClearAccount
.
setVisibility
(
View
.
VISIBLE
);
...
...
@@ -178,6 +178,14 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
@Override
public
void
afterTextChanged
(
Editable
s
)
{
String
str
=
s
.
toString
();
if
(
str
.
contains
(
"/r"
)
||
str
.
contains
(
"\n"
))
{
edAccount
.
setText
(
str
.
replace
(
"/r"
,
""
).
replace
(
"\n"
,
""
));
edPwd
.
requestFocus
();
if
(
edPwd
.
getText
()
!=
null
)
{
edPwd
.
setSelection
(
edPwd
.
getText
().
length
());
}
}
setLoginBtnState
();
}
});
...
...
@@ -303,7 +311,8 @@ public class LoginActivity extends LoginInterfaceImpl<LoginPresenter> implements
//保存登陸信息
// saveLoginInfo(loginBean);
}
//158 - 189
//158 - 189
@Override
public
void
showChooseRestaurantDialog
(
List
<
BrandsBean
.
BrandsData
>
brandsBeans
,
List
<
BrandsBean
.
BrandsData
>
brands
)
{
new
ChooseRestaurantDialog
.
BottomListSheetBuilder
(
mContext
)
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/activity/mvp/ui/activity/WelcomeActivity.java
View file @
a8ba4a08
...
...
@@ -15,10 +15,8 @@ import android.widget.TextView;
import
androidx.annotation.NonNull
;
import
androidx.annotation.Nullable
;
import
androidx.constraintlayout.widget.ConstraintLayout
;
import
androidx.core.content.ContextCompat
;
import
androidx.viewpager2.widget.ViewPager2
;
import
com.gingersoft.gsa.cloud.base.utils.StatusBarUtil
;
import
com.gingersoft.gsa.cloud.base.utils.encryption.Aes
;
import
com.gingersoft.gsa.cloud.base.utils.other.SPUtils
;
import
com.gingersoft.gsa.cloud.constans.UserConstans
;
...
...
@@ -80,7 +78,6 @@ public class WelcomeActivity extends LoginInterfaceImpl<WelcomePresenter> implem
@Override
public
int
initView
(
@Nullable
Bundle
savedInstanceState
)
{
StatusBarUtil
.
setColorNoTranslucent
(
this
,
ContextCompat
.
getColor
(
this
,
R
.
color
.
white
));
return
R
.
layout
.
activity_welcome
;
//如果你不需要框架帮你设置 setContentView(id) 需要自行设置,请返回 0
}
...
...
login-module/src/main/java/com/gingersoft/gsa/cloud/login/mvp/ui/adapter/LoginLimitAdapter.java
0 → 100644
View file @
a8ba4a08
package
com
.
gingersoft
.
gsa
.
cloud
.
login
.
mvp
.
ui
.
adapter
;
import
com.chad.library.adapter.base.BaseQuickAdapter
;
import
com.chad.library.adapter.base.viewholder.BaseViewHolder
;
import
com.gingersoft.gsa.cloud.base.utils.time.TimeUtil
;
import
com.gingersoft.gsa.cloud.login.R
;
import
com.gingersoft.gsa.cloud.login.mvp.bean.LoginLimitBean
;
import
org.jetbrains.annotations.NotNull
;
import
org.jetbrains.annotations.Nullable
;
import
java.util.List
;
public
class
LoginLimitAdapter
extends
BaseQuickAdapter
<
LoginLimitBean
,
BaseViewHolder
>
{
public
LoginLimitAdapter
(
@Nullable
List
<
LoginLimitBean
>
data
)
{
super
(
R
.
layout
.
login_limit_item
,
data
);
addChildClickViewIds
(
R
.
id
.
tv_login_limit_operation
);
}
@Override
protected
void
convert
(
@NotNull
BaseViewHolder
baseViewHolder
,
LoginLimitBean
loginLimitBean
)
{
baseViewHolder
.
setText
(
R
.
id
.
tv_login_limit_account
,
loginLimitBean
.
getUserName
());
baseViewHolder
.
setText
(
R
.
id
.
tv_login_limit_time
,
TimeUtil
.
getStringByFormat
(
loginLimitBean
.
getDateTime
(),
TimeUtil
.
dateFormatYMDHMS
));
}
}
login-module/src/main/res/drawable/shape_topleft_topright.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<shape
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<corners
android:topLeftRadius=
"@dimen/dp_8"
android:topRightRadius=
"@dimen/dp_8"
/>
<solid
android:color=
"@color/white"
/>
</shape>
\ No newline at end of file
login-module/src/main/res/layout/activity_choose_restaurant.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:orientation=
"vertical"
>
</LinearLayout>
\ No newline at end of file
login-module/src/main/res/layout/activity_welcome.xml
View file @
a8ba4a08
...
...
@@ -2,143 +2,142 @@
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:layout_width=
"match_parent"
android:
background=
"@color/white
"
android:
layout_height=
"match_parent
"
>
android:
layout_height=
"match_parent
"
android:
background=
"@color/white
"
>
<RelativeLayout
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_welcome_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_80"
android:text=
"多功能管理,讓管理更輕鬆"
android:textColor=
"@color/theme_color"
android:textSize=
"@dimen/sp_22"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_welcome_center"
android:layout_width=
"@dimen/dp_203"
android:layout_height=
"@dimen/dp_256"
android:layout_below=
"@+id/tv_welcome_title"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_60"
android:src=
"@mipmap/png_welcome_center"
/>
<TextView
android:id=
"@+id/iv_welcome_logo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/iv_welcome_center"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_30"
android:drawableTop=
"@mipmap/ic_launcher"
android:text=
"Ricepon POS"
android:textSize=
"@dimen/sp_16"
android:textColor=
"@color/theme_color"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_welcome_bottom"
<RelativeLayout
android:id=
"@+id/content_view"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:src=
"@mipmap/png_welcome_bottom"
/>
</RelativeLayout>
<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_height=
"match_parent"
app:layout_constraintTop_toTopOf=
"parent"
>
<TextView
android:id=
"@+id/tv_welcome_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_80"
android:text=
"多功能管理,讓管理更輕鬆"
android:textColor=
"@color/theme_color"
android:textSize=
"@dimen/sp_22"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_welcome_center"
android:layout_width=
"@dimen/dp_203"
android:layout_height=
"@dimen/dp_256"
android:layout_below=
"@+id/tv_welcome_title"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_60"
android:src=
"@mipmap/png_welcome_center"
/>
<TextView
android:id=
"@+id/iv_welcome_logo"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@+id/iv_welcome_center"
android:layout_centerHorizontal=
"true"
android:layout_marginTop=
"@dimen/dp_30"
android:drawableTop=
"@mipmap/ic_launcher"
android:text=
"Ricepon POS"
android:textColor=
"@color/theme_color"
android:textSize=
"@dimen/sp_16"
android:textStyle=
"bold"
/>
<ImageView
android:id=
"@+id/iv_welcome_bottom"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_alignParentBottom=
"true"
android:layout_centerHorizontal=
"true"
android:src=
"@mipmap/png_welcome_bottom"
/>
</RelativeLayout>
<androidx.constraintlayout.widget.ConstraintLayout
android:id=
"@+id/cl_guide_layout"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
<com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
android:id=
"@+id/guide_magic_indicator"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/dp_5"
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_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"
/>
<ImageView
android:id=
"@+id/iv_guide_close"
android:layout_width=
"@dimen/dp_42"
android:layout_height=
"@dimen/dp_42"
android:padding=
"@dimen/dp_12"
android:src=
"@drawable/ic_guide_close"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<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"
/>
<TextView
android:id=
"@+id/tv_guide_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_18"
android:text=
"多終端雲同步,輕松管理所有"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_19"
app:layout_constraintBottom_toTopOf=
"@id/tv_guide_details"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.12"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/tv_experience"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_15"
android:background=
"@drawable/shape_experience_bg"
android:paddingLeft=
"@dimen/dp_28"
android:paddingTop=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_28"
android:paddingBottom=
"@dimen/dp_10"
android:text=
"立即體驗"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
android:visibility=
"gone"
app:layout_constraintBottom_toTopOf=
"@id/guide_magic_indicator"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
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"
/>
<com.gingersoft.gsa.cloud.ui.widget.Indicator.UIndicator
android:id=
"@+id/guide_magic_indicator"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/dp_5"
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_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"
/>
<ImageView
android:id=
"@+id/iv_guide_close"
android:layout_width=
"@dimen/dp_42"
android:layout_height=
"@dimen/dp_42"
android:padding=
"@dimen/dp_12"
android:src=
"@drawable/ic_guide_close"
app:layout_constraintRight_toRightOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
<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"
/>
<TextView
android:id=
"@+id/tv_guide_title"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/dp_18"
android:text=
"多終端雲同步,輕松管理所有"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_19"
app:layout_constraintBottom_toTopOf=
"@id/tv_guide_details"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintVertical_bias=
"0.12"
app:layout_constraintVertical_chainStyle=
"packed"
/>
<TextView
android:id=
"@+id/tv_experience"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginBottom=
"@dimen/dp_15"
android:background=
"@drawable/shape_experience_bg"
android:paddingLeft=
"@dimen/dp_28"
android:paddingTop=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_28"
android:paddingBottom=
"@dimen/dp_10"
android:text=
"立即體驗"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_14"
android:visibility=
"gone"
app:layout_constraintBottom_toTopOf=
"@id/guide_magic_indicator"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintRight_toRightOf=
"parent"
/>
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
login-module/src/main/res/layout/login_limit_dialog_layout.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:background=
"@drawable/shape_topleft_topright"
android:paddingBottom=
"@dimen/dp_30"
android:orientation=
"vertical"
>
<ImageView
android:id=
"@+id/iv_login_limit_back"
android:layout_width=
"wrap_content"
android:layout_height=
"@dimen/dp_40"
android:paddingLeft=
"@dimen/dp_10"
android:paddingRight=
"@dimen/dp_10"
android:src=
"@drawable/ic_black_back"
/>
<View
android:layout_width=
"match_parent"
android:layout_height=
"@dimen/dp_1"
android:background=
"@color/color_ccc"
/>
<LinearLayout
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingTop=
"@dimen/dp_15"
android:paddingBottom=
"@dimen/dp_10"
android:orientation=
"horizontal"
>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"當前賬戶"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:gravity=
"center"
android:text=
"登錄時間"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
/>
<TextView
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"操作"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
/>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id=
"@+id/rv_login_limit"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
/>
</LinearLayout>
\ No newline at end of file
login-module/src/main/res/layout/login_limit_item.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
xmlns:tools=
"http://schemas.android.com/tools"
android:orientation=
"horizontal"
android:gravity=
"center_vertical"
android:paddingBottom=
"@dimen/dp_10"
>
<TextView
android:id=
"@+id/tv_login_limit_account"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
android:gravity=
"center"
android:text=
"當前賬戶"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_16"
/>
<TextView
android:id=
"@+id/tv_login_limit_time"
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"2"
android:gravity=
"center"
tools:text=
"登錄時間"
android:textColor=
"@color/theme_333_color"
android:textSize=
"@dimen/dp_14"
/>
<FrameLayout
android:layout_width=
"0dp"
android:layout_height=
"wrap_content"
android:layout_weight=
"1"
>
<com.qmuiteam.qmui.alpha.QMUIAlphaTextView
android:id=
"@+id/tv_login_limit_operation"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:background=
"@color/theme_color"
android:gravity=
"center"
android:paddingRight=
"@dimen/dp_10"
android:paddingTop=
"@dimen/dp_5"
android:paddingBottom=
"@dimen/dp_5"
android:paddingLeft=
"@dimen/dp_10"
android:text=
"踢出"
android:textColor=
"@color/white"
android:textSize=
"@dimen/dp_16"
/>
</FrameLayout>
</LinearLayout>
\ No newline at end of file
main-module/src/main/java/com/gingersoft/gsa/cloud/main/mvp/ui/activity/SettlementReportActivity.java
View file @
a8ba4a08
...
...
@@ -230,6 +230,8 @@ public class SettlementReportActivity extends BaseActivity<SettlementReportPrese
private
void
showSendSettlementDialog
()
{
QMUIDialog
.
MessageDialogBuilder
dialogBuilder
=
new
QMUIDialog
.
MessageDialogBuilder
(
this
);
dialogBuilder
.
setTitle
(
"溫馨提示"
);
dialogBuilder
.
setMessage
(
"是否確認清機"
);
dialogBuilder
.
addAction
(
0
,
"確認"
,
QMUIDialogAction
.
ACTION_PROP_NEGATIVE
,
(
dialog
,
index
)
->
{
mPresenter
.
sendSettlement
(
type
);
...
...
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/data/model/bean/MessageBean.kt
0 → 100644
View file @
a8ba4a08
package
com.gingersoft.gsa.other_order_mode.data.model.bean
data class
MessageBean
(
val
code
:
String
,
val
errorMsg
:
String
,
val
success
:
Boolean
=
false
,
val
sysTime
:
Long
=
0
,
val
data
:
Any
?
=
null
)
\ No newline at end of file
other_order_mode/src/main/java/com/gingersoft/gsa/other_order_mode/ui/activity/OrderDetailsActivity.kt
View file @
a8ba4a08
...
...
@@ -319,7 +319,7 @@ class OrderDetailsActivity : BaseActivity() {
cancelDialogForLoading
()
if
(
it
)
{
finish
()
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"
取消訂單成功
"
)
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"
訂單已取消
"
)
}
else
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"取消訂單失敗"
)
}
...
...
@@ -331,7 +331,7 @@ class OrderDetailsActivity : BaseActivity() {
cancelDialogForLoading
()
if
(
it
)
{
finish
()
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"
取消訂單成功
"
)
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"
訂單已取消
"
)
}
else
{
ToastUtils
.
show
(
this
@OrderDetailsActivity
,
"取消訂單失敗"
)
}
...
...
other_order_mode/src/main/res/layout/activity_order_details.xml
View file @
a8ba4a08
...
...
@@ -92,7 +92,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"@dimen/other_order_info_dialog_content_marginLeft"
android:text=
"@{data.order_from==
2?@string/ricepon_order:@string/h5
_order}"
android:text=
"@{data.order_from==
7?@string/h5_order:@string/ricepon
_order}"
android:textSize=
"@dimen/dp_16"
android:textStyle=
"normal"
/>
...
...
other_order_mode/src/main/res/layout/item_orderdetails_bill_info.xml
0 → 100644
View file @
a8ba4a08
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_marginTop=
"@dimen/dp_10"
android:paddingLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:paddingRight=
"@dimen/other_order_info_dialog_content_marginLeft"
>
<TextView
android:id=
"@+id/tv_item_pay_name"
style=
"@style/otherOrder_bill_textStyle"
android:layout_width=
"0dp"
android:layout_weight=
"0.7"
android:gravity=
"right"
android:layout_height=
"wrap_content"
tools:text=
"餐盒費:"
/>
<TextView
android:id=
"@+id/tv_item_pay_amount"
style=
"@style/otherOrder_bill_info_textStyle"
android:layout_width=
"0dp"
android:layout_weight=
"0.3"
android:layout_height=
"wrap_content"
tools:text=
"$110"
android:layout_marginLeft=
"@dimen/dp_5"
android:gravity=
"right"
/>
</LinearLayout>
other_order_mode/src/main/res/layout/layout_order_info_dialog.xml
View file @
a8ba4a08
...
...
@@ -40,7 +40,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:textSize=
"@dimen/dp_16"
android:text=
"@{data.order_from==
2?@string/ricepon_order:@string/h5
_order}"
android:text=
"@{data.order_from==
7?@string/h5_order:@string/ricepon
_order}"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
other_order_mode/src/main/res/layout/layout_order_info_dialog_new.xml
View file @
a8ba4a08
...
...
@@ -65,7 +65,7 @@
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginLeft=
"@dimen/other_order_info_dialog_content_marginLeft"
android:text=
"@{data.order_from==
2?@string/ricepon_order:@string/h5
_order}"
android:text=
"@{data.order_from==
7?@string/h5_order:@string/ricepon
_order}"
android:textSize=
"@dimen/dp_16"
app:layout_constraintLeft_toLeftOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
...
...
qm-skin-maker/src/main/res/values/theme.xml
View file @
a8ba4a08
...
...
@@ -192,5 +192,4 @@
<item
name=
"app_skin_progress_bar_bg_color"
>
@color/qmui_config_color_gray_8
</item>
<item
name=
"app_skin_progress_bar_progress_color"
>
@color/qmui_config_color_gray_1
</item>
</style>
</resources>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment