Ejemplo n.º 1
1
 private static void drawToast(View v, Rect vRect) {
   // TODO Auto-generated method stub
   if (mToast != null) {
     View tv = mToast.getView();
     if (tv.getWidth() > 0 && tv.isShown()) {
       if (LOGD_ENABLED) Log.i(LOG_TAG, "==== " + tv.getWidth() + " " + tv.getHeight());
       Bitmap second = Utils.createPngScreenshot(tv, tv.getWidth(), tv.getHeight(), 0);
       if (LOGD_ENABLED)
         Log.d(
             LOG_TAG,
             "====== gravity "
                 + mToast.getGravity()
                 + " x y "
                 + mToast.getXOffset()
                 + " "
                 + mToast.getYOffset()
                 + " "
                 + mToast.getHorizontalMargin()
                 + " "
                 + mToast.getVerticalMargin());
       PointF fromPoint =
           new PointF(
               (v.getWidth() - tv.getWidth()) / 2,
               v.getHeight() - vRect.top - mToast.getYOffset() - tv.getHeight());
       if (LOGD_ENABLED)
         Log.i(LOG_TAG, "======= prepare menu view2  ========" + fromPoint.x + " " + fromPoint.y);
       mCapture = Utils.mixtureBitmap2(mCapture, second, fromPoint, 0, (float) 1.0);
     }
   }
 }
 public TiUINotification(TiViewProxy proxy) {
   super(proxy);
   Log.d(TAG, "Creating a notifier", Log.DEBUG_MODE);
   toast = Toast.makeText(proxy.getActivity(), "", Toast.LENGTH_SHORT);
   horizontalMargin = toast.getHorizontalMargin();
   verticalMargin = toast.getVerticalMargin();
   offsetX = toast.getXOffset();
   offsetY = toast.getYOffset();
   gravity = toast.getGravity();
 }