Exemplo n.º 1
0
    @Override
    public void setInsets(
        MozcView mozcView, int contentViewWidth, int contentViewHeight, Insets outInsets) {
      if (!isFloatingMode(mozcView)) {
        DefaultInsetsCalculator.setInsetsDefault(
            mozcView, contentViewWidth, contentViewHeight, outInsets);
        return;
      }
      mozcView.getResources();
      int height = mozcView.getVisibleViewHeight();
      int width = mozcView.getSideAdjustedWidth();
      int left =
          mozcView.layoutAdjustment == LayoutAdjustment.RIGHT ? (contentViewWidth - width) : 0;

      outInsets.touchableInsets = Insets.TOUCHABLE_INSETS_REGION;
      outInsets.touchableRegion.set(
          left, contentViewHeight - height, left + width, contentViewHeight);
      outInsets.contentTopInsets = contentViewHeight;
      outInsets.visibleTopInsets = contentViewHeight;
      return;
    }
Exemplo n.º 2
0
 static void setInsetsDefault(
     MozcView mozcView, int contentViewWidth, int contentViewHeight, Insets outInsets) {
   outInsets.touchableInsets = Insets.TOUCHABLE_INSETS_CONTENT;
   outInsets.contentTopInsets = contentViewHeight - mozcView.getVisibleViewHeight();
   outInsets.visibleTopInsets = outInsets.contentTopInsets;
 }