Skip to content

CATROID-1623 Refactor GlideToAction to Kotlin#5099

Merged
wslany merged 4 commits intoCatrobat:developfrom
doppem15:CATROID-1623
Apr 26, 2026
Merged

CATROID-1623 Refactor GlideToAction to Kotlin#5099
wslany merged 4 commits intoCatrobat:developfrom
doppem15:CATROID-1623

Conversation

@doppem15
Copy link
Copy Markdown
Contributor

@doppem15 doppem15 commented Jul 6, 2025

The following files were refactored and converted to Kotlin by me and simplified as much as possible:
- GlideToAction.kt
- GlideToActionTest.kt
Furthermore, the file "ActionPhysicsFactory.kt" was modified to ensure compatibility with the new Kotlin files.

https://catrobat.atlassian.net/browse/CATROID-1623

Your checklist for this pull request

Please review the contributing guidelines and wiki pages of this repository.

  • Include the name of the Jira ticket in the PR’s title
  • Include a summary of the changes plus the relevant context
  • Choose the proper base branch (develop)
  • Confirm that the changes follow the project’s coding guidelines
  • Verify that the changes generate no compiler or linter warnings
  • Perform a self-review of the changes
  • Verify to commit no other files than the intentionally changed ones
  • Include reasonable and readable tests verifying the added or changed behavior
  • Confirm that new and existing unit tests pass locally
  • Check that the commits’ message style matches the project’s guideline
  • Stick to the project’s gitflow workflow
  • Verify that your changes do not have any conflicts with the base branch
  • After the PR, verify that all CI checks have passed
  • Post a message in the catroid-stage or catroid-ide Slack channel and ask for a code reviewer

@dajminks
Copy link
Copy Markdown
Contributor

Hi Markus,

4 suggestions;

  1. in ActionPhysicsFactory.kt maybe out of consistency reasons use a setter for duration and scope

  2. for easier reading, maybe in GlideToAction.kt Line 85, change the if to check for absolute values to be bigger than 0.1f instead of -0.1f > deltaX || deltaX > 0.1f and same for deltaY

  3. If possible, check does the restart (in the update function) work / does the duration really change after the restart

  4. You tested for null, Nan and positive numbers, what if you put in negative numbers?

And squash all commits into one commit

BR Dominik

@sonarqubecloud
Copy link
Copy Markdown

@doppem15
Copy link
Copy Markdown
Contributor Author

Hi Dominik,

i tried to follow your suggestions 2–4!

As for point 1), I understand your argument regarding consistency. However, I believe that in Kotlin it's cleaner to work this way, since set/get are generated automatically and their usage is preferred.
Maybe it would make sense to open a ticket to align this across the codebase — but at the moment, other actions are still written in Java, which is where the inconsistency comes from.

@reichli reichli added the Active Member Tickets that are assigned to members that are still currently active label Dec 25, 2025
@sonarqubecloud
Copy link
Copy Markdown

@dorianpercic dorianpercic changed the title Catroid-1623 Refactor GlideToAction to Kotlin CATROID-1623 Refactor GlideToAction to Kotlin Feb 12, 2026
@dorianpercic dorianpercic self-requested a review February 12, 2026 16:43
Copy link
Copy Markdown
Member

@harshsomankar123-tech harshsomankar123-tech left a comment

Choose a reason for hiding this comment

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

Hi @doppem15 , thanks for the refactoring! I have a few minor concerns.

Copy link
Copy Markdown
Member

@harshsomankar123-tech harshsomankar123-tech left a comment

Choose a reason for hiding this comment

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

@doppem15 @dorianpercic I’ve addressed my concerns, and one failing test case has now been fixed. Now LGTM.
Thanks!

@sonarqubecloud
Copy link
Copy Markdown

Copy link
Copy Markdown
Member

@wslany wslany left a comment

Choose a reason for hiding this comment

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

PO reviewed and found working as expected.

@wslany wslany merged commit ca54e26 into Catrobat:develop Apr 26, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Active Member Tickets that are assigned to members that are still currently active

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants