"Back" and "Menu" button disappeared on Javascript Build when using android Theme - codenameone

After send a javascript build with androidTheme (override the default iOS theme), the output javascript apps works properly, just the "ActionBar" (Back,Menu) button do not appear (yes, there is Commands added into the form)
This make my build javascript apps with androidTheme cannot perform Command action or even "Back" command.
Any idea to solve this issue? If I use default iOS theme, the command is added automatically into the top/bottom bar.

This seems to be a continuation of the discussion here.
Generally commands are not portable unless you use the Toolbar API at which point they become cross platform. The iOS theme uses the StatusBar style to space the title so you can just set that UIID to 0 but if you build a native iOS app that might be an issue.

Related

Ionic app rendering incorrectly after camera opened

I have an ionic 1 app that uses $cordovaCamera to retrieve a photo from the user. Oddly, after the camera is opened (doesn't matter whether the user takes a picture, cancels, or picks one from library) the app renders incorrectly once it's closed. The status bar overlays the top of the view, and the bottom of the view overflows off the viewport. However, if you re-orient the device (go from portrait to landscape) it will fix itself.
Is there any way to force the app to repaint manually?
Extra info regarding the bug itself: I created a new ionic 1 app separately and copied the camera code over exactly and it does not have the same problem. Same versions of ionic, angular, ngCordova, and the camera plugin. So I believe the actual rendering problem is specific to my app. However, after a full day of messing around I can't figure out for the life of me what's happening.
We had the same issue with the cordova-plugin-statusbar version: 2.2.1
The solution was pretty simple. We downgraded this dependency to version 2.2.0 and everything worked as expected again.
To use an exact version of a cordova plugin, specify it in the config.xml of your project as in example below:
<plugin name="cordova-plugin-statusbar" spec="2.2.0"/>
Don't forget to remove ./platforms and ./plugins folders and to run cordova prepare after downgrading the plugin versions.
take a look at this plugin:
cordova-plugin-hidden-statusbar-overlay
just install it, and after calling the camera, run this code:
window.plugin.statusbarOverlay.hide();
The answer ended up being pretty easy: REMOVE the status bar plugin.
I was under the impression that the status bar plugin was needed to make it appear at all but this is not the case. The StatusBar plugin only lets you style it - but since iOS 9 you can only choose from 2 options anyway.
Remove the status bar plugin completely. Don't forget to edit your bower.json, config.xml, the initialization code in your ionic app that sets StatusBar defaults, etc.
Add padding or margin to the top of your app when the body element has the class platform-ios. Per the Apple Developer Docs:
Obscure content under the status bar. By default, the background of the status bar is transparent, allowing content beneath to show through. Keep the status bar readable and don’t imply that content behind it is interactive. There are several common techniques for doing this:
1) Use a navigation bar in your app, which automatically displays a status bar background and ensures that content doesn’t appear under the status bar.
2) Display a custom image, such as a gradient or solid color, behind the status bar.
3) Apply a blur to the content behind the status bar.
What you should end up with is the exact same appearance without the plugin.

Button from an iframe in WebBrowser does not work

I am using the WebBrowser component. There is a button in an iframe which when clicked has to trigger redirect. The redirection is not happening and I am given the android code below to use it to make redirection work.
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setAllowFileAccess(true);
webView.getSettings().setDomStorageEnabled(true);// setJavaScriptCanOpenWindowsAutomatically(true);
webView.getSettings().setAllowContentAccess(true);
Do I have to
1. Create a cn1 plugin so I use the android code
2. Or those settings come by default with the WebBrowser component for android.
3. Or is there another stuff I have to do to get the button to work.
Thanks.
You can access any of the set* methods on the settings using BrowserComponent.setProperty() e.g.:
myBc.setProperty("AllowContentAccess", Boolean.TRUE);
Notice that this might fail if a special permission is required.

How to remove Splash screen for both iOS and Android in Xamarin.Forms?

I'm new to Xamarin.Forms and was looking for a way to remove the Splash Screen and have my custom animated splash screen, does anyone have the idea about how to do it? Any help at all would be great!
Thanks
There is a blog post here that details how remove the default splash screen and replace this on iOS, Android, and WindowsPhone.
For example on the Android example, they are talking about creating a new Activity, prior to loading the default Activity that will launch the Xamarin.Forms App.
Using that approach will most likely also work in all other platforms. As you can do some platform-specific native animation set, prior to launching your real Xamarin.Forms App in your PCL.

CodeNameOne : when modifying default theme -> issue on device

I use codenameOne to build an mobile app. On the simulator the app works fine.
The app works fine on device when i use a default theme but when i modify it, i have white pages.
Can somebody help?
On the simulator:
On the device (Tablet Sumsung galaxy 10.1) everything is white:
There is an issue with background gradient style UIID's on Android.
However, you should probably not use background theme gradients as explained here. They are less efficient than background images by a big margin.

How do you get ActionBar from SocialBoo theme to show up in your GUI?

Ok. Starting over with this. I see that the SocialBoo theme has something similar in what I want to achieve. If I find that I can work and improve. I Added a new socialboo theme and created blank GUI. Assumed it would be a Commandbehavior but that didnt do the trick, so did adding tabs. Seems like those components are not for that specific bar... However did notice another issue.
How do I get the social actionbar as displayed in the socialboo theme? (Screen shot). Assuming those images etc are part of the default theme, right.
Also, If I create a TouchCommand = bar, title or native. It displays fine in Gingerbread but not ICS. DO you know why is that? (screen shot)
Thanks, in advance.
Those images aren't a part of the theme, they are a part of the specific demo. If you add a Tabs component to the center of the border layout UI you will get thee tabs where the "icon" property will allow you to customize the unselected icon and you can customize the selected icon as well. You can see the full source/resource file of the social boo demo in the docs and demos zip in the download section.
Generally customizing commands is a bit complex because of platform specific constraints, when running on an Actual Android 4 device we use the native ActionBar by default to provide the experience Android users are used to. This is hard for us to simulate so you will only see this properly in the device build. I suggest not relying on commands, it seems that what you are trying to achieve is easily doable with tabs and its possible that's why you had difficulties in your other question.

Resources