diff --git a/Andro2UWP/Andro2UWP.Shared/MainPage.xaml b/Andro2UWP/Andro2UWP.Shared/MainPage.xaml index c003e48..35d5cc7 100644 --- a/Andro2UWP/Andro2UWP.Shared/MainPage.xaml +++ b/Andro2UWP/Andro2UWP.Shared/MainPage.xaml @@ -111,7 +111,7 @@ - + diff --git a/Andro2UWP/Andro2UWP.Shared/MainPage.xaml.cs b/Andro2UWP/Andro2UWP.Shared/MainPage.xaml.cs index 1657162..9af433c 100644 --- a/Andro2UWP/Andro2UWP.Shared/MainPage.xaml.cs +++ b/Andro2UWP/Andro2UWP.Shared/MainPage.xaml.cs @@ -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")) { @@ -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? //{ @@ -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 { diff --git a/Andro2UWP/Andro2UWP.Shared/pkModuleShared.cs b/Andro2UWP/Andro2UWP.Shared/pkModuleShared.cs index a835f9c..2cbaea0 100644 --- a/Andro2UWP/Andro2UWP.Shared/pkModuleShared.cs +++ b/Andro2UWP/Andro2UWP.Shared/pkModuleShared.cs @@ -230,17 +230,24 @@ public static async System.Threading.Tasks.Task 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 diff --git a/Andro2UWP/Andro2UWP.UWP/Andro2UWP.UWP.csproj b/Andro2UWP/Andro2UWP.UWP/Andro2UWP.UWP.csproj index 31ec9ad..cff582e 100644 --- a/Andro2UWP/Andro2UWP.UWP/Andro2UWP.UWP.csproj +++ b/Andro2UWP/Andro2UWP.UWP/Andro2UWP.UWP.csproj @@ -16,9 +16,6 @@ 1.0.10 - - 2.7.0 - 9.0.1 @@ -46,7 +43,7 @@ False False Always - arm + x86|x64|arm 0 OnApplicationRun SHA256 diff --git a/Andro2UWP/Andro2UWP.UWP/Package.appxmanifest b/Andro2UWP/Andro2UWP.UWP/Package.appxmanifest index fbbc037..f84c7e2 100644 --- a/Andro2UWP/Andro2UWP.UWP/Package.appxmanifest +++ b/Andro2UWP/Andro2UWP.UWP/Package.appxmanifest @@ -1,5 +1,5 @@  - + @@ -28,5 +28,9 @@ + + + + \ No newline at end of file