ActionBar implementation - android-layout

which is better to use, GreenDroid, ActionBarSherlock or the ActionBarCompat library?
i'm really having problems in making my app interface for this feature.

//use your custom xml view to show your actionbar
View actionBarView = getLayoutInflater().inflate(R.layout.action_bar_custom_view, null);
actionBar.setCustomView(actionBarView);
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

A simple thing is to do your own BUT if you really want it you could try actionbarsherlock, best is always a question about preference but I use sherlock. With your own you don't have some of the small quirks which comes with the bigger libraries.

Related

TextEdit/TextBox onKey events in J2me

I'm developing (or trying to) a J2ME application. I need to be able to handle onKeyEvents (keyDown/keyPressed/keyUp...) in TextEdit/TextBoxes, but I've learned that such thing is not possible in J2me, at least not in a simple way as in Java/Android development (myEdit.setOnKeyListener() for example). I've read something about using Canvas, but I'm not sure how can I use that to make it work for me.
Answer to this question ( Image in button - j2me ) involves using the CustomItem class and make an item look/act like a Button. Is there anyway to use the same approach?
The TextBox and TextField objects are high-level GUI stuff, available when doing javax.microedition.lcdui.Form stuff.
In order to use keyPressed() and keyReleased() you must use javax.microedition.lcdui.Canvas (low-level GUI stuff).
But what you're probably really after, is LWUIT (https://lwuit.java.net). It is a framework built on javax.microedition.lcdui.Canvas which gives you a Form-like API with all the things javax.microedition.lcdui.Form is missing.

NavigationBarViewController Storyboard example

I want to build my layout using storyboards but also use the implementation of Material. But I have trouble to understand how to use the NavigationBarViewController with Storyboards.
Can you create an example for Storyboard using the NavigationBarViewController with transition between views? Is it possible to use segues?
Your question is a little vague, but yes, you can segue (and usually do in any complex app) between views while contained in a navigation controller. The navigation controller will persist between these views unless you are segueing using modals.

Can I use StablexUI with HaxeFlixel?

I'm new to Haxe/HaxeFlixel and I want to use an UI tool to make my game.
After some research I find 3 tools that seems to be good to make UI for Haxe.
HaxeUI
StablexUI
flixel-ui
flixel-ui has a serious lack of documentation, so I'm leaning towards StablexUI. However, it's not integrated with HaxeFlixel.
I test to load it in a FlxState but there are some issues.
First, the cursor is behind the UI
Second, the UI doesn't catch keyboard input
Third, the text is not visible
This is my code:
override public function create():Void
{
FlxG.cameras.bgColor = 0xff131c1b;
FlxG.mouse.useSystemCursor = true;
UIBuilder.init();
Lib.current.addChild( UIBuilder.buildFn('ui/main.xml')() );
super.create();
}
And the XML:
<?xml version="1.0" encoding="UTF-8"?>
<HBox padding="10" childPadding="5">
<InputText id="'input'" skin:Paint-border="1" skin:Paint-color="0xFFFFFF" w="150" h="20" text="'type any message here'"/>
<!-- Here we create on-click handler wich shows our alert box with input message -->
<Button h="20" text="'Show me the alert!'" skin:Paint-color="0xbbbbbb" skin:Paint-border="1"/>
Is it possible to use StablexUI with HaxeFlixel, and if yes how?
First of all, Flixel subverts the basic OpenFL display list with its own, so you'll have to layer the entire StablexUI object over the entire Flixel canvas.
This has some noteable downsides to it -- primarily that your entire UI will always have to be over your entire flixel canvas, and will not care about or respond to things like flixel state changes, etc. It also cannot mix with flixel assets like FlxSprites. With the cursor you might be able to get good results by turning off the HaxeFlixel cursor and just using the regular system cursor.
As for flixel-ui's documentation what specifically is lacking? Were you not able to find what you needed here?
https://github.com/haxeflixel/flixel-ui
Another possibility is HaxeUI -- HaxeUI has customizable backends, so it's possible that it could be implemented with native flixel widgets. That's a lot of work, but you could let the maintainer, Ian Harrigan, know that it would be valuable to you, and he might add it in the future.

how to add canvas to the background of a form in j2me

I am new to j2me. I am developing a mobile application in j2me. Is there a way of adding a canvas object to the background of a form? I tried searching in net with few people suggesting to use "jmepolish". I have no idea what jmepolish is..Is there a way to do this with normal j2me classes?
No there's no way to do this. A J2ME form has very limited levels of customisation.
In order to make a fancy looking form that looks exactly as you want, you need to use the Canvas class; this involves doing everything else yourself, i.e. drawing your own input widgets, managing your own user interaction, including scrolling, and any touch screen/gesture stuff if your device supports it.
You can use libraries like J2ME Polish that will do that for you, but even then you will be constrained by what that library supports; and there is an overhead for including the library in your midlet.

What View Component does the Google Plus App (Stream) use?

if you use the Google Plus App on Android and switch to the Stream, you get a view where you can swipe to the left and right between the All circles/Incoming/Nearby-Stream. What view component is used for this? Is this a standard Android component? Or where can I find democode how i can build such a view component?
You should take a look at the ViewPager from Android Compatibility Package for the desired widget/swipe navigation. Find more about it here
http://developer.android.com/sdk/compatibility-library.html
Also, checkout this recently posted tutorial and some sample code on ViewPager by Richard:
http://geekyouup.blogspot.com/2011/07/viewpager-example-from-paug.html
It is a combination of a ViewPager together with an indicator for where you are currently and where you can go swiping left and right.
A sample of how this can be done along with code you can use in your own apps may for example be found here. I've played with this code a little and it works pretty well.
None of the default widgets/views. I guess, it's some kind of a custom view with swipe functionality.
Honeycomb opens up a few new widgets which seem to have these functionality. Have a look here.
http://developer.android.com/sdk/android-3.0.html (New Widgets)
I used APKTool to take a look at what's going on. Hopefully it is okay to post this here. This is from version 1.0.2 of the G+ APK.
removed google+ app code as per CommonsWare's suggestion
So, it looks like they're using standard views, though perhaps with a good deal of gesture detection and smooth animation magic.
EDIT) If you really want to know about the exact inner-workings of what is going on in the Stream activity, I suggest you use APKTool yourself and examine the .smali code

Resources