Skip to content

Commit

Permalink
chore: make proper environment using variant
Browse files Browse the repository at this point in the history
  • Loading branch information
indramahkota committed Feb 27, 2025
1 parent d6464da commit ded7e44
Show file tree
Hide file tree
Showing 12 changed files with 122 additions and 39 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ google-services.json
# Local configuration *(Mandatory)
secrets.properties
keystore.properties
development.properties
production.properties

#--------------------------

Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@

<br/>

---

## 🚀 Overview

This repository offers a robust foundation for Android app development, featuring:
Expand Down
12 changes: 11 additions & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.convention.compose.app)
alias(libs.plugins.kotlin.ksp)
}

android {
Expand All @@ -12,6 +11,17 @@ android {
versionCode = 1
versionName = "0.1.0"
}

flavorDimensions += "environment"

productFlavors {
create("development") {
dimension = "environment"
}
create("production") {
dimension = "environment"
}
}
}

kotlin {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,3 @@ public val exitPop: AnimatedContentTransitionScope<NavBackStackEntry>.() -> Exit
targetOffset = { it },
)
}

Original file line number Diff line number Diff line change
@@ -1,14 +1,38 @@
package feature.homepage.screen.dashboard

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Email
import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.Share
import androidx.compose.material3.Card
import androidx.compose.material3.Icon
import androidx.compose.material3.IconButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import coil.compose.AsyncImage
import core.designSystem.theme.LocalTypography
import kotlinx.coroutines.flow.Flow

@Composable
Expand All @@ -27,8 +51,58 @@ public fun DashboardScreen(
.padding(paddingValues)
.fillMaxSize(),
) {
Card(
shape = RoundedCornerShape(16.dp),
modifier = Modifier
.fillMaxWidth()
.padding(20.dp)
) {
Column(
modifier = Modifier.padding(16.dp),
horizontalAlignment = Alignment.CenterHorizontally
) {
AsyncImage(
model = "https://drive.usercontent.google.com/download?id=1slq2O4ZChlcuvsNk7ZM3wP8_Webc7ua1",
contentDescription = "Profile Picture",
modifier = Modifier
.size(192.dp, 228.dp)
.clip(RoundedCornerShape(16.dp)),
contentScale = ContentScale.Crop
)

Spacer(modifier = Modifier.height(12.dp))

Text(
text = "Indra Mahkota",
style = LocalTypography.current.header18Bold,
)

Spacer(modifier = Modifier.height(8.dp))

Text(
text = "Android Software Engineer\nSkilled in Kotlin, Jetpack Compose, React Native, and Flutter.",
style = LocalTypography.current.body14Regular,
textAlign = TextAlign.Center,
)

Spacer(modifier = Modifier.height(12.dp))

Row(
horizontalArrangement = Arrangement.spacedBy(4.dp),
modifier = Modifier.padding(top = 8.dp)
) {
IconButton(onClick = { }) {
Icon(Icons.Default.Share, contentDescription = "Share", tint = Color(0xFFFF5722))
}
IconButton(onClick = { }) {
Icon(Icons.Default.Favorite, contentDescription = "Favorite", tint = Color(0xFF1DA1F2))
}
IconButton(onClick = { }) {
Icon(Icons.Default.Email, contentDescription = "Message", tint = Color(0xFFE4405F))
}
}
}
}
}
}
}

56 changes: 28 additions & 28 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
[versions]
accompanist = "0.34.0"
activityCompose = "1.9.3"
activityKtx = "1.9.3"
androidDatabaseSqlcipher = "4.4.3"
androidToolsBuild = "8.7.2"
androidToolsCommon = "31.7.2"
androidxComposeBom = "2024.11.00"
activityCompose = "1.10.1"
activityKtx = "1.10.1"
androidDatabaseSqlcipher = "4.5.4"
androidToolsBuild = "8.7.3"
androidToolsCommon = "31.8.2"
androidxComposeBom = "2025.02.00"
androidxCoreKtx = "1.15.0"
androidxCoreSplashscreen = "1.0.1"
androidxDataStore = "1.1.1"
androidxDataStore = "1.1.3"
androidxEspressoCore = "3.6.1"
androidxMetrics = "1.0.0-beta01"
androidxProfileinstaller = "1.4.1"
androidxTracing = "1.2.0"
androidxWindow = "1.3.0"
apollo = "3.8.2"
appsFlyer = "6.14.0"
benManes = "0.51.0"
camerax = "1.4.0"
apollo = "3.8.5"
appsFlyer = "6.16.0"
benManes = "0.52.0"
camerax = "1.4.1"
catalogUpdate = "0.8.5"
chucker = "3.5.2"
cloudy = "0.1.1"
coil = "2.7.0"
composeDatePicker = "2.2.0"
exifinterface = "1.3.7"
firebaseAuthKtx = "23.1.0"
firebaseBom = "33.6.0"
exifinterface = "1.4.0"
firebaseAuthKtx = "23.2.0"
firebaseBom = "33.9.0"
guava = "33.3.1-jre"
indramahkota = "1.2.0"
indramahkota = "1.3.3"
installreferrer = "2.2"
jgit = "6.8.0.202311291450-r"
joda = "2.12.7"
koin = "4.0.0"
kotlin = "2.0.21"
kotlinxCoroutines = "1.9.0"
koin = "4.0.1"
kotlin = "2.1.0"
kotlinxCoroutines = "1.10.1"
kotlinxSerialization = "1.7.3"
ksp = "2.0.21-1.0.27"
ksp = "2.1.0-1.0.29"
ktor = "2.3.3"
lifecycle = "2.8.7"
lifecycleRuntimeCompose = "2.8.7"
Expand All @@ -44,25 +44,25 @@ mapbox = "10.16.2"
mhktCommonBom = "0.1.2"
mockito = "5.4.0"
molecule = "0.7.1"
navigation = "2.8.4"
navigation = "2.8.8"
okhttp = "4.12.0"
okhttp3IdlingResource = "1.0.0"
paging = "3.3.4"
pagingCommonAndroid = "3.3.4"
playServicesAuth = "21.2.0"
paging = "3.3.6"
pagingCommonAndroid = "3.3.6"
playServicesAuth = "21.3.0"
playServicesInstant = "18.1.0"
playServicesLocation = "21.3.0"
prettyTime = "5.0.0.Final"
protobuf = "4.26.1"
r8Version = "8.5.35"
r8Version = "8.7.18"
retrofit = "2.11.0"
retrofitConverterKotlinxSerialization = "1.0.0"
room = "2.6.1"
sentry = "7.15.0"
sentry = "8.2.0"
sqliteKtx = "2.4.0"
turbine = "1.1.0"
uiTooling = "1.7.5"
uiToolingPreviewAndroid = "1.7.5"
turbine = "1.2.0"
uiTooling = "1.7.8"
uiToolingPreviewAndroid = "1.7.8"
zxing = "3.5.0"

[libraries]
Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
5 changes: 2 additions & 3 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ done
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -206,7 +205,7 @@ fi
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
Expand Down
1 change: 1 addition & 0 deletions sample.development.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BACKEND_URL="https://development.example.com"
2 changes: 1 addition & 1 deletion secrets.defaults.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
BACKEND_URL="https://backend.example.com"
BACKEND_URL="https://production.example.com"
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ dependencyResolutionManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0"
}

include(":app")
Expand Down

0 comments on commit ded7e44

Please sign in to comment.