code: public static int resolveRtlGravity(int gravity) {
          if (0 != (gravity & ViewBaseCommon.RIGHT)) {
              gravity &= ~ViewBaseCommon.RIGHT;
              gravity |= ViewBaseCommon.LEFT;
          } else if (0 != (gravity & ViewBaseCommon.LEFT)) {
              gravity &= ~ViewBaseCommon.LEFT;
              gravity |= ViewBaseCommon.RIGHT;
          }
  
          return gravity;
      }
docs: Convert (left/right) gravity to (right/left).
  @param gravity
  @return rtl gravity