Skip to content

Instantly share code, notes, and snippets.

public static void clearParentsBackgrounds(View view) {
while (view != null) {
final ViewParent parent = view.getParent();
if (parent instanceof View) {
view = (View) parent;
view.setBackgroundResource(android.graphics.Color.TRANSPARENT);
} else {
view = null;
}
}
@Android-s14
Android-s14 / DialogBuilder.java
Last active August 29, 2015 14:17
Dialog Circular Reveal/Hide
private Dialog dialog;
private void buildDialog() {
dialog = new Dialog(activity);
dialogView = activity.getLayoutInflater().inflate(R.layout.dialog_new_participant, null);
dialogField = ButterKnife.findById(dialogView, R.id.edittext_new_participant);
dialogFab = ButterKnife.findById(dialogView, R.id.fab_new_participant_dialog);
dialog.setContentView(dialogView);
clearBackgrounds(dialogView);
setListeners();