Java Code Examples for android.widget.PopupWindow

The following code examples are extracted from open source projects. You can click to vote up the examples that are useful to you.

Example 1

From project 2Degrees-Toolbox, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 2

From project 4308Cirrus, under directory /Extras/actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 3

From project ActionBarSherlock, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 4

From project Amantech, under directory /Android/action_bar_sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 5

From project andlytics, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 6

From project android-thaiime, under directory /latinime/src/com/sugree/inputmethod/latin/.

Source file: SuggestionsView.java

  21 
vote

private void showPreview(View view,CharSequence word){
  if (TextUtils.isEmpty(word))   return;
  final TextView previewText=mPreviewText;
  previewText.setTextColor(mParams.mColorTypedWord);
  previewText.setText(word);
  previewText.measure(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  final int[] offsetInWindow=new int[2];
  view.getLocationInWindow(offsetInWindow);
  final int posX=offsetInWindow[0];
  final int posY=offsetInWindow[1] - previewText.getMeasuredHeight();
  final PopupWindow previewPopup=mPreviewPopup;
  if (previewPopup.isShowing()) {
    previewPopup.update(posX,posY,previewPopup.getWidth(),previewPopup.getHeight());
  }
 else {
    previewPopup.showAtLocation(this,Gravity.NO_GRAVITY,posX,posY);
  }
  previewText.setVisibility(VISIBLE);
  mHandler.postHidePreview();
}
 

Example 7

From project AndroidDevWeekendDub-BookLibrary, under directory /src/org/curiouscreature/android/shelves/activity/.

Source file: ShelvesActivity.java

  21 
vote

private void showPopup(){
  if (mPopup == null) {
    PopupWindow p=new PopupWindow(this);
    p.setFocusable(false);
    p.setContentView(mGridPosition);
    p.setWidth(ViewGroup.LayoutParams.FILL_PARENT);
    p.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    p.setBackgroundDrawable(null);
    p.setAnimationStyle(R.style.PopupAnimation);
    mPopup=p;
  }
  if (mGrid.getWindowVisibility() == View.VISIBLE) {
    mPopup.showAtLocation(mGrid,Gravity.CENTER,0,0);
  }
}
 

Example 8

From project androidZenWriter, under directory /library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 9

From project android_packages_inputmethods_LatinIME, under directory /java/src/com/android/inputmethod/latin/.

Source file: SuggestionsView.java

  21 
vote

private void showPreview(View view,CharSequence word){
  if (TextUtils.isEmpty(word))   return;
  final TextView previewText=mPreviewText;
  previewText.setTextColor(mParams.mColorTypedWord);
  previewText.setText(word);
  previewText.measure(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  final int[] offsetInWindow=new int[2];
  view.getLocationInWindow(offsetInWindow);
  final int posX=offsetInWindow[0];
  final int posY=offsetInWindow[1] - previewText.getMeasuredHeight();
  final PopupWindow previewPopup=mPreviewPopup;
  if (previewPopup.isShowing()) {
    previewPopup.update(posX,posY,previewPopup.getWidth(),previewPopup.getHeight());
  }
 else {
    previewPopup.showAtLocation(this,Gravity.NO_GRAVITY,posX,posY);
  }
  previewText.setVisibility(VISIBLE);
  mHandler.postHidePreview();
}
 

Example 10

From project Bitcoin-Wallet-for-Android, under directory /wallet/src/de/schildbach/wallet/ui/.

Source file: SendCoinsFragment.java

  21 
vote

private void popup(final View anchor,final View contentView){
  contentView.measure(MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED,0),MeasureSpec.makeMeasureSpec(MeasureSpec.UNSPECIFIED,0));
  popupWindow=new PopupWindow(contentView,contentView.getMeasuredWidth(),contentView.getMeasuredHeight(),false);
  popupWindow.showAsDropDown(anchor);
  contentView.setBackgroundResource(popupWindow.isAboveAnchor() ? R.drawable.popup_frame_above : R.drawable.popup_frame_below);
}
 

Example 11

From project Common-Sense-Net-2, under directory /AndroidBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 12

From project cw-omnibus, under directory /external/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 13

From project DeskSMS, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 14

From project dmix, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 15

From project dreamDroid, under directory /libraries/ABS/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 16

From project examples_2, under directory /SearchView/actionbarsherlock-lib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 17

From project farebot, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 18

From project finch, under directory /libs/JakeWharton-ActionBarSherlock-2eabf25/library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 19

From project GnucashMobile, under directory /com_actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 20

From project Google-Tasks-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 21

From project HSR-Timetable, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 22

From project ICS_LatinIME_QHD, under directory /java/src/com/android/inputmethod/latin/.

Source file: SuggestionsView.java

  21 
vote

private void showPreview(View view,CharSequence word){
  if (TextUtils.isEmpty(word))   return;
  final TextView previewText=mPreviewText;
  previewText.setTextColor(mParams.mColorTypedWord);
  previewText.setText(word);
  previewText.measure(ViewGroup.LayoutParams.WRAP_CONTENT,ViewGroup.LayoutParams.WRAP_CONTENT);
  final int[] offsetInWindow=new int[2];
  view.getLocationInWindow(offsetInWindow);
  final int posX=offsetInWindow[0];
  final int posY=offsetInWindow[1] - previewText.getMeasuredHeight();
  final PopupWindow previewPopup=mPreviewPopup;
  if (previewPopup.isShowing()) {
    previewPopup.update(posX,posY,previewPopup.getWidth(),previewPopup.getHeight());
  }
 else {
    previewPopup.showAtLocation(this,Gravity.NO_GRAVITY,posX,posY);
  }
  previewText.setVisibility(VISIBLE);
  mHandler.postHidePreview();
}
 

Example 23

From project iosched_3, under directory /libprojects/abs/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 24

From project IRC-Client, under directory /actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 25

From project Jota-Text-Editor, under directory /src/jp/sblo/pandora/jota/text/.

Source file: TextView.java

  21 
vote

public HandleView(CursorController controller,int pos){
  super(TextView.this.mContext);
  mController=controller;
  mContainer=new PopupWindow(TextView.this.mContext,null,com.android.internal.R.attr.textSelectHandleWindowStyle);
  mContainer.setClippingEnabled(false);
  setOrientation(pos);
}
 

Example 26

From project mediaphone, under directory /src/ac/robinson/mediaphone/activity/.

Source file: NarrativeBrowserActivity.java

  21 
vote

private void showPopup(){
  if (mScrollState != AbsListView.OnScrollListener.SCROLL_STATE_FLING) {
    return;
  }
  if (mPopup == null) {
    PopupWindow p=new PopupWindow(this);
    p.setFocusable(false);
    p.setContentView(mPopupPosition);
    p.setWidth(ViewGroup.LayoutParams.MATCH_PARENT);
    p.setHeight(ViewGroup.LayoutParams.WRAP_CONTENT);
    p.setBackgroundDrawable(null);
    p.setAnimationStyle(android.R.style.Animation_Dialog);
    mPopup=p;
  }
  if (mNarratives.getWindowVisibility() == View.VISIBLE) {
    mPopup.showAtLocation(mNarratives,Gravity.CENTER,0,0);
  }
}
 

Example 27

From project MensaUPB, under directory /libs/ActionbarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 28

From project mWater-Android-App, under directory /android/actionbarsherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 29

From project MyHeath-Android, under directory /actionbarlib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 30

From project onebusaway-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 31

From project open311-android, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 32

From project RebeLauncher, under directory /src/com/dirtypepper/rebelauncher/.

Source file: Launcher.java

  21 
vote

private void dismissPreview(final View v){
  final PopupWindow window=(PopupWindow)v.getTag(R.id.TAG_PREVIEW);
  if (window != null) {
    hideDesktop(false);
    window.setOnDismissListener(new PopupWindow.OnDismissListener(){
      @SuppressWarnings("unchecked") public void onDismiss(){
        ViewGroup group=(ViewGroup)v.getTag(R.id.workspace);
        int count=group.getChildCount();
        for (int i=0; i < count; i++) {
          ((ImageView)group.getChildAt(i)).setImageDrawable(null);
        }
        ArrayList<Bitmap> bitmaps=(ArrayList<Bitmap>)v.getTag(R.id.icon);
        for (        Bitmap bitmap : bitmaps)         bitmap.recycle();
        v.setTag(R.id.workspace,null);
        v.setTag(R.id.icon,null);
        window.setOnDismissListener(null);
      }
    }
);
    window.dismiss();
    showingPreviews=false;
    mWorkspace.unlock();
    mWorkspace.invalidate();
    mDesktopLocked=false;
  }
  v.setTag(R.id.TAG_PREVIEW,null);
}
 

Example 33

From project Schedule, under directory /libs/android/sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 34

From project SeriesGuide, under directory /ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 35

From project SMSSync, under directory /abslib/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 36

From project Something-Awful-Android, under directory /libraries/Sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 37

From project The-Reverse-Recipe-Book, under directory /actionbarsherlock4.0/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 38

From project twidere, under directory /src/org/mariotaku/popupmenu/.

Source file: PopupMenuCompat.java

  21 
vote

/** 
 * Constructor for default vertical layout
 * @param context Context
 */
PopupMenuCompat(final Context context,final View view){
  this.context=context;
  res=context.getResources();
  mAnchorView=view;
  mWindow=new PopupWindow(context);
  mWindow.setTouchInterceptor(this);
  mWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
  mWindowManager=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
  mAdapter=new MenuAdapter(context);
  mMenu=new MenuImpl(context,mAdapter);
  setView();
}
 

Example 39

From project Unibeer, under directory /libs/sherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 40

From project Wifileaks, under directory /WifiLeaks/ABS/library/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 41

From project XTrade, under directory /sherlock-bar/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 42

From project Yaaic, under directory /libs/ActionBarSherlock/src/com/actionbarsherlock/internal/widget/.

Source file: IcsListPopupWindow.java

  21 
vote

public IcsListPopupWindow(Context context,AttributeSet attrs,int defStyleAttr,int defStyleRes){
  mContext=context;
  if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB) {
    Context wrapped=new ContextThemeWrapper(context,defStyleRes);
    mPopup=new PopupWindow(wrapped,attrs,defStyleAttr);
  }
 else {
    mPopup=new PopupWindow(context,attrs,defStyleAttr,defStyleRes);
  }
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NEEDED);
}
 

