Skip to content

Convert MathUtils from Java to Kotlin#1546

Open
al3j4ndrolm wants to merge 1 commit into
OneBusAway:mainfrom
al3j4ndrolm:convert-mathutils-to-kotlin
Open

Convert MathUtils from Java to Kotlin#1546
al3j4ndrolm wants to merge 1 commit into
OneBusAway:mainfrom
al3j4ndrolm:convert-mathutils-to-kotlin

Conversation

@al3j4ndrolm

@al3j4ndrolm al3j4ndrolm commented Mar 20, 2026

Copy link
Copy Markdown

Part of the ongoing Java → Kotlin modernization effort. MathUtils is a pure arithmetic/geometry utility class with no Android dependencies, making it a clean, low-risk starting point for the migration.

Changes:

  • Replaced public class with object (Kotlin singleton pattern)
  • private static final intconst val
  • toDirection() negative-check simplified to an if expression
  • Added @JvmStatic on all methods to preserve existing Java call sites (VehicleOverlay.java, ArrowView.java, OrientationHelper.java) without modification

Related issues: N/A

  • Apply the AndroidStyle.xml style template to your code in Android Studio.
  • Run the unit tests with gradlew connectedObaGoogleDebugAndroidTest to make sure you didn't break anything

@CLAassistant

CLAassistant commented Mar 20, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants