Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Community Library Update Revision 5

New revision is available of the community library.  It is available at:

http://code.google.com/p/playbook-as3-lib/

 

This revision includes:

  • HTML interface to TextArea class
  • New StdSharedFolder class to make it easier to set standard shared folder directories. However, either there is a bug with the class or the file browser.  If you select 'video' and will still just go to photos.
  • TextInput class has its own event when the user presses the enter key.
  • TextInput clear icon has a larger hitArea to make it easier to press.
  • TextInput setFocus() method added, to (you guessed it) set that item to focus and display the keyboard.
  • TextInput tabNext( ... ) method added to make ti easier to define a sequence of text input fields that can be traversed from the keyboard.
  • TabletApplication now allows a background image to be set.  If you rotate, the image should be 1024x1024; otherwise 1024x600 works fine.
  • TabletApplication new methods: getOS, isPlayBook, isAir, getAppName.
  • New setPage method to PageViewStack.  Previously, only a page index was used.

 

Thanks for the input and code from various people.

 

We are working on a blog site that will include sample code and more detailed API documentation.

 

We also have plans to do a full "sample" app that will exercise and test the library but can be used as a basic app for new developers.  More on this later.

 

 

Developer
willyyr
Posts: 229
Registered: ‎08-14-2009
My Device: Bold 9900, DevAlpha A

Re: Community Library Update Revision 5

John thanks again for giving this to the community. You could also use the wiki for all your samples etc. (just a thought)
Willy R.
-
If my post solved your problem, make it easier for others to find by Accepting it as a solution or provide a Kudo if it was helpful for you. Thanks.
Developer
shawnblais
Posts: 439
Registered: ‎10-25-2010
My Device: Not Specified

Re: Community Library Update Revision 5

Did you miss my post on your last release?

 

I posted some code to enable listening of the Play/Pause hardware key, thought it might be a nice addition to the lib.

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Community Library Update Revision 5

Yes, I saw that. Adding it to the next release. Did not have time to test it for this release.
Developer
JohnPinkerton
Posts: 350
Registered: ‎01-21-2011
My Device: Curve 8900 (Personal) / Bold 9650 (Work)

Re: Community Library Update Revision 5

John,
Excited to see the blog site! Also, would love to subscribe to an email newsletter for this library (if one exists or you ever have plans for one).

Thanks again to John and the rest of the community for the work on this library!
Developer
Developer
CMY
Posts: 1,123
Registered: ‎02-10-2009
My Device: 8130 / 8350 / 9530 / 9550 / 9850 / PlayBook

Re: Community Library Update Revision 5

Here is a change that I added to your TimePicker class in the 3rd Release along with the DateParse to correctly adjust the time since you start with 1 instead of 0 with your hour array, and to keep from throwing an error if time is not changed. I don't know if I forgot to mention it but here it is again if you want to add it:

 

 

public function TimePicker( minute_intervals : uint = 5 ){
   super();
   this.width = 200;
   this.height = 42;
			
   this._minute_intervals = minute_intervals;
			
   var hours : Array = [ 
        {data:1,label:'1'},
	{data:2,label:'2'},
	{data:3,label:'3'},
	{data:4,label:'4'},
	{data:5,label:'5'},
	{data:6,label:'6'},
	{data:7,label:'7'},
	{data:8,label:'8'},
	{data:9,label:'9'},
	{data:10,label:'10'},
	{data:11,label:'11'},
	{data:12,label:'12'}];
			
	//
	var minutes : Array = new Array();
	var m : int;
	var l : String;
	for( m=0; m < 60; m += minute_intervals ){
		l = ''; // reset
		if( m < 10 )l = '0';
		l += String( m );
		minutes.push( { data : m, label : l } );
	}
			
	//
	var ampm : Array = [ {data:'am',label:'AM'},
                             {data:'pm',label:'PM'} ];
	this.dataProvider = new DataProvider( [ new DataProvider(hours), new DataProvider(minutes), new DataProvider(ampm) ] );
         
         //Added to auto set start time to current and adjust for 1 based
         //instead of 0 based hour array
         var current:Date = new Date();
         var cHour:uint = current.hours;
         var cMin:uint = current.minutes / minute_intervals;
         var cAP:uint = 0;
         if( cHour < 12 ){ cHour=(cHour+11)%12; }
         if( cHour > 11 ){ cAP = 1; cHour=(cHour+11)%12; }
         var sel:Array = new Array();
         sel.push(cHour);
         sel.push(cMin);
         sel.push(cAP);
         selectedIndices = sel;
}

 

 

Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Community Library Update Revision 5

Thanks for the correction. The setSelection method in the class now adjusts for that.
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Community Library Update Revision 5

Correction to my earlier post:

Here is the adjusted code:

 

//////////////////////////////////////////////////////////////
public function setSelectionDate( tm : Date ) : void
{
	var hrs  : int = tm.getHours()+1;
	var ampm : String = AM_SUFFIX;
	if( hrs > 12 )
	{
		hrs -= 12;
		ampm = PM_SUFFIX;
	}
				
	this.setSelection( hrs-1, tm.getMinutes(), ampm );
}
		
////////////////////////////////////////////////////////////////
public function setSelection( hour : uint, minute : uint, ampm : String ) : void
{
	var sel : Array = new Array();
	sel.push( hour - 1 );
	sel.push( minute / this._minute_intervals );
	sel.push( ( ampm == AM_SUFFIX ) ? 0 : 1 );
	this.selectedIndices = sel;
}

 

Developer
TheDarkIn1978
Posts: 409
Registered: ‎12-10-2010
My Device: PlayBook

Re: Community Library Update Revision 5

hi john.  i'm curious why you don't use ASDoc for library's documentation?  


PlayBook Applications:
Drop Swatch
Developer
jtegen
Posts: 6,541
Registered: ‎10-27-2010
My Device: HTC One, PlayBook, LE Z10, DE Q10

Re: Community Library Update Revision 5

Its on my list of a 1000 things to do. I'm working on getting my apps to work better with the device.