Example usage for android.widget PopupWindow setFocusable

List of usage examples for android.widget PopupWindow setFocusable

Introduction

In this page you can find the example usage for android.widget PopupWindow setFocusable.

Prototype

public void setFocusable(boolean focusable) 

Source Link

Document

Changes the focusability of the popup window.

Usage

From source file:com.mattermost.service.Promise.java

public static PopupWindow show() {
    Activity currentActivity = AppActivity.current;
    PopupWindow pw = new PopupWindow(currentActivity);
    pw.setFocusable(false);
    pw.setBackgroundDrawable(new ColorDrawable(0));
    ImageView img = new ImageView(currentActivity);
    pw.setContentView(img);//  ww  w.jav a 2  s  .c  om
    View view = currentActivity.getWindow().getDecorView();
    pw.setWidth(60);
    pw.setHeight(60);
    AnimatedCircleDrawable a = new AnimatedCircleDrawable(Color.RED, 5, Color.TRANSPARENT, 30);
    img.setImageDrawable(a);
    pw.showAtLocation(view, Gravity.LEFT | Gravity.TOP, view.getWidth() / 2 - 30, view.getHeight() / 2 - 30);
    a.start();

    return pw;
}

From source file:com.krayzk9s.imgurholo.tools.ImageUtils.java

public static void fullscreen(android.support.v4.app.Fragment fragment, JSONParcelable imageData,
        PopupWindow popupWindow, View mainView) {
    popupWindow.setBackgroundDrawable(new ColorDrawable(0x80000000));
    popupWindow.setFocusable(true);
    popupWindow.setWindowLayoutMode(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT);
    final ZoomableImageView zoomableImageView = new ZoomableImageView(fragment.getActivity());
    popupWindow.setContentView(zoomableImageView);
    popupWindow.showAtLocation(mainView, Gravity.TOP, 0, 0);
    LoadImageAsync loadImageAsync = new LoadImageAsync(zoomableImageView, imageData);
    loadImageAsync.execute();/*  ww  w . j  a v a  2s.  c o  m*/
}

From source file:com.knurld.dropboxdemo.KnurldActivity.java

public PopupWindow showLoadingPopup(View view) {
    View spinnerView = LayoutInflater.from((Activity) context).inflate(R.layout.loading_popup, null);
    ProgressBar progressBar = (ProgressBar) spinnerView.findViewById(R.id.speakProgress);
    progressBar.getIndeterminateDrawable().setColorFilter(Color.WHITE, PorterDuff.Mode.MULTIPLY);

    PopupWindow popupWindow = new PopupWindow(spinnerView, 500, 500);
    popupWindow.setFocusable(true);
    popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
    return popupWindow;
}

From source file:com.knurld.dropboxdemo.KnurldActivity.java

public void showInstructions(View view) {
    Activity parent = (Activity) context;
    View spinnerView = LayoutInflater.from(parent).inflate(R.layout.instructions_popup, null);

    TextView textView = (TextView) spinnerView.findViewById(R.id.phraseText);
    textView.setText("Press record to begin recording enrollment");

    PopupWindow popupWindow = new PopupWindow(spinnerView, 500, 500);
    popupWindow.setFocusable(true);
    popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);

    final PopupWindow finalPopupWindow = popupWindow;
    new android.os.Handler().postDelayed(new Runnable() {
        public void run() {
            finalPopupWindow.dismiss();/*from   w w  w . j  a v a 2  s  . c  o m*/
        }
    }, 3000);

}

From source file:com.knurld.dropboxdemo.KnurldActivity.java

public void showMessage(View view, String message) {
    Activity parent = (Activity) context;
    View spinnerView = LayoutInflater.from(parent).inflate(R.layout.instructions_popup, null);

    TextView textView = (TextView) spinnerView.findViewById(R.id.phraseText);
    textView.setText(message);//from  ww  w. jav a2 s. c o  m

    PopupWindow popupWindow = new PopupWindow(spinnerView, 500, 500);
    popupWindow.setFocusable(true);
    popupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);

    final PopupWindow finalPopupWindow = popupWindow;
    new android.os.Handler().postDelayed(new Runnable() {
        public void run() {
            finalPopupWindow.dismiss();
        }
    }, 3000);

}

From source file:com.survivingwithandroid.pegboard.DreamPinsActivity.java

@Override
public void onSaveSelected() {
    closeMenu();/*  w  w  w . j  a v a2 s  .c o  m*/

    LayoutInflater inf = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inf.inflate(R.layout.popsave_layout, null, false);

    final PopupWindow pw = new PopupWindow(v);
    pw.setFocusable(true);
    pw.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT);
    pw.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);

    final EditText edt = (EditText) v.findViewById(R.id.edtFileName);

    TextView saveTxt = (TextView) v.findViewById(R.id.dlgSave);
    TextView cancelTxt = (TextView) v.findViewById(R.id.dlgCancel);
    cancelTxt.setOnClickListener(new View.OnClickListener() {

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

    saveTxt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pw.dismiss();
            Bitmap b = pinTableFrag.createBitmap();
            try {
                ImageUtility.saveImage(b, edt.getEditableText().toString(), DreamPinsActivity.this);
            } catch (SaveFileException sfe) {
                Toast.makeText(DreamPinsActivity.this, getResources().getText(R.string.msgSaveFileError),
                        Toast.LENGTH_LONG).show();
            }
        }
    });

    pw.showAtLocation(v, Gravity.CENTER, 0, 0);

}

