Cool grid menu.
renderscriptTargetApi 22
renderscriptSupportModeEnabled true
// Configuration (You can call on Application)
private void makeBlurConfig() {
BlurredGridMenuConfig
.build(new BlurredGridMenuConfig.Builder()
.radius(1)
.downsample(1)
.overlayColor(Color.parseColor("#AA000000")));
}
// GridMenuFragment
private void makeGridMenuFragment() {
// This image will be blurred.
int backgroundResourceId = ...;
mGridMenuFragment = GridMenuFragment.newInstance(backgroundResourceId)
List<GridMenu> menus = new ArrayList<>();
menus.add(new GridMenu("Home", R.drawable.home));
...
menus.add(new GridMenu("Setting", R.drawable.settings));
...
mGridMenuFragment.setupMenu(menus);
mGridMenuFragment.setOnClickMenuListener(new GridMenuFragment.OnClickMenuListener() {
@Override
public void onClickMenu(GridMenu gridMenu, int position) {
Toast.makeText(context, "Title:" + gridMenu.getTitle() + ", Position:" + position,
Toast.LENGTH_SHORT).show();
}
});
}
repositories {
jcenter()
}
dependencies {
compile 'com.github.goka.blurredgridmenu:blurredgridmenu:1.0.1'
}
1.0.0 First release.
1.0.1 Modified some class names.
Reference 500px