android.widget.PopupWindow.setAnimationStyle()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(8.0k)|赞(0)|评价(0)|浏览(156)

本文整理了Java中android.widget.PopupWindow.setAnimationStyle()方法的一些代码示例,展示了PopupWindow.setAnimationStyle()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PopupWindow.setAnimationStyle()方法的具体详情如下:
包路径:android.widget.PopupWindow
类名称:PopupWindow
方法名:setAnimationStyle

PopupWindow.setAnimationStyle介绍

暂无

代码示例

代码示例来源:origin: jeasonlzy/NineGridView

@OnClick(R.id.more)
public void more(View view) {
  View popupView = mInflater.inflate(R.layout.popup_reply, null);
  popupView.findViewById(R.id.favour).setOnClickListener(this);
  popupView.findViewById(R.id.comment).setOnClickListener(this);
  window = new PopupWindow(popupView, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  window.setOutsideTouchable(true);
  window.setFocusable(true);
  window.setAnimationStyle(R.style.popup_more_anim);
  window.setBackgroundDrawable(new ColorDrawable(Color.BLACK));
  popupView.measure(0, 0);
  int xoff = -popupView.getMeasuredWidth();
  int yoff = -(popupView.getMeasuredHeight() + view.getHeight()) / 2;
  window.showAsDropDown(view, xoff, yoff);
}

代码示例来源:origin: pili-engineering/PLDroidPlayer

+ mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,
    anchorRect.left, 0);
    + mRoot.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mRoot, Gravity.BOTTOM,
    anchorRect.left, 0);

代码示例来源:origin: HotBitmapGG/bilibili-android-client

location[0] + mAnchor.getWidth(), location[1]
    + mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,
    anchorRect.left, 0);

代码示例来源:origin: ZieIony/Carbon

popupWindow.setBackgroundDrawable(new ColorDrawable(0x7fff0000));
popupWindow.setTouchable(true);
popupWindow.setAnimationStyle(0);
View view = new View(getContext());
view.setLayoutParams(new ViewGroup.MarginLayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.MATCH_PARENT));

代码示例来源:origin: Bearded-Hen/Android-Bootstrap

private void createDropDown() {
  ScrollView dropdownView = createDropDownView();
  dropdownWindow = new PopupWindow();
  dropdownWindow.setFocusable(true);
  dropdownWindow.setHeight(WindowManager.LayoutParams.WRAP_CONTENT);
  if (!isInEditMode()) {
    dropdownWindow.setBackgroundDrawable(DrawableUtils.resolveDrawable(android.R.drawable
                                          .dialog_holo_light_frame, getContext()));
  }
  dropdownWindow.setContentView(dropdownView);
  dropdownWindow.setOnDismissListener(this);
  dropdownWindow.setAnimationStyle(android.R.style.Animation_Activity);
  float longestStringWidth = measureStringWidth(getLongestString(dropdownData))
      + DimenUtils.dpToPixels((baselineItemRightPadding + baselineItemLeftPadding) * bootstrapSize);
  if (longestStringWidth < getMeasuredWidth()) {
    dropdownWindow.setWidth(DimenUtils.dpToPixels(getMeasuredWidth()));
  }
  else {
    dropdownWindow.setWidth((int) longestStringWidth + DimenUtils.dpToPixels(8));
  }
}

代码示例来源:origin: zyyoona7/EasyPopup

private void initQQPop() {
  View view = LayoutInflater.from(this).inflate(R.layout.layout_right_pop, null);
  mQQPop = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  mQQPop.setAnimationStyle(R.style.RightTopPopAnim);
  mQQPop.setFocusable(true);
  mQQPop.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  mQQPop.setOutsideTouchable(true);
}

代码示例来源:origin: zyyoona7/EasyPopup

private void initWeiboPop() {
    View view = LayoutInflater.from(this).inflate(R.layout.layout_center_pop, null);
    mWeiboPop = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
    mWeiboPop.setAnimationStyle(R.style.TopPopAnim);
    mWeiboPop.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
    mWeiboPop.setFocusable(true);
    mWeiboPop.setOutsideTouchable(false);
  }
}

代码示例来源:origin: zyyoona7/EasyPopup

private void initCirclePop() {
  View view = LayoutInflater.from(this).inflate(R.layout.layout_circle_comment, null);
  mCiclePop = new PopupWindow(view, ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT);
  mCiclePop.setAnimationStyle(R.style.RightPopAnim);
  mCiclePop.setFocusable(true);
  mCiclePop.setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
  mCiclePop.setOutsideTouchable(true);
}

代码示例来源:origin: OCNYang/Android-Animation-Set

private void showImgPopupWindow(View anchor) {
    if (mImgPopupWindow == null) {
      ImageView view = new ImageView(this);
      view.setImageDrawable(getDrawable(R.drawable.img_popup));

      mImgPopupWindow = new PopupWindow(view, anchor.getMeasuredWidth(), anchor.getMeasuredWidth());
      mImgPopupWindow.setAnimationStyle(R.style.popup_anim_style);
    }
    if (mImgPopupWindow.isShowing()) {
      mImgPopupWindow.dismiss();
    } else {
      mImgPopupWindow.showAsDropDown(anchor);
    }
  }
}

