Skip to content

Instantly share code, notes, and snippets.

@px-amaac
Last active December 16, 2015 23:48
Show Gist options
  • Save px-amaac/5515988 to your computer and use it in GitHub Desktop.
Save px-amaac/5515988 to your computer and use it in GitHub Desktop.
@Override
public void onResume() {
super.onResume();
MainActivity context = ((MainActivity) getSherlockActivity());
// hide "custom" button when category filter has not been customized
int filter = Global.getInstance(context).getCatFilterMask() & context.MASK_ALL;
Log.d(Global.LOG_TAG, "onResume() filter: " + filter);
if (filter == MASK_FOOD || filter == MASK_SHOP || filter == MASK_LODGE
|| filter == MASK_ALL)
bt.setVisibility(View.GONE);
else
bt.setVisibility(View.VISIBLE);
}
private static final int MASK_ALL = 0x3ff;
private static final int MASK_FOOD = 0x00f;
private static final int MASK_SHOP = 0x050;
private static final int MASK_LODGE = 0x100;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment