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

Use Material Desing 3 For File Actions Bottom Sheet #12058

Merged
merged 10 commits into from
Oct 31, 2023

Conversation

alperozturk96
Copy link
Collaborator

@alperozturk96 alperozturk96 commented Oct 18, 2023

Material Design 3 Bottom Sheet Example:
bottomsheet_hero

Before:
before

After:
Screenshot 2023-10-18 at 14 41 05

STATE_EXPANDED bottom sheet behaviour can't have rounded corners. Official Source

  • [ Done ] Tests written, or not not needed

return binding.root
}

private fun applyTintedRoundedBackground() {
Copy link
Member

Choose a reason for hiding this comment

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

</androidx.core.widget.NestedScrollView>
</LinearLayout>

</LinearLayout>
Copy link
Member

Choose a reason for hiding this comment

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

lacks an empty line at the end

@@ -109,6 +109,8 @@ class FileActionsBottomSheet : BottomSheetDialogFragment(), Injectable {
bottomSheetDialog.behavior.state = BottomSheetBehavior.STATE_EXPANDED
bottomSheetDialog.behavior.skipCollapsed = true

viewThemeUtils.platform.colorViewBackground(binding.bottomSheet, ColorRole.SURFACE_VARIANT)
Copy link
Member

Choose a reason for hiding this comment

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

surface variant seems to be very high contrast, maybe use the same we use for dialog background?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Indeed, it appears to be slightly darker. Regrettably, we are not providing a ColorRole for the dialog; instead, we are directly passing the dialog as an argument, and the common library applies the scheme internally.

I believe we may need to introduce an additional ColorRole or function for the bottomSheet within the viewThemeUtils.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, the color roles are from the library implementation build by Google and they don't ship the color role for bottom sheets yet. But when I checked Google Drive bottom sheets and dialog where using the exact same color, so I expect it to be 2 different design tokens but ultimately the same color.

The reason for passing the dialog directly is that we wanted to have or move to mostly higher-level functions so devs don't need to know and choose color roles but have the common lib always choosing the appropriate ones.

@alperozturk96
Copy link
Collaborator Author

@AndyScherzinger @tobiasKaminsky In pipiline these tests are failed but in my local machine all of it passed.

pass

@AndyScherzinger AndyScherzinger force-pushed the feature/use-m3-for-file-actions branch from 0b62666 to f165db1 Compare October 31, 2023 15:38
Copy link

blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.

Copy link

Codacy

Lint

TypemasterPR
Warnings7979
Errors00

SpotBugs

CategoryBaseNew
Bad practice2626
Correctness7878
Dodgy code385385
Experimental22
Internationalization99
Malicious code vulnerability22
Multithreaded correctness99
Performance5656
Security1818
Total585585

Copy link

APK file: https://www.kaminsky.me/nc-dev/android-artifacts/12058.apk

qrcode

To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.

@AndyScherzinger AndyScherzinger merged commit 8199408 into master Oct 31, 2023
18 of 19 checks passed
@delete-merged-branch delete-merged-branch bot deleted the feature/use-m3-for-file-actions branch October 31, 2023 16:58
@AndyScherzinger AndyScherzinger added this to the Nextcloud App 3.27.0 milestone Oct 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants