summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSungHyun Min <shyun.min@samsung.com>2017-07-05 16:35:46 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 13:34:38 +0900
commitce5661b99edecac7b18b1e8c8691908fdc1127a1 (patch)
tree03287b069e8f0b045b5800b7c0ac35d6d6254d81
parentab0a0b82f2ca28dfb6482ffe53fabd9a290a26a5 (diff)
downloadxamarin-forms-ce5661b99edecac7b18b1e8c8691908fdc1127a1.tar.gz
xamarin-forms-ce5661b99edecac7b18b1e8c8691908fdc1127a1.tar.bz2
xamarin-forms-ce5661b99edecac7b18b1e8c8691908fdc1127a1.zip
Fix Editor cursor position issue
TASK=TCAPI2439 Change-Id: I6cf8ba60d74b0cd3fc72e86f1336127cdc5e5559
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Native/Span.cs12
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs10
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs8
3 files changed, 22 insertions, 8 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Native/Span.cs b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
index 3ffea252..cf5299fb 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Native/Span.cs
+++ b/Xamarin.Forms.Platform.Tizen/Native/Span.cs
@@ -186,7 +186,7 @@ namespace Xamarin.Forms.Platform.Tizen.Native
else
{
// FontWeight is only available in case of FontAttributes.Bold is not used.
- if(FontWeight != Specific.FontWeight.None)
+ if (FontWeight != Specific.FontWeight.None)
{
_formattingString.AppendFormat("font_weight={0} ", FontWeight);
}
@@ -244,19 +244,25 @@ namespace Xamarin.Forms.Platform.Tizen.Native
case LineBreakMode.TailTruncation:
_formattingString.Append("ellipsis=1.0");
break;
+
case LineBreakMode.CharacterWrap:
_formattingString.Append("wrap=char");
break;
+
case LineBreakMode.WordWrap:
_formattingString.Append("wrap=word");
break;
+
case LineBreakMode.MixedWrap:
_formattingString.Append("wrap=mixed");
break;
+
case LineBreakMode.NoWrap:
- case LineBreakMode.None:
_formattingString.Append("wrap=none");
break;
+
+ case LineBreakMode.None:
+ break;
}
return _formattingString;
@@ -292,4 +298,4 @@ namespace Xamarin.Forms.Platform.Tizen.Native
return new Span { Text = text };
}
}
-}
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
index d5ca750b..39e018c5 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/EditorRenderer.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using Xamarin.Forms.Platform.Tizen.Native;
using EColor = ElmSharp.Color;
@@ -32,6 +32,7 @@ namespace Xamarin.Forms.Platform.Tizen
}
base.OnElementChanged(e);
}
+
protected override void Dispose(bool disposing)
{
if (disposing)
@@ -58,6 +59,10 @@ namespace Xamarin.Forms.Platform.Tizen
void UpdateText()
{
Control.Text = Element.Text;
+ if (!Control.IsFocused)
+ {
+ Control.MoveCursorEnd();
+ }
}
void UpdateTextColor()
@@ -88,5 +93,4 @@ namespace Xamarin.Forms.Platform.Tizen
Control.Keyboard = Element.Keyboard.ToNative();
}
}
-}
-
+} \ No newline at end of file
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
index 23ffca59..842aae87 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/EntryRenderer.cs
@@ -18,7 +18,7 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(Entry.KeyboardProperty, UpdateKeyboard);
RegisterPropertyHandler(Entry.PlaceholderProperty, UpdatePlaceholder);
RegisterPropertyHandler(Entry.PlaceholderColorProperty, UpdatePlaceholderColor);
- if(TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
+ if (TizenPlatformServices.AppDomain.IsTizenSpecificAvailable)
{
RegisterPropertyHandler("FontWeight", UpdateFontWeight);
}
@@ -77,6 +77,10 @@ namespace Xamarin.Forms.Platform.Tizen
void UpdateText()
{
Control.Text = Element.Text;
+ if (!Control.IsFocused)
+ {
+ Control.MoveCursorEnd();
+ }
}
void UpdateTextColor()
@@ -127,4 +131,4 @@ namespace Xamarin.Forms.Platform.Tizen
Control.FontWeight = Specific.GetFontWeight(Element);
}
}
-}
+} \ No newline at end of file