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

PLATIR-45069: Add theme overrides for Floating button AEP Presentables #731

Merged
merged 6 commits into from
Feb 24, 2025

Conversation

prudrabhat
Copy link
Contributor

@prudrabhat prudrabhat commented Jan 21, 2025

Description

Currently UIService components are built to inherit the current activity's theme to maintain the app's styling. While this works for most cases, background is one the items where inheriting the parent theme as is does not work well, as this property applies to the view background for all views within an activity - covering the draggable floating button area, covering the in-app message background window etc.

This PR solves the problem by creating a copy of the current app theme and overriding specific attributes with values that are needed. This override is applied only for FloatingButton presentables for now to limit the scope. We can look into adding this approach (simply invoking getThemedContext()) to other presentables if there are more requests.

Related Issue

PLATIR-45069

Motivation and Context

How Has This Been Tested?

  • Instrumentation tests
  • Manual tests
    • Added a non transparent android:background value for the testapp (tested both Theme.AppCompat.* and android:Theme.Material) and ensure that the floating button still shows up with a transparent background draggable area.
    • Trigger non floating button presentables in combination with floating button to ensure that the override is only applied to floating buttons.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Copy link

codecov bot commented Jan 21, 2025

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 66.02%. Comparing base (47bb4e7) to head (9e788d5).
Report is 13 commits behind head on dev.

Files with missing lines Patch % Lines
...keting/mobile/services/ui/common/AEPPresentable.kt 86.67% 1 Missing and 1 partial ⚠️

❌ Your project status has failed because the head coverage (66.02%) is below the target coverage (75.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev     #731      +/-   ##
============================================
- Coverage     68.98%   66.02%   -2.96%     
- Complexity     1939     2019      +80     
============================================
  Files           194      216      +22     
  Lines          8953    10659    +1706     
  Branches       1121     1384     +263     
============================================
+ Hits           6176     7037     +861     
- Misses         2313     3070     +757     
- Partials        464      552      +88     
Flag Coverage Δ
android-functional-tests 28.24% <88.24%> (?)
android-unit-tests 61.30% <0.00%> (?)
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...ces/ui/floatingbutton/FloatingButtonPresentable.kt 68.75% <100.00%> (+9.38%) ⬆️
...services/ui/floatingbutton/views/FloatingButton.kt 76.19% <100.00%> (+76.19%) ⬆️
...keting/mobile/services/ui/common/AEPPresentable.kt 94.09% <86.67%> (+6.99%) ⬆️

... and 66 files with indirect coverage changes

@prudrabhat prudrabhat changed the title PLATIR-45069: Add theme overrides for AEP Presentables PLATIR-45069: Add theme overrides for Floating AEP Presentables Feb 5, 2025
@prudrabhat prudrabhat changed the title PLATIR-45069: Add theme overrides for Floating AEP Presentables PLATIR-45069: Add theme overrides for Floating button AEP Presentables Feb 18, 2025
@prudrabhat prudrabhat marked this pull request as ready for review February 20, 2025 19:57
@prudrabhat prudrabhat requested a review from praveek February 20, 2025 19:59
@prudrabhat prudrabhat merged commit b68c723 into adobe:dev Feb 24, 2025
22 of 23 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.

2 participants