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

Migrated the whole app to Jetpack compose #281

Merged
merged 43 commits into from
Jan 2, 2025

Conversation

Saifuddin53
Copy link
Contributor

@Saifuddin53 Saifuddin53 commented Dec 18, 2024

Contributor checklist


Description

Complete Migration to Jetpack Compose

  • Removed all fragment dependencies.

  • Ensured composables are fully independent of XML.

  • Replaced the traditional ViewPager with Jetpack Compose's Pager layout.

  • Migrated all individual pages from fragments to composables.

  • Adopted Material theming specifically for managing colors across the app.

  • Replaced fragment-based navigation with Jetpack Navigation.

  • Designed a new navigation graph for seamless navigation within the app.

  • Added a custom dark mode switch, controlled via shared preferences.

  • Made dark mode independent of system settings for a better user experience.

  • Improved the settings screen to dynamically update the list of installed keyboards whenever a change occurs.

  • Refined layouts and components to ensure consistency across the app.

  • Adjusted design elements to align with a unified theme.

  • Installation Page Responsiveness Fix

Screenshots

Before

before.mp4

After

after.mp4

Manual Testing

  • Tested all app features manually to ensure functionality and stability.
  • Verified navigation, theme switching, dynamic updates, and overall app responsiveness across devices and orientations.

Automated Test Status

Currently, two tests are failing:
- Run Coverage
- Tests for XML-based Screens
These tests are for the XML-based screens migrated to Jetpack Compose. Addressing these failures will require updating or rewriting the tests, which can be done in a subsequent PR.

Related issue

Additional notes

  • Please feel free to test this branch thoroughly and share any suggestions or feedback. ☺️
  • This migration marks a significant step in modernizing the app, aligning it with current Android development best practices.

Copy link

Thank you for the pull request!

The Scribe team will do our best to address your contribution as soon as we can. The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

If you're not already a member of our public Matrix community, please consider joining! We'd suggest using Element as your Matrix client, and definitely join the General and Android rooms once you're in. Also consider joining our bi-weekly Saturday dev syncs. It'd be great to have you!

Maintainer checklist

  • The linting and formatting workflows within the PR checks do not indicate new errors in the files changed

  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@Saifuddin53 Saifuddin53 marked this pull request as draft December 18, 2024 06:22
@Saifuddin53
Copy link
Contributor Author

Will surely make the necessary changes @andrewtavis :)

@Saifuddin53
Copy link
Contributor Author

@angrezichatterbox @andrewtavis if possible then can you please share some screenshots of the bugs/inconsistencies as it is working all fine on my debugging machine it would help me a lot :-)

# Conflicts:
#	app/src/main/java/be/scri/adapters/ViewPagerAdapter.kt
#	app/src/main/java/be/scri/fragments/AboutFragment.kt
#	app/src/main/java/be/scri/fragments/LanguageSettingsFragment.kt
#	app/src/main/java/be/scri/fragments/MainFragment.kt
#	app/src/main/java/be/scri/fragments/PrivacyPolicyFragment.kt
#	app/src/main/java/be/scri/fragments/ScribeFragment.kt
#	app/src/main/java/be/scri/fragments/SettingsFragment.kt
#	app/src/main/java/be/scri/fragments/ThirdPartyFragment.kt
#	app/src/main/java/be/scri/fragments/WikimediaScribeFragment.kt
#	app/src/main/java/be/scri/ui/screens/AboutScreen.kt
#	app/src/main/java/be/scri/ui/screens/SettingsScreen.kt
@andrewtavis
Copy link
Member

I'll let @angrezichatterbox send along the screenshots. In the meantime, would you be able to check the linting errors and fix those? :) Seems to be some indentation issues.

@Saifuddin53
Copy link
Contributor Author

Wishing you a happy new year ✨🎉@andrewtavis @angrezichatterbox I've implemented the requested changes—please let me know if there's anything else to address!

@andrewtavis
Copy link
Member

Happy new year to you too, @Saifuddin53! 🎉 Thanks for the changes and looking forward to the review 😊

@angrezichatterbox
Copy link
Member

angrezichatterbox commented Jan 1, 2025

Happy new year @Saifuddin53

In Medium Phone API 35 and Pixel 9 Pro the screen looks like this.

Screenshot 2025-01-01 at 1 22 50 PM

The navigation bar seems to be like this for some reason.

Screenshot 2025-01-01 at 1 22 44 PM

Could u fix the dark mode toggle to be like the usual toggle instead of the one you have used.

Screenshot 2025-01-01 at 1 23 02 PM

The entire page seems to have centered a bit.

Also the individual page app bar title should have a little top padding.

@andrewtavis
Copy link
Member

Thanks so much for the detail in your review, @angrezichatterbox!

@Saifuddin53
Copy link
Contributor Author

Thanks a lot @angrezichatterbox for sharing the screenshots, this will help me a lot in solving the inconsistencies 🫡

@Saifuddin53
Copy link
Contributor Author

@angrezichatterbox I have made the required changes ready for review :)

Copy link
Member

@angrezichatterbox angrezichatterbox left a comment

Choose a reason for hiding this comment

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

All looks Great @Saifuddin53. Just a few changes and we would be good for merging.

.testTag("backgroundContainer")
.verticalScroll(scrollState),
horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Center,
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove the verticalArrangement and add a small top padding to the Image. Currently this is how the Installation Page looks for Scribe-iOS.

@@ -1,251 +0,0 @@
/**
Copy link
Member

Choose a reason for hiding this comment

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

Could you add this LICENSE TEXT to the SettingsScreen.kt that you have created. Could you check the same for the other pages as well. If it was already existing was it removed.

contentDescription = "Keyboard",
modifier =
Modifier
.clip(MaterialTheme.shapes.medium)
Copy link
Member

Choose a reason for hiding this comment

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

Could you remove this clip. I don't think it would be necessary. It add a circle to the Installation icon.

@Saifuddin53
Copy link
Contributor Author

@angrezichatterbox pushed the review changes

@andrewtavis andrewtavis linked an issue Jan 2, 2025 that may be closed by this pull request
2 tasks
@angrezichatterbox
Copy link
Member

Everything looks good to me now. Thanks for the quick changes @Saifuddin53

@andrewtavis
Copy link
Member

Feel free to accept and merge this, @angrezichatterbox, or I can get to it tonight after work as well :)

@angrezichatterbox angrezichatterbox merged commit 1c1ac22 into scribe-org:main Jan 2, 2025
4 checks passed
@Saifuddin53 Saifuddin53 deleted the compose_migration branch January 2, 2025 12:02
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.

The Installation Page is not responsive
3 participants