Skip to content

Commit 50f3244

Browse files
committed
git commit -m "chore: initial project setup with Clean Architecture
0 parents  commit 50f3244

44 files changed

Lines changed: 1421 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# Built application files
2+
*.apk
3+
*.ap_
4+
*.aab
5+
6+
# Files for the ART/Dalvik VM
7+
*.dex
8+
9+
# Java class files
10+
*.class
11+
12+
# Generated files
13+
bin/
14+
gen/
15+
out/
16+
release/
17+
18+
# Gradle files
19+
.gradle/
20+
build/
21+
22+
# Local configuration file (sdk path, etc)
23+
local.properties
24+
25+
# Android Studio
26+
.idea/
27+
*.iml
28+
.DS_Store
29+
30+
# External native build folder generated in Android Studio 2.2 and later
31+
.externalNativeBuild
32+
.cxx/
33+
34+
# Google Services (e.g. APIs or Firebase)
35+
google-services.json
36+
37+
# Version control
38+
vcs.xml
39+
40+
# Keystore files
41+
*.jks
42+
*.keystore
43+
44+
# Android Profiling
45+
*.hprof
46+
47+
# IntelliJ
48+
*.iml
49+
.idea/workspace.xml
50+
.idea/tasks.xml
51+
.idea/gradle.xml
52+
.idea/assetWizardSettings.xml
53+
.idea/dictionaries
54+
.idea/libraries
55+
.idea/shelf
56+
.idea/modules.xml
57+
.idea/navEditor.xml
58+
.idea/caches
59+
.idea/misc.xml
60+
61+
# Gradle
62+
gradle-app.setting
63+
!gradle-wrapper.jar
64+
.gradletasknamecache
65+
66+
# Captures folder
67+
captures/
68+
69+
# Log Files
70+
*.log
71+
72+
# BlueJ files
73+
*.ctxt
74+
75+
# Mobile Tools for Java (J2ME)
76+
.mtj.tmp/
77+
78+
# Package Files #
79+
*.jar
80+
*.war
81+
*.nar
82+
*.ear
83+
*.zip
84+
*.tar.gz
85+
*.rar
86+
87+
# virtual machine crash logs
88+
hs_err_pid*
89+
replay_pid*

app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

app/build.gradle.kts

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
plugins {
2+
alias(libs.plugins.android.application)
3+
alias(libs.plugins.kotlin.compose)
4+
}
5+
6+
android {
7+
namespace = "com.marcodomingues.soundflow"
8+
compileSdk = 36
9+
10+
defaultConfig {
11+
applicationId = "com.marcodomingues.soundflow"
12+
minSdk = 24
13+
targetSdk = 36
14+
versionCode = 1
15+
versionName = "1.0.0"
16+
17+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
18+
vectorDrawables {
19+
useSupportLibrary = true
20+
}
21+
}
22+
23+
buildTypes {
24+
release {
25+
isMinifyEnabled = false // ← Desativado por agora
26+
}
27+
}
28+
29+
compileOptions {
30+
sourceCompatibility = JavaVersion.VERSION_17
31+
targetCompatibility = JavaVersion.VERSION_17
32+
}
33+
34+
packaging {
35+
resources {
36+
excludes += "/META-INF/{AL2.0,LGPL2.1}"
37+
}
38+
}
39+
}
40+
41+
dependencies {
42+
// Core Android
43+
implementation(libs.androidx.core.ktx)
44+
implementation(libs.androidx.lifecycle.runtime.ktx)
45+
implementation(libs.androidx.activity.compose)
46+
47+
// Compose BOM
48+
implementation(platform(libs.androidx.compose.bom))
49+
implementation(libs.androidx.ui)
50+
implementation(libs.androidx.ui.graphics)
51+
implementation(libs.androidx.ui.tooling.preview)
52+
implementation(libs.androidx.material3)
53+
implementation(libs.androidx.material.icons.extended)
54+
55+
// Navigation
56+
implementation(libs.androidx.navigation.compose)
57+
58+
// ViewModel Compose
59+
implementation(libs.androidx.lifecycle.viewmodel.compose)
60+
implementation(libs.androidx.lifecycle.runtime.compose)
61+
62+
// Coroutines
63+
implementation(libs.kotlinx.coroutines.android)
64+
implementation(libs.kotlinx.coroutines.core)
65+
66+
// Testing
67+
testImplementation(libs.junit)
68+
androidTestImplementation(libs.androidx.junit)
69+
androidTestImplementation(libs.androidx.espresso.core)
70+
androidTestImplementation(platform(libs.androidx.compose.bom))
71+
androidTestImplementation(libs.androidx.ui.test.junit4)
72+
73+
// Debug
74+
debugImplementation(libs.androidx.ui.tooling)
75+
debugImplementation(libs.androidx.ui.test.manifest)
76+
}

