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
33208aac
Commit
33208aac
authored
Sep 06, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
75e0cf8d
9fd2497f
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
15 deletions
+24
-15
WebViewFragment.kt
...se/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
+1
-1
FileFragment.kt
...in/java/com/base/browserwhite/ui/fragment/FileFragment.kt
+23
-14
No files found.
app/src/main/java/com/base/browserwhite/ui/activity/webbrowser/WebViewFragment.kt
View file @
33208aac
...
...
@@ -139,7 +139,6 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
animator
.
interpolator
=
AccelerateDecelerateInterpolator
()
animator
.
duration
=
1000
animator
.
addUpdateListener
{
animation
->
Log
.
d
(
"glc"
,
"animation:"
+
animation
)
// 更新按钮的位置
button
.
translationY
=
animation
.
animatedValue
as
Float
}
...
...
@@ -197,6 +196,7 @@ class WebViewFragment : BaseFragment<FragmentWebViewBinding>() {
//网页使用localStorage等Web存储API,需要启用DOM存储
webSettings
.
domStorageEnabled
=
true
webSettings
.
setUseWideViewPort
(
false
);
//设置WebChromeClient
...
...
app/src/main/java/com/base/browserwhite/ui/fragment/FileFragment.kt
View file @
33208aac
...
...
@@ -274,7 +274,14 @@ class FileFragment : BaseFragment<FragmentFileBinding>() {
}
private
fun
initMediaData
()
=
Thread
{
private
fun
initMediaData
()
{
// 确保 Fragment 已经附加到 Activity
if
(!
isAdded
)
{
return
}
// 在新的线程中加载媒体文件列表
Thread
{
val
list
=
requireContext
().
getMediaFile
().
filter
{
val
file
=
File
(
it
.
path
)
if
(
BuildConfig
.
DEBUG
)
{
...
...
@@ -283,13 +290,15 @@ class FileFragment : BaseFragment<FragmentFileBinding>() {
System
.
currentTimeMillis
()
-
file
.
lastModified
()
<=
15L
*
24
*
60
*
60
*
1000
}
}
binding
.
root
.
post
{
// 回到主线程更新 UI
activity
?.
runOnUiThread
{
if
(
list
.
isEmpty
())
{
binding
.
tvTitleRecent
.
visibility
=
View
.
GONE
}
adapter
.
setData
(
list
)
}
}.
start
()
}
}
\ No newline at end of file
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