Example usage for android.app Dialog setCanceledOnTouchOutside

List of usage examples for android.app Dialog setCanceledOnTouchOutside

Introduction

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

Prototype

public void setCanceledOnTouchOutside(boolean cancel) 

Source Link

Document

Sets whether this dialog is canceled when touched outside the window's bounds.

Usage

From source file:com.androzic.track.TrackToRoute.java

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.act_track_to_route, container);

    algA = (RadioButton) rootView.findViewById(R.id.alg_a);
    //algB = (RadioButton) rootView.findViewById(R.id.alg_b);
    algA.setChecked(true);/*  w w  w . j ava2  s .  c om*/

    sensitivity = (SeekBar) rootView.findViewById(R.id.sensitivity);

    Button generate = (Button) rootView.findViewById(R.id.generate_button);
    generate.setOnClickListener(saveOnClickListener);

    final Dialog dialog = getDialog();

    dialog.setTitle(R.string.savetrack_name);
    dialog.setCanceledOnTouchOutside(false);

    return rootView;
}

From source file:eu.thedarken.rootvalidator.ui.AboutDialog.java

@NonNull
@Override/* w  w  w  .  j ava 2 s . c  o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    setCancelable(true);
    dialog.setCanceledOnTouchOutside(true);
    return dialog;
}

From source file:it.polimi.spf.app.permissiondisclaimer.PermissionDisclaimerDialogFragment.java

@NonNull
@Override/* w  w w .ja  v  a 2s.  c o  m*/
public Dialog onCreateDialog(Bundle savedInstanceState) {
    Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.getWindow().requestFeature(Window.FEATURE_NO_TITLE);
    dialog.setCanceledOnTouchOutside(false);
    return dialog;
}

From source file:com.dgsd.android.ShiftTracker.Fragment.HoursAndIncomeSummaryFragment.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    View v = LayoutInflater.from(getActivity()).inflate(R.layout.fragment_hour_and_income_summary, null);

    mMonth = (TextView) v.findViewById(R.id.month);
    mThreeMonth = (TextView) v.findViewById(R.id.three_months);
    mSixMonth = (TextView) v.findViewById(R.id.six_months);
    mNineMonth = (TextView) v.findViewById(R.id.nine_months);
    mThisYear = (TextView) v.findViewById(R.id.year);

    AlertDialog.Builder b = new AlertDialog.Builder(getActivity());
    b.setView(v);//from   w ww. ja v  a 2s .  c  o m

    Time time = new Time();
    time.setJulianDay(mJulianDay);

    b.setTitle(DateFormat.getDateFormat(getActivity()).format(time.toMillis(true)));

    Dialog d = b.create();
    d.setCanceledOnTouchOutside(true);

    return d;
}

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  .ja  va2 s .c  o m
    imageView.setOnClickListener(new View.OnClickListener() {
        public void onClick(final View v) {
            dismiss();
        }
    });

    return dialog;
}

From source file:org.lunci.dumbthing.dialog.AddDumbThingDialog.java

@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
    final Dialog dialog = super.onCreateDialog(savedInstanceState);
    dialog.setTitle(getResources().getString(R.string.add_dumb_thing));
    dialog.setCanceledOnTouchOutside(true);
    dialog.getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE);
    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  w w. j  a va 2 s. co 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);//from  w  ww  .j av a  2  s. c o m
    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   w  w w.j a v a  2s . 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: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);//from  ww  w .jav a2 s.  co m
    dialog.setCanceledOnTouchOutside(true);

    return dialog;
}