代码示例来源:origin: curtis2/SuperVideoPlayer

Rect anchorRect = new Rect(location[0], location[1], location[0] + mAnchor.getWidth(), location[1] + mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
setWindowLayoutType();
mWindow.showAtLocation(mAnchor, Gravity.NO_GRAVITY, anchorRect.left, anchorRect.bottom);

代码示例来源:origin: pili-engineering/PLDroidShortVideo

+ mAnchor.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mAnchor, Gravity.BOTTOM,
    anchorRect.left, 0);
    + mRoot.getHeight());
mWindow.setAnimationStyle(mAnimStyle);
mWindow.showAtLocation(mRoot, Gravity.BOTTOM,
    anchorRect.left, 0);

代码示例来源:origin: zyyoona7/EasyPopup

if (touchX<getWidth() && screenHeight-touchY<getHeight()){
  getPopupWindow().setAnimationStyle(R.style.LeftBottomPopAnim);
  offsetY=touchY-getHeight();
}else if (touchX+getWidth()>screenWidth && touchY+getHeight()>screenHeight){
  getPopupWindow().setAnimationStyle(R.style.RightBottomPopAnim);
  offsetX=(touchX-getWidth());
  offsetY=touchY-getHeight();
}else if (touchX+getWidth()>screenWidth){
  getPopupWindow().setAnimationStyle(R.style.RightTopPopAnim);
  offsetX=(touchX-getWidth());
}else {
  getPopupWindow().setAnimationStyle(R.style.LeftTopPopAnim);

代码示例来源:origin: chat-sdk/chat-sdk-android

imagePopup.setBackgroundDrawable(new BitmapDrawable());
imagePopup.setOutsideTouchable(true);
imagePopup.setAnimationStyle(R.style.ImagePopupAnimation);

代码示例来源:origin: stackoverflow.com

popupWindow.setAnimationStyle(R.style.PopupAnimation);
popupWindow.showAtLocation(findViewById(R.id.btn_show), Gravity.NO_GRAVITY, 0, 0);
popupWindow.setFocusable(true);

代码示例来源:origin: pinguo-zhouwei/CustomPopwindow

mPopupWindow.setAnimationStyle(mAnimationStyle);

代码示例来源:origin: skydoves/PowerMenu

/**
 * sets custom animations of the popup. It will start up when the popup is showing.
 *
 * @param style custom animation style.
 */
public void setAnimationStyle(int style) {
  this.menuWindow.setAnimationStyle(style);
}

代码示例来源:origin: zyyoona7/EasyPopup

public T apply() {
  if (mPopupWindow == null) {
    mPopupWindow = new PopupWindow();
  }
  onPopupWindowCreated();
  initContentViewAndWH();
  onPopupWindowViewCreated(mContentView);
  if (mAnimationStyle != 0) {
    mPopupWindow.setAnimationStyle(mAnimationStyle);
  }
  initFocusAndBack();
  mPopupWindow.setOnDismissListener(this);
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
    if (mEnterTransition != null) {
      mPopupWindow.setEnterTransition(mEnterTransition);
    }
    if (mExitTransition != null) {
      mPopupWindow.setExitTransition(mExitTransition);
    }
  }
  return self();
}

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
  if (keyCode ==  KeyEvent.KEYCODE_MENU && event.getRepeatCount() == 0) {
      mPWMenu.setAnimationStyle(R.style.Animations_PopDownMenuBottom);
      mPWMenu.showAtLocation(mLParent, Gravity.BOTTOM | Gravity.CENTER,  0, 0);
    return true;
  }
  return super.onKeyUp(keyCode, event);
}

代码示例来源:origin: tohodog/QSVideoPlayer

private PopupWindow getPopupWindow(View popupView) {
  PopupWindow mPopupWindow = new PopupWindow(popupView, LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, true);
  mPopupWindow.setTouchable(true);
  mPopupWindow.setOutsideTouchable(true);
  mPopupWindow.setBackgroundDrawable(new ColorDrawable(0));
  mPopupWindow.setAnimationStyle(R.style.jc_popup_toast_anim);
  return mPopupWindow;
}

代码示例来源:origin: AntonioRedondo/AnotherMonitor

@Override
  public void onClick(View v) {
    mPWMenu.setAnimationStyle(R.style.Animations_PopDownMenu);
    if (Build.VERSION.SDK_INT < 19)
      mPWMenu.showAtLocation(mLTopBar, Gravity.TOP | Gravity.RIGHT, 0, mLTopBar.getHeight() + statusBarHeight);
    else mPWMenu.showAtLocation(mLTopBar, Gravity.TOP | Gravity.RIGHT, 0, mLTopBar.getHeight());
  }
});

相关文章