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
97dbe37b
Commit
97dbe37b
authored
Sep 05, 2024
by
wanglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
...
parent
eea87918
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
73 additions
and
49 deletions
+73
-49
MyApplication.kt
app/src/main/java/com/base/browserwhite/MyApplication.kt
+0
-3
NotificationPushUtil.kt
...in/java/com/base/browserwhite/fcm/NotificationPushUtil.kt
+2
-3
BookmarkActivity.kt
...ase/browserwhite/ui/activity/bookmark/BookmarkActivity.kt
+3
-0
Splash2Activity.kt
...m/base/browserwhite/ui/activity/splash/Splash2Activity.kt
+0
-1
WebBrowserActivity.kt
...browserwhite/ui/activity/webbrowser/WebBrowserActivity.kt
+12
-1
DialogViews.kt
...c/main/java/com/base/browserwhite/ui/views/DialogViews.kt
+15
-2
dialog_more_webbrowser.xml
app/src/main/res/layout/dialog_more_webbrowser.xml
+41
-39
No files found.
app/src/main/java/com/base/browserwhite/MyApplication.kt
View file @
97dbe37b
...
@@ -6,7 +6,6 @@ import android.content.Intent
...
@@ -6,7 +6,6 @@ import android.content.Intent
import
android.os.Bundle
import
android.os.Bundle
import
android.text.TextUtils
import
android.text.TextUtils
import
com.base.browserwhite.fcm.FCMManager
import
com.base.browserwhite.fcm.FCMManager
import
com.base.browserwhite.fcm.NotificationPushUtil.sendNotificationWhere
import
com.base.browserwhite.fcm.PackageBroadcastReceiver
import
com.base.browserwhite.fcm.PackageBroadcastReceiver
import
com.base.browserwhite.fcm.PackageBroadcastReceiver.Companion.registerPackageBroadcastReceiver
import
com.base.browserwhite.fcm.PackageBroadcastReceiver.Companion.registerPackageBroadcastReceiver
import
com.base.browserwhite.fcm.ScreenStatusReceiver
import
com.base.browserwhite.fcm.ScreenStatusReceiver
...
@@ -55,8 +54,6 @@ class MyApplication : Application() {
...
@@ -55,8 +54,6 @@ class MyApplication : Application() {
}
}
}
}
private
var
packageBroadcastReceiver
:
PackageBroadcastReceiver
?
=
null
fun
initApp
()
{
fun
initApp
()
{
FacebookSdk
.
sdkInitialize
(
applicationContext
)
FacebookSdk
.
sdkInitialize
(
applicationContext
)
val
topic
=
ConfigHelper
.
packageName
+
"_push"
val
topic
=
ConfigHelper
.
packageName
+
"_push"
...
...
app/src/main/java/com/base/browserwhite/fcm/NotificationPushUtil.kt
View file @
97dbe37b
...
@@ -3,7 +3,6 @@ package com.base.browserwhite.fcm
...
@@ -3,7 +3,6 @@ package com.base.browserwhite.fcm
import
android.content.Context
import
android.content.Context
import
android.os.Handler
import
android.os.Handler
import
android.os.HandlerThread
import
android.os.HandlerThread
import
android.util.Log
import
com.base.browserwhite.MyApplication
import
com.base.browserwhite.MyApplication
import
com.base.browserwhite.bean.ConstObject
import
com.base.browserwhite.bean.ConstObject
import
com.base.browserwhite.bean.ConstObject.ID_APP_PROCESS
import
com.base.browserwhite.bean.ConstObject.ID_APP_PROCESS
...
@@ -132,7 +131,7 @@ object NotificationPushUtil {
...
@@ -132,7 +131,7 @@ object NotificationPushUtil {
val
lastUseJunkTime
=
AppPreferences
.
getInstance
().
getLong
(
"last_use_junk_clean"
,
0
)
val
lastUseJunkTime
=
AppPreferences
.
getInstance
().
getLong
(
"last_use_junk_clean"
,
0
)
val
flag2
=
lastUseJunkTime
==
0L
||
System
.
currentTimeMillis
()
-
lastUseJunkTime
>
24
*
60
*
60
*
1000
val
flag2
=
lastUseJunkTime
==
0L
||
System
.
currentTimeMillis
()
-
lastUseJunkTime
>
24
*
60
*
60
*
1000
return
flag1
||
flag2
return
flag1
&&
flag2
}
else
{
}
else
{
return
false
return
false
}
}
...
@@ -157,7 +156,7 @@ object NotificationPushUtil {
...
@@ -157,7 +156,7 @@ object NotificationPushUtil {
val
flag1
=
lastPushTime
==
0L
||
System
.
currentTimeMillis
()
-
lastPushTime
>
24
*
60
*
60
*
1000
val
flag1
=
lastPushTime
==
0L
||
System
.
currentTimeMillis
()
-
lastPushTime
>
24
*
60
*
60
*
1000
val
lastUseTime
=
AppPreferences
.
getInstance
().
getLong
(
"last_process_use_time"
,
0
)
val
lastUseTime
=
AppPreferences
.
getInstance
().
getLong
(
"last_process_use_time"
,
0
)
val
flag2
=
lastUseTime
==
0L
||
System
.
currentTimeMillis
()
-
lastUseTime
>
24
*
60
*
60
*
1000
val
flag2
=
lastUseTime
==
0L
&&
System
.
currentTimeMillis
()
-
lastUseTime
>
24
*
60
*
60
*
1000
return
flag1
||
flag2
return
flag1
||
flag2
}
else
{
}
else
{
return
false
return
false
...
...
app/src/main/java/com/base/browserwhite/ui/activity/bookmark/BookmarkActivity.kt
View file @
97dbe37b
...
@@ -71,6 +71,9 @@ class BookmarkActivity : BaseActivity<ActivityBookmarkBinding>() {
...
@@ -71,6 +71,9 @@ class BookmarkActivity : BaseActivity<ActivityBookmarkBinding>() {
}
}
}
}
})
})
val
page
=
intent
.
extras
?.
getInt
(
"page"
,
0
)
?:
0
binding
.
viewPager2
.
currentItem
=
page
}
}
override
fun
initListener
()
{
override
fun
initListener
()
{
...
...
app/src/main/java/com/base/browserwhite/ui/activity/splash/Splash2Activity.kt
View file @
97dbe37b
...
@@ -69,7 +69,6 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
...
@@ -69,7 +69,6 @@ class Splash2Activity : BaseActivity<ActivitySplash2Binding>(),
}
}
NotificationPushUtil
.
stopNotificationHandler
()
NotificationPushUtil
.
stopNotificationHandler
()
NotificationPushUtil
.
stopNotificationHandlerNews
()
jumpType
=
intent
.
getIntExtra
(
"actionId"
,
0
)
jumpType
=
intent
.
getIntExtra
(
"actionId"
,
0
)
closeNotification
()
closeNotification
()
mTaskManager
=
TaskManager
(
binding
,
this
)
mTaskManager
=
TaskManager
(
binding
,
this
)
...
...
app/src/main/java/com/base/browserwhite/ui/activity/webbrowser/WebBrowserActivity.kt
View file @
97dbe37b
...
@@ -271,7 +271,18 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
...
@@ -271,7 +271,18 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
}
}
}
}
})
},
refreshAction
=
{
currentFragment
?.
reloadWebView
()
},
historyAction
=
{
startActivity
(
Intent
(
this
,
BookmarkActivity
::
class
.
java
).
apply
{
putExtra
(
"page"
,
1
)
})
finish
()
}
)
}
}
binding
.
ivShare
.
setOnClickListener
{
binding
.
ivShare
.
setOnClickListener
{
...
...
app/src/main/java/com/base/browserwhite/ui/views/DialogViews.kt
View file @
97dbe37b
...
@@ -333,10 +333,11 @@ object DialogViews {
...
@@ -333,10 +333,11 @@ object DialogViews {
fun
Context
.
showWebBrowserMoreDialog
(
fun
Context
.
showWebBrowserMoreDialog
(
bookmarkAdded
:
Boolean
=
false
,
bookmarkAdded
:
Boolean
=
false
,
bookmarkAction
:
(()
->
Unit
)?
=
null
,
//打开书签
bookmarkAction
:
(()
->
Unit
)?
=
null
,
//打开书签
joinAction
:
(()
->
Unit
)?
=
null
//加入书签
joinAction
:
(()
->
Unit
)?
=
null
,
//加入书签
refreshAction
:
(()
->
Unit
)?
=
null
,
//刷新
historyAction
:
(()
->
Unit
)?
=
null
,
//历史记录
)
{
)
{
val
dialog
=
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
)
val
dialog
=
BottomSheetDialog
(
this
,
R
.
style
.
BottomSheetDialog
)
val
binding
=
DialogMoreWebbrowserBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
val
binding
=
DialogMoreWebbrowserBinding
.
inflate
(
LayoutInflater
.
from
(
this
))
dialog
.
setContentView
(
binding
.
root
)
dialog
.
setContentView
(
binding
.
root
)
...
@@ -369,6 +370,18 @@ object DialogViews {
...
@@ -369,6 +370,18 @@ object DialogViews {
joinAction
?.
invoke
()
joinAction
?.
invoke
()
}
}
}
}
arrayOf
(
binding
.
ivRefresh
,
binding
.
tvRefresh
).
forEach
{
it
.
setOnClickListener
{
dialog
.
dismiss
()
refreshAction
?.
invoke
()
}
}
arrayOf
(
binding
.
ivHistory
,
binding
.
tvHistory
).
forEach
{
it
.
setOnClickListener
{
dialog
.
dismiss
()
historyAction
?.
invoke
()
}
}
}
}
...
...
app/src/main/res/layout/dialog_more_webbrowser.xml
View file @
97dbe37b
...
@@ -32,40 +32,6 @@
...
@@ -32,40 +32,6 @@
app:layout_constraintTop_toTopOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<ImageView
android:id=
"@+id/iv_history"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/history_browser"
app:layout_constraintEnd_toStartOf=
"@id/iv_refresh"
app:layout_constraintStart_toEndOf=
"@id/iv_bookmark"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<ImageView
android:id=
"@+id/iv_refresh"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/refresh_browser"
app:layout_constraintEnd_toStartOf=
"@id/iv_join_bookmark"
app:layout_constraintStart_toEndOf=
"@id/iv_history"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<ImageView
android:id=
"@+id/iv_join_bookmark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/join_browser"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_refresh"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:id=
"@+id/tv_bookmark"
android:id=
"@+id/tv_bookmark"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -80,6 +46,18 @@
...
@@ -80,6 +46,18 @@
app:layout_constraintTop_toBottomOf=
"@id/iv_bookmark"
app:layout_constraintTop_toBottomOf=
"@id/iv_bookmark"
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_history"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/history_browser"
app:layout_constraintEnd_toStartOf=
"@id/iv_refresh"
app:layout_constraintStart_toEndOf=
"@id/iv_bookmark"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:id=
"@+id/tv_history"
android:id=
"@+id/tv_history"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -94,6 +72,18 @@
...
@@ -94,6 +72,18 @@
app:layout_constraintTop_toBottomOf=
"@id/iv_history"
app:layout_constraintTop_toBottomOf=
"@id/iv_history"
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_refresh"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/refresh_browser"
app:layout_constraintEnd_toStartOf=
"@id/iv_join_bookmark"
app:layout_constraintStart_toEndOf=
"@id/iv_history"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:id=
"@+id/tv_refresh"
android:id=
"@+id/tv_refresh"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -109,6 +99,18 @@
...
@@ -109,6 +99,18 @@
tools:ignore=
"HardcodedText"
/>
tools:ignore=
"HardcodedText"
/>
<ImageView
android:id=
"@+id/iv_join_bookmark"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center_horizontal"
android:src=
"@mipmap/join_browser"
app:layout_constraintEnd_toEndOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_refresh"
app:layout_constraintTop_toTopOf=
"parent"
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:id=
"@+id/tv_join_bookmark"
android:id=
"@+id/tv_join_bookmark"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
...
@@ -149,12 +151,12 @@
...
@@ -149,12 +151,12 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:textColor=
"@color/black"
android:id=
"@+id/tv_traceless"
android:id=
"@+id/tv_traceless"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:text=
"Traceless"
android:text=
"Traceless"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_traceless"
app:layout_constraintStart_toEndOf=
"@id/iv_traceless"
...
@@ -206,12 +208,12 @@
...
@@ -206,12 +208,12 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:textColor=
"@color/black"
android:id=
"@+id/tv_download"
android:id=
"@+id/tv_download"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:text=
"Download"
android:text=
"Download"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_download"
app:layout_constraintStart_toEndOf=
"@id/iv_download"
...
@@ -247,12 +249,12 @@
...
@@ -247,12 +249,12 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:textColor=
"@color/black"
android:id=
"@+id/tv_settings"
android:id=
"@+id/tv_settings"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:text=
"Settings"
android:text=
"Settings"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_settings"
app:layout_constraintStart_toEndOf=
"@id/iv_settings"
...
@@ -288,12 +290,12 @@
...
@@ -288,12 +290,12 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:textColor=
"@color/black"
android:id=
"@+id/tv_inside_search"
android:id=
"@+id/tv_inside_search"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:text=
"Inside page search"
android:text=
"Inside page search"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_inside_search"
app:layout_constraintStart_toEndOf=
"@id/iv_inside_search"
...
@@ -329,12 +331,12 @@
...
@@ -329,12 +331,12 @@
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
<TextView
<TextView
android:textColor=
"@color/black"
android:id=
"@+id/tv_off"
android:id=
"@+id/tv_off"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginStart=
"12dp"
android:layout_marginStart=
"12dp"
android:text=
"Off"
android:text=
"Off"
android:textColor=
"@color/black"
android:textSize=
"16sp"
android:textSize=
"16sp"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/iv_off"
app:layout_constraintStart_toEndOf=
"@id/iv_off"
...
...
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