diff --git a/app/build.gradle b/app/build.gradle
index 528d5b9..f8ae802 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -19,7 +19,7 @@ android {
minSdk 31
targetSdk 33
versionCode 3
- versionName "2.0_alpha"
+ versionName "2.0_beta"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 14b72aa..9a67d5b 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -31,6 +31,7 @@
android:exported="true">
+
diff --git a/app/src/main/ic_launcher-playstore.png b/app/src/main/ic_launcher-playstore.png
new file mode 100644
index 0000000..b21e961
Binary files /dev/null and b/app/src/main/ic_launcher-playstore.png differ
diff --git a/app/src/main/java/com/maary/liveinpeace/Constants.kt b/app/src/main/java/com/maary/liveinpeace/Constants.kt
index 24f9f6e..1da106c 100644
--- a/app/src/main/java/com/maary/liveinpeace/Constants.kt
+++ b/app/src/main/java/com/maary/liveinpeace/Constants.kt
@@ -12,6 +12,7 @@ class Constants {
const val SHARED_PREF = "com.maary.liveinpeace.pref"
// 图标类型的 SharedPref 项目名称
const val PREF_ICON = "icon_type"
+ const val PREF_NOTIFY_TEXT_SIZE = "notification_text_size"
const val PREF_WATCHING_CONNECTING_TIME = "watching_connecting"
// 设置通知 id
const val ID_NOTIFICATION_SETTINGS = 3
@@ -30,6 +31,9 @@ class Constants {
const val ACTION_NAME_SETTINGS = "com.maary.liveinpeace.receiver.SettingsReceiver"
// 静音广播名称
const val BROADCAST_ACTION_MUTE = "com.maary.liveinpeace.MUTE_MEDIA"
+ // 前台服务状态改变广播
+ const val BROADCAST_ACTION_FOREGROUND = "com.maary.liveinpeace.ACTION_FOREGROUND_SERVICE_STATE"
+ const val BROADCAST_FOREGROUND_INTENT_EXTRA = "isForegroundServiceRunning"
// 当音量操作动作太过频繁后等待时间
const val REQUESTING_WAIT_MILLIS = 500
// 不同通知频道 ID
diff --git a/app/src/main/java/com/maary/liveinpeace/DeviceTimer.kt b/app/src/main/java/com/maary/liveinpeace/DeviceTimer.kt
new file mode 100644
index 0000000..7db978e
--- /dev/null
+++ b/app/src/main/java/com/maary/liveinpeace/DeviceTimer.kt
@@ -0,0 +1,46 @@
+package com.maary.liveinpeace
+
+import android.annotation.SuppressLint
+import android.app.Notification
+import android.content.Context
+import android.os.Handler
+import android.os.Looper
+import android.util.Log
+import androidx.core.app.NotificationCompat
+import androidx.core.app.NotificationManagerCompat
+
+class DeviceTimer(private val context: Context, private val deviceName: String) {
+ private val handler = Handler(Looper.getMainLooper())
+
+ @SuppressLint("MissingPermission")
+ private val runnable = Runnable {
+ with(NotificationManagerCompat.from(context)) {
+ notify(Constants.ID_NOTIFICATION_ALERT, createTimerNotification(context = context, deviceName = deviceName))
+ }
+ }
+
+ fun start() {
+ handler.postDelayed(runnable, Constants.ALERT_TIME)
+ Log.v("MUTE_TIMER", "TIMER_STARTED")
+ }
+
+ fun stop() {
+ handler.removeCallbacks(runnable)
+
+ }
+
+ private fun createTimerNotification(context: Context, deviceName: String) : Notification {
+ return NotificationCompat.Builder(context, Constants.CHANNEL_ID_ALERT)
+ .setContentTitle(context.getString(R.string.alert))
+ .setContentText(String.format(
+ context.resources.getString(R.string.device_connected_too_long),
+ deviceName
+ ))
+ .setSmallIcon(R.drawable.ic_headphone)
+ .setPriority(NotificationCompat.PRIORITY_HIGH)
+ .setAutoCancel(true)
+ .setGroupSummary(false)
+ .setGroup(Constants.ID_NOTIFICATION_GROUP_ALERTS)
+ .build()
+ }
+}
\ No newline at end of file
diff --git a/app/src/main/java/com/maary/liveinpeace/receiver/MuteMediaReceiver.kt b/app/src/main/java/com/maary/liveinpeace/receiver/MuteMediaReceiver.kt
index 48a85f3..91effb2 100644
--- a/app/src/main/java/com/maary/liveinpeace/receiver/MuteMediaReceiver.kt
+++ b/app/src/main/java/com/maary/liveinpeace/receiver/MuteMediaReceiver.kt
@@ -4,18 +4,14 @@ import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
import android.media.AudioManager
-import android.util.Log
import com.maary.liveinpeace.Constants
class MuteMediaReceiver: BroadcastReceiver() {
override fun onReceive(p0: Context?, p1: Intent?) {
if (p1?.action == Constants.BROADCAST_ACTION_MUTE){
- Log.v("MUTE_", "TRIGGERED")
val audioManager = p0?.getSystemService(Context.AUDIO_SERVICE) as AudioManager
-// audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, 0, 0)
do {
audioManager.adjustStreamVolume(AudioManager.STREAM_MUSIC, AudioManager.ADJUST_LOWER, 0)
-// Thread.sleep(FADE_STEP_MILLIS)
} while (audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) > 0)
}
}
diff --git a/app/src/main/java/com/maary/liveinpeace/service/ForegroundService.kt b/app/src/main/java/com/maary/liveinpeace/service/ForegroundService.kt
index 90e23da..8f55f6d 100644
--- a/app/src/main/java/com/maary/liveinpeace/service/ForegroundService.kt
+++ b/app/src/main/java/com/maary/liveinpeace/service/ForegroundService.kt
@@ -9,7 +9,6 @@ import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.graphics.Bitmap
-import android.graphics.BitmapFactory
import android.graphics.Canvas
import android.graphics.Color
import android.graphics.Paint
@@ -17,28 +16,28 @@ import android.graphics.Rect
import android.media.AudioDeviceCallback
import android.media.AudioDeviceInfo
import android.media.AudioManager
-import android.os.Handler
import android.os.IBinder
-import android.os.Looper
import android.util.Log
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationManagerCompat
import androidx.core.graphics.drawable.IconCompat
import com.maary.liveinpeace.Constants.Companion.ACTION_NAME_SETTINGS
import com.maary.liveinpeace.Constants.Companion.ALERT_TIME
+import com.maary.liveinpeace.Constants.Companion.BROADCAST_ACTION_FOREGROUND
import com.maary.liveinpeace.Constants.Companion.BROADCAST_ACTION_MUTE
-import com.maary.liveinpeace.Constants.Companion.CHANNEL_ID_ALERT
+import com.maary.liveinpeace.Constants.Companion.BROADCAST_FOREGROUND_INTENT_EXTRA
import com.maary.liveinpeace.Constants.Companion.CHANNEL_ID_DEFAULT
import com.maary.liveinpeace.Constants.Companion.ID_NOTIFICATION_ALERT
import com.maary.liveinpeace.Constants.Companion.ID_NOTIFICATION_FOREGROUND
-import com.maary.liveinpeace.Constants.Companion.ID_NOTIFICATION_GROUP_ALERTS
import com.maary.liveinpeace.Constants.Companion.ID_NOTIFICATION_GROUP_FORE
import com.maary.liveinpeace.Constants.Companion.MODE_IMG
import com.maary.liveinpeace.Constants.Companion.MODE_NUM
import com.maary.liveinpeace.Constants.Companion.PREF_ICON
+import com.maary.liveinpeace.Constants.Companion.PREF_NOTIFY_TEXT_SIZE
import com.maary.liveinpeace.Constants.Companion.PREF_WATCHING_CONNECTING_TIME
import com.maary.liveinpeace.Constants.Companion.SHARED_PREF
import com.maary.liveinpeace.DeviceMapChangeListener
+import com.maary.liveinpeace.DeviceTimer
import com.maary.liveinpeace.HistoryActivity
import com.maary.liveinpeace.R
import com.maary.liveinpeace.database.Connection
@@ -51,7 +50,6 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.time.LocalDate
-import kotlin.properties.Delegates
class ForegroundService: Service() {
@@ -59,7 +57,6 @@ class ForegroundService: Service() {
private lateinit var connectionDao: ConnectionDao
private val deviceTimerMap: MutableMap = mutableMapOf()
-// private val deviceMap: MutableMap = mutableMapOf()
private val volumeDrawableIds = intArrayOf(
R.drawable.ic_volume_silent,
@@ -69,8 +66,6 @@ class ForegroundService: Service() {
R.drawable.ic_volume_mega
)
- private var iconMode by Delegates.notNull()
-
private lateinit var volumeComment: Array
private lateinit var audioManager: AudioManager
@@ -127,30 +122,14 @@ class ForegroundService: Service() {
private val volumeChangeReceiver = object : VolumeReceiver() {
@SuppressLint("MissingPermission")
override fun updateNotification(context: Context) {
+ Log.v("MUTE_TEST", "VOLUME_CHANGE_RECEIVER")
with(NotificationManagerCompat.from(applicationContext)){
notify(ID_NOTIFICATION_FOREGROUND, createForegroundNotification(applicationContext))
}
}
}
- private fun deGroupNotification(context: Context){
- var isGrouped = false
- val notificationManager: NotificationManager =
- context.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
- val activeNotifications = notificationManager.activeNotifications
- for (notification in activeNotifications) {
- if (notification.isGroup){
- isGrouped = true
- Log.v("MUTE_NOTIFICATION", "VOLUME CHANGER")
- break
- }
- }
- if (isGrouped) {
- notificationManager.cancelAll()
- }
- }
-
- private fun saveDateWhenStop(){
+ private fun saveDataWhenStop(){
val disconnectedTime = System.currentTimeMillis()
for ( (deviceName, connection) in deviceMap){
@@ -289,7 +268,7 @@ class ForegroundService: Service() {
override fun onCreate() {
super.onCreate()
- iconMode = getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE).getInt(PREF_ICON, MODE_IMG)
+ Log.v("MUTE_TEST", "ON_CREATE")
audioManager = getSystemService(Context.AUDIO_SERVICE) as AudioManager
audioManager.registerAudioDeviceCallback(audioDeviceCallback, null)
@@ -302,35 +281,53 @@ class ForegroundService: Service() {
database = ConnectionRoomDatabase.getDatabase(applicationContext)
connectionDao = database.connectionDao()
+ startForeground(ID_NOTIFICATION_FOREGROUND, createForegroundNotification(context = applicationContext))
+ notifyForegroundServiceState(true)
+ Log.v("MUTE_TEST", "ON_CREATE_FINISH")
+ }
+
+ override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
+ super.onStartCommand(intent, flags, startId)
+ Log.v("MUTE_TEST", "ON_START_COMMAND")
+ // 返回 START_STICKY,以确保 Service 在被终止后能够自动重启
+ return START_STICKY
}
override fun onDestroy() {
- saveDateWhenStop()
+ notifyForegroundServiceState(false)
+
+ Log.v("MUTE_TEST", "ON_DESTROY")
+
+ saveDataWhenStop()
// 取消注册音量变化广播接收器
unregisterReceiver(volumeChangeReceiver)
audioManager.unregisterAudioDeviceCallback(audioDeviceCallback)
- isForegroundServiceRunning = false
+ val notificationManager: NotificationManager =
+ getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
+ notificationManager.cancel(ID_NOTIFICATION_FOREGROUND)
+// stopForeground(STOP_FOREGROUND_REMOVE)
+ Log.v("MUTE_TEST", "ON_DESTROY_FINISH")
super.onDestroy()
}
- override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
- startForeground(ID_NOTIFICATION_FOREGROUND, createForegroundNotification(context = applicationContext))
- isForegroundServiceRunning = true
-
- // 返回 START_STICKY,以确保 Service 在被终止后能够自动重启
- return START_STICKY
- }
-
override fun onBind(p0: Intent?): IBinder? {
TODO("Not yet implemented")
}
+ private fun notifyForegroundServiceState(isRunning: Boolean) {
+ isForegroundServiceRunning = isRunning
+ val intent = Intent(BROADCAST_ACTION_FOREGROUND)
+ intent.putExtra(BROADCAST_FOREGROUND_INTENT_EXTRA, isRunning)
+ sendBroadcast(intent)
+ }
+
@SuppressLint("LaunchActivityFromNotification")
fun createForegroundNotification(context: Context): Notification {
val currentVolume = getVolumePercentage(context)
val currentVolumeLevel = getVolumeLevel(currentVolume)
volumeComment = resources.getStringArray(R.array.array_volume_comment)
- val nIcon = generateNotificationIcon(context, iconMode)
+ val nIcon = generateNotificationIcon(context,
+ getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE).getInt(PREF_ICON, MODE_IMG))
val settingsIntent = Intent(this, SettingsReceiver::class.java).apply {
action = ACTION_NAME_SETTINGS
@@ -378,55 +375,61 @@ class ForegroundService: Service() {
.build()
}
+ private val textBounds = Rect()
+
private fun generateNotificationIcon(context: Context, iconMode: Int): IconCompat {
- val currentVolume = getVolumePercentage(context)
+ var currentVolume = getVolumePercentage(context)
val currentVolumeLevel = getVolumeLevel(currentVolume)
- if (iconMode == MODE_NUM){
- var count = currentVolume
- var isCountLow = false
- var isCountHigh = false
- val immutableBackground = BitmapFactory.decodeResource(context.resources,
- R.drawable.ic_notification_background
+ if (iconMode == MODE_NUM) {
+
+ val iconSize =
+ resources.getDimensionPixelSize(android.R.dimen.notification_large_icon_width)
+ val background = Bitmap.createBitmap(iconSize, iconSize, Bitmap.Config.ARGB_8888)
+
+ val sharedPref = getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE)
+ val textSizePref = sharedPref.getFloat(
+ PREF_NOTIFY_TEXT_SIZE, 0.0f
)
- val background = immutableBackground.copy(Bitmap.Config.ARGB_8888, true)
val paint = Paint().apply {
color = Color.WHITE
- textSize = 100f
typeface = context.resources.getFont(R.font.ndot_45)
isFakeBoldText = true
isAntiAlias = true
}
- if (count == 100){
- count = 99
- isCountHigh = true
- }
-
- if (count < 10) {
- count += 10
- isCountLow = true
- }
-
- val textBounds = Rect()
- paint.getTextBounds(count.toString(), 0, count.toString().length, textBounds)
- val textWidth = textBounds.width()
- val textHeight = textBounds.height()
-
val canvas = Canvas(background)
val canvasWidth = canvas.width
val canvasHeight = canvas.height
- val textSize = (canvasWidth / textWidth * textHeight).coerceAtMost(canvasHeight)
- paint.textSize = textSize.toFloat()
- if (isCountLow){
- count-=10
+ if (textSizePref == 0.0f) {
+
+ paint.getTextBounds(99.toString(), 0, 99.toString().length, textBounds)
+ val textWidth = textBounds.width()
+ val textHeight = textBounds.height()
+ val textSize = (canvasWidth / textWidth * textHeight).coerceAtMost(canvasHeight)
+ paint.textSize = textSize.toFloat()
+ with(sharedPref.edit()) {
+ putFloat(PREF_NOTIFY_TEXT_SIZE, textSize.toFloat())
+ }
+ } else {
+ paint.textSize = textSizePref
}
- var textToDraw = count.toString()
- if (isCountHigh) textToDraw = "!!"
- paint.getTextBounds(count.toString(), 0, count.toString().length, textBounds)
- canvas.drawText(textToDraw, (canvasWidth - textBounds.width()) / 2f, (canvasHeight + textBounds.height()) / 2f, paint)
+ var textToDraw = currentVolume.toString()
+ if (currentVolume == 100) {
+ currentVolume--
+ textToDraw = "!!"
+ }
+ paint.getTextBounds(
+ currentVolume.toString(), 0,
+ currentVolume.toString().length, textBounds)
+ canvas.drawText(
+ textToDraw,
+ (canvasWidth - textBounds.width()) / 2f,
+ (canvasHeight + textBounds.height()) / 2f,
+ paint
+ )
return IconCompat.createWithBitmap(background)
}
@@ -434,40 +437,4 @@ class ForegroundService: Service() {
return IconCompat.createWithResource(context, volumeDrawableIds[currentVolumeLevel])
}
}
-
- class DeviceTimer(private val context: Context, private val deviceName: String) {
- private val handler = Handler(Looper.getMainLooper())
-
- @SuppressLint("MissingPermission")
- private val runnable = Runnable {
- with(NotificationManagerCompat.from(context)) {
- notify(ID_NOTIFICATION_ALERT, createTimerNotification(context = context, deviceName = deviceName))
- }
- }
-
- fun start() {
- handler.postDelayed(runnable, ALERT_TIME)
- Log.v("MUTE_TIMER", "TIMER_STARTED")
- }
-
- fun stop() {
- handler.removeCallbacks(runnable)
-
- }
-
- private fun createTimerNotification(context: Context, deviceName: String) : Notification {
- return NotificationCompat.Builder(context, CHANNEL_ID_ALERT)
- .setContentTitle(context.getString(R.string.alert))
- .setContentText(String.format(
- context.resources.getString(R.string.device_connected_too_long),
- deviceName
- ))
- .setSmallIcon(R.drawable.ic_headphone)
- .setPriority(NotificationCompat.PRIORITY_HIGH)
- .setAutoCancel(true)
- .setGroupSummary(false)
- .setGroup(ID_NOTIFICATION_GROUP_ALERTS)
- .build()
- }
- }
}
\ No newline at end of file
diff --git a/app/src/main/java/com/maary/liveinpeace/service/QSTileService.kt b/app/src/main/java/com/maary/liveinpeace/service/QSTileService.kt
index 3f2613a..db3250f 100644
--- a/app/src/main/java/com/maary/liveinpeace/service/QSTileService.kt
+++ b/app/src/main/java/com/maary/liveinpeace/service/QSTileService.kt
@@ -3,8 +3,10 @@ package com.maary.liveinpeace.service
import android.Manifest
import android.app.NotificationChannel
import android.app.NotificationManager
+import android.content.BroadcastReceiver
import android.content.Context
import android.content.Intent
+import android.content.IntentFilter
import android.content.pm.PackageManager
import android.graphics.drawable.Icon
import android.os.Build
@@ -14,6 +16,8 @@ import android.service.quicksettings.TileService
import android.util.Log
import androidx.annotation.RequiresApi
import androidx.core.app.ActivityCompat
+import com.maary.liveinpeace.Constants.Companion.BROADCAST_ACTION_FOREGROUND
+import com.maary.liveinpeace.Constants.Companion.BROADCAST_FOREGROUND_INTENT_EXTRA
import com.maary.liveinpeace.Constants.Companion.CHANNEL_ID_ALERT
import com.maary.liveinpeace.Constants.Companion.CHANNEL_ID_DEFAULT
import com.maary.liveinpeace.Constants.Companion.CHANNEL_ID_SETTINGS
@@ -86,19 +90,39 @@ class QSTileService: TileService() {
override fun onStartListening() {
super.onStartListening()
- val tile = qsTile
+ val intentFilter = IntentFilter()
+ intentFilter.addAction(BROADCAST_ACTION_FOREGROUND)
+ registerReceiver(foregroundServiceReceiver, intentFilter)
+ }
- if (!ForegroundService.isForegroundServiceRunning()){
- tile.state = Tile.STATE_INACTIVE
- tile.icon = Icon.createWithResource(this, R.drawable.icon_qs_off)
- tile.label = getString(R.string.qstile_inactive)
+ override fun onStopListening() {
+ super.onStopListening()
+ unregisterReceiver(foregroundServiceReceiver)
+ }
- }else{
- tile.state = Tile.STATE_ACTIVE
- tile.icon = Icon.createWithResource(this, R.drawable.icon_qs_one)
- tile.label = getString(R.string.qstile_active)
+ private val foregroundServiceReceiver = object : BroadcastReceiver() {
+ override fun onReceive(context: Context, intent: Intent) {
+ Log.v("MUTE_QS", "TRIGGERED")
+
+ val isForegroundServiceRunning = intent.getBooleanExtra(
+ BROADCAST_FOREGROUND_INTENT_EXTRA, false)
+ // 在此处处理前台服务状态的变化
+ val tile = qsTile
+
+ if (!isForegroundServiceRunning){
+ Log.v("MUTE_QS", "NOT RUNNING")
+ tile.state = Tile.STATE_INACTIVE
+ tile.icon = Icon.createWithResource(context, R.drawable.icon_qs_off)
+ tile.label = getString(R.string.qstile_inactive)
+ val foregroundIntent = Intent(context, ForegroundService::class.java)
+ applicationContext.startForegroundService(foregroundIntent)
+ }else{
+ tile.state = Tile.STATE_ACTIVE
+ tile.icon = Icon.createWithResource(context, R.drawable.icon_qs_one)
+ tile.label = getString(R.string.qstile_active)
+ }
+ tile.updateTile()
}
- tile.updateTile()
}
private fun createNotificationChannel(importance:Int, id: String ,name:String, descriptionText: String) {
diff --git a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml b/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
deleted file mode 100644
index 2b068d1..0000000
--- a/app/src/main/res/drawable-v24/ic_launcher_foreground.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_launcher_foreground.xml b/app/src/main/res/drawable/ic_launcher_foreground.xml
new file mode 100644
index 0000000..872e23d
--- /dev/null
+++ b/app/src/main/res/drawable/ic_launcher_foreground.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
index 6f3b755..7353dbd 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
@@ -1,6 +1,5 @@
-
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
index 6f3b755..7353dbd 100644
--- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
+++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
@@ -1,6 +1,5 @@
-
-
-
+
+
\ No newline at end of file
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png
new file mode 100644
index 0000000..9ba1709
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.webp b/app/src/main/res/mipmap-hdpi/ic_launcher.webp
deleted file mode 100644
index c209e78..0000000
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.png b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png
new file mode 100644
index 0000000..41f29c4
Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp
deleted file mode 100644
index b2dfe3d..0000000
Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png
new file mode 100644
index 0000000..1393d76
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.webp b/app/src/main/res/mipmap-mdpi/ic_launcher.webp
deleted file mode 100644
index 4f0f1d6..0000000
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.png b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png
new file mode 100644
index 0000000..05f6e0e
Binary files /dev/null and b/app/src/main/res/mipmap-mdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp
deleted file mode 100644
index 62b611d..0000000
Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..ced82a8
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher.webp
deleted file mode 100644
index 948a307..0000000
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..9e58f7d
Binary files /dev/null and b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp
deleted file mode 100644
index 1b9a695..0000000
Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..1a0d9a6
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp
deleted file mode 100644
index 28d4b77..0000000
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..c968c23
Binary files /dev/null and b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp
deleted file mode 100644
index 9287f50..0000000
Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
new file mode 100644
index 0000000..f93288a
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp
deleted file mode 100644
index aa7d642..0000000
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.webp and /dev/null differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
new file mode 100644
index 0000000..7be85b6
Binary files /dev/null and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png differ
diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp b/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp
deleted file mode 100644
index 9126ae3..0000000
Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.webp and /dev/null differ
diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml
index 64b38ca..01dcfe9 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -30,7 +30,7 @@
汇总
设备图标
%02d 分钟
- %02d 小时 %02d 分钟
+ %1$d 小时 %2$d 分钟
启用提醒
禁用提醒
当前连接
diff --git a/app/src/main/res/values/ic_launcher_background.xml b/app/src/main/res/values/ic_launcher_background.xml
new file mode 100644
index 0000000..2cde810
--- /dev/null
+++ b/app/src/main/res/values/ic_launcher_background.xml
@@ -0,0 +1,4 @@
+
+
+ @color/material_dynamic_tertiary70
+
\ No newline at end of file
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 63255ee..e20485c 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -22,11 +22,11 @@
Summary
Device icon
%02d min
- %02d h %02d min
+ %1$d h %2$d min
Enable alert
Disable alert
Current Connections
- Connections Histroy
+ Connections History
Already connected
Device connection state indicator
diff --git a/build.gradle b/build.gradle
index 2164afb..115194f 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,6 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
- id 'com.android.application' version '8.0.0' apply false
- id 'com.android.library' version '8.0.0' apply false
+ id 'com.android.application' version '8.0.2' apply false
+ id 'com.android.library' version '8.0.2' apply false
id 'org.jetbrains.kotlin.android' version '1.9.0-Beta' apply false
}
\ No newline at end of file