-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat(android): add parity for BlurView API, move iOS to Ti.UI namespace #14277
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
base: master
Are you sure you want to change the base?
Conversation
android/modules/ui/src/java/ti/modules/titanium/ui/widget/TiUIBlurView.java
Outdated
Show resolved
Hide resolved
@m1ga iOS is now also moved over - we have the unique chance to do deprecate the old one in 13.0.0, so I will restore the Ti.UI.iOS.BlurView deprecate it in 13.0.0 and then we can remove it in 14.0.0 |
Co-authored-by: Michael Gangolf <m1ga@users.noreply.github.com>
<attr name="ti_footerTitleColor" format="color" /> | ||
<attr name="ti_footerTitleBackground" format="reference" /> | ||
<attr name="ti_footerTitleBackgroundColor" format="color" /> | ||
<declare-styleable name="BlurView"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefix with Ti
to prevent clashes with other libs
<attr name="ti_footerTitleBackground" format="reference" /> | ||
<attr name="ti_footerTitleBackgroundColor" format="color" /> | ||
<declare-styleable name="BlurView"> | ||
<attr name="blurOverlayColor" format="color"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<attr name="blurOverlayColor" format="color"/> | |
<attr name="ti_blurOverlayColor" format="color" /> |
@@ -0,0 +1,171 @@ | |||
package eightbitlab.com.blurview; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a readme file to the package to link to the repo and explain why it's bundled like this?
private void init(AttributeSet attrs, int defStyleAttr) | ||
{ | ||
TypedArray a = getContext().obtainStyledAttributes(attrs, R.styleable.BlurView, defStyleAttr, 0); | ||
overlayColor = a.getColor(R.styleable.BlurView_blurOverlayColor, TRANSPARENT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be like this then?
overlayColor = a.getColor(R.styleable.BlurView_blurOverlayColor, TRANSPARENT); | |
overlayColor = a.getColor(R.styleable.TiBlurView_ti_blurOverlayColor, TRANSPARENT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we even need that in the XML? Devs should rather use the top-level APIs, making this more clean / genuine as well
Let's move it to a module - but not in 13.0.0 anymore, the release is big enough already. We can keep this open and I'll prepare a blur view module under tidev that has the sources of this PR bundled in one repo. Alright? |
sounds good. There we could also use the gradle module to reduce the code size if you want or this internal code setup |
As discussed in m1ga/ti.blurview#2
This pull request introduces a new cross-platform-style
BlurView
for Android, providing a background blur effect similar to iOS'UIVisualEffectView
. It adds a newTi.UI.BlurView
component, exposes cross-platform blur effect constants, and updates build dependencies to support the feature. Documentation is also added for the new component and its properties.It uses
Dimezis/BlurView
for maximized backwards compatiblity - and iOS has also moved to the same API!