app/proguard-rules.pro

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Add project specific ProGuard rules here.
2+
# You can control the set of applied configuration files using the
3+
# proguardFiles setting in build.gradle.
4+
#
5+
# For more details, see
6+
# http://developer.android.com/guide/developing/tools/proguard.html
7+
8+
# If your project uses WebView with JS, uncomment the following
9+
# and specify the fully qualified class name to the JavaScript interface
10+
# class:
11+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12+
# public *;
13+
#}
14+
15+
# Uncomment this to preserve the line number information for
16+
# debugging stack traces.
17+
#-keepattributes SourceFile,LineNumberTable
18+
19+
# If you keep the line number information, uncomment this to
20+
# hide the original source file name.
21+
#-renamesourcefileattribute SourceFile
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.marcodomingues.soundflow
2+
3+
import androidx.test.platform.app.InstrumentationRegistry
4+
import androidx.test.ext.junit.runners.AndroidJUnit4
5+
6+
import org.junit.Test
7+
import org.junit.runner.RunWith
8+
9+
import org.junit.Assert.*
10+
11+
/**
12+
* Instrumented test, which will execute on an Android device.
13+
*
14+
* See [testing documentation](http://d.android.com/tools/testing).
15+
*/
16+
@RunWith(AndroidJUnit4::class)
17+
class ExampleInstrumentedTest {
18+
@Test
19+
fun useAppContext() {
20+
// Context of the app under test.
21+
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
22+
assertEquals("com.marcodomingues.soundflow", appContext.packageName)
23+
}
24+
}

app/src/main/AndroidManifest.xml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<!-- Required permissions for audio monitoring -->
6+
<uses-permission android:name="android.permission.RECORD_AUDIO" />
7+
<uses-permission android:name="android.permission.VIBRATE" />
8+
9+
<application
10+
android:allowBackup="true"
11+
android:dataExtractionRules="@xml/data_extraction_rules"
12+
android:fullBackupContent="@xml/backup_rules"
13+
android:icon="@mipmap/ic_launcher"
14+
android:label="@string/app_name"
15+
android:roundIcon="@mipmap/ic_launcher_round"
16+
android:supportsRtl="true"
17+
android:theme="@style/Theme.Soundflow"
18+
tools:targetApi="31">
19+
<activity
20+
android:name=".MainActivity"
21+
android:exported="true"
22+
android:theme="@style/Theme.Soundflow">
23+
<intent-filter>
24+
<action android:name="android.intent.action.MAIN" />
25+
<category android:name="android.intent.category.LAUNCHER" />
26+
</intent-filter>
27+
</activity>
28+
</application>
29+
30+
</manifest>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.marcodomingues.soundflow
2+
3+
import android.os.Bundle
4+
5+
import androidx.activity.compose.setContent
6+
import androidx.activity.enableEdgeToEdge
7+
import androidx.activity.ComponentActivity
8+
import com.marcodomingues.soundflow.ui.navigation.SoundFlowNavigation
9+
import com.marcodomingues.soundflow.ui.theme.SoundFlowTheme
10+
11+
class MainActivity : ComponentActivity() {
12+
override fun onCreate(savedInstanceState: Bundle?) {
13+
super.onCreate(savedInstanceState)
14+
enableEdgeToEdge()
15+
setContent {
16+
SoundFlowTheme {
17+
SoundFlowNavigation()
18+
}
19+
}
20+
}
21+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.marcodomingues.soundflow.domain.model
2+
3+
/**
4+
* Represents a noise level reading with automatic categorization.
5+
*
6+
* @property decibels The measured sound level in decibels (dB)
7+
* @property timestamp Unix timestamp in milliseconds when reading was taken
8+
*/
9+
data class NoiseLevel(
10+
val decibels: Double,
11+
val timestamp: Long = System.currentTimeMillis()
12+
) {
13+
/**
14+
* Auto-computed category based on decibel ranges:
15+
* - QUIET: 0-39 dB
16+
* - MODERATE: 40-59 dB
17+
* - LOUD: 60-79 dB
18+
* - HARMFUL: 80+ dB
19+
*/
20+
val category: NoiseCategory
21+
get() = when {
22+
decibels < 40 -> NoiseCategory.QUIET
23+
decibels < 60 -> NoiseCategory.MODERATE
24+
decibels < 80 -> NoiseCategory.LOUD
25+
else -> NoiseCategory.HARMFUL
26+
}
27+
}
28+
29+
/**
30+
* Noise level categories following WHO recommendations.
31+
* Labels are internal identifiers; UI translations handled via string resources.
32+
*/
33+
enum class NoiseCategory(val label: String) {
34+
QUIET("Quiet"),
35+
MODERATE("Moderate"),
36+
LOUD("Loud"),
37+
HARMFUL("Harmful")
38+
}

0 commit comments

Comments
 (0)