Skip to content

Commit

Permalink
Fixed navigation animation bug, fixed the bottom sheet implementation…
Browse files Browse the repository at this point in the history
… and the filter chips. Fixed fetching to run in the IO, and adding stuff to lists to MAIN
  • Loading branch information
Ashkan Haghighi Fashi committed Dec 31, 2023
1 parent b9d7e41 commit 8f15f61
Show file tree
Hide file tree
Showing 22 changed files with 366 additions and 243 deletions.
1 change: 0 additions & 1 deletion .fleet/receipt.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// Project generated by Kotlin Multiplatform Wizard
{
"spec": {
"template_id": "kmt",
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<!-- PROJECT LOGO -->
<br />
<div align="center">
<div>
<a href="https://github.com/Ashkan-san/Takedown">
<img src="composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png" alt="Logo" width="200" height="200">
<img src="composeApp/src/androidMain/res/mipmap-xxxhdpi/ic_launcher_round.png" alt="Logo" width="192" height="192">
</a>

<h3 align="center">Takedown - Wrestling Companion</h3>
<p align="center">
<p>
Takedown - Wrestling Companion: Turniere finden, neue Techniken lernen und deinen Progress tracken
</div>

Expand Down
2 changes: 2 additions & 0 deletions composeApp/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ kotlin {
// MAPS
implementation("com.google.maps.android:maps-compose:4.3.0")
implementation("com.google.android.gms:play-services-maps:18.2.0")

implementation("io.github.theapache64:rebugger:1.0.0-rc02")
}

androidMain.dependencies {
Expand Down
2 changes: 1 addition & 1 deletion composeApp/src/androidMain/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@android:style/Theme.Material.Light.NoActionBar">
android:theme="@android:style/Theme.Material.NoActionBar">
<activity
android:exported="true"
android:configChanges="orientation|screenSize|screenLayout|keyboardHidden|mnc|colorMode|density|fontScale|fontWeightAdjustment|keyboard|layoutDirection|locale|mcc|navigation|smallestScreenSize|touchscreen|uiMode"
Expand Down
11 changes: 4 additions & 7 deletions composeApp/src/androidMain/kotlin/Actual.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MapStyleOptions
import com.google.maps.android.compose.GoogleMap
import com.google.maps.android.compose.MapProperties
import com.google.maps.android.compose.MapUiSettings
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.rememberCameraPositionState
Expand Down Expand Up @@ -107,7 +106,7 @@ actual suspend fun fetchAllTurniere(): MutableList<Turnier> {
return turnierListe
}

actual suspend fun fetchAlterGewichtKlassen(turnier: Turnier): MutableList<RingenKlasse> {
actual suspend fun fetchRingenKlassen(turnier: Turnier): MutableList<RingenKlasse> {
val turnierAGList = mutableListOf<RingenKlasse>()

try {
Expand Down Expand Up @@ -191,7 +190,7 @@ actual fun Maps(
isMapLoaded: Boolean,
onMapLoaded: () -> Unit
) {
// TODO Scrolling bug und click
// TODO loading screen fixen
val context = LocalContext.current
val cameraPositionState = rememberCameraPositionState()

Expand Down Expand Up @@ -233,10 +232,7 @@ actual fun Maps(
cameraPositionState = cameraPositionState,
onMapLoaded = {
onMapLoaded()
//viewModel.setMapLoaded()
//isMapLoaded.value = true
},
uiSettings = MapUiSettings(),
properties = mapProperties.value
) {
Marker(
Expand All @@ -261,4 +257,5 @@ actual fun Maps(
}
}
}
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,3 @@ class MainActivity : ComponentActivity() {
}
}
}


/*
@Preview
@Composable
fun AppAndroidPreview() {
App()
}*/
1 change: 1 addition & 0 deletions composeApp/src/androidMain/kotlin/scraper/HtmlScraper.kt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ private fun fetchTable(page: HtmlPage): MutableList<Turnier> {
val turnier = Turnier(
id = id,
datum = turnierDatum,
beendet = isTurnierBeendet(turnierDatum.datumString),
titel = titel,
stadt = ort,
veranstalter = veranstalter,
Expand Down
23 changes: 21 additions & 2 deletions composeApp/src/androidMain/kotlin/scraper/ScraperUtil.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ package scraper

import org.htmlunit.BrowserVersion
import org.htmlunit.WebClient
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale

// Web Client Setup
fun setupWebClient(): WebClient {
Expand Down Expand Up @@ -30,6 +33,22 @@ fun determineGender(male: String, female: String): List<String> {

// Gewichtsklassenstring in einzelne Strings splitten und Liste
fun determineWeightclass(weightclassesString: String): List<String> {
val weightClassesList = weightclassesString.split(", ")
return weightClassesList
return weightclassesString.split(", ")
}

fun isTurnierBeendet(turnierDatum: String): Boolean {
val dateFormat = SimpleDateFormat("dd.MM.yyyy", Locale.GERMANY)
val currentDate = Date()
println("HEUTE " + currentDate)

try {
val turnierDate = dateFormat.parse(turnierDatum)
println("TURNIER " + turnierDate)
// Wenn aktuelles Datum nach Turnierdatum ist, ist Turnier beendet
return currentDate.after(turnierDate)
} catch (e: Exception) {
println("Bla")
}

return false
}
2 changes: 1 addition & 1 deletion composeApp/src/commonMain/kotlin/Expect.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import data.Turnier

expect suspend fun fetchAllTurniere(): MutableList<Turnier>

expect suspend fun fetchAlterGewichtKlassen(turnier: Turnier): MutableList<RingenKlasse>
expect suspend fun fetchRingenKlassen(turnier: Turnier): MutableList<RingenKlasse>

expect suspend fun fetchDetails(turnier: Turnier): Turnier

Expand Down
1 change: 1 addition & 0 deletions composeApp/src/commonMain/kotlin/data/Turnier.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ data class Turnier(
val titel: String,

val datum: TurnierDatum,
val beendet: Boolean,

val land: String = "",
val adresse: String = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import moe.tlaster.precompose.navigation.NavHost
import moe.tlaster.precompose.navigation.Navigator
import ui.regelwerk.RulesScreen
import ui.turnier.details.TurnierDetailsScreen
import ui.turnier.liste.TurniereListScreen
import ui.turnier.liste.TurniereScreen
import ui.turnier.ranking.TurnierRankingScreen
import viewmodel.TurnierViewModel

Expand All @@ -17,7 +17,7 @@ fun NavigationGraph(navigator: Navigator, viewModel: TurnierViewModel) {
) {
// HOME/TURNIERE
scene(route = BottomNavItem.Turniere.route) {
TurniereListScreen(navigator = navigator, viewModel = viewModel)
TurniereScreen(navigator = navigator, viewModel = viewModel)
}

scene(route = Screen.TurnierDetails.route) {
Expand Down
135 changes: 0 additions & 135 deletions composeApp/src/commonMain/kotlin/ui/turnier/liste/Filter.kt

This file was deleted.

Loading

0 comments on commit 8f15f61

Please sign in to comment.