Flex 3 loading background color - flex3

During loading of a Flex 3 built application, it always shows this blue-grayish background color. I've tried a handful of tips, building preloaders etc, and all that works, but even before the preloaders kick in, that blue-grayish color is displayed. I've tried lots of ways to change it, like editing compiler options, setting background image to an empty string etc, but nothing works.

I had this same issue and spent a good hour looking for a solution. To the best of my understanding, the blueish-grey color is directly set from the HTML file generated from index.template.hmtl. There is a binding in that file under <param name="bgcolor" value="{bgcolor}" /> that sets the background color. I'm assuming that bgcolor should be pulled from the backgroundColor you set in your Application. And you could also just try hard coding your value in that param also.

To get past the default 'bluish' background on loading to say...white, add this to the compiler arguments: -default-background-color #ffffff.

Related

How to style notifications in Vaadin Flow

I would like to style notifications in Vaadin Flow (19+), in Java, exactly as shown here in typescript, by assigning a theme and not setting the color of the elements (as shown in the java example). Apart the fact that setting the color is troublesome (foreground, background...) and fragile (e.g. switching to dark mode), the Java example shows setting a CSS color, I would expect to be allowed to use Lumo color variables (e.g. --lumo-success-color). Is this possible? Can anybody show an example?
You can use the addThemeVariants() method to define the variant you want to use:
Notification notification = new Notification();
notification.addThemeVariants(NotificationVariant.LUMO_PRIMARY);
The Java examples have not been moved over to the new docs site yet, you can find them here https://vaadin.com/components/vaadin-notification/java-examples/theme-variants

How do I change the appearance of my Xcode app?

I'm trying to create a dark mode for my application made in Xcode 8. My first though was to use Mojave's Dark Aqua, but I get many errors:
Unrecognized effect parameter type 10 encountered for effect type 1131375730. Skipping.
My next idea was to create my own .car file, using https://github.com/insidegui/AppearanceMaker. However, this did not change the background/window, even when I edited its Windows and Menus/Menu/Menu Background and its Colors/Window Background.
My third idea was to use El Capitan's Dark Theme (for the dark Menu and Dock, I'd assume). However, this changed the Aqua blue to a grey. Laaaaame.
What am I to do?
At the end of the day, Mojave's DarkAquaAppearance worked! I needed to set my NSWindow to the theme. (using yourNSWindow.appearance = [[NSAppearance alloc] initWithAppearanceNamed:#"DarkAquaAppearance" bundle:nil];, making sure that DarkAquaAppearance.car is in your "Supporting Files")
If you want to do the same, I have all the Mojave appearances in https://github.com/radzo73/Mojave-Appearances. It still will call errors about "Unrecognized effect parameter", but that's probably just the compressed assets, and I'm using an older system. ¯\_(ツ)_/¯
With (real) hope,
Conrad

How to Set SystemTray Color

I was attempting to change the color of the SystemTray, but for some reason I cannot get it to work correctly. I am not sure what I am doing wrong.
shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Cyan"
Is this not correct?
shell:SystemTray.IsVisible="True"
shell:SystemTray.BackgroundColor="Cyan"
Is the proper solution. I am using PhoneThemeManager from NuGet which automatically overrides device defaults to force either light or dark theme. Setting the SystemTray.Background using the above code is causing the Background to be white. Not sure how to fix this specific issue, but in all other cases the above code should work.

AIR custom transparent chrome problem Flash Builder 4.5.1

