Fixed the black screen before LoadingPage appears (#184)
author유리나/Common Platform Lab(SR)/Staff Engineer/삼성전자 <rina6350.you@samsung.com>
Thu, 2 Apr 2020 01:52:40 +0000 (10:52 +0900)
committer안주원/Common Platform Lab(SR)/Principal Engineer/삼성전자 <juwon.ahn@samsung.com>
Thu, 2 Apr 2020 01:52:40 +0000 (10:52 +0900)
test/UnderArmour/MapMyRun/MapMyRun.Tizen/App.xaml.cs
test/UnderArmour/MapMyRun/MapMyRun.Tizen/views/LoadingPage.xaml.cs

index 4deca3751a77401758e3ef28f814abcb07d23813..cd3f480e4f42a698f51135c24fbfd0690e1ee8df 100755 (executable)
@@ -17,17 +17,12 @@ namespace MapMyRun.Tizen
     [XamlCompilation(XamlCompilationOptions.Compile)]
     public partial class App : Application
     {
-        //private const string ServiceAppId = "org.tizen.example.MapMyRunService";
-        private const string ServiceAppId = "org.tizen.mapmyrunservice";
         public Workout workout;
         public SettingManager settingManager;
         public App()
         {
             InitializeComponent();
-            var dispatcher = MapMyRun.Models.Dispatcher.Instance;
-            settingManager = new SettingManager(dispatcher);
-            workout = new Workout(dispatcher, new PermissionManager(dispatcher));
-            MainPage = new LoadingPage(); ;
+            MainPage = new LoadingPage();
         }
 
                protected override void OnStart()
index 4ac8d816936a35f5502c9ca52e991bf2f29ebc98..1f9278b6cb126f4ddbee536a9ae8f131993f6848 100755 (executable)
@@ -10,33 +10,38 @@ using Tizen.Wearable.CircularUI.Forms;
 using MapMyRun.Tizen.ViewModels;
 using MapMyRun.Tizen.Models;
 using MapMyRun.Models;
+using MapMyRun.Models.Workout;
+using MapMyRun.Models.Settings;
 
 namespace MapMyRun.Tizen.Views
 {
     [XamlCompilation(XamlCompilationOptions.Compile)]
     public partial class LoadingPage : CirclePage
     {
-        private readonly Loading _loading;
-        private const string ServiceAppId = "org.tizen.mapmyrunservice";
+        private Loading _loading;
+               //private const string ServiceAppId = "org.tizen.example.MapMyRunService";
+               private const string ServiceAppId = "org.tizen.mapmyrunservice";
         public static readonly BindableProperty ProgressProperty =
             BindableProperty.Create("Progress",
                                     typeof(double),
                                     typeof(CircleProgressBarSurfaceItem),
                                     propertyChanged: (b, o, n) =>
                                     ProgressBarProgressChanged((CircleProgressBarSurfaceItem)b, (double)n));
-
         public LoadingPage()
         {
             InitializeComponent();
             ProgressBar.SetBinding(ProgressProperty, "Progress");
 
-            var dispatcher = MapMyRun.Models.Dispatcher.Instance;
-            _loading = new Loading(new AppLauncher(), new MessagePortHandler(),
-                dispatcher, new PhoneService(dispatcher, new TizenPlatformService()), ((App)Application.Current).settingManager, ServiceAppId);
-
-            BindingContext = new LoadingPageModel(_loading);
             Appearing += (s, e) =>
             {
+                var dispatcher = MapMyRun.Models.Dispatcher.Instance;
+
+                ((App)Application.Current).settingManager = new SettingManager(dispatcher);
+                ((App)Application.Current).workout = new Workout(dispatcher, new PermissionManager(dispatcher));
+
+                _loading = new Loading(new AppLauncher(), new MessagePortHandler(),
+                    dispatcher, new PhoneService(dispatcher, new TizenPlatformService()), ((App)Application.Current).settingManager, ServiceAppId);
+                BindingContext = new LoadingPageModel(_loading);
                 _loading.StartLoading();
                 (Application.Current as App).workout.StartListenWorkoutData();
             };