Example 43

From project Alerte-voirie-android, under directory /src/net/londatiga/android/.

Source file: CustomPopupWindow.java

  20 
vote

/** 
 * Create a QuickAction
 * @param anchor the view that the QuickAction will be displaying 'from'
 */
public CustomPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        CustomPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  windowManager=(WindowManager)anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 44

From project and-bible, under directory /tests/TableKeyboard/src/net/bible/android/view/util/buttongrid/.

Source file: ButtonGrid.java

  20 
vote

public void addButtons(List<ButtonInfo> buttonInfoList){
  this.buttonInfoList=buttonInfoList;
  int numButtons=buttonInfoList.size();
  mRowColLayout=new LayoutDesigner().calculateLayout(buttonInfoList);
  TableLayout.LayoutParams rowInTableLp=new TableLayout.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,1.0f);
  TableRow.LayoutParams cellInRowLp=new TableRow.LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,1.0f);
  int iCellNo=0;
  for (int iRow=0; iRow < mRowColLayout.rows; iRow++) {
    TableRow row=new TableRow(mContext);
    addView(row,rowInTableLp);
    for (int iCol=0; iCol < mRowColLayout.cols; iCol++) {
      if (iCellNo < numButtons) {
        ButtonInfo buttonInfo=buttonInfoList.get(iCellNo);
        Button button=new Button(mContext);
        button.setText(buttonInfo.name);
        button.setBackgroundResource(R.drawable.buttongrid_button_background);
        button.setTextColor(buttonInfo.textColor);
        button.setPadding(0,0,0,0);
        buttonInfo.button=button;
        buttonInfo.rowNo=iRow;
        buttonInfo.colNo=iCol;
        row.addView(button,cellInRowLp);
      }
 else {
        TextView spacer=new TextView(mContext);
        row.addView(spacer,cellInRowLp);
      }
      iCellNo++;
    }
  }
  LayoutInflater inflater=(LayoutInflater)mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  mPreviewText=(TextView)inflater.inflate(R.layout.buttongrid_button_preview,null);
  mPreviewPopup=new PopupWindow(mPreviewText);
  mPreviewPopup.setContentView(mPreviewText);
  mPreviewPopup.setBackgroundDrawable(null);
  mPreviewPopup.setTouchable(false);
  mPreviewText.setCompoundDrawables(null,null,null,null);
  float scale=mContext.getResources().getDisplayMetrics().density;
  mPreviewHeight=(int)(PREVIEW_HEIGHT_DIP * scale);
}
 

