[XStopWatch] Optimized sample app (#153)
author윤정현/Common Platform Lab(SR)/Staff Engineer/삼성전자 <jh0506.yun@samsung.com>
Wed, 18 Mar 2020 08:17:56 +0000 (17:17 +0900)
committer유리나/Common Platform Lab(SR)/Staff Engineer/삼성전자 <rina6350.you@samsung.com>
Wed, 18 Mar 2020 08:17:56 +0000 (17:17 +0900)
* Fixed to 1 page
* Fixed to load image sync
* Changed CircleProgressBarSurfaceItem BackgroundColor to transparent

Test/XStopWatch/XStopWatch/StopWatch.xaml
Test/XStopWatch/XStopWatch/StopWatchApplication.xaml
Test/XStopWatch/XStopWatch/StopWatchApplication.xaml.cs

index 4663baf..d7ab983 100644 (file)
@@ -2,6 +2,7 @@
 <cu:CirclePage xmlns="http://xamarin.com/schemas/2014/forms"
              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
              xmlns:cu="clr-namespace:Tizen.Wearable.CircularUI.Forms;assembly=XSF.CircularUI.Forms"
+             xmlns:tizen="clr-namespace:Xamarin.Forms.PlatformConfiguration.TizenSpecific;assembly=XSF.Core"
              xmlns:local="clr-namespace:XStopWatch"
              x:Name="Self"
              x:Class="XStopWatch.StopWatch">
@@ -22,7 +23,8 @@
     <cu:CirclePage.CircleSurfaceItems>
         <!-- this circular progressbar show the elapsed time -->
         <cu:CircleProgressBarSurfaceItem x:Name="Timebar"
-                                         BarColor="#12b4ff"
+                                         BackgroundColor="#00000000"
+                                         BarColor="#00000000"
                                          BarRadius="108"
                                          BarLineWidth="6"
                                          IsVisible="true"
     <ContentPage.Content>
         <AbsoluteLayout BackgroundColor="Black" x:Name="RootView">
             <!-- Background image that show the numbers and pins -->
-            <Image Source="images/b_stopwatch_unit_number.png"
+            <Image tizen:Image.File="images/b_stopwatch_unit_number.png"
                    AbsoluteLayout.LayoutBounds="0,0,1,1"
                    AbsoluteLayout.LayoutFlags="All"/>
             <!-- Red bar image that present current elapsed time -->
-            <Image Source="images/b_stopwatch_mark_red.png"
+            <Image tizen:Image.File="images/b_stopwatch_mark_red.png"
                    x:Name="RedBar"
                    AbsoluteLayout.LayoutBounds="0,0,1,1"
                    AbsoluteLayout.LayoutFlags="All"/>
             <!-- Blue bar image that present Lap time. it is visible only Lap measurement started -->
-            <Image Source="images/b_stopwatch_mark_blue.png"
+            <Image tizen:Image.File="images/b_stopwatch_mark_blue.png"
                    x:Name="BlueBar"
                    AbsoluteLayout.LayoutBounds="0,0,1,1"
                    AbsoluteLayout.LayoutFlags="All"
             </Label>
 
             <!-- If Lap is added, this small bracket image show the bounce animation -->
-            <Image Source="images/wc_visual_cue.png"
+            <Image tizen:Image.File="images/wc_visual_cue.png"
                    x:Name="CueBtn"
                    IsVisible="False"
                    AbsoluteLayout.LayoutBounds="315, 164, 18, 32"/>
 
             <!-- this translucent images indicate the area to receive the touch. -->
-            <Image Source="images/event_spot.png"
+            <Image tizen:Image.File="images/event_spot.png"
                    Opacity="0"
                    AbsoluteLayout.LayoutBounds="80, 126, 200, 200"
                    AbsoluteLayout.LayoutFlags="None">
                     <TapGestureRecognizer Tapped="OnBottomEventTapped"/>
                 </Image.GestureRecognizers>
             </Image>
-            <Image Source="images/event_spot.png"
+            <Image tizen:Image.File="images/event_spot.png"
                    Opacity="0"
                    AbsoluteLayout.LayoutBounds="80, 22, 200, 200"
                    AbsoluteLayout.LayoutFlags="None">
index 62eb923..f14e11e 100644 (file)
@@ -6,11 +6,11 @@
              x:Class="XStopWatch.StopWatchApplication">
     <Application.MainPage>
         <!-- Use CarouselPage to swipe the main page and Laps page -->
-        <CarouselPage x:Name="RootPage">
+        <!-- <CarouselPage x:Name="RootPage"> -->
             <!-- Main page of the Stopwatch -->
             <local:StopWatch x:Name="StopWatch" LapPressed="OnAddLap" StopPressed="OnStopLap"/>
             <!-- A page to shows a list of the recorded Lap times. Time property is used to show the time, and is associated with the time of the StopWatch. -->
-            <local:LapsPage x:Name="Laps" Time="{Binding AllTime, Source={x:Reference StopWatch}}"/>
-        </CarouselPage>
+            <!--  <local:LapsPage x:Name="Laps" Time="{Binding AllTime, Source={x:Reference StopWatch}}"/> -->
+        <!-- </CarouselPage> -->
     </Application.MainPage>
 </Application>
\ No newline at end of file
index 1c36039..6481ed2 100644 (file)
@@ -56,7 +56,7 @@ namespace XStopWatch
         void OnAddLap(object sender, (TimeSpan, TimeSpan) e)
         {
             // Add Lap record to LapsPage
-            Laps.AddLap(e);
+            //Laps.AddLap(e);
         }
 
         /// <summary>
@@ -67,7 +67,7 @@ namespace XStopWatch
         void OnStopLap(object sender, EventArgs e)
         {
             // Reset the LapsPage
-            Laps.Reset();
+            //Laps.Reset();
         }
     }
 }
\ No newline at end of file