NeoMAD 4.0 release notes¶
June 10, 2016
New features¶
Maps API¶
The Maps API is now supported for the Windows Store platform. The native map provider is used, which is Bing Maps.
Java 6¶
Enhance the language support in the transcompiler :
- Enumerations
- Generics
- Assertions
- Variable arguments
- Foreach loop
- Static imports
- Auto-boxing / auto-unboxing
- Method covariant return types
- Annotations (they are ignored)
Enhance the support of the java base APIs:
* Enumerations (java.lang.Enum
) are supported
* Generics are supported and some classes already in the API have been updated: java.lang.Class
, java.util.Hashtable
,
java.util.Stack
andjava.util.Vector
java.lang.Boolean
,java.lang.Byte
,java.lang.Character
,java.lang.Double
,java.lang.Float
,java.lang.Long
andjava.lang.Short
supports newvalueOf
methods- add
java.lang.StringBuilder
class that enables to easily manipulate char sequences java.lang.String
andjava.lang.StringBuffer
now implementsjava.lang.CharSequence
- add
java.io.FilterInputStream
andjava.io.FilterOutputStream
- improvement of Collection, Map, Set and List API. The following classes have been updated or added and now support Generics:
java.util.AbstractCollection
,java.util.AbstractList
,java.util.Abstract.Map
,java.util.AbstractQueue
,java.util.SequentialList
,java.util.AbstractSet
,java.util.ArrayDequue
,java.util.ArrayList
,java.util.Arrays
,java.util.BitSet
,java.util.Collection
,java.util.Collections
,java.util.Dictionary
,java.util.Enumeration
,java.util.HasMap
,java.util.HashSet
,java.util.Hashtable
,java.util.Iterator
,java.util.LinkedHasMap
,java.util.LinkedHashSet
,java.util.LinkedList
,java.util.List
,java.util.ListIterator
,java.util.Map
,java.util.MapEntry
,java.util.NavigableMap
,java.util.NavigableSet
,java.util.Set
,java.util.SortedMap
,java.util.SortedSet
,java.util.Stack
,java.util.TreeMap
andjava.util.TreeSet
Windows Phone emulator¶
Windows Phone 8 emulators are now supported by NeoMAD.
PagerTitleStrip¶
A group of classes that enables to display in an interactive or not-interactive way the current, previous and next pages of a ViewPager. To do that, it enables to associate each page with a title string. Three different visual aspects are available:
PagerTitleStrip
: the base class. Next, previous and current page titles are displayed above the pager. The current page title is centered, right there is the next page title and left the previous page title.PagerTabStrip
: same as thePagerTitleStrip
however the title of the current page is highlighted (different color or underlined depending on the platform behavior).PagerSlidingTabStrip
: the titles are displayed in an horizontal list above the pager. The title list may be scrolled independently from the pager in order for the user to select a page far away by clicking on its title. When the pager page changes, the list scrolls in order for the current title to be always visible.
PagerTitleStrip classes are provided with an adapter PagerTitleAdapter
that must be implemented to supply the
pager titles.
Bar code API¶
The com.neomades.barcode
package is a library to track and decode QR codes. It contains a screen and a view that use the camera
to track QR codes. They can be configured with a listener that triggers when a QR code is scanned by the camera. The listener
will return the decoded string of the QR code.
NB. only QR codes are supported. Other bar code formats will be added in the future.
AutoCompleteTextField¶
A TextField that show a drop-down list of suggestions in order to choose one of them.
InfoWindowClickListener¶
Maps can now listen when tap events occur on their marker info window. Add an InfoWindowListener
to a map using
setInfoWindowListener(InfoWindowListener)
and implement the callback.
RichTextLabel¶
Fonts and text size customization¶
Two new methods were added to customize fonts and text size of the RichTextLabel
:
- setFont(Font): set a custom font (TTF or system) as the default font for the RichTextLabel. The font is applied to all the html tags.
The font size is applied to the
p
tag and proportionally to the other tags. - setTextSize(int): change the size of the text (in dp). The size is applied to the
p
tag and proportionally to the other tags.
Homogenization¶
Homogenize the behavior of RichTextLabel
between the different platforms:
- HTML
style
font and attribute are ignored - HTML
font
tag is ignored - Improve support of badly formated HTML: try to display it even if the HTML is incomplete
Maps¶
Windows Phone and Windows Store Marker improvement¶
Windows Phone and Windows Store map markers have now the same behavior:
- If no icon is set, the first letter of the title will be displayed as the marker in a black info window. When clicking on it, it will display the whole title. Clicking anywhere else on the map will “close” the info window and display the first letter of the title.
- If an icon is set, the marker will have the same behavior as it has by default in Android and iOS. Firstly only the icon is displayed. Click on the icon, it opens its info window with title and snippet. Click anywhere on the map, it will close the info window.
MarkerIcon API¶
New methods and classes have been introduced to set the icon of a Marker
:
MarkerIcon
which represents the icon that will be set on aMarker
. The icon can be the default one (platform dependent), optionally with a hue, or an image.MarkerIconFactory
class which createsMarkerIcon
instances.Marker.setIcon(MarkerIcon)
method to set the icon on the marker.
Package content¶
Five new classes were added to manage errors in package content :
ParserException
TimeoutException
ServerException
NoConnectionException
AuthenticateException
ContentError
class has new method getContentException()
to get the correct type of error.
On Screen
now use onContentResponse(ContentResponse response)
and onContentError(ContentError error)
to listen package content events.
onReceiveError(ErrorEvent)
and onReceiveResponse(ContentResponse)
are now deprecated
Other enhancements¶
SlideScreen
left menu item for theiOS
platform: a button has been added in the navigation bar to open and close the left screen. It is not displayed if a menu is set on theSlideScreen
or on the middle screen of theSlideScreen
.Calendar
: adds the possibility to get the week of year usingCalendar.get[WEEK_OF_YEAR]
.Base64
: enables to encode a byte array in a base-64 string or to decode a base-64 string into a byte array.DateUtils.formatDate(Date)
andDateUtils.parseDate(String)
: enables to formatDate
toString
using the rfc1123 pattern and vice versa.ImageLoader
,ImageQuery
: add new methods inImageLoader
to customize image requests (e.g. basic authorization HTTP headers can be added to the request)
Compatibility changes¶
- NeoMAD has changed its default build behaviour for Android target. Now optimization and obfuscation steps are disabled by default. To enable them, use new options
-optimize
and/or-obfuscate
. To release binaries forPRODUCTION
mode, do not forget to enableoptimization
to minify the binary file, andobfuscation
to protect the binary from reverse-engineering attacks. NetworkResponse.getHeaders()
return type changed fromHashtable
toMap<String, String>
.ResManager.getString(int, Object...)
now returns the resource name if the string resource is not localized for the device’s current locale.
Deprecation¶
- The command line option
-o
has been deprecated. It has been replaced by-obfuscate
option. Maps
: in theMarker
class, thesetIcon(Image)
,setHue(int)
andgetHue()
methods are deprecated. Use thesetIcon(MarkerIcon)
method withMarkerIcon
andMarkerIconFactory
classes instead.
Fixes¶
- Windows Phone and Windows Store generated projects can now be correctly opened even if generated from a Mac.
- Fix an encoding problem that may happen when using
srcencoding
andapplicationidentifier
at the same time in the URS. applicationname
,vendor
anddescription
parameters in URS now accept special characters (like quote, punctuation characters…)TextArea
:setLines(int)
called with -1 now correctly cancel the previous call ofsetLines(int)
and reset the default behavior of theTextArea
.- Fix
MapListener.onMapLoaded()
: the behavior of the callback was not the same in all the platforms. Now it is called each time the map has finished rendering. RichTextLabel
: <a> tags with hyperlinks are now supported by theRichTextLabel
. The corresponding text will be highlighted and the link can be clicked to open the page in the web browser.StringUtils.replace(String, String, String)
andStringUtils.replaceAll(String, String, String)
: throw NullPointerException if one of the parameter is null. If the replace pattern is empty, returns the original String without modifications.- Fix
EventBus
retaining the instance of the last handled event. - Fix
ContentQuery
crash when a query is re-sent throughContentManager
- Fix
CacheEntry.refreshNeeded()
let the server updates the cache when server responses do not contain Cache headers - Fix cache update behavior when doing a request while the online date has not changed (data were systematically downloaded again from the server).
- Android:
- Fix
ViewPager.notifyDataChanged()
: call tonotifyDataChanged()
does not change the selected page anymore (it was resetting the pager to the first page). - Fix the interception of some touch events by
GridView
: the click and touch events were not always transmitted to child views. - Fix NullPointerException when the system wants to release memory by trimming memory from application.
- Fix
SmsManager
: Application crashed when usingsend(Message, SmsResultListener)
on device with Android 4.4 and above. - Fix
SlideScreen
bug withMenuItem
created by MiddleScreen
. - Fix
MarkeClickListener
: the callback is no longer called if the info window of the marker is opened. - Fix
RichTextLabel
: application crashed when using <ul><li> inside <li> tags. - Fix
RichTextLabel
: ellipsize may have been applied even if not necessary. Ellipsize has been deactivated forRichTextLabel
. - Fix
ZoomView
:Touch
events can be handled throughTouchListener
now. - Fix
ZoomView
: The zoomed view does not blink now. - Fix
SlideScreen
NullPointerException
crash when there is pinch gesture. - Fix
Maps
memory leak: the map was keeping a strong reference to a marker after removal, preventing marker instances to be garbage collected. - Fix
Maps
memory leak: theMapView
was never garbage collected. - Fix
LocationManager
always keeping a reference to the LocationListener used in requestMyLocation(LocationListener) or requestMyLocationChanges(LocationListener).
- Fix
- iOS:
- Fix Xcode build failures with method with name starting with
alloc
,init
,new
,initialize
- Fix
ComboBox
: items were correctly not updated when the ComboBox content has changed between two ComboBox opening - Fix
RadioButton.setCheckChangeListener(CheckChangeListener)
: the callback is now correctly called when the state of the RadioButton changes - Fix
JSONObject
: encoding problems may occur with strings when using methodJSONObject.optString(String)
- Fix
Preferences
:save()
method did not work if called from two different threads at the same time - Fix
ListView
: list may disappear under iOS 8 if the number of items changes while performing anotifyDataChanged()
- Fix
ListView
: list may freeze with an error message “no index path for table cell being reused” under iOS 8 when the content of the list is refreshed. - Fix
ListView
:ListView
items may have a wrong height if their layouts were too complex and if they were in MATCH_CONTENT on their height. - Fix layout calculation when the container view has a border.
- Fix
PagerTitleSlidingTabStrip
: sometimes when UI calculation occurred in theViewPager
while thePagerTitleSlidingTabStrip
was scrolling, thePagerTitleSlidingTabStrip
may have frozen. - Fix
PagerTitleStrip
: title was not set to the current page ifsetCurrentPage(int)
was called before thePagerTitleStrip
was displayed. - Fix
ViewPager
: the height of the pages was too small for its content if the pager had aPagerTitleStrip
. - Fix
GestureDetector
conflict withScrollView
pan gesture. - Fix
TextLabel
: The methodsetLines(int)
now correctly change the height of theTextLabel
. ListView
,GridView
andHorizontalListView
do not have a minimum default row height (or width forHorizontalListView
).- Fix
Transition
for iOS 9: during “in” transitions the destination screen went under the navigation bar. - Fix
setBackground(Background)
,setBackgroundColor(Color)
andsetBackgroundImage(Image)
forPagerTitleStrip
: background was not applied. - Fix
ViewPager
: when added aScrollView
inside aViewPager
, vertical scroll was disabled. - Fix
Stack
synchronization problem that may introduce thread-lock bugs. - Fix
ImageLabel
size when using ScaleType.SCALE_ASPECT_FIT and one of both side is in MATCH_CONTENT. - Fix Xcode signature step for installing automatically mobile provision
- Fix the database upgrade mechanism (the version number was not updated in the database).
- Fix compilation failure due to an unneeded reference to the declaring inner static class that was generated in an anonymous type.
- Fix an EXC_BAD_ACCESS occurring when executing a string concatenation with a double in transcompiled code.
- Fix
MenuItem.setAsLeftAction()
: the first letter of the native back button was displayed under the left action item. - Fix
Density.toDP()
: pixels were not correctly converted to their dp equivalent. - Fix
ListView
,HorizontalListView
andGridView
: item margin was not correctly displayed. - Fix
AppStore``submission failure caused by missing icon size for ``iPad Pro
(167x167) - Fix
ViewPager
:onPageChanged
callback was not called when a page was changed by selecting the tab of aPagerTitleStrip
. - Fix
StringUtils
: theformat
method crashed with some format specifiers (for example%-4d
) - Fix
Xcode
build for simulator step failures: now warning or error fromXcode
are printed out. The build is considered asFAILED
ifXcode
cannot build the project. - Fix
Float.parseFloat(String)
that was not throwing NumberFormatException when the string was malformed. - Networking data: deactivate default cache policy in order to correctly handle 304 HTTP response.
- Fix Xcode build failures with method with name starting with
- Windows Phone:
- Resolve a compilation failure when the generated project path is too long.
- Fix
ScreenResultListener
: callback was never called if the Screen was inside a SlideScreen. - Fix a crash happening sometimes when using
ComboBox.removeAllItems()
orComboBox.removeItem(int)
. - Fix
ComboBox
: items were not updated when the ComboBox content has changed between two ComboBox opening - Fix
ComboBox.getSelectedItem()
: when ComboBox was opened withopenChooser()
method, the index returned was always 0 - Fix
RadioButton.setCheckChangeListener(CheckChangeListener)
: the callback is now correctly called when the state of the RadioButton changes - Fix
PagerTitleTabStrip.setTabIndicatorColor(Color)
: the title of the page is now correctly colored (an exception was thrown before) - Fix
View.findView(int)
when called on aListView
. - Fix
SlideScreen
: title customization onScreen
insideSlideScreen
had no effect. - Use the version number declared in the URS in the generated project (it was previously ignored).
- Fix
ResManager.getResourceAsStream(String)
: a NullReferenceException was thrown if the path did not exist - Fix a transcompilation bug: methods were sometimes marked
virtual
instead ofoverride
. - Fix
AbsListView.setSeparatorHeight(int)
: When the height set was 1, the separator disappeared. - Fix the database upgrade mechanism (the version number was not updated in the database).
- Fix
ListView
crash (layout life cycle exception) that may have occured if an ImageUrlLabel was set in a list item and if the height of the list item was dependent of the ImageUrlLabel height. - Fix
ViewPager
:onPageChanged
callback was not called when a page was changed programmatically by usingsetCurrentPage(int)
. - Fix
TextArea.setBackgrounColor(Color)
andTextField.setBackgrounColor(Color)
: color was not applied when theTextArea
orTextField
had the focus. - Fix
Float.parseFloat(String)
that was throwing unexpected NumberFormatException.
- Windows Store Apps
- Resolve a compilation failure when the generated project path is too long.
- Fix
RadioButton.setCheckChangeListener(CheckChangeListener)
: the callback is now correctly called when the state of the RadioButton changes. - Fix
Application.setSupportedOrientation(int)
andScreen.setSupportedOrientation(int)
. Warning : the method will work only on real devices and not on the simulator. - Fix a bug related to
Dialogs
: sometimes even if the dialog was closed, its content stayed visible above the application - Fix
PagerTitleStrip
: refresh the titles whennotifyDataChanged()
is called on the pager to update the titles - Fix
ViewPager
:PagerTitleStrip
height was taking into account inside theViewPager
even if it was not visible. - Fix
Preferences
:save()
method did not work if called from two different threads at the same time - Fix
PagerTitleStrip
: Items became white after selection. - Fix
PagerTabStrip.setTabIndicatorColor(Color)
: Color was not applied correctly. - Fix
TextLabel
: label height is now correctly adjusted whensetLines(int)
orsetMaxLines(int)
are called. - Fix a crash occurring when calling
Application.openUrl(String)
. - Fix
WebView.shouldOverrideUrlLoading(WebView, String)
: the method was never called. - Fix
Screen
back button: the back button is not displayed if the title is not visible. - Fix
Menu
:MenuItem
did not appear and were not clickable on Windows 8.0. - Fix
Menu
: was shown every time a screen was displayed. - Fix
SlideScreen
: title customization onScreen
insideSlideScreen
had no effect. - Fix
ImageButton
: padding was not correctly applied. - Fix
ImageButton
: borders were not correctly set. - Fix
MapSettings.setMyLocationEnabled(boolean)
: the method was not implemented For Windows Store Apps. RichTextLabel
: update font size of various html elements in order to have more readable RichTextLabel.- Fix
ResManager.getResourceAsStream(String)
: a NullReferenceException was thrown if the path did not exist. - Fix
Screen.getOrientation()
: the method always returnedPORTRAIT_OR_LANDSCAPE
in some Windows devices. - Fix a transcompilation bug: methods were sometimes marked
virtual
instead ofoverride
. - Fix
AbsListView.setSeparatorHeight(int)
: when the height set was 1, the separator disappeared. - Fix
Controller.resetScreenStack(Screen)
:onDestroy()
was not called in the screens previously in the stack. - Fix
ImageUrlLabel
: images were not loaded sometimes. - Fix
Font
: TTF fonts declared in the URS file can now be used in the application. - Fix
TextField
:setTextColor()
did not apply the color to the text. - Fix the database upgrade mechanism (the version number was not updated in the database).
- Fix
TextArea.setBackgrounColor(Color)
andTextField.setBackgrounColor(Color)
: color was not applied when theTextArea
orTextField
had the focus. - Fix
Float.parseFloat(String)
that was throwing unexpected NumberFormatException. - Fix
Thread.join()
that was doing nothing.