summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjh5.cho <jh5.cho@samsung.com>2017-08-03 08:28:03 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-10-23 04:34:40 (GMT)
commitbcedc2fc34c36fcd8f2c9b23617b6f4e9197bf3b (patch)
tree0931864c3f23c2b0e09c6f9ed2f842587043deaa
parente50bbc0f84380958d9b79af218937d6bf1711617 (diff)
downloadxamarin-forms-bcedc2fc34c36fcd8f2c9b23617b6f4e9197bf3b.zip
xamarin-forms-bcedc2fc34c36fcd8f2c9b23617b6f4e9197bf3b.tar.gz
xamarin-forms-bcedc2fc34c36fcd8f2c9b23617b6f4e9197bf3b.tar.bz2
[Maps] Apply MapFW API changes to Xamarin Forms Maps
- TASK=TCAPI-2617 - User consent related native API has been changed on MapFW and this commit applies this change to Xamarin.Forms.Maps - Update required Tizen.Maps version to 1.0.16 - Update property, Tizen.Maps.PlaceAddress.FreeText - Change accessibility of Xamarin.Forms.Platform.Tizen.Log from internal to public Change-Id: Iad43c3246ee641b4ab815307af7f8e100849261c
-rw-r--r--Xamarin.Forms.Maps.Tizen/FormsMaps.cs35
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs2
-rw-r--r--Xamarin.Forms.Maps.Tizen/project.json4
-rw-r--r--Xamarin.Forms.Platform.Tizen/Log/ILogger.cs2
-rw-r--r--Xamarin.Forms.Platform.Tizen/Log/Log.cs4
5 files changed, 18 insertions, 29 deletions
diff --git a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
index 1961fad..2b1ba17 100644
--- a/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
+++ b/Xamarin.Forms.Maps.Tizen/FormsMaps.cs
@@ -11,29 +11,24 @@ namespace Xamarin
{
static MapService _mapService = null;
- static string ProviderName { get; set; }
-
- static string AuthenticationToken { get; set; }
-
internal static bool IsInitialized { get; private set; }
internal static MapService MapService
{
get
{
- Debug.Assert(_mapService != null, "FormsMaps is not initialized");
+ Debug.Assert(_mapService != null, "FormsMaps is not initialized properly.");
return _mapService;
}
}
public static void Init(string provider, string authenticationToken)
{
- ProviderName = provider;
- AuthenticationToken = authenticationToken;
-
if (IsInitialized)
return;
+ _mapService = new MapService(provider, authenticationToken);
+
FormsApplication.RequestingUserConsentFunc = new Func<Task>(() =>
{
TaskCompletionSource<bool> userConsentWaiter = new TaskCompletionSource<bool>();
@@ -44,23 +39,17 @@ namespace Xamarin
static async void UserConsentAction(TaskCompletionSource<bool> tcs)
{
- var result = await MapService.RequestUserConsent(ProviderName);
+ var result = await MapService.RequestUserConsent();
+ if (result)
+ {
+ GeocoderBackend.Register();
+ IsInitialized = true;
+ }
+ else
{
- if (result)
- {
- _mapService = new MapService(ProviderName, AuthenticationToken);
- if (_mapService != null)
- {
- GeocoderBackend.Register();
- IsInitialized = true;
- }
- }
- else
- {
- Debug.WriteLine("Failed to get user consent which is required to use map service");
- }
- tcs.SetResult(result);
+ Log.Warn("Failed to get user consent which is required to use map service.");
}
+ tcs.SetResult(result);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs
index dbf9397..65389f3 100755..100644
--- a/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs
+++ b/Xamarin.Forms.Maps.Tizen/GeocoderBackend.cs
@@ -25,7 +25,7 @@ namespace Xamarin.Forms.Maps.Tizen
var request = FormsMaps.MapService.CreateReverseGeocodeRequest(position.Latitude, position.Longitude);
var addresses = new List<string>();
foreach (var result in await request.GetResponseAsync())
- addresses.Add(result.Freetext);
+ addresses.Add(result.FreeText);
return addresses;
}
}
diff --git a/Xamarin.Forms.Maps.Tizen/project.json b/Xamarin.Forms.Maps.Tizen/project.json
index 41f306f..99a5ae0 100644
--- a/Xamarin.Forms.Maps.Tizen/project.json
+++ b/Xamarin.Forms.Maps.Tizen/project.json
@@ -4,11 +4,11 @@
"NETStandard.Library": "1.6.1",
"Tizen.Applications.UI": "1.5.8",
"Tizen.Location": "1.0.8",
- "Tizen.Maps": "1.0.12"
+ "Tizen.Maps": "1.0.16"
},
"frameworks": {
"netstandard1.6": {
"imports": "portable-net45+win8+wpa81+wp8"
}
}
-} \ No newline at end of file
+}
diff --git a/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs b/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs
index 6874641..4144d09 100644
--- a/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs
+++ b/Xamarin.Forms.Platform.Tizen/Log/ILogger.cs
@@ -5,7 +5,7 @@ namespace Xamarin.Forms.Platform.Tizen
/// <summary>
/// Reports log messages with various log levels.
/// </summary>
- internal interface ILogger
+ public interface ILogger
{
/// <summary>
/// Reports a debug log message.
diff --git a/Xamarin.Forms.Platform.Tizen/Log/Log.cs b/Xamarin.Forms.Platform.Tizen/Log/Log.cs
index 3ebeb11..63305e2 100644
--- a/Xamarin.Forms.Platform.Tizen/Log/Log.cs
+++ b/Xamarin.Forms.Platform.Tizen/Log/Log.cs
@@ -6,7 +6,7 @@ namespace Xamarin.Forms.Platform.Tizen
/// <summary>
/// Provides logging functionality.
/// </summary>
- internal static class Log
+ public static class Log
{
static String _tag = "Xamarin";
@@ -981,7 +981,7 @@ namespace Xamarin.Forms.Platform.Tizen
/// In case of any compilation errors, please make sure you're not using
/// explicit <c>null</c> value as one of the parameters.
/// </summary>
- internal struct Guardian
+ public struct Guardian
{
}
}