Commit 97dbe37b authored by wanglei's avatar wanglei

...

parent eea87918
...@@ -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"
......
...@@ -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
......
...@@ -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() {
......
...@@ -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)
......
...@@ -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 {
......
...@@ -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()
}
}
} }
......
...@@ -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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment