当前位置: 首页>>代码示例>>C#>>正文


C# android.getSpanFlags方法代码示例

本文整理汇总了C#中android.getSpanFlags方法的典型用法代码示例。如果您正苦于以下问题:C# android.getSpanFlags方法的具体用法?C# android.getSpanFlags怎么用?C# android.getSpanFlags使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android的用法示例。


在下文中一共展示了android.getSpanFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: onKeyDown


//.........这里部分代码省略.........
			if (i != 0)
			{
				bool dead = false;
				if ((i & android.view.KeyCharacterMap.COMBINING_ACCENT) != 0)
				{
					dead = true;
					i = i & android.view.KeyCharacterMap.COMBINING_ACCENT_MASK;
				}
				if (activeStart == selStart && activeEnd == selEnd)
				{
					bool replace = false;
					if (selEnd - selStart - 1 == 0)
					{
						char accent = content[selStart];
						int composed = android.view.KeyEvent.getDeadChar(accent, i);
						if (composed != 0)
						{
							i = composed;
							replace = true;
						}
					}
					if (!replace)
					{
						android.text.Selection.setSelection(content, selEnd);
						content.removeSpan(android.text.method.TextKeyListener.ACTIVE);
						selStart = selEnd;
					}
				}
				if ((pref & android.text.method.TextKeyListener.AUTO_CAP) != 0 && Sharpen.CharHelper.IsLower
					(i) && android.text.method.TextKeyListener.shouldCap(mAutoCap, content, selStart
					))
				{
					int where = content.getSpanEnd(android.text.method.TextKeyListener.CAPPED);
					int flags = content.getSpanFlags(android.text.method.TextKeyListener.CAPPED);
					if (where == selStart && (((flags >> 16) & unchecked((int)(0xFFFF))) == i))
					{
						content.removeSpan(android.text.method.TextKeyListener.CAPPED);
					}
					else
					{
						flags = i << 16;
						i = Sharpen.CharHelper.ToUpper(i);
						if (selStart == 0)
						{
							content.setSpan(android.text.method.TextKeyListener.CAPPED, 0, 0, android.text.SpannedClass.SPAN_MARK_MARK
								 | flags);
						}
						else
						{
							content.setSpan(android.text.method.TextKeyListener.CAPPED, selStart - 1, selStart
								, android.text.SpannedClass.SPAN_EXCLUSIVE_EXCLUSIVE | flags);
						}
					}
				}
				if (selStart != selEnd)
				{
					android.text.Selection.setSelection(content, selEnd);
				}
				content.setSpan(OLD_SEL_START, selStart, selStart, android.text.SpannedClass.SPAN_MARK_MARK
					);
				content.replace(selStart, selEnd, java.lang.CharSequenceProxy.Wrap(((char)i).ToString
					()));
				int oldStart = content.getSpanStart(OLD_SEL_START);
				selEnd = android.text.Selection.getSelectionEnd(content);
				if (oldStart < selEnd)
				{
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:67,代码来源:QwertyKeyListener.cs

示例2: release

		// no super to call through to
		private void release(android.text.Editable content, object what, android.view.KeyEvent
			 @event)
		{
			int current = content.getSpanFlags(what);
			switch (@event.getKeyCharacterMap().getModifierBehavior())
			{
				case android.view.KeyCharacterMap.MODIFIER_BEHAVIOR_CHORDED_OR_TOGGLED:
				{
					if (current == USED)
					{
						content.removeSpan(what);
					}
					else
					{
						if (current == PRESSED)
						{
							content.setSpan(what, 0, 0, RELEASED);
						}
					}
					break;
				}

				default:
				{
					content.removeSpan(what);
					break;
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:30,代码来源:MetaKeyKeyListener.cs

示例3: resetLock

		private static void resetLock(android.text.Spannable content, object what)
		{
			int current = content.getSpanFlags(what);
			if (current == LOCKED)
			{
				content.removeSpan(what);
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:8,代码来源:MetaKeyKeyListener.cs

示例4: press

		// no super to call through to
		private void press(android.text.Editable content, object what)
		{
			int state = content.getSpanFlags(what);
			if (state == PRESSED)
			{
			}
			else
			{
				// repeat before use
				if (state == RELEASED)
				{
					content.setSpan(what, 0, 0, LOCKED);
				}
				else
				{
					if (state == USED)
					{
					}
					else
					{
						// repeat after use
						if (state == LOCKED)
						{
							content.removeSpan(what);
						}
						else
						{
							content.setSpan(what, 0, 0, PRESSED);
						}
					}
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:34,代码来源:MetaKeyKeyListener.cs

示例5: adjust

		private static void adjust(android.text.Spannable content, object what)
		{
			int current = content.getSpanFlags(what);
			if (current == PRESSED)
			{
				content.setSpan(what, 0, 0, USED);
			}
			else
			{
				if (current == RELEASED)
				{
					content.removeSpan(what);
				}
			}
		}
开发者ID:hakeemsm,项目名称:XobotOS,代码行数:15,代码来源:MetaKeyKeyListener.cs


注:本文中的android.getSpanFlags方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。