chore: fmt

This commit is contained in:
Zane Schepke 2024-07-28 02:17:01 -04:00
parent 470fa0191b
commit 66e89c83e2
10 changed files with 13 additions and 21 deletions

View File

@ -1,6 +1,3 @@
import com.android.builder.model.v2.dsl.SigningConfig
import java.util.Properties
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
@ -188,10 +185,10 @@ dependencies {
implementation(libs.androidx.core.splashscreen)
}
fun nightlyVersionCode() : Int {
fun nightlyVersionCode(): Int {
return Constants.VERSION_CODE + Constants.NIGHTLY_CODE
}
fun nightlyVersionName() : String {
fun nightlyVersionName(): String {
return Constants.VERSION_NAME + "-${grgitService.service.get().grgit.head().abbreviatedId}"
}

View File

@ -30,7 +30,7 @@ class BootReceiver : BroadcastReceiver() {
context?.run {
applicationScope.launch {
val settings = appDataRepository.settings.getSettings()
if(settings.isRestoreOnBootEnabled) {
if (settings.isRestoreOnBootEnabled) {
if (settings.isAutoTunnelEnabled) {
Timber.i("Starting watcher service from boot")
serviceManager.startWatcherServiceForeground(context)

View File

@ -9,7 +9,6 @@ import android.content.Intent
import android.graphics.Color
import androidx.core.app.NotificationCompat
import com.zaneschepke.wireguardautotunnel.R
import com.zaneschepke.wireguardautotunnel.ui.MainActivity
import com.zaneschepke.wireguardautotunnel.ui.SplashActivity
import dagger.hilt.android.qualifiers.ApplicationContext
import javax.inject.Inject

View File

@ -10,11 +10,8 @@ import androidx.lifecycle.lifecycleScope
import com.zaneschepke.wireguardautotunnel.R
import com.zaneschepke.wireguardautotunnel.data.domain.TunnelConfig
import com.zaneschepke.wireguardautotunnel.data.repository.AppDataRepository
import com.zaneschepke.wireguardautotunnel.module.ApplicationScope
import com.zaneschepke.wireguardautotunnel.module.ServiceScope
import com.zaneschepke.wireguardautotunnel.service.foreground.ServiceManager
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import timber.log.Timber
@ -47,6 +44,7 @@ class AutoTunnelControlTile : TileService(), LifecycleOwner {
setTileDescription(this@AutoTunnelControlTile.getString(R.string.active))
}
}
false -> {
setTileDescription(this@AutoTunnelControlTile.getString(R.string.disabled))
setUnavailable()

View File

@ -5,17 +5,14 @@ import android.service.quicksettings.Tile
import android.service.quicksettings.TileService
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LifecycleService
import androidx.lifecycle.ServiceLifecycleDispatcher
import androidx.lifecycle.lifecycleScope
import com.zaneschepke.wireguardautotunnel.data.domain.TunnelConfig
import com.zaneschepke.wireguardautotunnel.data.repository.AppDataRepository
import com.zaneschepke.wireguardautotunnel.module.ApplicationScope
import com.zaneschepke.wireguardautotunnel.service.foreground.ServiceManager
import com.zaneschepke.wireguardautotunnel.service.tunnel.TunnelState
import com.zaneschepke.wireguardautotunnel.service.tunnel.VpnService
import dagger.hilt.android.AndroidEntryPoint
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.cancel
import kotlinx.coroutines.launch
import timber.log.Timber

View File

@ -38,7 +38,8 @@ fun RowListItem(
) {
Box(
modifier =
Modifier.focusRequester(focusRequester)
Modifier
.focusRequester(focusRequester)
.animateContentSize()
.clip(RoundedCornerShape(30.dp))
.combinedClickable(

View File

@ -539,7 +539,7 @@ fun MainScreen(
onHold = {},
expanded = false,
statistics = null,
focusRequester = focusRequester
focusRequester = focusRequester,
)
}
}

View File

@ -250,8 +250,8 @@ constructor(
fun onToggleRestartAtBoot() = viewModelScope.launch {
saveSettings(
uiState.value.settings.copy(
isRestoreOnBootEnabled = !uiState.value.settings.isRestoreOnBootEnabled
)
isRestoreOnBootEnabled = !uiState.value.settings.isRestoreOnBootEnabled,
),
)
}
}

View File

@ -40,7 +40,7 @@ fun Project.isGeneralFlavor(gradle: Gradle): Boolean {
}
fun Project.getSigningProperties() : Properties {
fun Project.getSigningProperties(): Properties {
return Properties().apply {
// created local file for signing details
try {
@ -51,7 +51,7 @@ fun Project.getSigningProperties() : Properties {
}
}
fun Project.getStoreFile() : File {
fun Project.getStoreFile(): File {
return file(
System.getenv()
.getOrDefault(
@ -61,7 +61,7 @@ fun Project.getStoreFile() : File {
)
}
fun Project.getSigningProperty(property: String) : String {
fun Project.getSigningProperty(property: String): String {
// try to get secrets from env first for pipeline build, then properties file for local
return System.getenv()
.getOrDefault(

View File

@ -29,7 +29,7 @@ composeBom = "2024.06.00"
compose = "1.6.8"
zxingAndroidEmbedded = "4.3.0"
coreSplashscreen = "1.0.1"
gradlePlugins-grgit="5.2.2"
gradlePlugins-grgit = "5.2.2"
#plugins
material = "1.12.0"