QuickActionView in Android

follow link While I was searching for an custom implementation of the QuickContactBadge for Android, I went into this interesting post ( Lorenz’s Blog ), which had a custom widget called QuickAction.
While it’s a very nice widget, it didn’t fit my needs because I had the necessity of create different action layouts ( horizontal, vertical, grid.. ), so I made a very quick modification to the above code and I ended with this implementation.
Basically I removed from the original Class the ActionItem list and set a see BaseAdapter as content source. In this way it’s more simple and easy to add more and different views to the widget.
Moreover I added the support for columns ( both fixed and automatic ).
Here you can see a snippet code of the next QuickActionView creation:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
public void onButtonClick( View v ) {
   
   // create the quick action view, passing the view anchor
   QuickActionView qa = QuickActionView.Builder( v );
   
   // set the adapter
   qa.setAdapter( new CustomAdapter( this ) );
     
   // set the number of columns ( setting -1 for auto )
   qa.setNumColumns( (int) (2 + (Math.random() * 10)) );
   qa.setOnClickListener( new DialogInterface.OnClickListener() {

      @Override
      public void onClick( DialogInterface dialog, int which ) {
         dialog.dismiss();
         Toast.makeText( getBaseContext(), "Selected item: " + which, Toast.LENGTH_SHORT ).show();
      }
   } );
     
   // finally show the view
   qa.show();
}

Here some Screenshots:

get

source url And here you can find the source code:  http://pacificcrossroads.net/?buying-a-dissertation-literature-review buying a dissertation literature review source code