Commit e188e64a authored by wanglei's avatar wanglei

...

parent bde02d1b
...@@ -280,7 +280,7 @@ ...@@ -280,7 +280,7 @@
<action android:name="com.google.firebase.MESSAGING_EVENT" /> <action android:name="com.google.firebase.MESSAGING_EVENT" />
<action android:name="com.google.android.c2dm.intent.RECEIVE" /> <action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.test.easy.cleanerjunk" /> <category android:name="com.kk.cleanmaster.file.cleanmaster.master" />
</intent-filter> </intent-filter>
</receiver> </receiver>
......
...@@ -9,6 +9,8 @@ import androidx.annotation.NonNull; ...@@ -9,6 +9,8 @@ import androidx.annotation.NonNull;
import com.base.browserwhite.MyApplication; import com.base.browserwhite.MyApplication;
import com.base.browserwhite.help.EventUtils; import com.base.browserwhite.help.EventUtils;
import com.base.browserwhite.utils.AppPreferences; import com.base.browserwhite.utils.AppPreferences;
import com.base.browserwhite.utils.LogEx;
import com.base.browserwhite.utils.ToastUtils;
import com.google.firebase.messaging.FirebaseMessagingService; import com.google.firebase.messaging.FirebaseMessagingService;
import com.google.firebase.messaging.RemoteMessage; import com.google.firebase.messaging.RemoteMessage;
...@@ -22,6 +24,7 @@ public class MessagingService extends FirebaseMessagingService { ...@@ -22,6 +24,7 @@ public class MessagingService extends FirebaseMessagingService {
@Override @Override
public void onMessageReceived(@NonNull RemoteMessage remoteMessage) { public void onMessageReceived(@NonNull RemoteMessage remoteMessage) {
super.onMessageReceived(remoteMessage); super.onMessageReceived(remoteMessage);
LogEx.INSTANCE.logDebug(TAG, "onMessageReceived", false);
EventUtils.INSTANCE.event("FCM_Received", null, null, false); EventUtils.INSTANCE.event("FCM_Received", null, null, false);
sendLocalNotification(); sendLocalNotification();
} }
......
package com.base.browserwhite.fcm;
import static com.base.browserwhite.fcm.NotificationPushUtil.PUSH_WHERE_TIMBER;
import android.util.Log;
import com.base.browserwhite.MyApplication;
import java.util.Timer;
import java.util.TimerTask;
public class StayServiceTimerManager {
private static StayServiceTimerManager instance;
private Timer taskTimer;
private boolean isTimerActive;
private StayServiceTimerManager() {
// 私有构造方法
}
public static synchronized StayServiceTimerManager getInstance() {
if (instance == null) {
instance = new StayServiceTimerManager();
}
return instance;
}
public void scheduleTask(long delay, long period) {
synchronized (StayServiceTimerManager.class) {
ensureTimerIsStopped(); // 确保定时器未运行
taskTimer = new Timer(); // 创建新的 Timer 实例
TimerTask task = new TimerTask() {
@Override
public void run() {
Log.d("glc", "Scheduled task is running");
// 确保设备处于交互状态,未锁定,且应用未暂停
if (ScreenStatusReceiver.isDeviceInteractive() && !ScreenStatusReceiver.isSecureLockActive() &&
MyApplication.PAUSED_VALUE != 1) {
Log.d("glc", "Scheduled task conditions are met");
NotificationPushUtil.INSTANCE.sendNotificationWhere(MyApplication.context, null, PUSH_WHERE_TIMBER);
}
}
};
taskTimer.schedule(task, delay, period); // 调度任务
isTimerActive = true; // 设置定时器状态为活跃
}
}
private void ensureTimerIsStopped() {
if (isTimerActive) {
if (taskTimer != null) {
taskTimer.cancel();
taskTimer.purge(); // 清除所有取消的任务
}
isTimerActive = false; // 重置定时器状态
}
}
public void stopTaskTimer() {
synchronized (StayServiceTimerManager.class) {
ensureTimerIsStopped(); // 停止定时器
}
}
public boolean isTaskTimerActive() {
return isTimerActive;
}
}
\ No newline at end of file
...@@ -17,8 +17,10 @@ import androidx.core.app.NotificationCompat ...@@ -17,8 +17,10 @@ import androidx.core.app.NotificationCompat
import androidx.core.graphics.drawable.IconCompat import androidx.core.graphics.drawable.IconCompat
import com.base.browserwhite.R import com.base.browserwhite.R
import com.base.browserwhite.bean.ConstObject import com.base.browserwhite.bean.ConstObject
import com.base.browserwhite.ui.activity.MainActivity import com.base.browserwhite.fcm.RecoveryTimerManager
import com.base.browserwhite.fcm.StayServiceTimerManager
import com.base.browserwhite.help.EventUtils import com.base.browserwhite.help.EventUtils
import com.base.browserwhite.ui.activity.MainActivity
import com.base.browserwhite.ui.activity.splash.Splash2Activity import com.base.browserwhite.ui.activity.splash.Splash2Activity
import kotlin.random.Random import kotlin.random.Random
...@@ -45,6 +47,7 @@ class StayNotificationService : Service() { ...@@ -45,6 +47,7 @@ class StayNotificationService : Service() {
} else { } else {
startService(intent) startService(intent)
} }
StayServiceTimerManager.getInstance().scheduleTask(60000L, 60000L)
} }
fun Context.restartStartStayNotification() { fun Context.restartStartStayNotification() {
......
...@@ -410,6 +410,7 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() { ...@@ -410,6 +410,7 @@ class WebBrowserActivity : BaseActivity<ActivityWebBrowserBinding>() {
} }
} }
} }
fun closeIm() { fun closeIm() {
val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager val imm = getSystemService(INPUT_METHOD_SERVICE) as InputMethodManager
if (imm != null && currentFocus != null) { if (imm != null && currentFocus != null) {
......
...@@ -27,6 +27,7 @@ import com.base.browserwhite.databinding.DialogCleanerReocordBinding ...@@ -27,6 +27,7 @@ import com.base.browserwhite.databinding.DialogCleanerReocordBinding
import com.base.browserwhite.databinding.DialogDefaultBrowserBinding import com.base.browserwhite.databinding.DialogDefaultBrowserBinding
import com.base.browserwhite.databinding.DialogDeleteTipBinding import com.base.browserwhite.databinding.DialogDeleteTipBinding
import com.base.browserwhite.databinding.DialogDownloadDisclaimerBinding import com.base.browserwhite.databinding.DialogDownloadDisclaimerBinding
import com.base.browserwhite.databinding.DialogImproveStabilityBinding
import com.base.browserwhite.databinding.DialogMediaMoreBinding import com.base.browserwhite.databinding.DialogMediaMoreBinding
import com.base.browserwhite.databinding.DialogMoreWebbrowserBinding import com.base.browserwhite.databinding.DialogMoreWebbrowserBinding
import com.base.browserwhite.databinding.DialogMyAccountBinding import com.base.browserwhite.databinding.DialogMyAccountBinding
...@@ -36,6 +37,7 @@ import com.base.browserwhite.help.RxBus ...@@ -36,6 +37,7 @@ import com.base.browserwhite.help.RxBus
import com.base.browserwhite.ui.activity.about.AboutActivity import com.base.browserwhite.ui.activity.about.AboutActivity
import com.base.browserwhite.ui.activity.feedback.FeedbackActivity import com.base.browserwhite.ui.activity.feedback.FeedbackActivity
import com.base.browserwhite.ui.views.DialogViews.showAddRootBookmarkDialog import com.base.browserwhite.ui.views.DialogViews.showAddRootBookmarkDialog
import com.base.browserwhite.ui.views.DialogViews.showDownloadDisclaimer
import com.base.browserwhite.utils.ActivityLauncher import com.base.browserwhite.utils.ActivityLauncher
import com.base.browserwhite.utils.AppPreferences import com.base.browserwhite.utils.AppPreferences
import com.base.browserwhite.utils.RoleManagerUtils.isDefaultBrowser import com.base.browserwhite.utils.RoleManagerUtils.isDefaultBrowser
...@@ -466,5 +468,19 @@ object DialogViews { ...@@ -466,5 +468,19 @@ object DialogViews {
} }
fun Context.showImproveStabilityDialog() {
val dialog = BottomSheetDialog(this, R.style.BottomSheetDialog)
val binding = DialogImproveStabilityBinding.inflate(LayoutInflater.from(this))
dialog.setContentView(binding.root)
dialog.setCanceledOnTouchOutside(false)
dialog.show()
val parentView = binding.root.parent as View
val behavior = BottomSheetBehavior.from(parentView)
//展开
behavior.state = BottomSheetBehavior.STATE_EXPANDED
}
} }
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#ADBADD" />
<corners android:radius="3dp" />
</shape>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
</shape>
\ No newline at end of file
...@@ -68,7 +68,7 @@ ...@@ -68,7 +68,7 @@
android:paddingHorizontal="5dp" android:paddingHorizontal="5dp"
android:selectAllOnFocus="true" android:selectAllOnFocus="true"
android:singleLine="true" android:singleLine="true"
android:textColorHint="#858587" android:textColor="@color/black"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintEnd_toStartOf="@id/fl_search" app:layout_constraintEnd_toStartOf="@id/fl_search"
app:layout_constraintStart_toEndOf="@id/fl_search_engine" app:layout_constraintStart_toEndOf="@id/fl_search_engine"
......
...@@ -86,7 +86,7 @@ ...@@ -86,7 +86,7 @@
android:hint="Search or enter website address" android:hint="Search or enter website address"
android:paddingHorizontal="5dp" android:paddingHorizontal="5dp"
android:singleLine="true" android:singleLine="true"
android:textColor="#858587" android:textColor="@color/black"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintEnd_toStartOf="@id/fl_refresh" app:layout_constraintEnd_toStartOf="@id/fl_refresh"
app:layout_constraintStart_toEndOf="@id/fl_search_engine" app:layout_constraintStart_toEndOf="@id/fl_search_engine"
......
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<FrameLayout
android:layout_width="match_parent"
android:layout_height="286dp"
android:background="@mipmap/tanchuangbg"
app:cardElevation="0dp">
<View
android:layout_width="80dp"
android:layout_height="6dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="12dp"
android:background="@drawable/bg_adbadd_3" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="96dp"
android:src="@mipmap/huojian" />
</FrameLayout>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="20dp"
android:text="Improve Stability"
android:textColor="@color/black"
android:textSize="21sp"
android:textStyle="bold"
tools:ignore="HardcodedText" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="13dp"
android:text="Allow apps to run in the background for better stability"
android:textColor="#505156"
android:textSize="13sp"
tools:ignore="HardcodedText" />
<TextView
android:id="@+id/tv_btn"
android:layout_width="338dp"
android:layout_height="50dp"
android:layout_gravity="center_horizontal"
android:layout_marginTop="15dp"
android:layout_marginBottom="36dp"
android:background="@drawable/bg_0571ed_25"
android:gravity="center"
android:text="Enable now"
android:textColor="@color/white"
android:textSize="18sp"
tools:ignore="HardcodedText" />
</LinearLayout>
\ No newline at end of file
...@@ -143,7 +143,7 @@ ...@@ -143,7 +143,7 @@
android:inputType="textUri" android:inputType="textUri"
android:paddingHorizontal="5dp" android:paddingHorizontal="5dp"
android:singleLine="true" android:singleLine="true"
android:textColorHint="#858587" android:textColorHint="@color/black"
android:textSize="14sp" android:textSize="14sp"
app:layout_constraintEnd_toStartOf="@id/fl_scan" app:layout_constraintEnd_toStartOf="@id/fl_scan"
app:layout_constraintStart_toEndOf="@id/fl_search_engine" app:layout_constraintStart_toEndOf="@id/fl_search_engine"
......
...@@ -17,6 +17,15 @@ ...@@ -17,6 +17,15 @@
<!-- <item name="android:backgroundDimEnabled">false</item>--> <!-- <item name="android:backgroundDimEnabled">false</item>-->
</style> </style>
<style name="BottomSheetDialog_tlf15" parent="Theme.Design.Light.BottomSheetDialog">
<item name="bottomSheetStyle">@style/bottomSheetStyleWrapper</item>
<!--去掉背景阴影-->
<!-- <item name="android:backgroundDimEnabled">false</item>-->
</style>
<style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal"> <style name="bottomSheetStyleWrapper" parent="Widget.Design.BottomSheet.Modal">
<item name="android:background">@android:color/transparent</item> <item name="android:background">@android:color/transparent</item>
</style> </style>
......
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