Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Bug] Brushes API - gradient offset does nothing on Android #11795

Closed
Tommigun1980 opened this issue Aug 15, 2020 · 3 comments · Fixed by #11812
Closed

[Bug] Brushes API - gradient offset does nothing on Android #11795

Tommigun1980 opened this issue Aug 15, 2020 · 3 comments · Fixed by #11812
Assignees
Labels
a/brushes e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! p/Android t/bug 🐛
Milestone

Comments

@Tommigun1980
Copy link

Tommigun1980 commented Aug 15, 2020

        <Setter
            Property="Background">
            <Setter.Value>
	            <LinearGradientBrush
		            StartPoint="0, 1" EndPoint="0.5, 0">
		            <GradientStop Color="{ OnPlatform iOS='Red', Android='Green' }" Offset="0.9" />
		            <GradientStop Color="{ OnPlatform iOS='Green', Android='Red' }" Offset="1.0" />
	            </LinearGradientBrush>
            </Setter.Value>
        </Setter>

Deliberately ugly colors to showcase the problem - 'Offset' does nothing on Android.

iOS:
Screenshot 2020-08-15 at 7 02 31

Android:
Screenshot 2020-08-15 at 7 02 41

This is quite bad as I have a very hard time making the Android version look remotely the same as iOS - so please provide a workaround if this takes some time to fix.

Thanks!

@Tommigun1980 Tommigun1980 added s/unverified New report that has yet to be verified t/bug 🐛 labels Aug 15, 2020
@samhouts samhouts added this to New in Triage Aug 15, 2020
@Tommigun1980
Copy link
Author

Tommigun1980 commented Aug 15, 2020

I think there might be more problems -- I stopped using the offset and edited the StartPoint and EndPoint properties instead, and Android still doesn't look remotely the same as iOS.

iOS:
Screenshot 2020-08-15 at 7 11 55

Android:
Screenshot 2020-08-15 at 7 12 02

(I changed the colors to something more sensible).

        <Setter
            Property="Background">
            <Setter.Value>
	            <LinearGradientBrush
		            StartPoint="0, 0.4" EndPoint="0.4, 0">
		            <GradientStop Color="{StaticResource MyColor1}" Offset="0.0" />
		            <GradientStop Color="{StaticResource MyColor2}" Offset="1.0" />
	            </LinearGradientBrush>
            </Setter.Value>
        </Setter>

Edit: This may still be an 'Offset' problem - I was assuming the default ramp to go from 0 to 1, but if I remove the offsets it looks different on iOS also. So maybe this is the same problem with the 'Offset' as in the first example.

@jsuarezruiz jsuarezruiz self-assigned this Aug 17, 2020
@jsuarezruiz jsuarezruiz added a/brushes p/Android e/3 🕒 3 and removed s/unverified New report that has yet to be verified labels Aug 17, 2020
@jsuarezruiz jsuarezruiz moved this from New to Ready For Work in Triage Aug 17, 2020
@samhouts samhouts added this to the 5.0.0 milestone Aug 17, 2020
@samhouts samhouts added the in-progress This issue has an associated pull request that may resolve it! label Aug 17, 2020
@samhouts samhouts added this to In Progress in vCurrent (4.8.0) Aug 17, 2020
@samhouts samhouts removed this from In Progress in vCurrent (4.8.0) Aug 18, 2020
@samhouts samhouts added this to In Progress in vNext+1 (5.0.0) Aug 18, 2020
@samhouts samhouts removed this from Ready For Work in Triage Aug 22, 2020
@samhouts samhouts moved this from To do to In progress in Android Ready For Work Aug 22, 2020
@CARP-Kaiser
Copy link

<Ellipse StrokeThickness="3" Fill="AliceBlue" WidthRequest="150" HeightRequest="150" HorizontalOptions="Center"> <Ellipse.Stroke> <LinearGradientBrush> <LinearGradientBrush.GradientStops> <GradientStop Color="Blue" Offset="0" /> <GradientStop Color="Yellow" Offset="{Binding UploadProgress,Mode=TwoWay}" /> <GradientStop Color="Red" Offset="1.0" /> </LinearGradientBrush.GradientStops> </LinearGradientBrush> </Ellipse.Stroke> </Ellipse>
image

@CARP-Kaiser
Copy link

Binding the offset of the second gradient stop to the viewmodel does not work as intended. The slider value is bound to a float property in the viewmodel that should drive the offset. This is on android.

@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
@PureWeen PureWeen added this to To do in v5.0.1 via automation Nov 5, 2020
@PureWeen PureWeen removed this from In Progress in vNext+1 (5.0.0) Nov 5, 2020
@PureWeen PureWeen added this to the 5.0.1 milestone Nov 5, 2020
@samhouts samhouts added this to In Progress in vNext+1 (5.0.0) Nov 5, 2020
@PureWeen PureWeen removed this from In Progress in vNext+1 (5.0.0) Nov 5, 2020
@jfversluis jfversluis moved this from To Fix to PR Needs Review in 5.0.0 SR 5 (Planning) Aug 30, 2021
Android Ready For Work automation moved this from In progress to Done Sep 6, 2021
v5.0.1 automation moved this from To do to Done Sep 6, 2021
5.0.0 SR 5 (Planning) automation moved this from PR Needs Review to Done Sep 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a/brushes e/3 🕒 3 in-progress This issue has an associated pull request that may resolve it! p/Android t/bug 🐛
Projects
Development

Successfully merging a pull request may close this issue.

5 participants