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

feat(android): viewShadowColor parity #13457

Merged
merged 2 commits into from
May 28, 2022
Merged

Conversation

m1ga
Copy link
Contributor

@m1ga m1ga commented May 22, 2022

Adds parity for viewShadowColor.

Example:

const window = Ti.UI.createWindow({});
const v1 = Ti.UI.createView({
	width: 100,
	height: 100,
	left: 50,
	backgroundColor: "#fff",
	elevation: 40,
})
const v2 = Ti.UI.createView({
	width: 100,
	height: 100,
	right: 50,
	backgroundColor: "#fff",
	elevation: 40,
	viewShadowColor: "#00f"
})

v1.addEventListener("click", e => {
	v1.viewShadowColor = "yellow";
});

v2.addEventListener("click", e => {
	v2.viewShadowColor = "red"
})

window.add([v1, v2]);
window.open();

open the app and click on the views.

Screenshot_20220522-151400

You can do it already with the current SDK using your theme:

    <style name="AppTheme" parent="Theme.Titanium.DayNight.Solid.NoTitleBar">
        <item name="android:ambientShadowAlpha">0.5</item>
        <item name="android:spotShadowAlpha">0.5</item>

        <item name="android:outlineAmbientShadowColor">@color/defaultOutlineAmbientShadowColor</item>
        <item name="android:outlineSpotShadowColor">@color/defaultOutlineSpotShadowColor</item>
    </style>
    
    <color name="defaultOutlineAmbientShadowColor">#ff0000</color>
    <color name="defaultOutlineSpotShadowColor">#ff0000</color>

Copy link
Collaborator

@hansemannn hansemannn left a comment

Choose a reason for hiding this comment

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

Looks good! Can be merged once master is bumped to 11.1.0 (will do today)

@hansemannn hansemannn added this to the 11.1.0 milestone May 26, 2022
@caspahouzer
Copy link
Contributor

As Hans already bumped the master to 11.1.0 and he approved this PR, LGTM

@caspahouzer caspahouzer merged commit 63b70fd into tidev:master May 28, 2022
@m1ga m1ga deleted the androidShadowColor branch November 12, 2022 00:05
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.

3 participants