Let kotlinter format the code
This commit is contained in:
@@ -3,10 +3,19 @@ package com.github.gotify
|
|||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
import android.graphics.Typeface
|
import android.graphics.Typeface
|
||||||
import android.text.style.*
|
import android.text.style.BackgroundColorSpan
|
||||||
|
import android.text.style.BulletSpan
|
||||||
|
import android.text.style.QuoteSpan
|
||||||
|
import android.text.style.RelativeSizeSpan
|
||||||
|
import android.text.style.StyleSpan
|
||||||
|
import android.text.style.TypefaceSpan
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
import io.noties.markwon.*
|
import io.noties.markwon.AbstractMarkwonPlugin
|
||||||
|
import io.noties.markwon.Markwon
|
||||||
|
import io.noties.markwon.MarkwonSpansFactory
|
||||||
|
import io.noties.markwon.MarkwonVisitor
|
||||||
|
import io.noties.markwon.RenderProps
|
||||||
import io.noties.markwon.core.CorePlugin
|
import io.noties.markwon.core.CorePlugin
|
||||||
import io.noties.markwon.core.CoreProps
|
import io.noties.markwon.core.CoreProps
|
||||||
import io.noties.markwon.core.MarkwonTheme
|
import io.noties.markwon.core.MarkwonTheme
|
||||||
@@ -17,7 +26,13 @@ import io.noties.markwon.image.picasso.PicassoImagesPlugin
|
|||||||
import io.noties.markwon.movement.MovementMethodPlugin
|
import io.noties.markwon.movement.MovementMethodPlugin
|
||||||
import org.commonmark.ext.gfm.tables.TableCell
|
import org.commonmark.ext.gfm.tables.TableCell
|
||||||
import org.commonmark.ext.gfm.tables.TablesExtension
|
import org.commonmark.ext.gfm.tables.TablesExtension
|
||||||
import org.commonmark.node.*
|
import org.commonmark.node.BlockQuote
|
||||||
|
import org.commonmark.node.Code
|
||||||
|
import org.commonmark.node.Emphasis
|
||||||
|
import org.commonmark.node.Heading
|
||||||
|
import org.commonmark.node.Link
|
||||||
|
import org.commonmark.node.ListItem
|
||||||
|
import org.commonmark.node.StrongEmphasis
|
||||||
import org.commonmark.parser.Parser
|
import org.commonmark.parser.Parser
|
||||||
|
|
||||||
internal object MarkwonFactory {
|
internal object MarkwonFactory {
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ internal class MissedMessageUtil(private val api: MessageApi) {
|
|||||||
result.addAll(filtered)
|
result.addAll(filtered)
|
||||||
if (messages.size != filtered.size ||
|
if (messages.size != filtered.size ||
|
||||||
messages.size == 0 ||
|
messages.size == 0 ||
|
||||||
pagedMessages.paging.next == null) {
|
pagedMessages.paging.next == null
|
||||||
|
) {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
since = pagedMessages.paging.since
|
since = pagedMessages.paging.since
|
||||||
|
|||||||
@@ -15,6 +15,12 @@ import com.google.android.material.snackbar.Snackbar
|
|||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
import com.squareup.picasso.Picasso.LoadedFrom
|
import com.squareup.picasso.Picasso.LoadedFrom
|
||||||
import com.squareup.picasso.Target
|
import com.squareup.picasso.Target
|
||||||
|
import kotlinx.coroutines.CoroutineDispatcher
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
import kotlinx.coroutines.launch
|
||||||
|
import okio.Buffer
|
||||||
|
import org.threeten.bp.OffsetDateTime
|
||||||
import java.io.BufferedReader
|
import java.io.BufferedReader
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.io.InputStream
|
import java.io.InputStream
|
||||||
@@ -23,12 +29,6 @@ import java.net.MalformedURLException
|
|||||||
import java.net.URI
|
import java.net.URI
|
||||||
import java.net.URISyntaxException
|
import java.net.URISyntaxException
|
||||||
import java.net.URL
|
import java.net.URL
|
||||||
import kotlinx.coroutines.CoroutineDispatcher
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
|
||||||
import kotlinx.coroutines.launch
|
|
||||||
import okio.Buffer
|
|
||||||
import org.threeten.bp.OffsetDateTime
|
|
||||||
|
|
||||||
internal object Utils {
|
internal object Utils {
|
||||||
val JSON: Gson = JSON().gson
|
val JSON: Gson = JSON().gson
|
||||||
@@ -52,17 +52,21 @@ internal object Utils {
|
|||||||
fun resolveAbsoluteUrl(baseURL: String, target: String?): String? {
|
fun resolveAbsoluteUrl(baseURL: String, target: String?): String? {
|
||||||
return if (target == null) {
|
return if (target == null) {
|
||||||
null
|
null
|
||||||
} else try {
|
} else {
|
||||||
val targetUri = URI(target)
|
try {
|
||||||
if (targetUri.isAbsolute) {
|
val targetUri = URI(target)
|
||||||
|
if (targetUri.isAbsolute) {
|
||||||
|
target
|
||||||
|
} else {
|
||||||
|
URL(URL(baseURL), target).toString()
|
||||||
|
}
|
||||||
|
} catch (e: MalformedURLException) {
|
||||||
|
Log.e("Could not resolve absolute url", e)
|
||||||
target
|
target
|
||||||
} else URL(URL(baseURL), target).toString()
|
} catch (e: URISyntaxException) {
|
||||||
} catch (e: MalformedURLException) {
|
Log.e("Could not resolve absolute url", e)
|
||||||
Log.e("Could not resolve absolute url", e)
|
target
|
||||||
target
|
}
|
||||||
} catch (e: URISyntaxException) {
|
|
||||||
Log.e("Could not resolve absolute url", e)
|
|
||||||
target
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -85,9 +89,7 @@ internal object Utils {
|
|||||||
var currentLine: String?
|
var currentLine: String?
|
||||||
try {
|
try {
|
||||||
BufferedReader(InputStreamReader(inputStream)).use { reader ->
|
BufferedReader(InputStreamReader(inputStream)).use { reader ->
|
||||||
while (reader.readLine().also {
|
while (reader.readLine().also { currentLine = it } != null) {
|
||||||
currentLine = it
|
|
||||||
} != null) {
|
|
||||||
sb.append(currentLine).append("\n")
|
sb.append(currentLine).append("\n")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.github.gotify.api
|
package com.github.gotify.api
|
||||||
|
|
||||||
import java.io.IOException
|
|
||||||
import retrofit2.Call
|
import retrofit2.Call
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
internal object Api {
|
internal object Api {
|
||||||
@Throws(ApiException::class)
|
@Throws(ApiException::class)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package com.github.gotify.api
|
package com.github.gotify.api
|
||||||
|
|
||||||
import java.io.IOException
|
|
||||||
import retrofit2.Response
|
import retrofit2.Response
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
internal class ApiException : Exception {
|
internal class ApiException : Exception {
|
||||||
var body: String = ""
|
var body: String = ""
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import android.annotation.SuppressLint
|
|||||||
import com.github.gotify.SSLSettings
|
import com.github.gotify.SSLSettings
|
||||||
import com.github.gotify.Utils
|
import com.github.gotify.Utils
|
||||||
import com.github.gotify.log.Log
|
import com.github.gotify.log.Log
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
import java.io.IOException
|
import java.io.IOException
|
||||||
import java.security.GeneralSecurityException
|
import java.security.GeneralSecurityException
|
||||||
import java.security.KeyStore
|
import java.security.KeyStore
|
||||||
@@ -11,8 +12,10 @@ import java.security.SecureRandom
|
|||||||
import java.security.cert.Certificate
|
import java.security.cert.Certificate
|
||||||
import java.security.cert.CertificateFactory
|
import java.security.cert.CertificateFactory
|
||||||
import java.security.cert.X509Certificate
|
import java.security.cert.X509Certificate
|
||||||
import javax.net.ssl.*
|
import javax.net.ssl.SSLContext
|
||||||
import okhttp3.OkHttpClient
|
import javax.net.ssl.TrustManager
|
||||||
|
import javax.net.ssl.TrustManagerFactory
|
||||||
|
import javax.net.ssl.X509TrustManager
|
||||||
|
|
||||||
internal object CertUtils {
|
internal object CertUtils {
|
||||||
@SuppressLint("CustomX509TrustManager")
|
@SuppressLint("CustomX509TrustManager")
|
||||||
|
|||||||
@@ -37,7 +37,8 @@ internal object ClientFactory {
|
|||||||
): ApiClient {
|
): ApiClient {
|
||||||
val client = defaultClient(
|
val client = defaultClient(
|
||||||
arrayOf("clientTokenHeader"),
|
arrayOf("clientTokenHeader"),
|
||||||
"$baseUrl/", sslSettings
|
"$baseUrl/",
|
||||||
|
sslSettings
|
||||||
)
|
)
|
||||||
val tokenAuth = client.apiAuthorizations["clientTokenHeader"] as ApiKeyAuth
|
val tokenAuth = client.apiAuthorizations["clientTokenHeader"] as ApiKeyAuth
|
||||||
tokenAuth.apiKey = token
|
tokenAuth.apiKey = token
|
||||||
|
|||||||
@@ -31,8 +31,8 @@ import com.github.gotify.init.InitializationActivity
|
|||||||
import com.github.gotify.log.Log
|
import com.github.gotify.log.Log
|
||||||
import com.github.gotify.log.LogsActivity
|
import com.github.gotify.log.LogsActivity
|
||||||
import com.github.gotify.log.UncaughtExceptionHandler
|
import com.github.gotify.log.UncaughtExceptionHandler
|
||||||
import java.security.cert.X509Certificate
|
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
|
import java.security.cert.X509Certificate
|
||||||
|
|
||||||
internal class LoginActivity : AppCompatActivity() {
|
internal class LoginActivity : AppCompatActivity() {
|
||||||
companion object {
|
companion object {
|
||||||
@@ -125,7 +125,9 @@ internal class LoginActivity : AppCompatActivity() {
|
|||||||
private fun toggleShowAdvanced() {
|
private fun toggleShowAdvanced() {
|
||||||
val selectedCertName = if (caCertContents != null) {
|
val selectedCertName = if (caCertContents != null) {
|
||||||
getNameOfCertContent(caCertContents!!)
|
getNameOfCertContent(caCertContents!!)
|
||||||
} else null
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
advancedDialog = AdvancedDialog(this, layoutInflater)
|
advancedDialog = AdvancedDialog(this, layoutInflater)
|
||||||
.onDisableSSLChanged { _, disable ->
|
.onDisableSSLChanged { _, disable ->
|
||||||
|
|||||||
@@ -26,9 +26,9 @@ import com.github.gotify.databinding.MessageItemCompactBinding
|
|||||||
import com.github.gotify.messages.provider.MessageWithImage
|
import com.github.gotify.messages.provider.MessageWithImage
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
import io.noties.markwon.Markwon
|
import io.noties.markwon.Markwon
|
||||||
import java.text.DateFormat
|
|
||||||
import java.util.*
|
|
||||||
import org.threeten.bp.OffsetDateTime
|
import org.threeten.bp.OffsetDateTime
|
||||||
|
import java.text.DateFormat
|
||||||
|
import java.util.Date
|
||||||
|
|
||||||
internal class ListMessageAdapter(
|
internal class ListMessageAdapter(
|
||||||
private val context: Context,
|
private val context: Context,
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package com.github.gotify.messages
|
package com.github.gotify.messages
|
||||||
|
|
||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.content.*
|
import android.content.BroadcastReceiver
|
||||||
|
import android.content.Context
|
||||||
|
import android.content.Intent
|
||||||
|
import android.content.IntentFilter
|
||||||
import android.graphics.Canvas
|
import android.graphics.Canvas
|
||||||
import android.graphics.drawable.ColorDrawable
|
import android.graphics.drawable.ColorDrawable
|
||||||
import android.graphics.drawable.Drawable
|
import android.graphics.drawable.Drawable
|
||||||
@@ -45,21 +48,21 @@ import com.github.gotify.init.InitializationActivity
|
|||||||
import com.github.gotify.log.Log
|
import com.github.gotify.log.Log
|
||||||
import com.github.gotify.log.LogsActivity
|
import com.github.gotify.log.LogsActivity
|
||||||
import com.github.gotify.login.LoginActivity
|
import com.github.gotify.login.LoginActivity
|
||||||
import com.github.gotify.messages.provider.*
|
import com.github.gotify.messages.provider.MessageState
|
||||||
|
import com.github.gotify.messages.provider.MessageWithImage
|
||||||
import com.github.gotify.service.WebSocketService
|
import com.github.gotify.service.WebSocketService
|
||||||
import com.github.gotify.settings.SettingsActivity
|
import com.github.gotify.settings.SettingsActivity
|
||||||
import com.github.gotify.sharing.ShareActivity
|
import com.github.gotify.sharing.ShareActivity
|
||||||
import com.google.android.material.navigation.NavigationView
|
import com.google.android.material.navigation.NavigationView
|
||||||
import com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback
|
import com.google.android.material.snackbar.BaseTransientBottomBar.BaseCallback
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import java.io.IOException
|
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
import kotlinx.coroutines.withContext
|
import kotlinx.coroutines.withContext
|
||||||
|
import java.io.IOException
|
||||||
|
|
||||||
internal class MessagesActivity :
|
internal class MessagesActivity :
|
||||||
AppCompatActivity(),
|
AppCompatActivity(),
|
||||||
NavigationView.OnNavigationItemSelectedListener
|
NavigationView.OnNavigationItemSelectedListener {
|
||||||
{
|
|
||||||
private lateinit var binding: ActivityMessagesBinding
|
private lateinit var binding: ActivityMessagesBinding
|
||||||
private lateinit var viewModel: MessagesModel
|
private lateinit var viewModel: MessagesModel
|
||||||
private var isLoadMore = false
|
private var isLoadMore = false
|
||||||
@@ -90,7 +93,8 @@ internal class MessagesActivity :
|
|||||||
val layoutManager = LinearLayoutManager(this)
|
val layoutManager = LinearLayoutManager(this)
|
||||||
val messagesView: RecyclerView = binding.messagesView
|
val messagesView: RecyclerView = binding.messagesView
|
||||||
val dividerItemDecoration = DividerItemDecoration(
|
val dividerItemDecoration = DividerItemDecoration(
|
||||||
messagesView.context, layoutManager.orientation
|
messagesView.context,
|
||||||
|
layoutManager.orientation
|
||||||
)
|
)
|
||||||
listMessageAdapter = ListMessageAdapter(
|
listMessageAdapter = ListMessageAdapter(
|
||||||
this,
|
this,
|
||||||
@@ -132,7 +136,8 @@ internal class MessagesActivity :
|
|||||||
invalidateOptionsMenu()
|
invalidateOptionsMenu()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
|
|
||||||
swipeRefreshLayout.isEnabled = false
|
swipeRefreshLayout.isEnabled = false
|
||||||
messagesView
|
messagesView
|
||||||
|
|||||||
@@ -14,10 +14,10 @@ import com.github.gotify.log.Log
|
|||||||
import com.github.gotify.messages.provider.MessageImageCombiner
|
import com.github.gotify.messages.provider.MessageImageCombiner
|
||||||
import com.squareup.picasso.OkHttp3Downloader
|
import com.squareup.picasso.OkHttp3Downloader
|
||||||
import com.squareup.picasso.Picasso
|
import com.squareup.picasso.Picasso
|
||||||
import java.io.File
|
|
||||||
import java.io.IOException
|
|
||||||
import okhttp3.Cache
|
import okhttp3.Cache
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
|
import java.io.File
|
||||||
|
import java.io.IOException
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
internal class PicassoHandler(private val context: Context, private val settings: Settings) {
|
internal class PicassoHandler(private val context: Context, private val settings: Settings) {
|
||||||
|
|||||||
@@ -11,10 +11,15 @@ import com.github.gotify.api.Callback.SuccessCallback
|
|||||||
import com.github.gotify.api.CertUtils
|
import com.github.gotify.api.CertUtils
|
||||||
import com.github.gotify.client.model.Message
|
import com.github.gotify.client.model.Message
|
||||||
import com.github.gotify.log.Log
|
import com.github.gotify.log.Log
|
||||||
import java.util.*
|
import okhttp3.HttpUrl
|
||||||
|
import okhttp3.OkHttpClient
|
||||||
|
import okhttp3.Request
|
||||||
|
import okhttp3.Response
|
||||||
|
import okhttp3.WebSocket
|
||||||
|
import okhttp3.WebSocketListener
|
||||||
|
import java.util.Calendar
|
||||||
import java.util.concurrent.TimeUnit
|
import java.util.concurrent.TimeUnit
|
||||||
import java.util.concurrent.atomic.AtomicLong
|
import java.util.concurrent.atomic.AtomicLong
|
||||||
import okhttp3.*
|
|
||||||
|
|
||||||
internal class WebSocketConnection(
|
internal class WebSocketConnection(
|
||||||
private val baseUrl: String,
|
private val baseUrl: String,
|
||||||
|
|||||||
@@ -1,6 +1,10 @@
|
|||||||
package com.github.gotify.service
|
package com.github.gotify.service
|
||||||
|
|
||||||
import android.app.*
|
import android.app.AlarmManager
|
||||||
|
import android.app.Notification
|
||||||
|
import android.app.NotificationManager
|
||||||
|
import android.app.PendingIntent
|
||||||
|
import android.app.Service
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
import android.content.IntentFilter
|
import android.content.IntentFilter
|
||||||
import android.graphics.Color
|
import android.graphics.Color
|
||||||
@@ -11,7 +15,12 @@ import android.os.IBinder
|
|||||||
import androidx.annotation.RequiresApi
|
import androidx.annotation.RequiresApi
|
||||||
import androidx.core.app.NotificationCompat
|
import androidx.core.app.NotificationCompat
|
||||||
import androidx.core.content.ContextCompat
|
import androidx.core.content.ContextCompat
|
||||||
import com.github.gotify.*
|
import com.github.gotify.MarkwonFactory
|
||||||
|
import com.github.gotify.MissedMessageUtil
|
||||||
|
import com.github.gotify.NotificationSupport
|
||||||
|
import com.github.gotify.R
|
||||||
|
import com.github.gotify.Settings
|
||||||
|
import com.github.gotify.Utils
|
||||||
import com.github.gotify.api.Callback
|
import com.github.gotify.api.Callback
|
||||||
import com.github.gotify.api.ClientFactory
|
import com.github.gotify.api.ClientFactory
|
||||||
import com.github.gotify.client.api.MessageApi
|
import com.github.gotify.client.api.MessageApi
|
||||||
@@ -107,7 +116,8 @@ internal class WebSocketService : Service() {
|
|||||||
|
|
||||||
private fun onClose() {
|
private fun onClose() {
|
||||||
showForegroundNotification(
|
showForegroundNotification(
|
||||||
getString(R.string.websocket_closed), getString(R.string.websocket_reconnect)
|
getString(R.string.websocket_closed),
|
||||||
|
getString(R.string.websocket_reconnect)
|
||||||
)
|
)
|
||||||
ClientFactory.userApiWithToken(settings)
|
ClientFactory.userApiWithToken(settings)
|
||||||
.currentUser()
|
.currentUser()
|
||||||
@@ -121,8 +131,10 @@ internal class WebSocketService : Service() {
|
|||||||
getString(R.string.websocket_closed_logout)
|
getString(R.string.websocket_closed_logout)
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
Log.i("WebSocket closed but the user still authenticated, " +
|
Log.i(
|
||||||
"trying to reconnect")
|
"WebSocket closed but the user still authenticated, " +
|
||||||
|
"trying to reconnect"
|
||||||
|
)
|
||||||
doReconnect()
|
doReconnect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -146,7 +158,8 @@ internal class WebSocketService : Service() {
|
|||||||
val intervalUnit = resources
|
val intervalUnit = resources
|
||||||
.getQuantityString(R.plurals.websocket_retry_interval, minutes, minutes)
|
.getQuantityString(R.plurals.websocket_retry_interval, minutes, minutes)
|
||||||
showForegroundNotification(
|
showForegroundNotification(
|
||||||
status, "${getString(R.string.websocket_reconnect)} $intervalUnit"
|
status,
|
||||||
|
"${getString(R.string.websocket_reconnect)} $intervalUnit"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +231,10 @@ internal class WebSocketService : Service() {
|
|||||||
val notificationIntent = Intent(this, MessagesActivity::class.java)
|
val notificationIntent = Intent(this, MessagesActivity::class.java)
|
||||||
|
|
||||||
val pendingIntent = PendingIntent.getActivity(
|
val pendingIntent = PendingIntent.getActivity(
|
||||||
this, 0, notificationIntent, PendingIntent.FLAG_IMMUTABLE
|
this,
|
||||||
|
0,
|
||||||
|
notificationIntent,
|
||||||
|
PendingIntent.FLAG_IMMUTABLE
|
||||||
)
|
)
|
||||||
val notificationBuilder =
|
val notificationBuilder =
|
||||||
NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
|
NotificationCompat.Builder(this, NotificationSupport.Channel.FOREGROUND)
|
||||||
@@ -297,7 +313,8 @@ internal class WebSocketService : Service() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
val b = NotificationCompat.Builder(
|
val b = NotificationCompat.Builder(
|
||||||
this, NotificationSupport.convertPriorityToChannel(priority)
|
this,
|
||||||
|
NotificationSupport.convertPriorityToChannel(priority)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
@@ -358,7 +375,8 @@ internal class WebSocketService : Service() {
|
|||||||
)
|
)
|
||||||
|
|
||||||
val builder = NotificationCompat.Builder(
|
val builder = NotificationCompat.Builder(
|
||||||
this, NotificationSupport.convertPriorityToChannel(priority)
|
this,
|
||||||
|
NotificationSupport.convertPriorityToChannel(priority)
|
||||||
)
|
)
|
||||||
|
|
||||||
builder.setAutoCancel(true)
|
builder.setAutoCancel(true)
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ internal object ThemeHelper {
|
|||||||
AppCompatDelegate.MODE_NIGHT_NO
|
AppCompatDelegate.MODE_NIGHT_NO
|
||||||
} else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
|
} else if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.P) {
|
||||||
AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY
|
AppCompatDelegate.MODE_NIGHT_AUTO_BATTERY
|
||||||
} else AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
} else {
|
||||||
|
AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user