Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_goodmoney
Project
Project
Details
Activity
Releases
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
android
android_goodmoney
Commits
5199dd9e
Commit
5199dd9e
authored
Dec 28, 2020
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化吐司
parent
5d68fb12
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
2 deletions
+22
-2
build.gradle
GoodMoney/app/build.gradle
+2
-0
MintsApplication.java
...p/src/main/java/com/mints/goodmoney/MintsApplication.java
+7
-0
ToastUtil.java
...pp/src/main/java/com/mints/goodmoney/utils/ToastUtil.java
+13
-2
No files found.
GoodMoney/app/build.gradle
View file @
5199dd9e
...
...
@@ -172,6 +172,8 @@ dependencies {
implementation
'com.androidkun:XTabLayout:1.1.5'
// zxing
implementation
'com.king.zxing:zxing-lite:1.1.7-androidx'
// toast
implementation
'com.hjq:toast:8.8'
// 工具类
// gson
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/MintsApplication.java
View file @
5199dd9e
...
...
@@ -11,6 +11,7 @@ import androidx.localbroadcastmanager.content.LocalBroadcastManager;
import
androidx.multidex.MultiDexApplication
;
import
com.bun.miitmdid.core.JLibrary
;
import
com.hjq.toast.ToastUtils
;
import
com.mints.goodmoney.common.Constant
;
import
com.mints.goodmoney.manager.ChannelManager
;
import
com.mints.goodmoney.manager.LiebaoManager
;
...
...
@@ -107,6 +108,12 @@ public class MintsApplication extends MultiDexApplication {
* 三方配置
*/
private
void
thirdConfig
()
{
try
{
ToastUtils
.
init
(
this
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
// 移动安全联盟 oaid
initMiitHelper
();
...
...
GoodMoney/app/src/main/java/com/mints/goodmoney/utils/ToastUtil.java
View file @
5199dd9e
...
...
@@ -10,6 +10,7 @@ import android.view.View;
import
android.widget.TextView
;
import
android.widget.Toast
;
import
com.hjq.toast.ToastUtils
;
import
com.mints.goodmoney.R
;
/**
...
...
@@ -26,11 +27,21 @@ public class ToastUtil {
private
static
final
Object
mSynObj
=
new
Object
();
public
static
void
show
(
Context
context
,
String
msg
)
{
showToast
(
context
,
msg
,
Toast
.
LENGTH_SHORT
,
Gravity
.
CENTER
);
try
{
ToastUtils
.
show
(
msg
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
showToast
(
context
,
msg
,
Toast
.
LENGTH_SHORT
,
Gravity
.
CENTER
);
}
}
public
static
void
showLong
(
Context
context
,
String
msg
)
{
showToast
(
context
,
msg
,
Toast
.
LENGTH_LONG
,
Gravity
.
CENTER
);
try
{
ToastUtils
.
show
(
msg
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
showToast
(
context
,
msg
,
Toast
.
LENGTH_LONG
,
Gravity
.
CENTER
);
}
}
public
static
void
show
(
Context
context
,
String
msg
,
boolean
isShowToast
)
{
...
...
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