From source file:com.survivingwithandroid.pegboard.DreamPinsActivity.java

public void onBackgroundSelected() {
    LayoutInflater inf = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inf.inflate(R.layout.popbkg_layout, null, false);

    final PopupWindow pw = new PopupWindow(v);
    pw.setFocusable(true);
    pw.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT);
    pw.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);

    TextView changeTxt = (TextView) v.findViewById(R.id.dlgChange);
    TextView resetTxt = (TextView) v.findViewById(R.id.dlgReset);
    TextView cancelTxt = (TextView) v.findViewById(R.id.dlgCancel);
    cancelTxt.setOnClickListener(new View.OnClickListener() {

        @Override/*  w  w w .  j  a v  a 2 s.c  o  m*/
        public void onClick(View v) {
            pw.dismiss();
        }
    });

    resetTxt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pw.dismiss();
            pinTableFrag.setBackground(R.drawable.tilebkg);
        }
    });

    changeTxt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pw.dismiss();
            // Start a new Intent to get the picture from the Gallery
            Intent intent = new Intent();
            intent.setType("image/*");
            intent.setAction(Intent.ACTION_GET_CONTENT);
            intent.addCategory(Intent.CATEGORY_OPENABLE);
            startActivityForResult(intent, SELECT_PICTURE);
        }
    });

    pw.showAtLocation(v, Gravity.CENTER, 0, 0);

}

From source file:com.survivingwithandroid.pegboard1.DreamPinsActivity.java

@Override
public void onSaveSelected() {
    closeMenu();/*from w w  w . j a va2  s. c  o m*/

    LayoutInflater inf = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inf.inflate(R.layout.popsave_layout, null, false);

    final PopupWindow pw = new PopupWindow(v);
    pw.setFocusable(true);
    pw.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT);
    pw.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);

    final EditText edt = (EditText) v.findViewById(R.id.edtFileName);

    TextView saveTxt = (TextView) v.findViewById(R.id.dlgSave);
    TextView cancelTxt = (TextView) v.findViewById(R.id.dlgCancel);
    cancelTxt.setOnClickListener(new View.OnClickListener() {

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

    saveTxt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pw.dismiss();
            Bitmap b = pinTableFrag.createBitmap();
            try {
                ///////////////
                ImageUtility.saveImage(b, edt.getEditableText().toString(), DreamPinsActivity.this);
                ///////////////

            } catch (SaveFileException sfe) {
                Toast.makeText(DreamPinsActivity.this, getResources().getText(R.string.msgSaveFileError),
                        Toast.LENGTH_LONG).show();
            }
        }
    });

    pw.showAtLocation(v, Gravity.CENTER, 0, 0);

}

From source file:com.zipzapd.DreamPinsActivity.java

@Override
public void onSaveSelected() {
    closeMenu();// ww w  .j  a  va 2s .c  o m

    LayoutInflater inf = (LayoutInflater) this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
    View v = inf.inflate(R.layout.popsave_layout, null, false);

    final PopupWindow pw = new PopupWindow(v);
    pw.setFocusable(true);
    pw.setWidth(RelativeLayout.LayoutParams.WRAP_CONTENT);
    pw.setHeight(RelativeLayout.LayoutParams.WRAP_CONTENT);

    final EditText edt = (EditText) v.findViewById(R.id.edtFileName);

    TextView saveTxt = (TextView) v.findViewById(R.id.dlgSave);
    TextView cancelTxt = (TextView) v.findViewById(R.id.dlgCancel);
    cancelTxt.setOnClickListener(new View.OnClickListener() {

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

    saveTxt.setOnClickListener(new View.OnClickListener() {

        @Override
        public void onClick(View v) {
            pw.dismiss();
            Bitmap b = pinTableFrag.createBitmap();
            try {
                ///////////////
                ImageUtility.saveImage(b, edt.getEditableText().toString(), DreamPinsActivity.this);

                sync.putZipZapData();
                ///////////////

            } catch (SaveFileException sfe) {
                Toast.makeText(DreamPinsActivity.this, getResources().getText(R.string.msgSaveFileError),
                        Toast.LENGTH_LONG).show();
            }
        }
    });

    pw.showAtLocation(v, Gravity.CENTER, 0, 0);

}

From source file:org.zywx.wbpalmstar.plugin.uexscrawl.PhotoScrawlActivity.java

private void showPopWindow(SeekBar seekBar, View relativeView) {
    int w = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
    int h = View.MeasureSpec.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED);
    seekBar.measure(w, h);/*from  w ww  .  j  a v a 2 s  .c o  m*/
    PopupWindow popupWindow = new PopupWindow(seekBar);
    popupWindow.setBackgroundDrawable(new ColorDrawable());
    popupWindow.setFocusable(true);
    popupWindow.setOutsideTouchable(true);
    popupWindow.setWidth(seekBar.getMeasuredWidth());
    popupWindow.setHeight(EUExUtil.dipToPixels(120));
    popupWindow.showAtLocation(mImageContentLayout, Gravity.BOTTOM,
            relativeView.getLeft() - mImageContentLayout.getWidth() / 2 + relativeView.getWidth() / 2,
            mCloseLayout.getHeight() + relativeView.getHeight() + 50);
}