Skip to content

Instantly share code, notes, and snippets.

@korniltsev
Last active December 15, 2015 06:59
Show Gist options
  • Save korniltsev/5220729 to your computer and use it in GitHub Desktop.
Save korniltsev/5220729 to your computer and use it in GitHub Desktop.
/**
* User: korniltsev
* Date: 22.03.13
* Time: 14:51
*/
public class ConfirmDialogFactory {
public static Dialog build(Activity a)
{
final Dialog dialog = new Dialog(a,R.style.CustomStyle);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.confirmtransferdialog);
// set the custom dialog components - text, image and button
ImageButton dialogButtonOK = (ImageButton) dialog.findViewById(R.id.ConfirmTransferButtonOK);
dialogButtonOK.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
TabBarActivity parent = (TabBarActivity)a.getParent();
parent.switchTab(TabBarActivity.CONFIRM_ACTIVITY_TAB);// 1 - плохо, вынеси куданибудь в константу
dialog.dismiss();
}
});
return dialog;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment