コード例 #1
0
  @Override
  public void dismissSingleUserProfile() {
    if (LayoutSpec.isPhone(getActivity()) && getChildFragmentManager().popBackStackImmediate()) {
      isShowingCommonUserProfile = false;

      restoreCurrentPageAfterClosingOverlay();
    }
  }
コード例 #2
0
  public static int getMarginBetweenCursorButtons(Context context) {
    int margin;
    int cursorButtonWidth =
        context.getResources().getDimensionPixelSize(R.dimen.new_cursor_menu_button_width);

    if (LayoutSpec.isPhone(context)) {
      int paddingEdge =
          context
              .getResources()
              .getDimensionPixelSize(R.dimen.cursor_toolbar_padding_horizontal_edge);
      int total =
          ViewUtils.getOrientationIndependentDisplayWidth(context)
              - 2 * paddingEdge
              - cursorButtonWidth * NUM_CURSOR_ROW_BUTTONS;
      margin = total / (NUM_CURSOR_ROW_BUTTONS - 1);
    } else {
      margin = context.getResources().getDimensionPixelSize(R.dimen.cursor_toolbar_padding_item);
    }
    return margin;
  }