UXDivers / Grial-UI-Kit-Support

This is our public repository for customers to report bugs about Grial UI Kit for Xamarin Forms
61 stars 26 forks source link

Custom Styles, Navigation Background Color not working in Android #469

Open eglibecerra opened 6 years ago

eglibecerra commented 6 years ago

The navigation bar in android is coming up as white instead of the proper color

Description

This is my specific styles for the issue I have in App.xaml

<Style TargetType="NavigationPage" ApplyToDerivedTypes="true">
    <Setter Property="BarBackgroundColor" Value="{ DynamicResource AccentColor }" />
    <Setter Property="BarTextColor" Value="{ DynamicResource InverseTextColor }" />
</Style>

I updated it to this just to see if i got some response from it, and I can safely say that BarTextColor works fine as this does change if i switch between Black and Red for example... but the main one Im having issues with is BarBackgroundColor doesnt pickup.

<Style TargetType="NavigationPage" ApplyToDerivedTypes="true">
       <Setter Property="HasNavigationBar" Value="True" />
       <Setter Property="BarBackgroundColor" Value="#027CC5" /> <!--This is a blue, also tried with #FF027CC5-->
       <Setter Property="BarTextColor" Value="Black" />
</Style>    

Not sure why this is not working... can someone please guide me in the right direction Cheers.

Screenshots

image

As you can see the NavBar's backgroudn color always comes back as white. the color atm i switched to black to see if I was getting some response from updating these styles, and yeah they change to black so i know this is the area i should be updating....

Version

image

image

Love the product by the way it has saved me a ton of time.

jpbrocca commented 6 years ago

Hi @eglibecerra,

This is weird. Is this happening on a Grial Starter or Grial Full sample downloaded from Grial admin, or is this happening in your own project? If it is the latest all I can think of is that perhaps you don't have the android theme set on the Android project. Is this happening on all your Android devices?

Can you please add more details about:

Regards and thanks for the positive feedback about Grial :) JP

eglibecerra commented 6 years ago

Hi JP,

This is happening on the Grial Full Sample downloaded from Grial Admin, I created my own styles as per the template you guys provide... its happening on Samsung Galaxy S7 and Samsung Glaxy S9 both with Oreo. Also with emulator (Android 8.1 API 27) it works fine in IOS

I'm using Xamarin forms 3.10x image

And yes i do have the theme set on my android project, below the merge MyAppTheme into Main.xaml

image

And in my MainActivity.cs after The OnCreate method that replaces the splash theme to my app theme

image

This is really weird indeed this didnt happen before when I was on the previous version of Grial.

eglibecerra commented 6 years ago

I have also noticed that my Splash screen has the ActionBar showing in a different color than my AccentColor which is a blue, its now coming as grey check this out...

image

This is also weird as my Splash theme inheirts from NoActionBar

image

jpbrocca commented 6 years ago

Hi @eglibecerra, Thanks for the detailed info!

That is really weird. I guess this could be possible happening due to:

We are going to research and let you know if we could reproduce the issue (so far we couldn't) and our findings.

Best regards, JP

eglibecerra commented 6 years ago

Ok been trying everything to debug this for hours, still no luck but my latest breakthrough is that I've noticed a flicker between when I navigate from my page to the page that has the issue with the navbar... a bit of context, the origin page has a custom nav bar (thats why the nav colors here are good), the destination page has the default navigation the one showing white background (when it should be white) but look closely at how it flickers between the correct color to a white background weeeeiird... theres nothing on my .cs file just the initialise and nothing on my model that does anything like show or hide on any of the lifecycle events. The image below is a screenshot of what happens miliseconds before I switch pages through navigation

image

And the gif below shows me navigating from a page to the page in question...

androidnavigationissueloop

Hmm Since im navigating from a page with a custom nav, to a page without it.... I've noticed you guys in the samples have this tweak for android on the NavigateTo method... which i cant use as im using MVVM with Prism, (perhaps i could just havent tried) but still i doubt this would be an issue, i think the below code im talking about just takes care of that flicker during navigation... please correct me if im wrong.

image

eglibecerra commented 6 years ago

Hi JP just answering your questions...

I had to re-install visual studio as i had a weird update that didnt complete and trashed my instance, tried to clean up recover you name it tried it all had to re-download vs2017 these are my detailed versions...

Microsoft Visual Studio Enterprise 2017 Version 15.7.6 VisualStudio.15.Release/15.7.6+27703.2047 Microsoft .NET Framework Version 4.7.03056

Installed Version: Enterprise

VisualStudio.Mac 1.0 Mac Extension for Visual Studio

Xamarin 4.10.10.2 (35a01d8dc) Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin Designer 4.12.1 (f3257e429) Visual Studio extension to enable Xamarin Designer tools in Visual Studio.

Xamarin.Android SDK 8.3.3.2 (HEAD/dffc59120) Xamarin.Android Reference Assemblies and MSBuild support.

Xamarin.iOS and Xamarin.Mac SDK 11.12.0.4 (64fece5) Xamarin.iOS and Xamarin.Mac Reference Assemblies and MSBuild support.

jpbrocca commented 6 years ago

Hi @eglibecerra, how are you?

We couldn't reproduce your issue. We downloaded a Grial Full sample from Grial Admin, changed colors on style but everything seems to work OK.

Did you find anything else that could help us to identify the root of this issue?

Regards and thanks, JP

eglibecerra commented 6 years ago

Hi JP, Thanks for getting back and thanks for trying to reproduce the issue, I really cant think of anything else that could be causing this... its so weird I wish I knew... lets put this on hold for a sec I'm going to try and extend the navigation and force the colors on it. Hopefully this will work, have you guys noticed a lot of people using the latest version of Grial for XF 3.0? (perhaps by some analytics you guys may have on the site) Could it be just me? for god knows why?

xperseguers commented 5 years ago

Any further idea on it? Looks like I'm experiencing something similar, although not using Prism nor Grial Kit but my own application. Detail on this post: https://forums.xamarin.com/discussion/comment/358993

I'm able to change the color of the text but the navigation background constantly stays white, no matter what!

ShamineDsouza commented 4 years ago

Hi,

I am facing a similar issue in IOS . It is working fine in android