Quote:
Originally Posted by perrce
Btw, could you give me a quick rundown of the advantages of 1.4.1 + BananasPlus versus 1.4 + Bananas?
I know you've mentioned the scrolling BText and better art for standard definition. It seems that there were a few other things that escape my memory...
|
There are extra control types:
BMovableListPlus (similar to the season pass list)
BShuttleBarPlus (for streams, aka the trickplay bar that goes over recordings/live)
BScrollPanePlus (a scrolling viewport of a set of views)
BTilesPlus (a view that tiles another view repeatedly
Some enhancements to existing controls:
-buttons and lists both support "disabled" highlights (the black bar instead of the blue one)
-BKeyboardPlus is a more skinnable version of the keyboards and lets you make new keyboards that aren't restricted to a specific layout. It also gives you a "tall" keyboard similar to the browse by title feature on tivo.
-New layout manager to layout a screen using stretching and anchoring so you make one layout that adjusts itself depending on screen size instead of a layout for every resolution.
-All plus controls (except keyboard) extend their non plus counterpart so you can use them interchangeably for the most part.
-dynamically resizable skin graphics if you use the ScaledImageElement class.
-fonts, colors and other settings are stored in the skin and scaled to the resolution and are easily overridden.
-Automatic resource management in components. Like BButtonPlus has a setValue method and automatically disposes of the resource when it's no longer used.
-Lists have cell renderers with a good default so you don't have to extend a list in most cases and can set the renderer to tell it how to render your list items. Makes code a little cleaner.
Each plus component knows how to size itself appropriately for the resolution it is on. Here' a good example snippet from your code:
Instead of doing this with an if/else statement:
Code:
if(this.app.getHeight() >= 720) {
this.keyboard = new HDKeyboard( this.getNormal(), // Parent view
this.safeTitleH, // x
this.screenHeight / 4, // y
this.screenWidth - (2 * this.safeTitleH), // width
this.rowHeight * 7, // height
HDKeyboard.PLAIN_KEYBOARD, // keyboard type
true // show tips
);
}
else {
this.keyboard = new BKeyboard( this.getNormal(), // Parent view
this.safeTitleH, // x
this.screenHeight / 4, // y
this.screenWidth - (2 * this.safeTitleH), // width
this.rowHeight * 7, // height
BKeyboard.PLAIN_KEYBOARD, // keyboard type
true // show tips
);
}
All you need to do is this instead:
Code:
this.keyboard = new BKeyboardPlus( this.getNormal(), // Parent view
this.safeTitleH, // x
this.screenHeight / 4, // y
BKeyboardPlus.PLAIN_KEYBOARD, // keyboard type
true // show tips
);
It's easy for you to start using Bananas Plus if you want. You can mix regular Bananas and Plus in the same app. You just need to convert your BApplication to a BApplicationPlus and then get rid of the hmehd references.
Harmonium.java
-extend BApplicationPlus
-change initService() to just init()
-have your HarmoniumFactory extend FactoryPlus and pass in true to the constructor. (until I figure out the real problem with 0.45)
HSkin.java:
-extend BSkinPlus
-move the guts of the constructor into an overriden configure(Resolution) method.
In the screens where you use HDKeyboard, use BKeyboardPlus instead.
That should be about it to get it started.