Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
mediaexplorer74 committed Feb 12, 2022
1 parent c3a38d2 commit eef1d5e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Andro2UWP/Andro2UWP.Shared/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</Grid>
<Page.BottomAppBar>
<win:CommandBar>
<AppBarButton Icon="Refresh" x:Uid="uiRefresh" Label="Refresh list" Click="uiRefreshList_Click"/>
<AppBarButton Icon="Refresh" x:Uid="uiRefresh" Name="uiRefresh" Label="Refresh list" Click="uiRefreshList_Click"/>

<AppBarToggleButton Icon="Clock" x:Uid="uiAutoRefresh" Name="uiAutoRefresh" Label="Auto refresh" Click="uiAutoRefresh_Click" />

Expand Down
10 changes: 5 additions & 5 deletions Andro2UWP/Andro2UWP.Shared/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -636,8 +636,8 @@ private async void uiCreateFilter_Click(object sender, RoutedEventArgs e)
// uiRefreshList_Click
private async void uiRefreshList_Click(object sender, RoutedEventArgs e)
{
// obsolete button
//uiRefreshList.IsEnabled = false;
// Refresh button
uiRefresh.IsEnabled = false;

if (p.k.GetPlatform("uwp"))
{
Expand All @@ -652,8 +652,8 @@ private async void uiRefreshList_Click(object sender, RoutedEventArgs e)
//await App.WczytajNowe();
}

// obsolete button
//uiRefreshList.IsEnabled = true;
// Refresh button
uiRefresh.IsEnabled = true;

//if (sender != null) // there is no call other than from event button, so always sender < > null?
//{
Expand Down Expand Up @@ -756,7 +756,7 @@ private async void uiAutoRefresh_Click(object sender, RoutedEventArgs e)
new Windows.ApplicationModel.Background.SystemCondition
(Windows.ApplicationModel.Background.SystemConditionType.InternetAvailable);

p.k.RegisterTimerTrigger("Andro2UWP_Timer", 15, false, oCondition);
p.k.RegisterTimerTrigger("Andro2UWP_Timer", 15, false, oCondition); // 15 - 15 minutes
}
else
{
Expand Down
9 changes: 8 additions & 1 deletion Andro2UWP/Andro2UWP.Shared/pkModuleShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,17 +230,24 @@ public static async System.Threading.Tasks.Task<bool> CanRegisterTriggersAsync()

return false;
}


// TODO : REDO IT!! Bad timer

public static Windows.ApplicationModel.Background.BackgroundTaskRegistration RegisterTimerTrigger(string sName, uint iMinutes, bool bOneShot = false, Windows.ApplicationModel.Background.SystemCondition oCondition = null)
{
try
{
var builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();
Windows.ApplicationModel.Background.BackgroundTaskBuilder builder = new Windows.ApplicationModel.Background.BackgroundTaskBuilder();

builder.SetTrigger(new Windows.ApplicationModel.Background.TimeTrigger(iMinutes, bOneShot));

builder.Name = sName;

if (oCondition is object) builder.AddCondition(oCondition);

var oRet = builder.Register();

return oRet;
}
catch
Expand Down
5 changes: 1 addition & 4 deletions Andro2UWP/Andro2UWP.UWP/Andro2UWP.UWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
<PackageReference Include="Microsoft.OneDriveSDK.Authentication">
<Version>1.0.10</Version>
</PackageReference>
<PackageReference Include="Microsoft.UI.Xaml">
<Version>2.7.0</Version>
</PackageReference>
<PackageReference Include="Newtonsoft.Json">
<Version>9.0.1</Version>
</PackageReference>
Expand Down Expand Up @@ -46,7 +43,7 @@
<GenerateAppInstallerFile>False</GenerateAppInstallerFile>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<AppxBundle>Always</AppxBundle>
<AppxBundlePlatforms>arm</AppxBundlePlatforms>
<AppxBundlePlatforms>x86|x64|arm</AppxBundlePlatforms>
<AppInstallerUpdateFrequency>0</AppInstallerUpdateFrequency>
<AppInstallerCheckForUpdateFrequency>OnApplicationRun</AppInstallerCheckForUpdateFrequency>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
Expand Down
6 changes: 5 additions & 1 deletion Andro2UWP/Andro2UWP.UWP/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" IgnorableNamespaces="uap mp">
<Package xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10" xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest" xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10" xmlns:uap3="http://schemas.microsoft.com/appx/manifest/uap/windows10/3" xmlns:uap4="http://schemas.microsoft.com/appx/manifest/uap/windows10/4" xmlns:iot="http://schemas.microsoft.com/appx/manifest/iot/windows10" IgnorableNamespaces="uap mp uap3 uap4 iot">
<Identity Name="Andro2UWP1" Publisher="CN=media" Version="1.0.12.0" />
<mp:PhoneIdentity PhoneProductId="d0cc5bdd-f438-4335-a112-49cb246ce412" PhonePublisherId="00000000-0000-0000-0000-000000000000" />
<Properties>
Expand Down Expand Up @@ -28,5 +28,9 @@
</Applications>
<Capabilities>
<Capability Name="internetClient" />
<uap3:Capability Name="backgroundMediaPlayback"/>
<uap4:Capability Name="offlineMapsManagement"/>
<iot:Capability Name="lowLevelDevices"/>
<DeviceCapability Name="lowLevel"/>
</Capabilities>
</Package>

0 comments on commit eef1d5e

Please sign in to comment.