Example 45

From project android-bankdroid, under directory /src/com/liato/bankdroid/.

Source file: BetterPopupWindow.java

  20 
vote

/** 
 * Create a BetterPopupWindow
 * @param anchor the view that the BetterPopupWindow will be displaying 'from'
 */
public BetterPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  this.window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        BetterPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  this.windowManager=(WindowManager)this.anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 46

From project android_7, under directory /src/org/immopoly/android/helper/.

Source file: HudPopupHelper.java

  20 
vote

public HudPopupHelper(Activity activity,int type){
switch (type) {
case TYPE_FINANCE_POPUP:
    mLayoutView=(LinearLayout)activity.getLayoutInflater().inflate(R.layout.hud_statistic,null);
  break;
default :
mLayoutView=(LinearLayout)activity.getLayoutInflater().inflate(R.layout.hud_statistic,null);
break;
}
if (mLayoutView != null) {
mPopupView=new PopupWindow(mLayoutView,LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT,false);
mPopupView.setOutsideTouchable(true);
mPopupView.setBackgroundDrawable(new BitmapDrawable());
mPopupView.setTouchable(true);
mPopupView.setTouchInterceptor(new View.OnTouchListener(){
@Override public boolean onTouch(View v,MotionEvent event){
new Handler().postDelayed(new Runnable(){
  public void run(){
    mPopupView.dismiss();
  }
}
,200);
return true;
}
}
);
}
}
 

