alhneiti/Android-QuickAction — pull request #1 by juleZZZ (2013-08-08 13:12:26+00:00)
Title: Support for only images as grid items is added

To support grid items as only images a new QuickActionImageGrid class is added. Here is a sample code how to use it:
```
public class QuickActionActivity extends SherlockActivity implements OnClickListener {

private QuickActionWidget mBar;
private QuickActionWidget mGrid;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

Button btn = (Button) findViewById(R.id.btnShowImageGrid);

btn.setOnClickListener(this);

prepareQuickActionImageGrid();

}

@Override
public void onClick(View view) {
switch(view.getId()) {
case R.id.btnShowImageGrid:
onShowImageGrid(view);
break;
}
}

public void onShowImageGrid(View v) {
mGrid.show(v);
}

private void prepareQuickActionImageGrid() {
mGrid = new QuickActionImageGrid(this);
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_compose));
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_export));
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_share));
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_search));
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_edit));
mGrid.addQuickAction(new MyQuickAction(this, R.drawable.gd_action_bar_locate));

mGrid.setOnQuickActionClickListener(mActionListener);
}

private OnQuickActionClickListener mActionListener = new OnQuickActionClickListener() {
public void onQuickActionClicked(QuickActionWidget widget, int position) {
Toast.makeText(QuickActionActivity.this, "Item " + position + " clicked", Toast.LENGTH_SHORT).show();
}
};

private static class MyQuickAction extends QuickAction {

private static final ColorFilter BLACK_CF = new LightingColorFilter(Color.BLACK, Color.BLACK);

public MyQuickAction(Context ctx, int drawableId) {
super(ctx, buildDrawable(ctx, drawableId));
}

private static Drawable buildDrawable(Context ctx, int drawableId) {
Drawable d = ctx.getResources().getDrawable(drawableId);
d.setColorFilter(BLACK_CF);
return d;
}

}
}
```