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
ca6752a2
Commit
ca6752a2
authored
Sep 06, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
90b0c31f
dbfcf391
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
WebViewFragment.kt
...se/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
+10
-4
No files found.
app/src/main/java/com/base/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
View file @
ca6752a2
...
...
@@ -9,6 +9,7 @@ import android.app.Dialog
import
android.content.Context
import
android.net.Uri
import
android.net.http.SslError
import
android.util.Log
import
android.view.View
import
android.view.animation.AccelerateDecelerateInterpolator
import
android.view.animation.AccelerateInterpolator
...
...
@@ -27,6 +28,7 @@ import android.webkit.WebView
import
android.webkit.WebViewClient
import
androidx.core.view.isVisible
import
androidx.lifecycle.lifecycleScope
import
com.base.browserwhite.MyApplication
import
com.base.browserwhite.bean.BookmarkBean
import
com.base.browserwhite.bean.ConstObject.webPrivacy
import
com.base.browserwhite.bean.DownloadBean
...
...
@@ -44,6 +46,7 @@ import com.base.browserwhite.utils.DownloadUtils.saveDownloadRecordFile
import
com.base.browserwhite.utils.LogEx
import
com.base.browserwhite.utils.SpBeanUtils
import
com.base.browserwhite.utils.SpBeanUtils.HISTORY_SP_KEY
import
com.base.browserwhite.utils.Utils.dpToPx
import
com.google.gson.Gson
import
com.liulishuo.filedownloader.FileDownloader
import
kotlinx.coroutines.Dispatchers
...
...
@@ -122,18 +125,21 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
fun
dropAndBounceButton
(
button
:
View
)
{
// 初始位置
button
.
isVisible
=
downloadList
.
isNotEmpty
()
val
startTranslationY
=
button
.
translationY
// 掉落位置
val
dropTranslationY
=
(-
button
.
height
*
3
).
toFloat
()
val
dropTranslationY1
=
(-
button
.
height
*
2
).
toFloat
()
val
dropTranslationY
=
-(
MyApplication
.
context
.
dpToPx
(
60f
)).
toFloat
()
val
dropTranslationY1
=
-(
MyApplication
.
context
.
dpToPx
(
20f
)).
toFloat
()
val
dropTranslationY2
=
-(
MyApplication
.
context
.
dpToPx
(
20f
)).
toFloat
()
// 回弹高度
button
.
isVisible
=
downloadList
.
isNotEmpty
()
val
animator
=
ValueAnimator
.
ofFloat
(
dropTranslationY
,
startTranslationY
,
dropTranslationY1
,
startTranslationY
)
animator
.
interpolator
=
AccelerateDecelerateInterpolator
()
animator
.
duration
=
3
000
animator
.
duration
=
1
000
animator
.
addUpdateListener
{
animation
->
Log
.
d
(
"glc"
,
"animation:"
+
animation
)
// 更新按钮的位置
button
.
translationY
=
animation
.
animatedValue
as
Float
}
...
...
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