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

Added Jetpack Glance Theming #536

Merged
merged 14 commits into from Aug 21, 2023
Merged

Added Jetpack Glance Theming #536

merged 14 commits into from Aug 21, 2023

Conversation

tuuhin
Copy link
Contributor

@tuuhin tuuhin commented Aug 10, 2023

Added Colors to App Widget

App Widget is now responsive to the dynamic colors of the app on Android 12+,on lower version the app light and dark theme is used.

Secondary Changes

  • Rounded shape added on version lesser than Android 12
  • Added no task drawable to give a pictorial representation of no tasks

AlkaaGlanceTheme provides the glance theme,its used to get the dynamic colors,providing the color-provider by ColorProviders on Android 12+ dynamic color is taken in using material3 glance dependency and below that designed system colors.
Under Android 12 glance docent provides corner radius thus a shape drawable with the similar color radius  is implemented with surface colors.
Additionally due to the theme change preview is not properly visible in the widget drawer so added surface and surface color values
For No task additional vector resource is used to designate there is no tasks.
The heading of the widget was looking blank so added the Heading "Your Tasks",for the portuguese I just googled the translation,please change them if they are wrong.
TaskListGlanceWidget changes are added, changes include use of GlanceTheme.colors provider as color provider and some others.
In loading and preview added the background which is the same drawable mentioned above
The app widget can be directly updated by using updateAll no need to use the updateAppWidget when the serializer data get updated the update is catch by the currentState.
A updateData function that takes the new data and update the serializer
@tuuhin
Copy link
Contributor Author

tuuhin commented Aug 15, 2023

It's seems due to the keytool the build is failing.Its showing keystore was tampered with or password was incorrect.Could you elaborate on this.(why the build is failing)

@igorescodro
Copy link
Owner

It's seems due to the keytool the build is failing.Its showing keystore was tampered with or password was incorrect.Could you elaborate on this.(why the build is failing)

The current CI structure is not very fork friendly. The build.yml generates the signed release variant to make sure that the app is production ready. However, all the keys and passwords are GitHub Secrets, and GitHub doesn't provide this information for non-contributors.

I'll try to update the CI to run with fake credentials when an external PR is submitted, but this might take a while. In the meantime, I recommend you run ./gradlew check test locally to make sure your code is in compliance with our linters. Thank you for your contribution.

AlkaaGlanceTheme provides the glance theme,its used to get the dynamic colors,providing the color-provider by ColorProviders on Android 12+ dynamic color is taken in using material3 glance dependency and below that designed system colors.
Under Android 12 glance docent provides corner radius thus a shape drawable with the similar color radius  is implemented with surface colors.
Additionally due to the theme change preview is not properly visible in the widget drawer so added surface and surface color values
For No task additional vector resource is used to designate there is no tasks.
The heading of the widget was looking blank so added the Heading "Your Tasks",for the portuguese I just googled the translation,please change them if they are wrong.
TaskListGlanceWidget changes are added, changes include use of GlanceTheme.colors provider as color provider and some others.
In loading and preview added the background which is the same drawable mentioned above
The app widget can be directly updated by using updateAll no need to use the updateAppWidget when the serializer data get updated the update is catch by the currentState.
A updateData function that takes the new data and update the serializer
@igorescodro
Copy link
Owner

igorescodro commented Aug 15, 2023

Awesome! Now it’s working properly. The CI is failing due to lint checks. I believe you are good to go.

Unfortunately, the Instrumented Tests are very flaky recently so I might need to rerun them a few times.

@tuuhin
Copy link
Contributor Author

tuuhin commented Aug 15, 2023

Great to hear that the workflows are working fine now!

tuuhin and others added 8 commits August 15, 2023 19:03
AlkaaGlanceTheme provides the glance theme,its used to get the dynamic colors,providing the color-provider by ColorProviders on Android 12+ dynamic color is taken in using material3 glance dependency and below that designed system colors.
Under Android 12 glance docent provides corner radius thus a shape drawable with the similar color radius  is implemented with surface colors.
Additionally due to the theme change preview is not properly visible in the widget drawer so added surface and surface color values
For No task additional vector resource is used to designate there is no tasks.
The heading of the widget was looking blank so added the Heading "Your Tasks",for the portuguese I just googled the translation,please change them if they are wrong.
TaskListGlanceWidget changes are added, changes include use of GlanceTheme.colors provider as color provider and some others.
In loading and preview added the background which is the same drawable mentioned above
The app widget can be directly updated by using updateAll no need to use the updateAppWidget when the serializer data get updated the update is catch by the currentState.
A updateData function that takes the new data and update the serializer
Most of the linting errors are corrected.
Some doc strings are added and some where its corrected.
In the glance app preview the new glance heading <Your Tasks> aren't added so updated the preview xml and preview png files.
Ktlint was containing about the some linting problems fixed that.
The actual code is not changed only commas and braces are added
Reverting file that was wrongly updated when rebasing
Dumb mistake
Copy link
Owner

@igorescodro igorescodro left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Just run the app and the new widget looks great!

String resources for portuguese is corrected as per the suggestions,added contentDescription for Images
@tuuhin
Copy link
Contributor Author

tuuhin commented Aug 21, 2023

Changes as per the suggestion

  • string resources are corrected.
  • image description is added

@igorescodro igorescodro merged commit 66bbf0c into igorescodro:main Aug 21, 2023
4 of 5 checks passed
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.

None yet

2 participants