Example 47

From project android_packages_apps_Superuser, under directory /src/com/noshufou/android/su/widget/.

Source file: BetterPopupWindow.java

  20 
vote

/** 
 * Create a BetterPopupWindow
 * @param anchor the view that the BetterPopupWindow will be displaying 'from'
 */
public BetterPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  this.window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        BetterPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  this.windowManager=(WindowManager)this.anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 48

From project dungbeetle, under directory /src/edu/stanford/mobisocial/dungbeetle/.

Source file: CustomPopupWindow.java

  20 
vote

/** 
 * Create a QuickAction
 * @param anchor the view that the QuickAction will be displaying 'from'
 */
public CustomPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        CustomPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  windowManager=(WindowManager)anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 49

From project Ebento, under directory /src/mobisocial/bento/ebento/ui/quickaction/.

Source file: PopupWindows.java

  20 
vote

/** 
 * Constructor.
 * @param context Context
 */
public PopupWindows(Context context){
  mContext=context;
  mWindow=new PopupWindow(context);
  mWindow.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        mWindow.dismiss();
        return true;
      }
      return false;
    }
  }
);
  mWindowManager=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
}
 

Example 50

From project Gingerbread-Keyboard, under directory /src/com/android/inputmethod/latin/.

Source file: CandidateView.java

  20 
vote

/** 
 * Construct a CandidateView for showing suggested words for completion.
 * @param context
 * @param attrs
 */
