Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[UI] Upgrade to Material 3 design, refactor some core elements #201

Merged
merged 64 commits into from
Jun 30, 2024

Conversation

sadorowo
Copy link
Contributor

@sadorowo sadorowo commented Jun 13, 2024

Replaces #146
Replaces #196
Closes #179
Closes #162
Closes #131
Opens #202

Credits

Important

One thing have been done, I've increased minSdk to 21. tools:overrideLibrary wasn't working for me so I had to do this. If anybody knows a solution, you can review modified build.gradle file.
This is now fixed

What have been done

  • Updated Gradle dependencies
  • Fixed missing Intent receiver flags for Tiramisu+ API
  • Merged Szkolny.eu commits to original @santoni0's fork
  • Added text align in Home Timetable card
  • Fixed Material 3 code
  • Adapted code to new Gradle dependencies
  • Added Android 13+ themed icon
  • Removed dead code
  • Replaced deprecated methods with their alternatives
  • Adapted Notes elements to MD3:
    • dialog
    • view
  • Added grade code support
  • Added ability to lock layout

Warning

I'll remove dead code & replace deprecated methods in another PR. (maybe)
However, I don't promise anything

Things required to merge this PR

  • Merge changes from sadorowo/NavLib into original branch, and then:
    • change repository owner and commit ID in build.gradle:
      implementation "com.github.sadorowo:NavLib:323288f" -> implementation "com.github.kuba2k2:NavLib:<new commit hash>"
  • Fix "Back button opens drawer" function, currently app is opening drawer and exiting. We need to prevent exiting. - done

Conclusion

I'm not perfect in writing Android apps, especially in Kotlin/Java. Personally I prefer using Flutter because I often need to write multiplatform apps. However, I think the code is working fine.

Two things I've adjusted and I'm not sure about them:
1. data/api/edziennik/vulcan/data/VulcanHebe.kt:394

- filterType: HebeFilterType? = null,
+ filterType: HebeFilterType = HebeFilterType.BY_PUPIL,

I've set default filterType to BY_PUPIL, because if I wouldn't change it, the when condition would be non-exhaustive. I've tested it and it works fine for me.
edit: I misunderstood this code, now it's fixed

  1. sync/WorkerUtils.kt
    Basically, I've only changed two things. These changes were required because of the dependency upgrade.
First change
- val scheduledWork = workManager.workDatabase.workSpecDao().scheduledWork;
+ val scheduledWork = workManager.workDatabase.workSpecDao().getScheduledWork() as MutableList;

The as MutableList here is required because removeAll method which is used later doesn't exist for regular List.

Second change
- (WorkSpec.periodStartTime + WorkSpec.initialDelay)
+ WorkSpec.calculateNextRunTime()

I'm most unsure about this change. WorkSpec.periodStartTime doesn't exist in new version of androidx.work, so I think this is the replacement for this calculation.

Additional info

Original fork code is here.

@sadorowo sadorowo marked this pull request as ready for review June 15, 2024 19:14
@sadorowo
Copy link
Contributor Author

sadorowo commented Jun 15, 2024

sorry for such a huge number of changes in one PR, good luck future reviewer(s) 🥲

@sadorowo sadorowo marked this pull request as draft June 17, 2024 19:54
@sadorowo
Copy link
Contributor Author

marking as draft until all issues will be fixed

@kuba2k2 kuba2k2 marked this pull request as ready for review June 30, 2024 14:04
@kuba2k2 kuba2k2 changed the title [ui + core] huge code update [UI] Upgrade to Material 3 design, refactor some core elements Jun 30, 2024
@kuba2k2 kuba2k2 merged commit 0823e72 into szkolny-eu:develop Jun 30, 2024
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.

Dodanie themed icon UI: usunięcie dolnego paska Material You/Material 3
3 participants