Example usage for android.app Dialog requestWindowFeature

List of usage examples for android.app Dialog requestWindowFeature

Introduction

In this page you can find the example usage for android.app Dialog requestWindowFeature.

Prototype

public final boolean requestWindowFeature(int featureId) 

Source Link

Document

Enable extended window features.

Usage

From source file:com.iutiao.sdk.dialogs.ProfileDialog.java

@NonNull
@Override//from w ww .jav  a2s .c om
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View view = getActivity().getLayoutInflater().inflate(R.layout.com_iutiao_dialog_profile, null);
    AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
    builder.setView(view);
    Dialog dialog = builder.create();
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    onViewCreated(view, savedInstanceState);
    return dialog;
}

From source file:bos.whu.familytree.ui.activitys.base.BaseActivity.java

@Override
public void onNavigationDrawerItemSelected(int position) {
    switch (position) {
    case DrawerMenu.HOME:
        fragmentTransaction(new HomeFragment());
        break;//  w w  w .j a v  a 2  s . c  o  m
    case DrawerMenu.ABOUT:
        Dialog dialog = new Dialog(this);
        dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
        dialog.setContentView(R.layout.about_dialog);
        dialog.show();
        break;
    }
}

From source file:com.feathercoin.wallet.feathercoin.util.BitmapFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bitmap bitmap = (Bitmap) getArguments().getParcelable(KEY_BITMAP);

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.bitmap_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitmap_dialog_image);
    imageView.setImageBitmap(bitmap);/*w  ww  .jav  a  2s  .com*/
    imageView.setOnClickListener(new View.OnClickListener() {
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}

From source file:cc.mintcoin.wallet.util.BitmapFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bitmap bitmap = (Bitmap) getArguments().getParcelable(KEY_BITMAP);

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.bitmap_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitmap_dialog_image);
    imageView.setImageBitmap(bitmap);/*from w  ww  .  java 2s .  c  o  m*/
    imageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}

From source file:com.bushstar.kobocoin_android_wallet.util.BitmapFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bitmap bitmap = getArguments().getParcelable(KEY_BITMAP);

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.bitmap_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitmap_dialog_image);
    imageView.setImageBitmap(bitmap);/* w w  w .j a  v  a  2 s. com*/
    imageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}

From source file:de.schildbach.wallet.ui.BitmapFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final BitmapDrawable bitmap = new BitmapDrawable(getResources(), (Bitmap) args.getParcelable(KEY_BITMAP));
    bitmap.setFilterBitmap(false);/*from  ww w  .ja v a2 s  .  c  o  m*/

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(R.layout.bitmap_dialog);
    dialog.setCanceledOnTouchOutside(true);

    final ImageView imageView = (ImageView) dialog.findViewById(R.id.bitmap_dialog_image);
    imageView.setImageDrawable(bitmap);
    imageView.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(final View v) {
            dismissAllowingStateLoss();
        }
    });

    return dialog;
}

From source file:com.amazon.appstream.fireclient.ErrorDialogFragment.java

/**
 * Standard initialization. Sets up the dialog to quit the
 * activity on clicking its only button.
 *///  w  w  w. ja  v  a2  s .c  o m
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setCancelable(false);
    dialog.getWindow().setBackgroundDrawable(ConnectDialogFragment.mEmpty);
    dialog.setContentView(R.layout.fatal_error);

    final Button signin = (Button) dialog.findViewById(R.id.signin);
    final TextView message = (TextView) dialog.findViewById(R.id.message);

    message.setText(mMessage);

    signin.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();

            ((FireClientActivity) getActivity()).openConnectDialog(null);
        }
    });

    return dialog;
}

From source file:com.amazon.appstream.sampleclient.ErrorDialogFragment.java

/**
 * Standard initialization. Sets up the dialog to quit the
 * activity on clicking its only button.
 *///  w  w  w  . j  a  v a  2s.co  m
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {

    final Dialog dialog = new Dialog(getActivity());

    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    dialog.setCancelable(false);
    dialog.getWindow().setBackgroundDrawable(ConnectDialogFragment.mEmpty);
    dialog.setContentView(R.layout.fatal_error);

    final Button signin = (Button) dialog.findViewById(R.id.signin);
    final TextView message = (TextView) dialog.findViewById(R.id.message);

    message.setText(mMessage);

    signin.setOnClickListener(new OnClickListener() {

        @Override
        public void onClick(View v) {
            dialog.dismiss();

            ((SampleClientActivity) getActivity()).openConnectDialog(null);
        }
    });

    return dialog;
}

From source file:com.androzic.PreferencesHelpDialog.java

@SuppressLint("NewApi")
@Override// w ww . j a  va 2  s.c om
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.FROYO) {
        dialog.setOnShowListener(new DialogInterface.OnShowListener() {
            @Override
            public void onShow(DialogInterface dialog) {
                scrollToView(rootView, rootView.findViewById(sectionId));
            }
        });
    }
    return dialog;
}

From source file:de.schildbach.litecoinwallet.ui.HelpDialogFragment.java

@Override
public Dialog onCreateDialog(final Bundle savedInstanceState) {
    final Bundle args = getArguments();
    final String page = args.getString(KEY_PAGE);

    final WebView webView = new WebView(activity);
    webView.loadUrl("file:///android_asset/" + page + languagePrefix() + ".html");

    final Dialog dialog = new Dialog(activity);
    dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
    dialog.setContentView(webView);/*w  ww .j a  va  2s  . c  om*/
    dialog.setCanceledOnTouchOutside(true);

    return dialog;
}