BIN
PomoTime/Assets/BadgeLogo.scale-100.png
Normal file
|
After Width: | Height: | Size: 219 B |
BIN
PomoTime/Assets/BadgeLogo.scale-125.png
Normal file
|
After Width: | Height: | Size: 237 B |
BIN
PomoTime/Assets/BadgeLogo.scale-150.png
Normal file
|
After Width: | Height: | Size: 302 B |
BIN
PomoTime/Assets/BadgeLogo.scale-200.png
Normal file
|
After Width: | Height: | Size: 385 B |
BIN
PomoTime/Assets/BadgeLogo.scale-400.png
Normal file
|
After Width: | Height: | Size: 678 B |
BIN
PomoTime/Assets/LargeTile.scale-100.png
Normal file
|
After Width: | Height: | Size: 8.2 KiB |
BIN
PomoTime/Assets/LargeTile.scale-125.png
Normal file
|
After Width: | Height: | Size: 11 KiB |
BIN
PomoTime/Assets/LargeTile.scale-150.png
Normal file
|
After Width: | Height: | Size: 14 KiB |
BIN
PomoTime/Assets/LargeTile.scale-200.png
Normal file
|
After Width: | Height: | Size: 21 KiB |
BIN
PomoTime/Assets/LargeTile.scale-400.png
Normal file
|
After Width: | Height: | Size: 52 KiB |
BIN
PomoTime/Assets/SmallTile.scale-100.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
PomoTime/Assets/SmallTile.scale-125.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
PomoTime/Assets/SmallTile.scale-150.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
PomoTime/Assets/SmallTile.scale-200.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
PomoTime/Assets/SmallTile.scale-400.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
PomoTime/Assets/SplashScreen.scale-100.png
Normal file
|
After Width: | Height: | Size: 8.7 KiB |
BIN
PomoTime/Assets/SplashScreen.scale-125.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
PomoTime/Assets/SplashScreen.scale-150.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 23 KiB |
BIN
PomoTime/Assets/SplashScreen.scale-400.png
Normal file
|
After Width: | Height: | Size: 56 KiB |
BIN
PomoTime/Assets/Square150x150Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
PomoTime/Assets/Square150x150Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
PomoTime/Assets/Square150x150Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 8.0 KiB |
BIN
PomoTime/Assets/Square150x150Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 798 B |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
|
After Width: | Height: | Size: 793 B |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 2.7 KiB |
BIN
PomoTime/Assets/Square44x44Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
PomoTime/Assets/Square44x44Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
PomoTime/Assets/Square44x44Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 4.1 KiB |
BIN
PomoTime/Assets/Square44x44Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
PomoTime/Assets/Square44x44Logo.targetsize-16.png
Normal file
|
After Width: | Height: | Size: 567 B |
BIN
PomoTime/Assets/Square44x44Logo.targetsize-24.png
Normal file
|
After Width: | Height: | Size: 803 B |
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
BIN
PomoTime/Assets/Square44x44Logo.targetsize-256.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
PomoTime/Assets/Square44x44Logo.targetsize-32.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
PomoTime/Assets/Square44x44Logo.targetsize-48.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB |
BIN
PomoTime/Assets/StoreLogo.scale-100.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
PomoTime/Assets/StoreLogo.scale-125.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
PomoTime/Assets/StoreLogo.scale-150.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
PomoTime/Assets/StoreLogo.scale-200.png
Normal file
|
After Width: | Height: | Size: 7.0 KiB |
BIN
PomoTime/Assets/StoreLogo.scale-400.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
PomoTime/Assets/Wide310x150Logo.scale-100.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
PomoTime/Assets/Wide310x150Logo.scale-125.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
PomoTime/Assets/Wide310x150Logo.scale-150.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 8.7 KiB |
BIN
PomoTime/Assets/Wide310x150Logo.scale-400.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
PomoTime/Assets/logo.pdf
Normal file
288
PomoTime/Assets/logo.svg
Normal file
@@ -0,0 +1,288 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="50mm"
|
||||
height="50mm"
|
||||
viewBox="0 0 50 50"
|
||||
version="1.1"
|
||||
id="svg8"
|
||||
inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
|
||||
sodipodi:docname="logo.svg">
|
||||
<defs
|
||||
id="defs2">
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter4563">
|
||||
<feFlood
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood4553" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite4555" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="1"
|
||||
result="blur"
|
||||
id="feGaussianBlur4557" />
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset"
|
||||
id="feOffset4559" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite4561" />
|
||||
</filter>
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter5063">
|
||||
<feFlood
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood5053" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite5055" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="1"
|
||||
result="blur"
|
||||
id="feGaussianBlur5057" />
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset"
|
||||
id="feOffset5059" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="fbSourceGraphic"
|
||||
id="feComposite5061" />
|
||||
<feColorMatrix
|
||||
result="fbSourceGraphicAlpha"
|
||||
in="fbSourceGraphic"
|
||||
values="0 0 0 -1 0 0 0 0 -1 0 0 0 0 -1 0 0 0 0 1 0"
|
||||
id="feColorMatrix5065" />
|
||||
<feFlood
|
||||
id="feFlood5067"
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
in="fbSourceGraphic" />
|
||||
<feComposite
|
||||
in2="fbSourceGraphic"
|
||||
id="feComposite5069"
|
||||
in="flood"
|
||||
operator="in"
|
||||
result="composite1" />
|
||||
<feGaussianBlur
|
||||
id="feGaussianBlur5071"
|
||||
in="composite1"
|
||||
stdDeviation="1"
|
||||
result="blur" />
|
||||
<feOffset
|
||||
id="feOffset5073"
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset" />
|
||||
<feComposite
|
||||
in2="offset"
|
||||
id="feComposite5075"
|
||||
in="fbSourceGraphic"
|
||||
operator="over"
|
||||
result="composite2" />
|
||||
</filter>
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter5149"
|
||||
x="-0.88880014"
|
||||
width="2.7776003"
|
||||
y="-0.33329998"
|
||||
height="1.6666">
|
||||
<feFlood
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood5139" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite5141" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="1.1109997"
|
||||
result="blur"
|
||||
id="feGaussianBlur5143" />
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset"
|
||||
id="feOffset5145" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite5147" />
|
||||
</filter>
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter5149-9"
|
||||
x="-0.88880014"
|
||||
width="2.7776003"
|
||||
y="-0.33329999"
|
||||
height="1.6666">
|
||||
<feFlood
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood5139-7" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite5141-1" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="1.1109997"
|
||||
result="blur"
|
||||
id="feGaussianBlur5143-9" />
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset"
|
||||
id="feOffset5145-9" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite5147-9" />
|
||||
</filter>
|
||||
<filter
|
||||
style="color-interpolation-filters:sRGB;"
|
||||
inkscape:label="Drop Shadow"
|
||||
id="filter5223">
|
||||
<feFlood
|
||||
flood-opacity="0.498039"
|
||||
flood-color="rgb(0,0,0)"
|
||||
result="flood"
|
||||
id="feFlood5213" />
|
||||
<feComposite
|
||||
in="flood"
|
||||
in2="SourceGraphic"
|
||||
operator="in"
|
||||
result="composite1"
|
||||
id="feComposite5215" />
|
||||
<feGaussianBlur
|
||||
in="composite1"
|
||||
stdDeviation="0.5"
|
||||
result="blur"
|
||||
id="feGaussianBlur5217" />
|
||||
<feOffset
|
||||
dx="0"
|
||||
dy="0"
|
||||
result="offset"
|
||||
id="feOffset5219" />
|
||||
<feComposite
|
||||
in="SourceGraphic"
|
||||
in2="offset"
|
||||
operator="over"
|
||||
result="composite2"
|
||||
id="feComposite5221" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="3.959798"
|
||||
inkscape:cx="25.566052"
|
||||
inkscape:cy="120.77662"
|
||||
inkscape:document-units="mm"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:pagecheckerboard="false"
|
||||
inkscape:window-width="1858"
|
||||
inkscape:window-height="1057"
|
||||
inkscape:window-x="54"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata5">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Layer 1"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1"
|
||||
transform="translate(0,-247)">
|
||||
<circle
|
||||
id="path19"
|
||||
cx="25"
|
||||
cy="271.73273"
|
||||
style="fill:#e02a32;fill-opacity:1;stroke-width:0.31074643;filter:url(#filter4563)"
|
||||
r="17.5" />
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal;filter:url(#filter5149)"
|
||||
id="rect5089"
|
||||
width="2.9999988"
|
||||
height="7.9999986"
|
||||
x="23.666399"
|
||||
y="257.92111"
|
||||
ry="0.8018086" />
|
||||
<rect
|
||||
style="fill:#ffffff;fill-opacity:1;stroke:#ffffff;stroke-width:0;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;paint-order:normal;filter:url(#filter5149-9)"
|
||||
id="rect5089-0"
|
||||
width="2.9999988"
|
||||
height="7.9999986"
|
||||
x="32.510048"
|
||||
y="263.19946"
|
||||
ry="0.8018086"
|
||||
transform="matrix(0.61291664,0.60035105,-0.48714351,0.49733961,144.24917,114.38603)" />
|
||||
<path
|
||||
style="fill:#00bc0b;fill-opacity:1;stroke:#000000;stroke-width:0;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;filter:url(#filter5223)"
|
||||
d="m 24.857816,249.19077 v 4.25875 c 0,0 -6.920473,-0.63882 -7.665755,-1.49057 -0.745281,-0.85175 -1.490564,-1.7035 -1.490564,-1.7035 0,0 0.172922,2.96039 0.869307,3.26152 0.696384,0.30114 4.630017,1.33631 4.159487,1.73156 -0.470531,0.39525 -4.799408,1.6939 -4.799408,1.6939 0,0 4.178307,0.84696 5.476971,0.0188 1.298663,-0.82813 3.011393,-1.99505 3.011393,-1.99505 l -0.752848,2.95493 c 0,0 3.12432,-1.52452 3.27489,-2.27737 0.15057,-0.75285 0.15057,-0.95988 0.15057,-0.95988 0,0 3.481924,2.78555 4.874691,2.61615 1.392772,-0.16939 1.411591,-0.20703 1.411591,-0.20703 l -5.025261,-3.0114 c 0,0 5.90986,0.95989 6.643885,0.18822 0.734028,-0.77167 0.903419,-1.82566 0.903419,-1.82566 l -1.656267,0.60228 c 0,0 -1.035167,0.54581 -2.917287,0.56464 -1.882119,0.0188 -3.820705,-0.60228 -3.820705,-0.60228 l -0.0941,-4.06538 z"
|
||||
id="path5198"
|
||||
inkscape:connector-curvature="0" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 8.8 KiB |
@@ -13,10 +13,7 @@
|
||||
<Page.Resources>
|
||||
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
|
||||
<converters:FormatStringConverter x:Key="FormatStringConverter" />
|
||||
<converters:BoolToObjectConverter
|
||||
x:Key="BoolToWorkRestConverter"
|
||||
FalseValue="Work"
|
||||
TrueValue="Rest" />
|
||||
<local:PeriodToStringConverter x:Key="PeriodToStringConverter" />
|
||||
</Page.Resources>
|
||||
|
||||
<Grid>
|
||||
@@ -65,13 +62,14 @@
|
||||
VerticalAlignment="Top"
|
||||
FontSize="30"
|
||||
FontWeight="Light"
|
||||
Text="{x:Bind runningState.OnRest, Converter={StaticResource BoolToWorkRestConverter}, Mode=OneWay}" />
|
||||
Text="{x:Bind runningState.CurrentPeriod, Converter={StaticResource PeriodToStringConverter}, Mode=OneWay}" />
|
||||
</Grid>
|
||||
<Grid Grid.Row="0" Grid.Column="1">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
@@ -89,17 +87,29 @@
|
||||
SpinButtonPlacementMode="Inline"
|
||||
Value="{x:Bind WorkMinutes, Mode=TwoWay}" />
|
||||
<controls:NumberBox
|
||||
x:Name="RestMinutesInput"
|
||||
x:Name="BreakMinutesInput"
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Header="Rest time:"
|
||||
Header="Break time:"
|
||||
LargeChange="5"
|
||||
Minimum="0"
|
||||
SmallChange="1"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
Value="{x:Bind RestMinutes, Mode=TwoWay}" />
|
||||
Value="{x:Bind BreakMinutes, Mode=TwoWay}" />
|
||||
<controls:NumberBox
|
||||
x:Name="LongBreakMinutesInput"
|
||||
Grid.Row="2"
|
||||
Grid.Column="0"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Header="Long break time:"
|
||||
LargeChange="15"
|
||||
Minimum="0"
|
||||
SmallChange="5"
|
||||
SpinButtonPlacementMode="Inline"
|
||||
Value="{x:Bind LongBreakMinutes, Mode=TwoWay}" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Grid>
|
||||
|
||||
@@ -15,6 +15,8 @@ using Windows.UI.Xaml.Input;
|
||||
using Windows.UI.Xaml.Media;
|
||||
using Windows.UI.Xaml.Navigation;
|
||||
using Windows.Storage;
|
||||
using Windows.System.Threading;
|
||||
using Windows.UI.Core;
|
||||
|
||||
|
||||
// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409
|
||||
@@ -26,11 +28,16 @@ namespace PomoTime
|
||||
/// </summary>
|
||||
public sealed partial class MainPage : Page
|
||||
{
|
||||
private DispatcherTimer dispatcherTimer;
|
||||
public RunningState runningState = new RunningState();
|
||||
private const int DefaultBreakMinutes = 5;
|
||||
private const int DefaultWorkMinutes = 25;
|
||||
private const int DefaultLongBreakMinutes = 15;
|
||||
|
||||
private int RestMinutes { get; set; }
|
||||
|
||||
private int BreakMinutes { get; set; }
|
||||
private int WorkMinutes { get; set; }
|
||||
private int LongBreakMinutes { get; set; }
|
||||
|
||||
|
||||
public MainPage()
|
||||
{
|
||||
@@ -50,44 +57,84 @@ namespace PomoTime
|
||||
Windows.Storage.ApplicationDataCompositeValue minutes = (ApplicationDataCompositeValue)roamingSettings.Values["Minutes"];
|
||||
if (minutes != null)
|
||||
{
|
||||
WorkMinutes = (int)minutes["WorkMinutes"];
|
||||
RestMinutes = (int)minutes["RestMinutes"];
|
||||
if (minutes["WorkMinutes"] != null)
|
||||
{
|
||||
WorkMinutes = (int)minutes["WorkMinutes"];
|
||||
}
|
||||
else
|
||||
{
|
||||
WorkMinutes = DefaultWorkMinutes;
|
||||
}
|
||||
if (minutes["BreakMinutes"] != null)
|
||||
{
|
||||
BreakMinutes = (int)minutes["BreakMinutes"];
|
||||
}
|
||||
else
|
||||
{
|
||||
BreakMinutes = DefaultBreakMinutes;
|
||||
}
|
||||
if (minutes["LongBreakMinutes"] != null)
|
||||
{
|
||||
LongBreakMinutes = (int)minutes["LongBreakMinutes"];
|
||||
}
|
||||
else
|
||||
{
|
||||
LongBreakMinutes = DefaultLongBreakMinutes;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Some maigc defualt numbers
|
||||
WorkMinutes = 40;
|
||||
RestMinutes = 5;
|
||||
WorkMinutes = DefaultWorkMinutes;
|
||||
BreakMinutes = DefaultBreakMinutes;
|
||||
LongBreakMinutes = DefaultLongBreakMinutes;
|
||||
}
|
||||
runningState.MinutesLeft = WorkMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
|
||||
}
|
||||
public void DispatcherTimerSetup()
|
||||
{
|
||||
dispatcherTimer = new DispatcherTimer();
|
||||
dispatcherTimer.Tick += dispatcherTimer_Tick;
|
||||
dispatcherTimer.Interval = new TimeSpan(0, 0, 1);
|
||||
}
|
||||
|
||||
void dispatcherTimer_Tick(object sender, object e)
|
||||
void timer_Tick()
|
||||
{
|
||||
if (!runningState.IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
if (runningState.SecondsLeft == 0)
|
||||
{
|
||||
runningState.SecondsLeft = 59;
|
||||
if (runningState.MinutesLeft == 0)
|
||||
{
|
||||
if (runningState.OnRest)
|
||||
switch (runningState.CurrentPeriod)
|
||||
{
|
||||
runningState.OnRest = false;
|
||||
runningState.MinutesLeft = WorkMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
runningState.OnRest = true;
|
||||
runningState.MinutesLeft = RestMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
case Period.Work:
|
||||
if (runningState.PreviousShortBreaks != 4)
|
||||
{
|
||||
runningState.CurrentPeriod = Period.ShortBreak;
|
||||
runningState.MinutesLeft = BreakMinutes;
|
||||
}
|
||||
else
|
||||
{
|
||||
runningState.CurrentPeriod = Period.LongBreak;
|
||||
runningState.MinutesLeft = LongBreakMinutes;
|
||||
}
|
||||
runningState.SecondsLeft = 0;
|
||||
|
||||
break;
|
||||
case Period.ShortBreak:
|
||||
runningState.CurrentPeriod = Period.Work;
|
||||
runningState.PreviousShortBreaks += 1;
|
||||
runningState.MinutesLeft = WorkMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
break;
|
||||
case Period.LongBreak:
|
||||
runningState.CurrentPeriod = Period.Work;
|
||||
runningState.PreviousShortBreaks = 0;
|
||||
runningState.MinutesLeft = WorkMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
break;
|
||||
default:
|
||||
throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -105,24 +152,21 @@ namespace PomoTime
|
||||
private void PlayButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppBarButton b = sender as AppBarButton;
|
||||
dispatcherTimer.Start();
|
||||
runningState.IsRunning = true;
|
||||
}
|
||||
|
||||
private void PauseButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppBarButton b = sender as AppBarButton;
|
||||
dispatcherTimer.Stop();
|
||||
runningState.IsRunning = false;
|
||||
}
|
||||
|
||||
private void ResetButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
AppBarButton b = sender as AppBarButton;
|
||||
dispatcherTimer.Stop();
|
||||
runningState.IsRunning = false;
|
||||
|
||||
runningState.OnRest = false;
|
||||
runningState.CurrentPeriod = Period.Work;
|
||||
runningState.MinutesLeft = WorkMinutes;
|
||||
runningState.SecondsLeft = 0;
|
||||
}
|
||||
@@ -150,14 +194,22 @@ namespace PomoTime
|
||||
ApplicationDataContainer roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
|
||||
Windows.Storage.ApplicationDataCompositeValue minutes = new Windows.Storage.ApplicationDataCompositeValue();
|
||||
minutes["WorkMinutes"] = WorkMinutes;
|
||||
minutes["RestMinutes"] = RestMinutes;
|
||||
minutes["BreakMinutes"] = BreakMinutes;
|
||||
minutes["LongBreakMinutes"] = LongBreakMinutes;
|
||||
roamingSettings.Values["Minutes"] = minutes;
|
||||
deferral.Complete();
|
||||
}
|
||||
|
||||
private void MainPageLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
DispatcherTimerSetup();
|
||||
ThreadPoolTimer timer = ThreadPoolTimer.CreatePeriodicTimer(async (t) =>
|
||||
{
|
||||
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
|
||||
() =>
|
||||
{
|
||||
timer_Tick();
|
||||
});
|
||||
}, TimeSpan.FromSeconds(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,10 +35,11 @@
|
||||
DisplayName="PomoTime"
|
||||
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||
Description="PomoTime"
|
||||
Description="A qute little pomodoro technique timer, which does exactly what you think it does - counts (by default) 40 minutes of work time and then 5 minutes of rest time. And repeats until you stop it."
|
||||
BackgroundColor="transparent">
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square71x71Logo="Assets\SmallTile.png" Square310x310Logo="Assets\LargeTile.png"/>
|
||||
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||
<uap:LockScreen BadgeLogo="Assets\BadgeLogo.png" Notification="badge"/>
|
||||
</uap:VisualElements>
|
||||
</Application>
|
||||
</Applications>
|
||||
|
||||
53
PomoTime/PeriodToStringConverter.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Windows.UI.Xaml.Data;
|
||||
|
||||
namespace PomoTime
|
||||
{
|
||||
public class PeriodToStringConverter : IValueConverter
|
||||
{
|
||||
|
||||
#region IValueConverter Members
|
||||
|
||||
// Define the Convert method to change a DateTime object to
|
||||
// a month string.
|
||||
public object Convert(object value, Type targetType,
|
||||
object parameter, string language)
|
||||
{
|
||||
// The value parameter is the data from the source object.
|
||||
Period period = (Period)value;
|
||||
string output;
|
||||
switch (period)
|
||||
{
|
||||
case Period.LongBreak:
|
||||
output = "Long break";
|
||||
break;
|
||||
case Period.ShortBreak:
|
||||
output = "Short break";
|
||||
break;
|
||||
case Period.Work:
|
||||
output = "Work";
|
||||
break;
|
||||
default:
|
||||
output = "Something wrong";
|
||||
break;
|
||||
}
|
||||
|
||||
// Return the month value to pass to the target.
|
||||
return output;
|
||||
}
|
||||
|
||||
// ConvertBack is not implemented for a OneWay binding.
|
||||
public object ConvertBack(object value, Type targetType,
|
||||
object parameter, string language)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
}
|
||||
@@ -122,6 +122,7 @@
|
||||
<Compile Include="MainPage.xaml.cs">
|
||||
<DependentUpon>MainPage.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PeriodToStringConverter.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RunningState.cs" />
|
||||
</ItemGroup>
|
||||
@@ -131,13 +132,62 @@
|
||||
</AppxManifest>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Assets\BadgeLogo.scale-100.png" />
|
||||
<Content Include="Assets\BadgeLogo.scale-125.png" />
|
||||
<Content Include="Assets\BadgeLogo.scale-150.png" />
|
||||
<Content Include="Assets\BadgeLogo.scale-200.png" />
|
||||
<Content Include="Assets\BadgeLogo.scale-400.png" />
|
||||
<Content Include="Assets\LargeTile.scale-100.png" />
|
||||
<Content Include="Assets\LargeTile.scale-125.png" />
|
||||
<Content Include="Assets\LargeTile.scale-150.png" />
|
||||
<Content Include="Assets\LargeTile.scale-200.png" />
|
||||
<Content Include="Assets\LargeTile.scale-400.png" />
|
||||
<Content Include="Assets\SmallTile.scale-100.png" />
|
||||
<Content Include="Assets\SmallTile.scale-125.png" />
|
||||
<Content Include="Assets\SmallTile.scale-150.png" />
|
||||
<Content Include="Assets\SmallTile.scale-200.png" />
|
||||
<Content Include="Assets\SmallTile.scale-400.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-100.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-125.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-150.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-400.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-100.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-125.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-150.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-400.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-16.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-24.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-256.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-32.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-lightunplated_targetsize-48.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-16.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-32.png" />
|
||||
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-100.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-125.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-150.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-400.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-16.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-256.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-32.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-48.png" />
|
||||
<Content Include="Assets\StoreLogo.scale-100.png" />
|
||||
<Content Include="Assets\StoreLogo.scale-125.png" />
|
||||
<Content Include="Assets\StoreLogo.scale-150.png" />
|
||||
<Content Include="Assets\StoreLogo.scale-200.png" />
|
||||
<Content Include="Assets\StoreLogo.scale-400.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-100.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-125.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-150.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
|
||||
<Content Include="Properties\Default.rd.xml" />
|
||||
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||
<Content Include="Assets\StoreLogo.png" />
|
||||
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@@ -152,7 +202,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform">
|
||||
<Version>6.2.9</Version>
|
||||
<Version>6.2.10</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications">
|
||||
<Version>6.0.0</Version>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Toolkit.Uwp.UI">
|
||||
<Version>6.0.0</Version>
|
||||
|
||||
@@ -8,6 +8,10 @@ using System.Threading.Tasks;
|
||||
|
||||
namespace PomoTime
|
||||
{
|
||||
public enum Period
|
||||
{
|
||||
Work, ShortBreak, LongBreak
|
||||
}
|
||||
public class RunningState : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
@@ -52,17 +56,31 @@ namespace PomoTime
|
||||
|
||||
}
|
||||
|
||||
public bool _on_rest;
|
||||
public Period _period;
|
||||
|
||||
public bool OnRest
|
||||
public Period CurrentPeriod
|
||||
{
|
||||
get { return _on_rest; }
|
||||
get { return _period; }
|
||||
set
|
||||
{
|
||||
_on_rest = value;
|
||||
NotifyPropertyChanged("OnRest");
|
||||
_period = value;
|
||||
NotifyPropertyChanged("CurrentPeriod");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public int _previous_short_breaks;
|
||||
|
||||
public int PreviousShortBreaks
|
||||
{
|
||||
get { return _previous_short_breaks; }
|
||||
set
|
||||
{
|
||||
_previous_short_breaks = value;
|
||||
NotifyPropertyChanged("PreviousShortBreaks");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||