Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
android_vedio
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_vedio
Commits
478c7a21
Commit
478c7a21
authored
Sep 26, 2023
by
mengcuiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
4984fd26
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
16 deletions
+32
-16
ConsumerToastUtil.kt
...main/java/com/duben/dayplaylet/utils/ConsumerToastUtil.kt
+5
-2
toast_text_layout.xml
video/app/src/main/res/layout/toast_text_layout.xml
+27
-14
ic_splash_top.png
video/app/src/main/res/mipmap-xhdpi/ic_splash_top.png
+0
-0
No files found.
video/app/src/main/java/com/duben/dayplaylet/utils/ConsumerToastUtil.kt
View file @
478c7a21
package
com.duben.dayplaylet.utils
package
com.duben.dayplaylet.utils
import
android.annotation.SuppressLint
import
android.content.Context
import
android.content.Context
import
android.os.Handler
import
android.os.Handler
import
android.view.Gravity
import
android.view.Gravity
...
@@ -11,6 +12,7 @@ import android.widget.Toast
...
@@ -11,6 +12,7 @@ import android.widget.Toast
import
com.duben.dayplaylet.R
import
com.duben.dayplaylet.R
object
ConsumerToastUtil
{
object
ConsumerToastUtil
{
@SuppressLint
(
"MissingInflatedId"
)
@JvmStatic
@JvmStatic
fun
showAwardText
(
context
:
Context
?,
redPkgInt
:
Int
,
yuanbaoInt
:
Int
)
{
fun
showAwardText
(
context
:
Context
?,
redPkgInt
:
Int
,
yuanbaoInt
:
Int
)
{
SoundPoolUtil
.
getInstance
().
getGoldVoice
()
SoundPoolUtil
.
getInstance
().
getGoldVoice
()
...
@@ -23,6 +25,7 @@ object ConsumerToastUtil {
...
@@ -23,6 +25,7 @@ object ConsumerToastUtil {
try
{
try
{
val
toastview
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
toast_text_layout
,
null
)
val
toastview
=
LayoutInflater
.
from
(
context
).
inflate
(
R
.
layout
.
toast_text_layout
,
null
)
val
ll_toast_redpkg
=
toastview
.
findViewById
<
View
>(
R
.
id
.
ll_toast_redpkg
)
as
LinearLayout
val
ll_toast_redpkg
=
toastview
.
findViewById
<
View
>(
R
.
id
.
ll_toast_redpkg
)
as
LinearLayout
val
ll_toast_yuanbao
=
toastview
.
findViewById
<
View
>(
R
.
id
.
ll_toast_yuanbao
)
as
LinearLayout
val
redPkg
=
toastview
.
findViewById
<
View
>(
R
.
id
.
tv_toast_redpkg
)
as
TextView
val
redPkg
=
toastview
.
findViewById
<
View
>(
R
.
id
.
tv_toast_redpkg
)
as
TextView
val
yuanbao
=
toastview
.
findViewById
<
View
>(
R
.
id
.
tv_toast_yuanbao
)
as
TextView
val
yuanbao
=
toastview
.
findViewById
<
View
>(
R
.
id
.
tv_toast_yuanbao
)
as
TextView
...
@@ -34,9 +37,9 @@ object ConsumerToastUtil {
...
@@ -34,9 +37,9 @@ object ConsumerToastUtil {
}
}
if
(
yuanbaoInt
>
0
)
{
if
(
yuanbaoInt
>
0
)
{
yuanbao
.
text
=
"+${yuanbaoInt}"
yuanbao
.
text
=
"+${yuanbaoInt}"
yuanbao
.
visibility
=
View
.
VISIBLE
ll_toast_
yuanbao
.
visibility
=
View
.
VISIBLE
}
else
{
}
else
{
yuanbao
.
visibility
=
View
.
GONE
ll_toast_
yuanbao
.
visibility
=
View
.
GONE
}
}
val
toast
=
Toast
(
context
)
val
toast
=
Toast
(
context
)
toast
.
setGravity
(
Gravity
.
CENTER
,
0
,
0
)
toast
.
setGravity
(
Gravity
.
CENTER
,
0
,
0
)
...
...
video/app/src/main/res/layout/toast_text_layout.xml
View file @
478c7a21
...
@@ -11,12 +11,12 @@
...
@@ -11,12 +11,12 @@
android:id=
"@+id/ll_toast_redpkg"
android:id=
"@+id/ll_toast_redpkg"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"
2
0dp"
android:layout_margin=
"
3
0dp"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<ImageView
<ImageView
android:layout_width=
"
6
0dp"
android:layout_width=
"
12
0dp"
android:layout_height=
"
6
0dp"
android:layout_height=
"
12
0dp"
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/ic_redpkg"
/>
android:src=
"@mipmap/ic_redpkg"
/>
...
@@ -27,22 +27,35 @@
...
@@ -27,22 +27,35 @@
android:layout_gravity=
"center_horizontal"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"4dp"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/white"
android:textColor=
"@color/white"
android:textSize=
"
1
8sp"
android:textSize=
"
2
8sp"
android:textStyle=
"bold"
android:textStyle=
"bold"
tools:text=
"+10"
/>
tools:text=
"+10"
/>
</LinearLayout>
</LinearLayout>
<LinearLayout
<TextView
android:id=
"@+id/ll_toast_yuanbao"
android:id=
"@+id/tv_toast_yuanbao"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin=
"30dp"
android:layout_margin=
"30dp"
android:drawableTop=
"@mipmap/ic_yuanbao"
android:orientation=
"vertical"
>
android:drawablePadding=
"14dp"
android:gravity=
"center_horizontal"
<ImageView
android:textColor=
"@color/white"
android:layout_width=
"120dp"
android:textSize=
"18sp"
android:layout_height=
"120dp"
android:textStyle=
"bold"
android:layout_gravity=
"center_horizontal"
tools:text=
"+10"
/>
android:src=
"@mipmap/ic_yuanbao"
/>
<TextView
android:id=
"@+id/tv_toast_yuanbao"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:layout_marginTop=
"4dp"
android:textColor=
"@color/white"
android:textSize=
"28sp"
android:textStyle=
"bold"
tools:text=
"+10"
/>
</LinearLayout>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
video/app/src/main/res/mipmap-xhdpi/ic_splash_top.png
View replaced file @
4984fd26
View file @
478c7a21
13.4 KB
|
W:
|
H:
13.2 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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