Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fluttertoast
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
songyanzhi
fluttertoast
Commits
29cf2bff
Unverified
Commit
29cf2bff
authored
Feb 25, 2022
by
Mike
Committed by
GitHub
Feb 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed issue #340 (#353)
* fix: #340 * fix gravity
parent
d09a526f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
+3
-3
No files found.
android/src/main/kotlin/io/github/ponnamkarthik/toast/fluttertoast/MethodCallHandlerImpl.kt
View file @
29cf2bff
...
@@ -46,7 +46,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -46,7 +46,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
Toast
.
LENGTH_SHORT
Toast
.
LENGTH_SHORT
}
}
if
(
bgcolor
!=
null
&&
Build
.
VERSION
.
SDK_INT
<=
3
0
)
{
if
(
bgcolor
!=
null
&&
Build
.
VERSION
.
SDK_INT
<=
3
1
)
{
val
layout
=
(
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
)
as
LayoutInflater
).
inflate
(
R
.
layout
.
toast_custom
,
null
)
val
layout
=
(
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
)
as
LayoutInflater
).
inflate
(
R
.
layout
.
toast_custom
,
null
)
val
text
=
layout
.
findViewById
<
TextView
>(
R
.
id
.
text
)
val
text
=
layout
.
findViewById
<
TextView
>(
R
.
id
.
text
)
text
.
text
=
mMessage
text
.
text
=
mMessage
...
@@ -71,7 +71,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -71,7 +71,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
mToast
.
view
=
layout
mToast
.
view
=
layout
}
else
{
}
else
{
mToast
=
Toast
.
makeText
(
context
,
mMessage
,
mDuration
)
mToast
=
Toast
.
makeText
(
context
,
mMessage
,
mDuration
)
if
(
Build
.
VERSION
.
SDK_INT
<
30
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
=
31
)
{
try
{
try
{
val
textView
:
TextView
=
mToast
.
view
!!
.
findViewById
(
android
.
R
.
id
.
message
)
val
textView
:
TextView
=
mToast
.
view
!!
.
findViewById
(
android
.
R
.
id
.
message
)
if
(
textSize
!=
null
)
{
if
(
textSize
!=
null
)
{
...
@@ -85,7 +85,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
...
@@ -85,7 +85,7 @@ internal class MethodCallHandlerImpl(var context: Context) : MethodCallHandler {
}
}
}
}
}
}
if
(
Build
.
VERSION
.
SDK_INT
<
30
)
{
if
(
Build
.
VERSION
.
SDK_INT
<
=
31
)
{
when
(
mGravity
)
{
when
(
mGravity
)
{
Gravity
.
CENTER
->
{
Gravity
.
CENTER
->
{
mToast
.
setGravity
(
mGravity
,
0
,
0
)
mToast
.
setGravity
(
mGravity
,
0
,
0
)
...
...
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