Dialog dialog = new Dialog(getActivity()); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // layout to display dialog.setContentView(R.layout.add_edit); // set color transpartent dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); dialog.show();
AlertDialog.Builder adb = new AlertDialog.Builder(this); Dialog d = adb.setView(new View(this)).create(); // (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.) WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(d.getWindow().getAttributes()); lp.width = WindowManager.LayoutParams.MATCH_PARENT; lp.height = WindowManager.LayoutParams.MATCH_PARENT; d.show(); d.getWindow().setAttributes(lp);
Dialog alertDialog = new Dialog(this); alertDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); alertDialog.setContentView(R.layout.tabs); alertDialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); alertDialog.show();
public void showImage() { Dialog builder = new Dialog(this); builder.requestWindowFeature(Window.FEATURE_NO_TITLE); builder.getWindow().setBackgroundDrawable( new ColorDrawable(android.graphics.Color.TRANSPARENT)); builder.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialogInterface) { //nothing; } }); ImageView imageView = new ImageView(this); imageView.setImageURI(imageUri); builder.addContentView(imageView, new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT)); builder.show(); }
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dialog_login); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT));
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);
final Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.setContentView(R.layout.splash); dialog.show();
Dialog dialog = new Dialog(this); dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); // layout to display dialog.setContentView(R.layout.about_program_dialog_layout); // set color transpartent dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); dialog.show();
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setBackgroundDrawableResource(r.drawable.your_drawable); dialog.getWindow().setContentView(R.layout.your_custom_dialog_layout); dialog.getWindow().getAttributes().width = LayoutParams.FILL_PARENT; dialog.show();
AlertDialog.Builder adb = new AlertDialog.Builder(this); Dialog d = adb.setView(new View(this)).create(); // (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.) WindowManager.LayoutParams lp = new WindowManager.LayoutParams(); lp.copyFrom(d.getWindow().getAttributes()); lp.width = WindowManager.LayoutParams.MATCH_PARENT; lp.height = WindowManager.LayoutParams.MATCH_PARENT; d.show(); d.getWindow().setAttributes(lp);
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.dailog_layout); dialog.getWindow().setBackgroundDrawable( new ColorDrawable(0)); dialog.getWindow().setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); dialog.getWindow().clearFlags( WindowManager.LayoutParams.FLAG_DIM_BEHIND);
Dialog dialog = new Dialog(this); dialog.requestWindowFeature(dialog.getWindow().FEATURE_NO_TITLE);
public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Dialog overlayInfo = new Dialog(MainActivity.this); // Making sure there's no title. overlayInfo.requestWindowFeature(Window.FEATURE_NO_TITLE); // Making dialog content transparent. overlayInfo.getWindow().setBackgroundDrawable( new ColorDrawable(Color.TRANSPARENT)); // Removing window dim normally visible when dialog are shown. overlayInfo.getWindow().clearFlags( WindowManager.LayoutParams.FLAG_DIM_BEHIND); // Setting position of content, relative to window. WindowManager.LayoutParams params = overlayInfo.getWindow().getAttributes(); params.gravity = Gravity.TOP | Gravity.LEFT; params.x = 100; params.y = 20; // If user taps anywhere on the screen, dialog will be cancelled. overlayInfo.setCancelable(true); // Setting the content using prepared XML layout file. overlayInfo.setContentView(R.layout.info_overlay); overlayInfo.show(); }
private void showPictureialog() { final Dialog dialog = new Dialog(this, android.R.style.Theme_Translucent_NoTitleBar); // Setting dialogview Window window = dialog.getWindow(); window.setGravity(Gravity.CENTER); window.setLayout(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT); dialog.setTitle(null); dialog.setContentView(R.layout.selectpic_dialog); dialog.setCancelable(true); dialog.show(); }
public void showImage(final int imageId) { Dialog builder = new Dialog(this); builder.requestWindowFeature(Window.FEATURE_NO_TITLE); builder.getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT)); builder.setOnDismissListener(new DialogInterface.OnDismissListener() { @Override public void onDismiss(DialogInterface dialogInterface) { //nothing; } }); ImageView imageView = new ImageView(this); imageView.setImageDrawable(ResourcesCompat.getDrawable(getResources(), imageId, getTheme())); builder.addContentView(imageView, new RelativeLayout.LayoutParams( ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); builder.show(); }
Dialog choiceDialog = new Dialog(this); choiceDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); Window window = choiceDialog.getWindow(); int y = findViewById(R.id.bannerview).getTop(); WindowManager.LayoutParams lp = window.getAttributes(); lp.y = y; lp.dimAmount = 0;`enter code here` lp.windowAnimations = android.R.anim.fade_in; window.setAttributes(lp); choiceDialog.setContentView(R.layout.conversation_action_dialog);
public void onCoachMark(){ final Dialog dialog = new Dialog(this); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(android.graphics.Color.TRANSPARENT)); dialog.setContentView(R.layout.coach_mark); dialog.setCanceledOnTouchOutside(true); //for dismissing anywhere you touch View masterView = dialog.findViewById(R.id.coach_mark_master_view); masterView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { dialog.dismiss(); } }); dialog.show(); }
private void addNote() { final Dialog dialog = new Dialog(this); dialog.setContentView(R.layout.textentryalertdialog); dialog.setTitle("Add note"); TextView msgText = (TextView) dialog.findViewById(R.id.messagetext); msgText.setText("Whatever prompt you want"); final EditText inputLine = (EditText) dialog.findViewById(R.id.my_edittext); Button okButton = (Button) dialog.findViewById(R.id.OKButton); okButton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { dialog.dismiss(); // app specific code } }); Button cancelButton = (Button) dialog.findViewById(R.id.CancelButton); cancelButton.setOnClickListener(new OnClickListener() { public void onClick(View arg0) { dialog.dismiss(); } }); dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_VISIBLE); dialog.show(); }
final Dialog dialog = new Dialog(this); dialog.requestWindowFeature( Window.FEATURE_CUSTOM_TITLE );//adds in the dialog box a frame for the custom title dialog.setContentView(R.layout.pop_up_new_contact);//loads the layout we have already create pop_up_new_contact.xml dialog.getWindow().setFeatureInt( Window.FEATURE_CUSTOM_TITLE, R.layout.custom_title_dialog_box);//sets our custom title(custom_title_dialog_box.xml) as the current title of the dialog box. The custom_title_dialog_box.xml contains a TextView with id: title_new_contact and an ImageView with id: x1_button.
final Dialog dialog = new Dialog(context); dialog.getWindow(); dialog.requestWindowFeature(Window.FEATURE_NO_TITLE); dialog.setContentView(R.layout.yourlayout); dialog.show();