I'm re-creating an AIR app with FB 4.5.1. (I've started from scratch, having had trouble importing FB 4 projects).
In the app.xml I have the following defined:
<systemChrome>none</systemChrome>
<transparent>true</transparent>
Having done this I still get a full window with titlebar, min, max, and close buttons.
what gives?
I believe you need to create a skin for the application.
This appears in Adobe's forum, and includes an FXP of a functional transparent app:
http://forums.adobe.com/thread/476699
Setting systemChrome & transparency along with "backgroundAlpha" to "0" would have helped in Flex 3.
But, skinning of components in Flex 4 i.e Spark components is little different and completely customizable.
Following are the steps you need to do make the window transparent.
Set systemChrome to "none" in the XML configuration file
Set transparent to "true" in the XML configuration file
Copy the skin code from <SDK_FOLDER>\frameworks\projects\airframework\src\spark\skins\spark\S parkChromeWindowedApplicationSkin.mxml and paste in a new MXML file.
Set the "alpha" property of "backgroundRect" object inside the skin file to "0".
Assign the newly created skin as the "skinClass" for "s:WindowedApplication" object
Please import the attached FXP file using "File->Import Flex Project" menu and have a look at the code to make it much more clear.
First, I discovered it is easier to interact with app.XML by opening it via "Open With -> Text Editor".
Second, and this is really embarrassing, I had simply failed to remove the comments bracketing
was:
<!-- <systemChrome>none</systemChrome> -->
<!--<transparent>true</transparent>-->
should have been:
<systemChrome>none</systemChrome>
<transparent>true</transparent>
...duh! I knew better, but...
Lastly, for a completely chromeless app, add
showStatusBar="false"
to the app header.
that's it!

Theme-aware XAML resources in a WP7 project

I'm making a Windows Phone 7 application and I'm a bit confused with dark/light themes.
With a panorama, you very often set a background image. The issue is it's very hard to make a picture which is right for both dark and light themes. How are we supposed to proceed?
Is there a way to force a dark/light theme for a panorama? This will avoid making theme-specific panorama background pictures. Then how do I do? I found xaml files in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Design. If this is a right way to proceed, how can I import them for my panorama?
Or if there's no way (or if it's wrong) to force a dark/light theme: how to write conditional XAML to set correct resources? Now I have the following XAML (default.xaml) which is fine with the dark theme:
<ImageBrush x:Key="PageBackground" ImageSource="Resources/PageBackground.png" Stretch="None" />
<ImageBrush x:Key="PanoramaBackground" ImageSource="Resources/PanoramaBackground.png" Stretch="None" />
But when I use a light theme, black controls and black texts are hard to read with my dark background pictures. So I made different pictures that I can use this way:
<ImageBrush x:Key="PageBackground" ImageSource="Resources/PageBackgroundLight.png" Stretch="None" />
<ImageBrush x:Key="PanoramaBackground" ImageSource="Resources/PanoramaBackgroundLight.png" Stretch="None" />
Now my issue is to make XAML conditional to declare the right thing depending on the current theme.
I found no relevant way on the Internet. I would prefer not to use code or code-behind for that because I believe XAML is able to do this (I just don't know how).
EDIT: Code snippet to load a xaml file as ResourceDictionary
string xaml = null;
StreamResourceInfo xamlInfo = Application.GetResourceStream(new Uri("light.xaml", UriKind.Relative));
using (StreamReader sr = new StreamReader(xamlInfo.Stream))
xaml = sr.ReadToEnd();
dic = (ResourceDictionary)XamlReader.Load(xaml);
this.Resources.MergedDictionaries.Add(dic);
To force a dark or white theme you can indeed use the styles defined in the folder you pointed out. Copy and Paste the rules you need to your App.xaml (just PhoneForegroundColor, PhoneBackgroundColor and the related Brushes would be a good start).
It's probably better though to stay "theme-aware" and load a different image for light and dark themes. Here is an article explaining how to do this: http://blog.jayway.com/2010/12/16/theme-aware-panorama-background-in-windows-phone-7/
There is another possibility I've found: You can use the Coding4Fun Toolkit Converter according to these instructions. However, I'm unable to use correctly use them.
Another possibiliy is to use an OpacityMask. But this only works for black/white images :/
Yousef's solution looks interesting. but it takes too much time to load. The image will be changed round about 1s after the app started. I've tested this on a Nokia 820. I've moved the call for setting the DataContext in a Loaded Event, which was called much later. Now the call takes place in the constructor, so the image will be already set when the application displays it. However, it still adds more loading time :( Any suggestions on how to improve this?