Skip to content

Commit

Permalink
Update project
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbel committed Dec 18, 2024
1 parent cedb123 commit b30ea5d
Show file tree
Hide file tree
Showing 16 changed files with 722 additions and 387 deletions.
12 changes: 12 additions & 0 deletions .github/data/data.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,17 @@
"name": "Central Asian wild boar",
"description": "The Central Asian wild boar (Sus scrofa nigripes) is a subspecies of wild boar native to Central Asia, including Kazakhstan, Uzbekistan, and surrounding regions. It has a lighter build compared to its Siberian relatives, with shorter fur and well-developed tusks. Adapted to arid and semi-arid environments, it feeds on roots, plants, and small animals, displaying remarkable endurance in harsh conditions.",
"picture": "https://i.ibb.co/xfBHnH7/central-asian-boar.webp"
},
{
"id": 4,
"name": "Indian wild boar.",
"description": "The Indian wild boar (*Sus scrofa cristatus*) is a subspecies of wild pig native to South Asia. It has a robust body, dark gray to black coloration, and a distinctive mane of coarse hair along its back. Found in forests, grasslands, and agricultural areas, it is known for its adaptability and plays a key role in the ecosystem as a forager.",
"picture": "https://i.ibb.co/SNdTNcW/Indian-wild-boar.webp"
},
{
"id": 5,
"name": "Pygmy hog",
"description": "The pygmy hog (*Porcula salvania*) is the smallest and rarest wild pig, found in the grasslands of northeastern India and Nepal. It is critically endangered, with a compact body, dark brown coloration, and short legs, adapted to dense vegetation.",
"picture": "https://i.ibb.co/kBmgqJg/pygmy-hog.webp"
}
]
7 changes: 7 additions & 0 deletions core/src/main/kotlin/org/michaelbel/core/ktx/ModifierKtx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ package org.michaelbel.core.ktx

import androidx.compose.foundation.clickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.displayCutoutPadding
import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.composed
Expand All @@ -16,4 +18,9 @@ fun Modifier.clickableWithoutRipple(
indication = null,
onClick = { block() }
)
}

@Composable
fun Modifier.displayCutoutPaddingIfLandscape(): Modifier {
return if (isLandscape) displayCutoutPadding() else this
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ inline val navigationSuiteType: NavigationSuiteType
val density = LocalDensity.current
val windowSize = with(density) { currentWindowSize().toSize().toDpSize() }
return when {
adaptiveInfo.windowPosture.isTabletop -> NavigationSuiteType.NavigationBar
adaptiveInfo.windowSizeClass.isCompact -> NavigationSuiteType.NavigationBar
adaptiveInfo.windowPosture.isTabletop && isPortrait -> NavigationSuiteType.NavigationBar
adaptiveInfo.windowSizeClass.isCompact && isPortrait -> NavigationSuiteType.NavigationBar
adaptiveInfo.windowSizeClass.windowWidthSizeClass == WindowWidthSizeClass.EXPANDED && windowSize.width >= 1200.dp -> NavigationSuiteType.NavigationDrawer
else -> NavigationSuiteType.NavigationRail
}
Expand Down
1 change: 1 addition & 0 deletions mobile/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ plugins {
alias(libs.plugins.kotlin.android)
alias(libs.plugins.kotlin.serialization)
alias(libs.plugins.kotlin.compose)
alias(libs.plugins.kotlin.parcelize)
}

private val gitCommitsCount: Int by lazy {
Expand Down
4 changes: 3 additions & 1 deletion mobile/src/main/kotlin/org/michaelbel/template/AppModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,9 @@ import org.michaelbel.template.ktor.AppService
import org.michaelbel.template.repository.AppRepository
import org.michaelbel.template.room.AppDao
import org.michaelbel.template.room.AppDatabase
import org.michaelbel.template.ui.list.ListViewModel
import org.michaelbel.template.ui.details.DetailsViewModel
import org.michaelbel.template.ui.details2.DetailsViewModel2
import org.michaelbel.template.ui.list.ListViewModel

val appModule = module {
includes(dispatchersKoinModule)
Expand Down Expand Up @@ -84,4 +85,5 @@ val appModule = module {
viewModelOf(::MainViewModel)
viewModelOf(::ListViewModel)
viewModelOf(::DetailsViewModel)
viewModelOf(::DetailsViewModel2)
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.appcompat.app.AppCompatActivity
import androidx.core.splashscreen.SplashScreen.Companion.installSplashScreen
import org.michaelbel.template.ui.AppTheme
import org.michaelbel.template.ui.MainActivityContent

class MainActivity: AppCompatActivity() {
Expand All @@ -14,7 +15,9 @@ class MainActivity: AppCompatActivity() {
super.onCreate(savedInstanceState)
enableEdgeToEdge()
setContent {
MainActivityContent()
AppTheme {
MainActivityContent()
}
}
}
}
Loading

0 comments on commit b30ea5d

Please sign in to comment.