public CandidateView(Context context,AttributeSet attrs){
  super(context,attrs);
  mSelectionHighlight=context.getResources().getDrawable(R.drawable.list_selector_background_pressed);
  LayoutInflater inflate=(LayoutInflater)context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
  Resources res=context.getResources();
  mPreviewPopup=new PopupWindow(context);
  mPreviewText=(TextView)inflate.inflate(R.layout.candidate_preview,null);
  mPreviewPopup.setWindowLayoutMode(LayoutParams.WRAP_CONTENT,LayoutParams.WRAP_CONTENT);
  mPreviewPopup.setContentView(mPreviewText);
  mPreviewPopup.setBackgroundDrawable(null);
  mPreviewPopup.setAnimationStyle(R.style.KeyPreviewAnimation);
  mColorNormal=res.getColor(R.color.candidate_normal);
  mColorRecommended=res.getColor(R.color.candidate_recommended);
  mColorOther=res.getColor(R.color.candidate_other);
  mDivider=res.getDrawable(R.drawable.keyboard_suggest_strip_divider);
  mAddToDictionaryHint=res.getString(R.string.hint_add_to_dictionary);
  mPaint=new Paint();
  mPaint.setColor(mColorNormal);
  mPaint.setAntiAlias(true);
  mPaint.setTextSize(mPreviewText.getTextSize());
  mPaint.setStrokeWidth(0);
  mPaint.setTextAlign(Align.CENTER);
  mDescent=(int)mPaint.descent();
  mMinTouchableWidth=(int)res.getDimension(R.dimen.candidate_min_touchable_width);
  mGestureDetector=new GestureDetector(new CandidateStripGestureListener(mMinTouchableWidth));
  setWillNotDraw(false);
  setHorizontalScrollBarEnabled(false);
  setVerticalScrollBarEnabled(false);
  scrollTo(0,getScrollY());
}
 

Example 51

From project gobandroid, under directory /src/org/ligi/gobandroid_hd/ui/.

Source file: BetterPopupWindow.java

  20 
vote

/** 
 * Create a BetterPopupWindow
 * @param anchor the view that the BetterPopupWindow will be displaying 'from'
 */
public BetterPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  this.window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        BetterPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  this.windowManager=(WindowManager)this.anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 52

From project MyExpenses, under directory /src/org/example/qberticus/quickactions/.

Source file: BetterPopupWindow.java

  20 
vote

/** 
 * Create a BetterPopupWindow
 * @param anchor the view that the BetterPopupWindow will be displaying 'from'
 */
public BetterPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  this.window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        BetterPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  this.windowManager=(WindowManager)this.anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 53

From project PinyinIME, under directory /src/com/android/inputmethod/pinyin/.

Source file: PinyinIME.java

  20 
vote

@Override public View onCreateCandidatesView(){
  if (mEnvironment.needDebug()) {
    Log.d(TAG,"onCreateCandidatesView.");
  }
  LayoutInflater inflater=getLayoutInflater();
  mFloatingContainer=(LinearLayout)inflater.inflate(R.layout.floating_container,null);
  mComposingView=(ComposingView)mFloatingContainer.getChildAt(0);
  mCandidatesContainer=(CandidatesContainer)inflater.inflate(R.layout.candidates_container,null);
  mCandidatesBalloon=new BalloonHint(this,mCandidatesContainer,MeasureSpec.UNSPECIFIED);
  mCandidatesBalloon.setBalloonBackground(getResources().getDrawable(R.drawable.candidate_balloon_bg));
  mCandidatesContainer.initialize(mChoiceNotifier,mCandidatesBalloon,mGestureDetectorCandidates);
  if (null != mFloatingWindow && mFloatingWindow.isShowing()) {
    mFloatingWindowTimer.cancelShowing();
    mFloatingWindow.dismiss();
  }
  mFloatingWindow=new PopupWindow(this);
  mFloatingWindow.setClippingEnabled(false);
  mFloatingWindow.setBackgroundDrawable(null);
  mFloatingWindow.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
  mFloatingWindow.setContentView(mFloatingContainer);
  setCandidatesViewShown(true);
  return mCandidatesContainer;
}
 

Example 54

From project RA_Launcher, under directory /src/com/dympy/QuickAction/.

Source file: PopupWindows.java

  20 
vote

/** 
 * Constructor.
 * @param context Context
 */
public PopupWindows(Context context){
  mContext=context;
  mWindow=new PopupWindow(context);
  mWindow.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        mWindow.dismiss();
        return true;
      }
      return false;
    }
  }
);
  mWindowManager=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
}
 

Example 55

From project RingPack, under directory /src/com/cryclops/ringpack/actionitems/.

Source file: CustomPopupWindow.java

  20 
vote

/** 
 * Create a QuickAction
 * @param anchor the view that the QuickAction will be displaying 'from'
 */
