AIR for Android: toggle SYSTEM_UI_FLAG_HIDE_NAVIGATION - android

I want to toggle SYSTEM_UI_FLAG_HIDE_NAVIGATION or SYSTEM_UI_FLAG_LOW_PROFILE flag when compiling with AIR for ANDROID, but I don't know how to to this. Probably I had to modify the name_of_app.xml ...
I want to 'try' to switch off the menu bar in an Android Tablet, but every methods I try are a mess ....
Any Help ??
Massimo

If you want to remove the statusbar (the bar at the top), you need to go fullscreen. You can do this either in your app.xml by setting <fullscreen>true</fullscreen> or in your app at runtime by setting stage.displayState = StageDisplayState.FULL_SCREEN;
If you are trying to hide the menubar (the soft-navigation present at the bottom of Nexus devices and a limited number of other Android devices), this will set those buttons to be in their minified state as well (they are not hidden, but are set to a simple glowing circle rather than the icon). I do not know if it is possible through AIR to hide the menubar completely. It should be possible using an AIR Native Extension, assuming it is possible at all, but that may (likely is) more trouble than it is worth for such a simple task.
For future reference, you can't set most Android flags through AIR. It simply is not supported. You can set uses-permission and uses-feature in your app.xml as Manifest additions, but that is it.

Related

How to change system view icons/style, functionality on android?

How to change view and functionality of multiwindow form(picture 1) like that done samsung(picture 2)?
Do we need a launcher (just a specific system change) or do we need to compile a new ROM (if ROM, then where do we need to change the code and view)?
I tried to find a section of the system where the design and window functions are regulated in the multiwindow / freeform mode, but it did not work out. How do you think what part of the code is responsible for the style and elements of this "app header" (panel with button close and others)?
Take a look at Android Runtime Resource Overlay (aka RRO).

Android Action bar direction RTL

I try what simon tell to do for change direction but it's doesn't working.
It's seems that for hundredth of a second it's work but when Action bar add the action buttons it's put the buttons at left instead at right.
What can be the problem? it's seems that somewhere in nmy code had line that tell freamwork to do otherwise?
The RTL value (true or false) is included in the flags in getApplicationInfo.flags.
As a long shot - is it possible that you are somehow changing the value?
The ability to set RTL was added in Android 4.2 if you are supporting this OS level or higher, this will be easier for you to accomplish.
Proof it is 4.2+: https://groups.google.com/forum/#!topic/actionbarsherlock/-npidM2Eo0w
Google post outlining how to change to RTL: https://plus.google.com/+AndroidDevelopers/posts/HuHNSb8V7s8
Otherwise, I would reference the SO question already pointed to in another comment if you are supporting an OS level older than 4.2: How to handle RTL languages on pre 4.2 versions of Android?

How to disable flipping of the "up" button on the action bar?

Background
I've made an "app manager" alternative app, and I wish to add translation for RTL (right to left) languages.
Since I know that as of certain Android version, things got flipped to let words and sentences align correctly, I decided to first switch to such a language and then continue with the translation
The problem
After switching to an RTL language (Hebrew in my case), I've found out that the action bar's up button has the "<" image flipped horizontally:
So now it shows ">" instead.
The question
How do I fix it? It doesn't make sense to see it this way...
What worked for me was to let the system use the default theme, and not specify Holo. If you can live with that, the Up button will be oriented correctly. Unfortunately this cannot be done if you use AppCompat of course.
To make this even more annoying: the flipping of the up button is device specific. It occurs on Samsung devices but not on Google's. The supportsRtl flag is only for API 17 and above, so older Samsung phones cannot be fixed.
The issue is apparently the Holo implementation on Samsung devices. Be careful with flipping the icon since on Google phones it will be flipped wrong.
See this: https://code.google.com/p/android/issues/detail?id=68476
Well, you can access that ActionBar "up" affordance by calling Resources.getIdentifier and View.findViewById. After that you could rotate it.
final int upId = getResources().getIdentifier("up", "id", "android");
final View up = findViewById(upId);
// Call this to just rotate the icon 180°
if (getResources().getConfiguration().getLayoutDirection() == View.LAYOUT_DIRECTION_RTL) {
up.setRotation(180f);
}

Remove Android options menu in XE5 Delphi

Is there a way to completely remove the Android options menu in XE5 Delphi? I've been testing my application on a HTC One and because my phone doesn't have a menu button and my application doesn't have an options button, android automatically adds a options menu. Since this button is added by Android there is no way to add items to the menu.
I've already tried to change the minimal SDK version, but this makes the application very unstable and makes it crash when the orientation is changed:
<uses-sdk android:minSdkVersion="14" />
Is there an other way to remove the options menu? Now there is just a large options menu in the bottom of my screen that has no menu items.
Ok, you're right in that this empty action overflow menu is added because of your lack of hardware menu button.
On a Nexus 7 it's not such an issue as the empty overflow menu is added at the end of the other soft buttons.
On a HTC One, however, you can configure the Home button to act as a menu button, which removes the action overflow button.
It's not correct to say you can't add items to the menu. My Android session at CodeRage 8 shows how to add menu items. However, I'll grant you, it's a bit of a faff.
In order to remove it, the docs say you should set the targetSdkVersion attribute (not minSdkVersion) in your Android manifest to 14 (see this blog post for details). However having tried this it causes a crash if you don't prevent rotation in the RTM version of XE5, as you saw with your tests. This issue is sat in QC, logged some weeks back, hopefully to receive a fix in the near future.
However you should consider restricting the rotation as one course of action...... This is easy enough.
you must change in manifest android:configChanges="orientation|keyboardHidden">
to:
android:configChanges="orientation|keyboardHidden|screenSize">
then you can set minsdk, maxsdk, targetsdk as you want, and application will not crash

On Google TV How do I make Fullscreen Activity hide title and button properly?

It would seem that the Fullscreen Activity Demo/Template does not behave the same on Google TV with the way Status/Navigation/Action bar are handled. Note: to make the default template work on Honeycomb I had to make a slight change to the provided SystemUiHiderHoneycomb class (details)
Question: Should the Template work properly? (I think yes). Is there a good way of fixing it without special handling for Google TV detection? What's a good way of achieving the same result of hiding the title at the top and the button at the bottom?
Steps to reproduce:
Create new application via Android Tools wizard
Use Fullscreen Activity as first and only activity
perform code modification to SystemUiHiderHoneycomb class (details)
I tested this on a Google TV emulator and on a real device with the same result. (I also tested it without the change in step 3).
In the manifest, you need to ask for Theme.Holo.Light.noactionbar in your manifest.
There is a programmatic way to do this if you don't want to muck with the theme in the Manifest file.
See: http://emergentbit.blogspot.com/2012/12/andorid-quick-tip-remove-title-bar-from.html
TL;DR
// Remove title bar
requestWindowFeature(Window.FEATURE_NO_TITLE);
// Remove notification bar
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);

Categories

Resources