Skip to content

Commit

Permalink
Get rid of lint warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JolandaVerhoef committed Mar 29, 2024
1 parent f366230 commit bb84056
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ android {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import kotlinx.coroutines.flow.stateIn

@HiltViewModel
class MainActivityViewModel @Inject constructor(
val settingsRepository: SettingsRepository
settingsRepository: SettingsRepository
) : ViewModel() {
val uiState: StateFlow<MainActivityUiState> = settingsRepository.cameraAppSettings.map {
Success(it)
Expand All @@ -42,6 +42,6 @@ class MainActivityViewModel @Inject constructor(
}

sealed interface MainActivityUiState {
object Loading : MainActivityUiState
data object Loading : MainActivityUiState
data class Success(val cameraAppSettings: CameraAppSettings) : MainActivityUiState
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ enum class AspectRatio(val ratio: Rational) {
/** returns the AspectRatio enum equivalent of a provided AspectRatioProto */
fun fromProto(aspectRatioProto: AspectRatioProto): AspectRatio {
return when (aspectRatioProto) {
AspectRatioProto.ASPECT_RATIO_NINE_SIXTEEN -> AspectRatio.NINE_SIXTEEN
AspectRatioProto.ASPECT_RATIO_ONE_ONE -> AspectRatio.ONE_ONE
AspectRatioProto.ASPECT_RATIO_NINE_SIXTEEN -> NINE_SIXTEEN
AspectRatioProto.ASPECT_RATIO_ONE_ONE -> ONE_ONE

// defaults to 3:4 aspect ratio
AspectRatioProto.ASPECT_RATIO_THREE_FOUR,
AspectRatioProto.ASPECT_RATIO_UNDEFINED,
AspectRatioProto.UNRECOGNIZED
-> AspectRatio.THREE_FOUR
-> THREE_FOUR
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion domain/camera/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<manifest>

</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ class FakeCameraUseCase(
override fun getZoomScale(): StateFlow<Float> = _zoomScale.asStateFlow()

private val _surfaceRequest = MutableStateFlow<SurfaceRequest?>(null)
fun setSurfaceRequest(surfaceRequest: SurfaceRequest) {
_surfaceRequest.value = surfaceRequest
}
override fun getSurfaceRequest(): StateFlow<SurfaceRequest?> = _surfaceRequest.asStateFlow()

override fun getScreenFlashEvents() = screenFlashEvents
Expand Down
1 change: 1 addition & 0 deletions feature/preview/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ android {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
Expand Down
1 change: 1 addition & 0 deletions feature/quicksettings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ android {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
Expand Down
1 change: 1 addition & 0 deletions feature/settings/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ android {
jvmToolchain(17)
}
buildFeatures {
buildConfig = true
compose = true
}
composeOptions {
Expand Down
8 changes: 6 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Suppress warnings for experimental AGP properties
android.suppressUnsupportedOptionWarnings=android.suppressUnsupportedOptionWarnings,\
android.experimental.testOptions.managedDevices.maxConcurrentDevices,\
android.experimental.testOptions.managedDevices.setupTimeoutMinutes,\
android.testoptions.manageddevices.emulator.gpu
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
# Enables namespacing of each library's R class so that its R class includes only the
# resources declared in the library itself and none from the library's dependencies,
# thereby reducing the size of the R class for that library
android.nonTransitiveRClass=true
android.defaults.buildfeatures.buildconfig=true
android.nonFinalResIds=false
# Properites to make gradle managed devices testing more stable (see https://issuetracker.google.com/287312019#comment41)
# Properties to make gradle managed devices testing more stable (see https://issuetracker.google.com/287312019#comment41)
android.experimental.testOptions.managedDevices.maxConcurrentDevices=1
android.experimental.testOptions.managedDevices.setupTimeoutMinutes=180
# Ensure we can run managed devices on servers that don't support hardware rendering
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ pluginManagement {
gradlePluginPortal()
}
}
@Suppress("UnstableApiUsage")
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
Expand Down

0 comments on commit bb84056

Please sign in to comment.