Skip to content

22 UI bug#25

Open
Julius-Babies wants to merge 17 commits intomainfrom
22-ui-bug
Open

22 UI bug#25
Julius-Babies wants to merge 17 commits intomainfrom
22-ui-bug

Conversation

@Julius-Babies
Copy link
Copy Markdown
Owner

I will review the changes now

@Julius-Babies Julius-Babies self-assigned this Jun 10, 2025
@Julius-Babies Julius-Babies linked an issue Jun 10, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Owner Author

@Julius-Babies Julius-Babies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small changes, someone else needs to approve this since I started this pr and therefore cannot approve it.

provider,
1000L, // 1 Sekunde
1f, // 1 Meter
1000L,
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So-called "Magic-numbers" should be defined using a constant at a somewhat top level given the importance of those. See https://en.wikipedia.org/wiki/Magic_number_(programming)?useskin=vector

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also include the unit in the constant name. I suggest using Kotlin's const-keyword (see https://kotlinlang.org/docs/properties.html#compile-time-constants)

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file seems rather large, consider refactoring some components into useful separate files enhancing reusability and testability in the future. However, this is not necessary yet so feel free to just skip this :)

…on detection radius from 200m to 250m for better user experience - Fix S-Bahn line announcements to avoid Gleis prefix - Improve platform name handling to remove redundant Gleis prefixes - Fix German text for eine Minute delay announcement - Refactor line announcement logic for different transport types: S-Bahn: S1 in Richtung X an Gleis Y, Trains: Gleis RE1 in Richtung X an Gleis Y, Bus/Tram: Linie 62 in Richtung X an Steig Y
@Belgarus
Copy link
Copy Markdown
Collaborator

Okay, I’ll keep working on this a bit more, but right now everything seems to be working fine.

Belgarus added 4 commits June 11, 2025 21:10
…object with location-related constants - Add provider-specific time and distance thresholds - Add sensor-related constants - Improve code maintainability and readability - Make configuration values easier to modify
…ffixes to constant names (METERS, MILLIS, NANOS) - Use Kotlin const keyword for compile-time constants - Remove redundant comments as units are now in names - Update all constant references throughout the code - Improve code readability and maintainability
Refactor MainActivity to use Compose and MVVM architecture. Adjust Play/Pause button to take up 50% of screen height and optimize station departure display to show only next departure per line. Add proper delay indicators and improve loading states. Fix location permission handling and station distance calculation.
@Belgarus
Copy link
Copy Markdown
Collaborator

My main changes:


- Refactor MainActivity to use Compose and MVVM architecture
- Adjust Play/Pause button to 50% screen height
- Show only next departure per line/destination
- Add proper delay indicators (+/-) for departures
- Fix location permission handling
- Fix station distance calculation

Demo.mp4

TTS works perfectly fine, but sound doesn’t seem to work in the markup, I guess.

@Belgarus
Copy link
Copy Markdown
Collaborator

Should I simplify the files a bit more? It’s quite a lot of code.

@Belgarus
Copy link
Copy Markdown
Collaborator

Would you mind testing if the app works on your device too? I’ve only tried it on my old Android phone so far.

@Julius-Babies
Copy link
Copy Markdown
Owner Author

Should I simplify the files a bit more? It’s quite a lot of code.

Next time, split these changes into multiple tickets and pull requests (PRs). I saw something related to translations in the changes that has nothing to do with the initial issue #22. It's really hard to review these massive PRs, that's why it takes so long.


Would you mind testing if the app works on your device too? I’ve only tried it on my old Android phone so far.

If it works on your device, it should also work on newer ones. If you're able to test it on an emulator with a more recent version of Android, feel free to do so. If the app works on there too, I'll merge this and we forget that this big PR ever existed ;)

@Belgarus
Copy link
Copy Markdown
Collaborator

Okay I will test it and will look that everything works fine. :)

@Belgarus
Copy link
Copy Markdown
Collaborator

The Emulator is stuck loading. Should I open a new PR?

@Belgarus
Copy link
Copy Markdown
Collaborator

Belgarus commented Jan 6, 2026

Can we merge this as an unstable version?

@Belgarus Belgarus added bug Something isn't working problem state:in_progress Someone is working on this labels Feb 27, 2026
Copy link
Copy Markdown
Owner Author

@Julius-Babies Julius-Babies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since I opened this PR, I cannot approve nor request changes. If you clean up the unnecessary stuff we can merge this since we have to do some architectural planning anyways later on.

val plannedTime = extractLocalTimeFromDateString(it.scheduleTime)
val actualTime = extractLocalTimeFromDateString(realTime)
(plannedTime.hour - actualTime.hour) * 60 + (plannedTime.minute - actualTime.minute)
(actualTime.hour - plannedTime.hour) * 60 + (actualTime.minute - plannedTime.minute)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should switch to kotlinx.datetime to get access to the Duration class which allows something like (actualTime - plannedTime).inWholeMinutes.

If you want to work on something, you should check the library out: https://github.com/Kotlin/kotlinx-datetime

This would be a required step to make the app work on iOS, since the LocalDate class we are currently using is a Java-Class which we are unable to utilize when targeting non-Android platforms. Feel free to create a master ticket for Kotlin Multiplatform for iOS (see https://kotlinlang.org/docs/multiplatform/kmp-overview.html) and a child ticket for the replacement of java DateTime API with the Kotlin alternative.

emptyList<Station>()
} else {
Log.d("DVBSource", "JSON content length: ${content.length}")
Log.d("DVBSource", "First 100 characters: ${content.take(100)}")
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to log this

Station(it.properties.number, it.properties.name, it.geometry.coordinates[0], it.geometry.coordinates[1], emptyList())
Log.d("DVBSource", "Starting to load stations from raw resource")
return try {
val inputStream = context.resources.openRawResource(R.raw.stops)
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be deferred to the VVO-Api in the long term, so we can also get rid of the batch script which generates the json. Feel free to create a ticket.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a dedicated activity for this? We have a loading indicator on the main activity

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either complete or remove this file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working problem state:in_progress Someone is working on this

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Heavy computations blocking UI Thread

3 participants