Floating Action Menu for Android

I’ve just created this simple Android library, inspired from the recent changes to the Google+ app, which introduced a floating action item to the bottom. In G+ the action item appears and disappears based on the page scrolling.

In the same way I’ve created this library, with some more customization options, like the gravity and direction of the floating menu items.

Here’s a video of a sample implementation:

Source code and documentation can be find on the github project page:

https://github.com/sephiroth74/android-floating-action-menu

More Picasso changes

I recently added more changes to my forked version of the Picasso library.

Delay

Added withDelay(long ms) method in the RequestCreator class. Basically it will delay the load of the passed resource by n milliseconds.

[cce]
Picasso.with( context )
.load( url )
.withDelay( 100 )
.into( image );
[/cce]

Batch toggle on/off

In the original Picasso code all the “complete” events are dispatched using a batch operation, this means that you can have at the same time 3/4 “complete” events being triggered, which eventually can cause lags in the UI.
In this fork the batch is disabled by default and can be re-enabled by using:

[cce]
Picasso.with( context )
.setUseBatch( true );
[/cce]

Fork or download the source from GitHub:
https://github.com/sephiroth74/picasso

Link the library in your build.gradle:
compile “it.sephiroth.android.library.picasso:picasso:+”

FlexLayout for AsWing

As you may have noticed I’m working with AsWing right now 🙂
Today I proposed a modification of the layout system. That’s because I couldn’t find any layout which satisfied my needs: a container which grows its components in order to fill the entire container size BUT which also keep in mind the component minimum and maximum sizes.
So it will try to grow all the components to the same size, but if a component has defined a specific minimum or maximum size, take that size under consideration.

Here’s a screenshot of the FlexLayout class in action ( click over the image to see the live demo ):

And here’s the code for using the layout:

f.getContentPane().setLayout( new FlexLayout( FlexLayout.VERTICAL, 2 ) );

Continue reading

ZaaIL adds support for 40+ image format to Flash

Zaalabs yesterday announced the release of an opensource ( under MIT license ) library, written using Alchemy, which will allow swf to load at runtime more than 40 different image formats ( you will have access to the bitmapdata of the loaded file ).

This is indeed a great news ( I’m thinking in particular to the benefits it can have for us at Aviary )!
This actionscript library is a porting of the DevIL library. And in fact reading at the features list of the DevIL library you can see that a lot of image formats are currently supported:
  • Windows Bitmap – .bmp
  • Dr. Halo – .cut
  • Multi-PCX – .dcx
  • Dicom – .dicom, .dcm
  • DirectDraw Surface – .dds
  • OpenEXR – .exr
  • Flexible Image Transport System – .fits, .fit
  • Heavy Metal: FAKK 2 – .ftx
  • Radiance High Dynamic – .hdr
  • Macintosh icon – .icns
  • Windows icon/cursor – .ico, .cur
  • Interchange File Format – .iff
  • Infinity Ward Image – .iwi
  • Graphics Interchange Format – .gif
  • Jpeg – .jpg, .jpe, .jpeg
  • Jpeg 2000 – .jp2
  • Interlaced Bitmap – .lbm
  • Homeworld texture – .lif
  • Half-Life Model – .mdl
  • MPEG-1 Audio Layer 3 – .mp3
  • Palette – .pal
  • Kodak PhotoCD – .pcd
  • ZSoft PCX – .pcx
  • Softimage PIC – .pic
  • Portable Network Graphics – .png
  • Portable Anymap – .pbm, .pgm, .pnm, .pnm
  • Alias | Wavefront – .pix
  • Adobe PhotoShop – .psd
  • PaintShop Pro – .psp
  • Pixar – .pxr
  • Raw data – .raw
  • Homeworld 2 Texture – .rot
  • Silicon Graphics – .sgi, .bw, .rgb, .rgba
  • Creative Assembly Texture – .texture
  • Truevision Targa – .tga
  • Tagged Image File Format – .tif
  • Gamecube Texture – .tpl
  • Unreal Texture – .utx
  • Quake 2 Texture – .wal
  • Valve Texture Format – .vtf
  • HD Photo – .wdp, .hdp
  • X Pixel Map – .xpm
  • Doom graphics

Vector.splice bug

Usually people complain about opensource projects because they lack of documentation ( that’s true most of the times.. ), but this doens’t happen only there…

Today I’ve spent a lot of time trying to understand why I was so stupid because I wasn’t able to concatenate 2 vectors of int using splice.
But for what you can read from the *official* Adobe documentation, which says (about the third parameter for the splice method):

… items — An optional list of one or more comma-separated values, **or a Vector**, to insert into the Vector at the position specified in the startIndex parameter.

Ok, that’s why I didn’t know why I couldn’t manage to make it work! This simple code gives wrong results:


var v1: Vector. = new Vector.();
v1.push(1);
v1.push(2);
v1.push(3);
v1.push(4);

var v2: Vector. = new Vector.();
v2.push(100);
v2.push(200);
v1.splice( 1, 1, v2 );

// Expected result: [1,100,200,3,4]
// Actual result: [1,0,3,4]

It seems that the third parameter is being casted into int and so only ‘0’ has been inserted into the first Vector!

I tried to look into Adobe jira bugbase and what I’ve found there is that it was a known bug since long time and it has been also moved to the tamarin bugbase.

The problem is that at the end they simply closed the bug as invalid bug because the documentation was wrong!

Funny

Flex 3 Tree double-click to edit

Some people asked about changing the default editing behavior of a Flex 3 Tree control so  that item editing starts on a double-click event instead of the default single click.

Indeed it has been covered several times on forums or mailing list, but it’s faster to create a simple script than search for it sometimes.

Here’s the files:
Here’s the live demo:

AMFPHP recent updates

Well, after a long time without any news it seems now we’re close to different updates about AMFPHP.

As you probably know Wade Arnold took the place of Patrick some time ago as project leader but no real big changes were committed since then.
But after the partnership between Zend and Adobe things started to change and amfphp started to move forward to the Zend Framework… and in fact many developers were afraid about the real future of amfphp.
Bt, as Wade said, the amfphp core will remain separated from the framework implementation ( a framework which I will never use however ), in order to have a shared core and 2 different branches for the implementation. ( a new release was promised before Adobe MAX )
However I’m afraid too about what could happen expecially when 2 major software houses “promote” an opensource project.
Probably I’m too sceptical, but I believe that in the future more and more things will be only supported in the zend_amf and not in the standalone amfphp project.

Microsoft to release .NET libraries source code

Well, it seems that Microsoft will release the .NET libraries (not all, but it seems the most relevants ) source code with the next release of Visual Studio 2008 late this year.

This will be useful indeed while debugging in VS, but also it would be very interesting to look into the source code to view how they did it, expecially the Windows Form related part.. (..but what about Silverlight? :))

Read more here: http://weblogs.asp.net/scottgu/…framework-libraries.aspx