Manually Setting the color of the WP7 System Tray - windows-phone-7

I have read the UI Design Guidelines for WP7 development and am actually a fan of Metro (to a point). However, an app I am developing is requiring custom theming regardless of the user's theme settings.
In general, I just manually set each element that I want to be sure uses a specific color (rather than a theme resource). But I can't seem to find settings regarding the system tray (status bar).
I am okay with it showing as long as I can change it's color (failing that though, how can I hide it?). The color I need it to always be is black. Obviously when the dark theme is selected, we are good to go. But it looks terrible in the light theme to have a big white bar at the top of the app.
Hopefully this is an easy question with some easy to earn rep!

It is possible to change that color in mango. SystemTray.BackgroundColor = Colors.Orange; In my case it must be inserted in OnNavidatedTo, in constructor it disappeared after 1 second.

If you want to set this in the xaml you can do something like this:
shell:SystemTray.IsVisible="True"
shell:SystemTray.Opacity="0"
shell:SystemTray.ForegroundColor="Black"

I am not aware of a way to change the theme of the system tray (or status bar). You can hide it using the SystemTray.IsVisible property.
Note that I've had trouble trying to set that property within the page constructor (I think it fails when resuming after tombstoning, don't remember exactly). The solution was to place the code in the page's Loaded or OnNavigatedTo event.

Related

Is the social boo theme dead in codenameone?

I've been struggling with app dialog and toolbar appearances in the social boo theme for some time. I recently discovered that my struggles are less with my code and more with the theme. In the GUI Builder switching the Native Themes from IOS6, IOS7, and Android (Gingerbread I believe) all create very different dialogs ranging from matching to illegible to ok. Also I found this demo:
https://www.codenameone.com/demos-SocialBoo.html
and ran it on my Android (S6) phone. The below image illustrates the problems:
Social Boo visualizations
Note the Dialog's appearances as they change in the first 3 images. Please note in the 3rd Android picture I'm clicking on the Cancel button to show how differently it paints with the pointer pressed. The 4th image is again from my phone, note the toolbar button on the top right with a square image placed oddly over a rectangular button. Ah finally, all the problems I'm seeing in my app happening elsewhere!
Hopefully my title question now makes more sense. Is the social boo theme being updated with CodenameOne releases or is it dead? Should I abandon using it as it'll have quite varied appearances on devices especially iOS? I'd love to have the theme maintain the IOS6 appearance on all devices - how can I achieve that goal? Thank you in advance for your help!
It's a bit out of date. Most developers just cut a PSD design from scratch which works best when based on a native theme.
You can easily fix these things if you want to work with that theme though. When we implement a theme we don't aim to implement every feature that might be needed as those are hard to predict and will increase the theme size. The original theme didn't include design for dialogs so some behaviors leaked out.
You can use theme constants and UIID's like the theme constant dlgButtonCommandUIID to determine the UIID of the buttons within the dialog.

How to make a menubar app look good with "Dark Mode" in Yosemite?

While developing a menubar app, I am having a hard time finding the preferred method for making the app actually look good. I would have thought that Apple controls would have essentially handled this for the most part, but it appears not.
What is the preferred method for making sure a menubar app looks good in both light and dark mode? Am I missing some control functionality that facilitates this more easily or do I need to manually detect the mode and modify controls appropriately?
I have a menubar app, and I didn't have to do anything to make it look good in the dark theme.
Light theme:
Dark theme:
The most important things you need to do are:
Use system colors (e.g., [NSColor textColor], [NSColor textBackgroundColor]. These automatically adapt with the various themes. See the Color and Typography section of Apple's OS X Human Interface Guidelines.
Use template images. These also adapt to color changes. See the System-Provided Images section of Apple's OS X Human Interface Guidelines.
It's worth noting that Apple has not made it easy to programmatically detect which color theme is running (there are some tricks, but I'm not aware of any sanctioned method). My sense is that they've done this intentionally, so developers don't do custom per-theme stuff. Using system colors and template images, you shouldn't have to.
Update:
Sample project here: https://github.com/zpasternack/MenuBarTest
Well, you haven't explain (or shown) in what way it looks bad. Probably, you are using a normal, non-template image for its icon. You should use a template image, which is an image whose only significant part is the alpha mask. You tell the system that it's a template image either by naming it with a "Template" suffix (e.g. "FooTemplate.png") or by calling -setTemplate: on it.