public CustomPopupWindow(View anchor){
  this.anchor=anchor;
  this.window=new PopupWindow(anchor.getContext());
  window.setTouchInterceptor(new OnTouchListener(){
    @Override public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        CustomPopupWindow.this.window.dismiss();
        return true;
      }
      return false;
    }
  }
);
  windowManager=(WindowManager)anchor.getContext().getSystemService(Context.WINDOW_SERVICE);
  onCreate();
}
 

Example 56

From project roman10-android-tutorial, under directory /dash/src/roman10/quickactionwindow/.

Source file: CustomPopupWindow3.java

  20 
vote

/** 
 * Constructor.
 * @param context Context
 */
public CustomPopupWindow3(Context context){
  mContext=context;
  mWindow=new PopupWindow(context);
  mWindow.setTouchInterceptor(new OnTouchListener(){
    public boolean onTouch(    View v,    MotionEvent event){
      if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
        mWindow.dismiss();
        return true;
      }
      return false;
    }
  }
);
  mWindowManager=(WindowManager)context.getSystemService(Context.WINDOW_SERVICE);
}
 

Example 57

From project TeclaAccess, under directory /source/src/ca/idi/tekla/ime/.

Source file: TeclaIME.java

  20 
vote

public void run(){
  if (TeclaApp.highlighter.isSoftIMEShowing()) {
    Display display=getDisplay();
    if (mSwitchPopup == null) {
      mSwitch=getLayoutInflater().inflate(R.layout.popup_fullscreen_transparent,null);
      mSwitch.setOnTouchListener(mSwitchTouchListener);
      mSwitch.setOnClickListener(mSwitchClickListener);
      mSwitch.setOnLongClickListener(mSwitchLongPressListener);
      mSwitchPopup=new PopupWindow(mSwitch);
    }
    if (mSwitchPopup.isShowing())     mSwitchPopup.dismiss();
    mSwitchPopup.setWidth(display.getWidth());
    mSwitchPopup.setHeight(display.getHeight());
    mSwitchPopup.showAtLocation(mIMEView,Gravity.NO_GRAVITY,0,0);
    TeclaApp.getInstance().showToast(R.string.fullscreen_enabled);
    if (TeclaApp.DEBUG)     Log.d(TeclaApp.TAG,CLASS_TAG + "Fullscreen switch shown");
    evaluateStartScanning();
  }
 else {
    startFullScreenSwitchMode(1000);
  }
}
 

Example 58

From project cow, under directory /libs/ActionBarSherlock/library/src/com/actionbarsherlock/internal/view/menu/.

Source file: MenuPopupHelper.java

  19 
vote

public boolean tryShow(){
  mPopup=new IcsListPopupWindow(mContext,null,R.attr.popupMenuStyle);
  mPopup.setOnDismissListener(this);
  mPopup.setOnItemClickListener(this);
  mAdapter=new MenuAdapter(mMenu);
  mPopup.setAdapter(mAdapter);
  mPopup.setModal(true);
  View anchor=mAnchorView;
  if (anchor != null) {
    final boolean addGlobalListener=mTreeObserver == null;
    mTreeObserver=anchor.getViewTreeObserver();
    if (addGlobalListener)     mTreeObserver.addOnGlobalLayoutListener(this);
    ((View_HasStateListenerSupport)anchor).addOnAttachStateChangeListener(this);
    mPopup.setAnchorView(anchor);
  }
 else {
    return false;
  }
  mPopup.setContentWidth(Math.min(measureContentWidth(mAdapter),mPopupMaxWidth));
  mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
  mPopup.show();
  mPopup.getListView().setOnKeyListener(this);
  return true;
}
 

Example 59

From project shoppinglist, under directory /ShoppingList/src/org/openintents/shopping/ui/widget/backport/.

Source file: ListPopupWindow.java

  19 
vote

public void run(){
  if (mDropDownList != null && mDropDownList.getCount() > mDropDownList.getChildCount() && mDropDownList.getChildCount() <= mListItemExpandMaximum) {
    mPopup.setInputMethodMode(PopupWindow.INPUT_METHOD_NOT_NEEDED);
    show();
  }
}