public static int getCursorEditTextAnchorPosition(Context context, int width) { if (ViewUtils.isInPortrait(context)) { return (width - context.getResources().getDimensionPixelSize(R.dimen.cursor_desired_width)) / 2; } return context.getResources().getDimensionPixelSize(R.dimen.cursor_anchor2); }
public static int getCursorMenuLeftMargin(Context context, int totalWidth) { if (ViewUtils.isInPortrait(context)) { return getCursorEditTextAnchorPosition(context, totalWidth) - context.getResources().getDimensionPixelSize(R.dimen.new_cursor_menu_button_width) - context.getResources().getDimensionPixelSize(R.dimen.cursor_typing_left_margin); } return context.getResources().getDimensionPixelSize(R.dimen.cursor_typing_left_margin); }