Automatic Dark/Light Icon Support in Windows Phone 8

I think this is a very common problem, but I cannot find a suitable solution for me. As you all know, WP supports a dark and a light theme. The user can change the theme and there are ways to override his decision and to display everything in the color theme you've selected. However, I'm just trying to react to this two theme types and I want to display icons in the correct color.
If you use the Application Bar, you can select from many built in icons, which will be automatically inverted from light to dark and vice versa.
Why isn't there any support for normal images? For example: I want to display a telephone icon. I've picked one from the built in icons and copied it from the Microsoft SDK folder to the Image folder of my project. If the user uses the dark theme, everything will be fine because the white telephone icon will be visible on the black background. But if he switches to the light theme, the icon will be invisible because it is white on white.
I'm fully aware of the style resources for textboxes or background colors, which use the phone's accent or theme color. But why is it, that there is no support for simple icons which I added as Image to my XAML page?
Of course I could detect in the constructor of the page if the user is in dark or light mode. I would then load either a black or white version of the telephone icon. But this check will be done everytime I visit the page and slows everything down. It's also annoying to manually add the check for the theme each time I'm adding a theme aware image.
Is there any solution, which will work with XAML only? Or is at least easy to maintain? And why can't I use the built in images from the SDK right from the beginning? They are already available in dark and light versions and are already used in the application bar.
If you want the icon to function like in the actionbar, just be white (if dark theme) and black (if light theme) then you can add the image as an opacity mask to a rectangle, like this:
<Rectangle Fill="{StaticResource PhoneForegroundBrush}" Width="48" Height="48" >
<Rectangle.OpacityMask>
<ImageBrush ImageSource="/Images/my.icon.png" />
</Rectangle.OpacityMask>
</Rectangle>
Where my.icon.png is a white image, like those you can choose for the actionbar.
You could use vector graphics instead of bitmap icons and use a theme-aware brush to draw them.
If you want the App to respond to a switch of the theme you'll need to respond to it any way.
I added a property to the base class of my Views that returns the selected theme. That way I can use/bind to that value.
It is also possible to use a ValueConverter that turns a logical name of a resource into a name of a theme specific resource.
Edit
Have a look at this: Custom light/dark theme resources on Windows Phone 7
Detect the theme (Supporting dark and light themes gives the best solution for this, I think), and then set the image accordingly. If you do this a lot, a custom control where you can supply two image sources and the correct one gets used would be easy enough to create.
Edit: Here's another good article on this topic. New Screen Resolutions
You pick a White Foregrounded icon use it. It suits for both Light and Dark themes. Thats what I have been doing.
The Coding 4 Fun control toolkit includes a round button that mimics the application bar buttons, including updating the foreground color depending on the theme. The code is open source, so perhaps you might find an answer in there. Or, as a hack, you could use the RoundButton control, turn off the border, and not provide a Click event.

How to set the default color theme of an app in Windows Phone 7?

Is it possible to set the default color of an application?
The problem is I have custom backgrounds in my app. If I have the white theme selected it looks nice. When I select the dark theme I cannot read it.
Is there a way to set it for the whole application e.g. that it should be white, whatever the phone default theme is?
Just define your own color resources and use them on your elements where necessary. Here is an example how to do this. Defining one "default color" for the whole application is not possible as far as I know. It would be a rather obscure setting. Maybe property value inheritance comes close to what you mean.
By the way: please don't design overly bright applications which ignore my dark theme. It hurts my eyes.

Buttons on ApplicationBar (WP7)

If you open settings of wifi and choose any network you will see Password textbox and BUTTONS (not icons) in ApplicationBar. How it is made? Is it some kind of ApplicationBar template? Or it is some Border control, but how to show a Border above the SIP(keyboard)?
Any ideas how to make the same thing?
What are you describing was not created using Silverlight (all the "hero" applications are done in C++) and are therefore not limited by the current SL feature set.
In relation to your actual question, it is not possible to template the ApplicationBar nor is it even possible to determine when the SIP is displayed (or what its height is).
In short, I'd stick to icons if you want your application to work well across devices.

Resources