Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Sign in / Register
Toggle navigation
B
Browser White
Project
Project
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wanglei
Browser White
Commits
506dfa5e
Commit
506dfa5e
authored
Sep 06, 2024
by
leichao.gao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
474d8319
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
92 deletions
+13
-92
NotificationUiUtil.kt
...main/java/com/base/browserwhite/fcm/NotificationUiUtil.kt
+1
-1
WebViewFragment.kt
...se/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
+12
-91
No files found.
app/src/main/java/com/base/browserwhite/fcm/NotificationUiUtil.kt
View file @
506dfa5e
...
@@ -165,7 +165,7 @@ object NotificationUiUtil {
...
@@ -165,7 +165,7 @@ object NotificationUiUtil {
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_wendu_now
,
Random
.
nextInt
(
min
,
max
).
toString
())
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_day_desc
,
if
(
isDayOrNight
())
subBean
.
textDay
else
subBean
.
textNight
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
bigRemoteViews
.
setTextViewText
(
R
.
id
.
tv_weather_info
,
"$min℃/$max℃ ${formatATime()}"
)
sendNotificationUI
(
context
,
actionId
,
bigRemoteViews
,
big
RemoteViews
)
sendNotificationUI
(
context
,
actionId
,
bigRemoteViews
,
small
RemoteViews
)
}
}
else
->
{
else
->
{
...
...
app/src/main/java/com/base/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
View file @
506dfa5e
...
@@ -3,12 +3,14 @@ package com.base.browserwhite.ui.activity.webbrowser
...
@@ -3,12 +3,14 @@ package com.base.browserwhite.ui.activity.webbrowser
import
android.animation.Animator
import
android.animation.Animator
import
android.animation.AnimatorSet
import
android.animation.AnimatorSet
import
android.animation.ObjectAnimator
import
android.animation.ObjectAnimator
import
android.animation.ValueAnimator
import
android.annotation.SuppressLint
import
android.annotation.SuppressLint
import
android.app.Dialog
import
android.app.Dialog
import
android.content.Context
import
android.content.Context
import
android.net.Uri
import
android.net.Uri
import
android.net.http.SslError
import
android.net.http.SslError
import
android.view.View
import
android.view.View
import
android.view.animation.AccelerateDecelerateInterpolator
import
android.view.animation.AccelerateInterpolator
import
android.view.animation.AccelerateInterpolator
import
android.view.animation.DecelerateInterpolator
import
android.view.animation.DecelerateInterpolator
import
android.view.animation.LinearInterpolator
import
android.view.animation.LinearInterpolator
...
@@ -123,100 +125,20 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
...
@@ -123,100 +125,20 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
// 掉落位置
// 掉落位置
val
dropTranslationY
=
(-
button
.
height
*
3
).
toFloat
()
val
dropTranslationY
=
(-
button
.
height
*
3
).
toFloat
()
val
dropTranslationY1
=
(-
button
.
height
*
2
).
toFloat
()
// 回弹高度
// 回弹高度
val
bounceHeight
=
-
30f
button
.
isVisible
=
downloadList
.
isNotEmpty
()
val
animator
=
ValueAnimator
.
ofFloat
(
dropTranslationY
,
startTranslationY
,
dropTranslationY1
,
startTranslationY
)
animator
.
interpolator
=
AccelerateDecelerateInterpolator
()
animator
.
duration
=
3000
animator
.
addUpdateListener
{
animation
->
// 更新按钮的位置
button
.
translationY
=
animation
.
animatedValue
as
Float
}
animator
.
start
()
// 创建掉落动画
// 创建掉落动画
val
dropAnimator
=
ObjectAnimator
.
ofFloat
(
button
,
"translationY"
,
startTranslationY
,
dropTranslationY
)
dropAnimator
.
setDuration
(
1000
)
dropAnimator
.
interpolator
=
LinearInterpolator
()
// 创建第一次回弹动画
val
bounceUpAnimator
=
ObjectAnimator
.
ofFloat
(
button
,
"translationY"
,
dropTranslationY
,
dropTranslationY
+
bounceHeight
)
bounceUpAnimator
.
setDuration
(
600
)
bounceUpAnimator
.
interpolator
=
DecelerateInterpolator
()
// 创建第一次回弹后下落动画
val
bounceDownAnimator
=
ObjectAnimator
.
ofFloat
(
button
,
"translationY"
,
dropTranslationY
+
bounceHeight
,
dropTranslationY
)
bounceDownAnimator
.
setDuration
(
600
)
bounceDownAnimator
.
interpolator
=
AccelerateInterpolator
()
// 创建第二次回弹动画
val
secondBounceUpAnimator
=
ObjectAnimator
.
ofFloat
(
button
,
"translationY"
,
dropTranslationY
,
startTranslationY
+
bounceHeight
)
secondBounceUpAnimator
.
setDuration
(
600
)
secondBounceUpAnimator
.
interpolator
=
DecelerateInterpolator
()
// 创建第二次回弹后下落动画
val
secondBounceDownAnimator
=
ObjectAnimator
.
ofFloat
(
button
,
"translationY"
,
startTranslationY
+
bounceHeight
,
startTranslationY
)
secondBounceDownAnimator
.
setDuration
(
600
)
secondBounceDownAnimator
.
interpolator
=
LinearInterpolator
()
// 创建动画集合
val
bounceSet
=
AnimatorSet
()
bounceSet
.
playSequentially
(
bounceUpAnimator
,
bounceDownAnimator
,
secondBounceUpAnimator
,
secondBounceDownAnimator
)
// 监听第一次回弹动画结束,开始第二次回弹动画
bounceUpAnimator
.
addListener
(
object
:
Animator
.
AnimatorListener
{
override
fun
onAnimationStart
(
animation
:
Animator
)
{
binding
.
flDownload
.
isVisible
=
downloadList
.
isNotEmpty
()
}
override
fun
onAnimationEnd
(
animation
:
Animator
)
{
secondBounceUpAnimator
.
start
()
}
override
fun
onAnimationCancel
(
animation
:
Animator
)
{
}
override
fun
onAnimationRepeat
(
animation
:
Animator
)
{
}
})
// 启动掉落动画,然后开始回弹动画
dropAnimator
.
addListener
(
object
:
Animator
.
AnimatorListener
{
override
fun
onAnimationStart
(
animation
:
Animator
)
{
}
override
fun
onAnimationEnd
(
animation
:
Animator
)
{
bounceUpAnimator
.
start
()
}
override
fun
onAnimationCancel
(
animation
:
Animator
)
{
}
override
fun
onAnimationRepeat
(
animation
:
Animator
)
{
}
})
// 启动动画
dropAnimator
.
start
()
}
}
fun
reloadWebView
()
{
fun
reloadWebView
()
{
...
@@ -419,7 +341,6 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
...
@@ -419,7 +341,6 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
downloadAdapter
?.
notifyDataSetChanged
()
downloadAdapter
?.
notifyDataSetChanged
()
}
}
}
}
}
}
...
...
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