コード例 #1
0
ファイル: Selection.cs プロジェクト: hakeemsm/XobotOS
		/// <summary>
		/// Move the selection end to the buffer offset physically to the left of
		/// the current selection end.
		/// </summary>
		/// <remarks>
		/// Move the selection end to the buffer offset physically to the left of
		/// the current selection end.
		/// </remarks>
		public static bool extendLeft(android.text.Spannable text, android.text.Layout layout
			)
		{
			int end = getSelectionEnd(text);
			int to = layout.getOffsetToLeftOf(end);
			if (to != end)
			{
				extendSelection(text, to);
				return true;
			}
			return true;
		}
コード例 #2
0
ファイル: Selection.cs プロジェクト: hakeemsm/XobotOS
		/// <summary>
		/// Move the cursor to the buffer offset physically to the left of
		/// the current offset, or return false if the cursor is already
		/// at the left edge of the line and there is not another line to move it to.
		/// </summary>
		/// <remarks>
		/// Move the cursor to the buffer offset physically to the left of
		/// the current offset, or return false if the cursor is already
		/// at the left edge of the line and there is not another line to move it to.
		/// </remarks>
		public static bool moveLeft(android.text.Spannable text, android.text.Layout layout
			)
		{
			int start = getSelectionStart(text);
			int end = getSelectionEnd(text);
			if (start != end)
			{
				setSelection(text, chooseHorizontal(layout, -1, start, end));
				return true;
			}
			else
			{
				int to = layout.getOffsetToLeftOf(end);
				if (to != end)
				{
					setSelection(text, to);
					return true;
				}
			}
			return false;
		}