Android Quick Action Bar.
Quick Actions are basically actions/functions in a popup bar that are triggered by specific visual elements/buttons/items on the screen. Quick Actions are used to display contextual actions typically used in list views but not limited to it. You can imagine a phone-book or contact list on the phone. Now, there are certain set of actions that will be common to all contacts in the views like; make a call, send message, edit contact or may be even transfer files by Email, Bluetooth etc. Basically these functions that are common to items in a context can be put in the Quick Action bar. This way the screen is uncluttered and simple and more importantly we needn’t sacrifice on the actions needed.
Screen Shot :
Create Actionable Items:
The below code snippet is used to create an actionable item i.e. the actions you would want to place in the quick action bar. Creating an actionable item involves specifying the title, setting an icon that represents the item which will help you relate to the action, and finally set a Listener for the action. The term itself is self-explanatory. Yes, it is used to determine the action to be performed when clicked or pressed. As far as the icon /image goes, it can be easily set by referring to it from the resources as is the case with any external resource set in android which you would aware of, I am most certain.
final QuickActionIcons edit = new QuickActionIcons();;
edit.setTitle("Edit");
edit.setIcon(getResources().getDrawable(R.drawable.edit));
edit.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
// add u r action
}
});]
Create Quick Action Dialog:
This part is even simpler. Like in this example, when an item in the list view is clicked / pressed, a new quick action bar/dialog is created. Then all the actionable items that you have created in the previous step are appended one by one to the quick action bar. After this you simply have to specify the animation style i.e. how do you want the dialog to be displayed on screen.
resultPane.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
QuickActionBar qab = new QuickActionBar(view);
qab.addItem(edit);
qab.addItem(call);
qab.addItem(send_data);
qab.setAnimationStyle(QuickActionBar.GROW_FROM_LEFT);
qab.show();
}
});
Quick Actions are basically actions/functions in a popup bar that are triggered by specific visual elements/buttons/items on the screen. Quick Actions are used to display contextual actions typically used in list views but not limited to it. You can imagine a phone-book or contact list on the phone. Now, there are certain set of actions that will be common to all contacts in the views like; make a call, send message, edit contact or may be even transfer files by Email, Bluetooth etc. Basically these functions that are common to items in a context can be put in the Quick Action bar. This way the screen is uncluttered and simple and more importantly we needn’t sacrifice on the actions needed.
Screen Shot :
Create Actionable Items:
The below code snippet is used to create an actionable item i.e. the actions you would want to place in the quick action bar. Creating an actionable item involves specifying the title, setting an icon that represents the item which will help you relate to the action, and finally set a Listener for the action. The term itself is self-explanatory. Yes, it is used to determine the action to be performed when clicked or pressed. As far as the icon /image goes, it can be easily set by referring to it from the resources as is the case with any external resource set in android which you would aware of, I am most certain.
final QuickActionIcons edit = new QuickActionIcons();;
edit.setTitle("Edit");
edit.setIcon(getResources().getDrawable(R.drawable.edit));
edit.setOnClickListener(new OnClickListener()
{
public void onClick(View v)
{
// add u r action
}
});]
Create Quick Action Dialog:
This part is even simpler. Like in this example, when an item in the list view is clicked / pressed, a new quick action bar/dialog is created. Then all the actionable items that you have created in the previous step are appended one by one to the quick action bar. After this you simply have to specify the animation style i.e. how do you want the dialog to be displayed on screen.
resultPane.setOnItemClickListener(new OnItemClickListener()
{
public void onItemClick(AdapterView<?> parent, View view, int position, long id)
{
QuickActionBar qab = new QuickActionBar(view);
qab.addItem(edit);
qab.addItem(call);
qab.addItem(send_data);
qab.setAnimationStyle(QuickActionBar.GROW_FROM_LEFT);
qab.show();
}
});