This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ch.protonmail.htmlcomposer | |
import kotlinx.serialization.SerialName | |
import kotlinx.serialization.Serializable | |
@Serializable | |
data class HtmlStyle( | |
@SerialName("0") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':demo:mergeDexDebug'. | |
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:38) | |
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:73) | |
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52) | |
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:49) | |
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416) | |
at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406) | |
at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165) | |
at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotificationBuilder( | |
context: Context | |
) : ResourcedBuilder by context() { | |
var contentText: CharSequence? by optional { contentTextRes } | |
@StringRes var contentTextRes: Int? = null | |
var title: CharSequence by required { titleRes } | |
@get:StringRes var titleRes: Int? = null | |
@get:DrawableRes var smallIconRes: Int by required() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NotificationBuilder( private val context: Context ) { | |
var title: String? = null | |
@get: StringRes titleRes: Int? = null | |
... | |
fun build() : Notification { | |
val notificationTitle = title | |
?: titleRes?.let { context.getString( titleRes ) }!! | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context.showNotification( R.id.cache_cleaned_id ) { | |
importance = NotificationImportance.LOW | |
channel { | |
idRes = R.string.background_group_id | |
nameRes = R.string.background_group_name | |
} | |
notification { | |
smallIconRes = R.drawable.ic_app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val notificationManager = context.getSystemService<NotificationManager>()!! | |
val title = context.getString( R.string.cache_cleaned_title ) | |
val id = context.getString( R.id.cache_cleaned_id ).toInt() | |
val channelId = context.getString( R.string.background_group_id ) | |
val channelName = context.getString( R.string.background_group_name ) | |
val notification = NotificationCompat.Builder( context, channelId ) | |
.setSmallIcon( R.drawable.ic_app ) |