Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Android Studio / IntelliJ
# Ignores user-specific settings, caches, and generated files.
.gradle/
.idea/
*.iml
*.iws
*.ipr
build/
local.properties

# Build artifacts
# These are the compiled outputs of your project.
*.apk
*.aab
*.so
*.a
*.o
*.o.d
*.so.d

# Generated files from older Android toolchains
gen/
out/

# Firebase
# It's best practice not to commit this file to public repositories.
google-services.json

# Signing Keys
# CRITICAL: Never commit your signing keys.
*.keystore
*.jks
*.pem

# Log files
*.log

# C/C++ native build files
.cxx/
.externalNativeBuild/

# Android Studio captures folder (screenshots/videos from emulator)
captures/

# Navigation editor temp files
.navigation/

# Misc
.classpath
.project
.settings/
*.swp
*.swo
*~
.vscode/

# macOS
.DS_Store
1 change: 1 addition & 0 deletions TXT FILES/TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FIX BUTTONS FOR CREATING NEW ITEM
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
101 changes: 101 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.compose)
id("com.google.gms.google-services")
}

android {
namespace = "com.samuel.inventorymanager"
// Consider checking for the latest stable API levels.
// compileSdk = 36 is fine, but adjust as necessary for future compatibility.
compileSdk = 36

defaultConfig {
applicationId = "com.samuel.inventorymanager"
minSdk = 24
targetSdk = 36
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}
packaging {
resources {
excludes += "META-INF/DEPENDENCIES"
}
}
// ==
buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = "11"
}
buildFeatures {
compose = true
}
}

// Ensure all dependencies are inside this block with curly braces
dependencies {
// --- Google Services ---
// For Google Sign-In and other Google Play services
implementation("com.google.android.gms:play-services-auth:21.0.0")
implementation("com.google.firebase:firebase-auth:22.3.1")
implementation("com.google.firebase:firebase-core:21.1.1")
implementation("com.google.firebase:firebase-analytics")
implementation(platform("com.google.firebase:firebase-bom:34.5.0"))
implementation("com.google.firebase:firebase-auth")

// Use one, consistent version

// For Google One Tap Sign-In
implementation("androidx.credentials:credentials:1.2.0")
implementation("androidx.credentials:credentials-play-services-auth:1.2.0")
implementation("com.google.android.libraries.identity.googleid:googleid:1.1.0")

// --- Google Drive API ---
// Required for DriveScopes and interacting with the Drive API
implementation("com.google.api-client:google-api-client-android:2.2.0")
implementation("com.google.apis:google-api-services-drive:v3-rev20220815-2.0.0")

// --- AndroidX & Jetpack Compose ---
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.lifecycle.runtime.ktx)
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.9.4")
implementation(libs.androidx.activity.compose)
implementation(platform(libs.androidx.compose.bom))
implementation("androidx.activity:activity-compose:1.9.3")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
implementation(libs.androidx.compose.ui)
implementation(libs.androidx.compose.ui.graphics)
implementation(libs.androidx.compose.ui.tooling.preview)
implementation(libs.androidx.compose.material3)
implementation("androidx.compose.material:material-icons-extended-android:1.7.8")

// --- Utility ---
// Gson for JSON processing
implementation("com.google.code.gson:gson:2.13.2") // Kept one instance
// Coil for image loading
implementation("io.coil-kt:coil-compose:2.7.0")

// --- Testing ---
testImplementation(libs.junit)
androidTestImplementation(libs.androidx.junit)
androidTestImplementation(libs.androidx.espresso.core)
androidTestImplementation(platform(libs.androidx.compose.bom))
androidTestImplementation(libs.androidx.compose.ui.test.junit4)
debugImplementation(libs.androidx.compose.ui.tooling)
debugImplementation(libs.androidx.compose.ui.test.manifest)
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.samuel.inventorymanager

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.assertEquals
import org.junit.Test
import org.junit.runner.RunWith

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.samuel.inventorymanager", appContext.packageName)
}
}
62 changes: 62 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">

<!-- Camera Permissions -->
<uses-feature
android:name="android.hardware.camera"
android:required="false" />
<uses-permission android:name="android.permission.CAMERA" />

<!--
Storage Permissions
Warning: MANAGE_EXTERNAL_STORAGE requires Google Play approval for most apps.
Ensure your app's core functionality depends on broad file access.
-->
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE"
tools:ignore="ScopedStorage" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"
android:maxSdkVersion="29" />


<!--
Application Definition
All attributes must be inside this single opening tag.
-->
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.InventoryManager"
android:requestLegacyExternalStorage="true"
tools:targetApi="31">

<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.InventoryManager">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<provider
android:name="androidx.core.content.FileProvider"
android:authorities="${applicationId}.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths" />
</provider>

</application>

</manifest>
28 changes: 28 additions & 0 deletions app/src/main/java/com/samuel/inventorymanager/MainActivity.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.samuel.inventorymanager // Ensure this matches your package name

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.ui.Modifier
import com.samuel.inventorymanager.screens.MainAppScreen
import com.samuel.inventorymanager.ui.theme.InventoryManagerTheme

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
InventoryManagerTheme {
// A surface container using the 'background' color from the theme
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background
) {
MainAppScreen()
}
}
}
}
}
Loading