Skip to content

Instantly share code, notes, and snippets.

View Shvet's full-sized avatar
💻
Compose

Shvet Shvet

💻
Compose
  • Shvet Consultancy service
  • Rajkot
View GitHub Profile
@Shvet
Shvet / maven_publish.gradle
Created January 5, 2022 10:47 — forked from viktoriia-io/maven_publish.gradle
Maven publishing script for customising pom file generation
apply plugin: 'maven-publish'
afterEvaluate {
publishing {
publications {
maven(MavenPublication) {
groupId project.ext.pomGroupID
artifactId project.name
version project.ext.pomVersion
@Shvet
Shvet / AddDarkModeButton.kt
Created July 8, 2021 05:08 — forked from HugoMatilla/AddDarkModeButton.kt
Add a DarkMode Button to your activity
fun addDarkModeButton() {
val darkButton = Button(this).apply {
text = if (getDefaultNightMode() != MODE_NIGHT_YES) "Go Dark " else "Go Light"
layoutParams = LayoutParams(MATCH_PARENT, WRAP_CONTENT)
}
(window.decorView as ViewGroup).addView(darkButton) // or `yourContainer.addView(darkButton)`
darkButton.setOnClickListener {
AppCompatDelegate.setDefaultNightMode(