code: public void show(int gravity, int x, int y) {
          initializePopupWindow();
          mPopupWindow.showAtLocation(mTrigger, gravity, x, y);
          mPopupWindow.update();
          // 此处如果ContentView有入场动画的话，显示动画
          if (null != contentInAnimation) {
              mContentView.startAnimation(contentInAnimation);
          }
      }
docs: 按照指定位置和偏移量显示PopupWindow