Where is API call to do "lights out mode" in honeycomb? - android-3.0-honeycomb

I am working on a game and would like to have the full screen to itself.
Did anyone found a way to make the app go full screen on Android Honeycomb preview emulator?

Lights out mode has changed in the full 3.0 SDK. You can now enter lights out mode as follows:
View v = findViewById(R.id.view_id);
v.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
You can also set a listener on the view to be notified on changes to the system bar's visibility.

In prior versions of Android you can set the application to a full screen mode using this line in the manifest:
android:theme="#android:style/Theme.NoTitleBar.Fullscreen".
I can't say for sure that works in 2.3, since I haven't done anything with 2.3 yet.
Secondly, I'm not too familiar with the term "lights out mode" but you can adjust the screen brightness using the WindowManager.LayoutParams class and the screenBrightness field.

Two things I can add:
My ListActivity hides the status bar, but when it pops up a progress dialog the status bar shows for as long as the progress dialog is displayed. The following reduced it to a brief flash, and applies to all dialogs done via "showDialog". I can't get rid of it entirely yet.
protected void onPrepareDialog (int id, Dialog dialog) {
View main_layout = dialog.findViewById(android.R.id.content).getRootView();
main_layout.setSystemUiVisibility(View.STATUS_BAR_HIDDEN);
}
CAVEAT: "onPrepareDialog" is deprecated...
As shown in the snippet above, you can get the root view's ID without defining an explicit ID in the parent layout in the xml layout file, which makes this a one-file edit.

Related

WixCode controlling view of element on mobile / desktop

I'm learning the new Wix Code online development IDE and want to understand how to control the visibility of an item on mobile or desktop. How should I approach this?
If you're just trying to hide things from mobile, there's an easier way to do it (go to the mobile editor and click the element's hide button).
But assuming you're asking about WixCode because you need custom behavior:
Check out the formFactor API
https://www.wix.com/code/reference/wix-window.html#formFactor
And the properties panel
https://support.wix.com/en/article/working-with-the-properties-panel-6441151
The properties panel is where you'll set the element's default visibility.
Then check the formFactor using that API above
And finally use $w('#elementname).show() or hide() to change its visibility.
You have two options -
If you only want to control what appears on mobile vs desktop, you have a toggle to hide elements on mobile.
If you want to change dynamically visibility of elements on each or both, use the formFactor and hide/show/collapse/expand APIs.
For instance, on a button click you may want to show element1 on desktop and element 2 on mobile. The code will look something like the following -
import wixWindow from 'wix-window';
export function button1_onClick() {
if (wixWindow.formFactor === 'Mobile') {
$w('#element2').show();
}
else {
$w('#element1').show();
}
}

Is it possible to display custom icon in Visual Studio status bar

I am aware of displaying custom text in Visual Studio status bar using IVSStatusBar interface. I have even blogged about it.
However, I have requirement to display custom icon on the Visual Studio status bar. Similar to what Resharper does to display solution errors. On clicking the icon, it also pops-up a context menu.
So, How can I display a custom icon in Visual Studio status bar, and if possible display a menu also on clicking it?. An example will help.
The Animation method of IVSStatusBar already display icons, but uses predefined icons defined in Constants. Is it possible to have custom icons and pass to Animation method?
On exploring the SDK, I found that IVSStatusBarUser interface can be used to display custom information when the window implementing that interface is displayed. But I am not sure whether that interface can be used to display custom icon.
There is no published API for that kind of status bar extensibility. In one of my own extensions (PerfWatson Monitor), I locate the status bar element by searching the WPF visual tree, using a recursive search and VisualTreeHelper, descending from Application.Current.MainWindow looking for the resize gripper in the bottom right - a child element with the Name property set to
"ResizeGripControl". When I've found the gripper, I look at its parent (it should be a DockPanel) and insert my control in there. Note that, as your screenshot shows, Resharper is known to employ a similar trick, so you'll have to come up with a strategy that works with and without Resharper installed. Also note that some pieces of the status bar (the text, the line/col information and any animations) run in their own UI thread, so be careful if your control ends up there.
I notice you also ask about extending the existing animations. Yes, you can supply your own animations via a bitmap strip of 16x16 frames. See http://social.msdn.microsoft.com/Forums/en-US/vsx/thread/fef208e7-b79d-4a0c-94fe-e6861196e1f5/#ba47b61c-77a8-46c8-aa10-a04211312e6c for an example. Unfortunately, this won't allow a clickable menu.

Why are icons in property sheets rendered with so few colors?

I am creating a property sheet shell extension and want to have a little icon to set off my property tab from the standard system tabs. Unfortunately, my icon is being rendered almost entirely in grey.
Original image:
In the property sheet tab:
At first I thought this was somehow my problem, but then I saw that TortoiseSVN appears to have the same problem:
This happens in both Windows 7 and Windows 8.
Does anyone know why these images are appearing so muted? Also, does anyone have any hints on how to make the icon look good in spite of this colorlessness?
The PropertySheet function initialises its tab control with a 16 color (ILC_COLOR) ImageList and copies the supplied icon for each page into it. There doesn't seem to be a way to override this and supply your own ImageList (or to specify the bit depth of the created ImageList). Presumably this is a legacy of the original Windows 95 code that never got updated as things moved on.
Instead of Property Sheets, you can use Tab Control, which makes tabs management more flexible and clear. And of course you can use any type of icons, because you have to create your own ImageList.
Here you can read about Tab Controls:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb760548(v=vs.85).aspx
And here you can access example usage of Tab Controls:
Icons in Win32 Property Pages are ugly - 4 bit icons

Activereports (under VB6) issue

I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)...
I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear.
I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made it bigger and that made no difference.
What could be causing this?
Thank you!
Nick
It sounds like the TextBox is inside a UserControl. A UserControl is created by a developer, and is basically one control with any number of other controls in it. You can check to see if there are any User Controls in your project in the Project Explorer (Ctrl+R).
One way to know exactly what class the control belongs to is to open your form in design mode (Shift+F7), click on the control, and look at the Properties window (F4). The drop-down list should show the currently selected control's class name in bold, then the name of the object.
What is the control's class? If it is anything other than TextBox, then this would explain the unexpected behavior you experienced.

Unable to get system fonts on Panel's CreationComplete event on Mac

I am developing a Flex Panel, which has two combo-boxes. One of the combo-box will display the system fonts and the other combo-box will display the corresponding styles. For eg the first combo-box will display "Arial" then the other combo-box will display the following list:
Regular
Bold
Italic etc
I wrote the code "Photoshop.app.fonts" on my Panel's creation complete. This works fine when used in Windows but when I use the same code on Mac, this code does not work.
I saw that when I trace the "Photoshop.app.fonts.length" on Panel's creation complete on Mac the value returned is 0 while if I use the same code in click of a button i.e basically after the panel is fully created I get correct value ie 394.
Can someone please guide me why this is happening? and an alternate solution to get system fonts on Panel's creation complete event for Mac.
Thanks.
I have solved this problem by using PSMacDom which recursively calls my Panel's creation-complete function, which then retrives all the system fonts.
Thanks.

Resources