From 4c121bd0b7439cce095e702830beeda71f832dbb Mon Sep 17 00:00:00 2001 From: Xonshiz Date: Sun, 24 Mar 2019 21:29:34 +0530 Subject: [PATCH] UWP Download Location Fixed. 1.) UWP download location fixed. 2.) BadgeLogo fixed. 3.) Added references for Ads in UWP project. (Doesn't work tho). Know Issues : Setting up AdControlView in UWP throws `System.InvalidOperationException: 'Cannot assign a native control without an Element; Renderer unbound and/or disposed. Please consult Xamarin.Forms renderers for reference implementation of OnElementChanged.'`. Need to fix that. --- Changelog.md | 12 +++- README.md | 3 +- docs/changelog.rst | 10 ++++ docs/index.rst | 5 +- .../comic_dl.Android/comic_dl.Android.csproj | 3 + .../comic_dl.Android.csproj.user | 2 +- .../dependencyServices/DirectoryHelper.cs | 10 ++-- .../Assets/BadgeLogo.scale-100.png | Bin 757 -> 578 bytes .../Assets/BadgeLogo.scale-125.png | Bin 1055 -> 649 bytes .../Assets/BadgeLogo.scale-150.png | Bin 1362 -> 739 bytes .../Assets/BadgeLogo.scale-200.png | Bin 3199 -> 1392 bytes .../Assets/BadgeLogo.scale-400.png | Bin 5337 -> 2020 bytes src/comic_dl/comic_dl.UWP/comic_dl.UWP.csproj | 12 +++- .../customRenderer/AdViewRenderer.cs | 55 ++++++++++++++++++ .../dependencyServices/DirectoryHelper.cs | 39 +++++++++---- src/comic_dl/comic_dl.iOS/comic_dl.iOS.csproj | 14 +++-- .../dependencyServices/DirectoryHelper.cs | 9 +-- .../_comic/downloader/ComicDownloader.cs | 2 +- .../comic_dl/_manga/downloader/Downloader.cs | 2 +- src/comic_dl/comic_dl/comic_dl.csproj | 1 + src/comic_dl/comic_dl/interace/IDirectory.cs | 3 +- 21 files changed, 143 insertions(+), 39 deletions(-) create mode 100644 src/comic_dl/comic_dl.UWP/customRenderer/AdViewRenderer.cs diff --git a/Changelog.md b/Changelog.md index c3c3942..012d0c3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,2 +1,10 @@ -- Initial Code Commit For CoManga [2019.03.05] -- Added download location for UWP [2019.03.11] +- Initial Code Commit For CoManga. [2019.03.05] +- Added download location for UWP. [2019.03.11] +- UWP download location fixed. [2019.03.24] +- BadgeLogo fixed. [2019.03.24] +- Added references for Ads in UWP project. (Doesn't work tho). [2019.03.24] + +Know Issues : +Setting up AdControlView in UWP throws `System.InvalidOperationException: 'Cannot assign a native control without an Element; Renderer unbound and/or disposed. Please consult Xamarin.Forms renderers for reference implementation of OnElementChanged.'`. + +Need to fix that. \ No newline at end of file diff --git a/README.md b/README.md index ab77e1b..3eba9c8 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,7 @@ If you're on iOS, then you're compiling the project and the files will be stored You should get your downloaded items there. #### UWP -Getting the permissions is a little tricky in UWP. I've literally tried a lot of different things and couldn't get it to work. So, you'll have to work hard to get these downloaded files. You can find them in this location : -`C:\Users\{Your User Name}\AppData\Local\Packages\8c5bdaa1-7509-4aca-bd99-321c57de3c9f_0b312jg1at2fy\LocalState\CoManga` +You can find your downloaded content in the `"Downloads"` folder undeder the folder named "CoManga". # Why Is It Not On Application Stores? diff --git a/docs/changelog.rst b/docs/changelog.rst index c3c3942..2e32b87 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,2 +1,12 @@ - Initial Code Commit For CoManga [2019.03.05] - Added download location for UWP [2019.03.11] +- Initial Code Commit For CoManga. [2019.03.05] +- Added download location for UWP. [2019.03.11] +- UWP download location fixed. [2019.03.24] +- BadgeLogo fixed. [2019.03.24] +- Added references for Ads in UWP project. (Doesn't work tho). [2019.03.24] + +Know Issues : +Setting up AdControlView in UWP throws `System.InvalidOperationException: 'Cannot assign a native control without an Element; Renderer unbound and/or disposed. Please consult Xamarin.Forms renderers for reference implementation of OnElementChanged.'`. + +Need to fix that. \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 8832112..35977d9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -94,10 +94,7 @@ You should get your downloaded items there. UWP ^^^ -Getting the permissions is a little tricky in UWP. I've literally tried -a lot of different things and couldn't get it to work. So, you'll have -to work hard to get these downloaded files. You can find them in this -location : ``C:\Users\{Your User Name}\AppData\Local\Packages\8c5bdaa1-7509-4aca-bd99-321c57de3c9f_0b312jg1at2fy\LocalState\CoManga`` +You can find your downloaded content in the `"Downloads"` folder undeder the folder named "CoManga". Why Is It Not On Application Stores? ==================================== diff --git a/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj b/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj index f1ccc4f..ff7b51e 100644 --- a/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj +++ b/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj @@ -65,6 +65,9 @@ 1.9.1 + + 10.1705.16001 + 12.0.1 diff --git a/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj.user b/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj.user index e1e5b56..b3df81b 100644 --- a/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj.user +++ b/src/comic_dl/comic_dl.Android/comic_dl.Android.csproj.user @@ -1,7 +1,7 @@  - Xiaomi Mi A1 + Android_Accelerated_x86_Oreo Android_Accelerated_x86_Oreo Theme.DeviceDefault.NoActionBar.Fullscreen diff --git a/src/comic_dl/comic_dl.Android/dependencyServices/DirectoryHelper.cs b/src/comic_dl/comic_dl.Android/dependencyServices/DirectoryHelper.cs index 071e74f..177a308 100644 --- a/src/comic_dl/comic_dl.Android/dependencyServices/DirectoryHelper.cs +++ b/src/comic_dl/comic_dl.Android/dependencyServices/DirectoryHelper.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; using System.Text; - +using System.Threading.Tasks; using Android.App; using Android.Content; using Android.OS; @@ -53,7 +53,7 @@ public bool CheckExisingFile(string fileAddress) return false; } - public bool CreateFile(string directoryName, byte[] contentToWrite) + public Task CreateFile(string directoryName, byte[] contentToWrite) { var filePath = Path.Combine(documentBasePath, directoryName); if (!File.Exists(filePath)) @@ -61,14 +61,14 @@ public bool CreateFile(string directoryName, byte[] contentToWrite) try { File.WriteAllBytes(directoryName, contentToWrite); - return true; + return Task.FromResult(true); } catch (Exception) { - return false; + return Task.FromResult(false); } } - return false; + return Task.FromResult(false); } } } \ No newline at end of file diff --git a/src/comic_dl/comic_dl.UWP/Assets/BadgeLogo.scale-100.png b/src/comic_dl/comic_dl.UWP/Assets/BadgeLogo.scale-100.png index d4364e498290dfff11505c022d22ed0de8dfccd7..210ad396c2d1f233b18d14210e10106cb6b27629 100644 GIT binary patch literal 578 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_*1mUKs7M+SzC{oH>NS%G|oWRD45bDP46hOx7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^> z;_2(k{+L;WlVADWNBw0C42-ItE{-7GX)bMwZCZ0i+s z`oiIO`re{&&Z@>~UuAM*SanYcF$=GBoi?-SZgo_OQ}>H)tIr)UU@mS;v@mvKj$(0X zc0YD8X?nCzOVP#?8HdQr{)Mnv3>C{ z@|~zJcU2Zmwu$O zw7ZLG-U>|rc*g(!8EF~jfcptHiD0`|OXPSds+U5S*V@Ql40p%HWuipOmWL cnVXoN8kCxtQdxL16%?@yp00i_>zopr04&nb8vphErXLeaLy;OLnq!N~T4~}My|qWF$g(t< ziQ*^?;XejiZ-jZK8mp~8`GLFb(^|gBQkv{IHP(i3zFrRKuYuQ9Xyo5+GSg)36^blt zlO2`9uYAw(>VG96HF(Aip7u{Cxm#;*imxTvF*cm+UcdE0DmTzdW7V~Chg1B`JD&Wy zF4?g${7DZtx=ERN1{!3d+udTQdp)kFUkh219S1_5DrR_IxyeQvXM|V$%f&9z&oZ`4ue~HxG&phLdGD0KoS-;k)*{>nX zrPf-di+_Lmi|5V7Rt=o2(6MTiD$agBc?!~8;u+%{)Wa3V$$@PqY2Z5VEggBx^z8Tk z&5nEh)2&G_*Thg$)JM*~Gy}VLjJ;np%?41zmqzb+-v(`xJj^p%sw-!{8@+0hgY58< zBJl-6@tXU3FY9fDX@+X(L)U5IKKb$-tM@YZDOVO><3Px(IQpZ~M(aA}##(5+!-bUG z1?xJN_B>kN*7z3xjuYb7C1;#6w$ko#n>I~4_`id(sbJg>Dt&y45+O1^0nLq&&%J-~ QJpcdz07*qoM6N<$g8N}~&;S4c diff --git a/src/comic_dl/comic_dl.UWP/Assets/BadgeLogo.scale-125.png b/src/comic_dl/comic_dl.UWP/Assets/BadgeLogo.scale-125.png index 3146a25536426dd248534da536860eca84440a37..a8b4e1502e06fb08159ad4032a1cd870d6d92c37 100644 GIT binary patch delta 625 zcmbQw(aAbNxt@U~-O<;Pfnj4m_n$;o1_lO&WRD45bDP z46hOx7_4S6Fo+k-*%fF5lweBoc6VX;-`;;_Kaj^>;_2(k{+L;WlVADWNBw0C42(IR zE{-7+n#{x$Ur`8U)Kf&F{eyLnvxN`9C%0`Rtv}pvZGYGi`(kqLG2PoPf>oQ*obFGe4XwKH0PV-i)%S zcxR=PTc)gg5n-mj^Yw=GS#mSN%|ArAzsQUZypeu2eSXOo!Db8TMS@@J1(Kc5E|!YC zqI9$(M9Ecm(~4t0G2PM|?Spz+EySA_hTfEV@%I96jqAx}$J*BYzP49gJNdPCeZJAY z%Af0x6tn-!f6(G2x%j%T<2QBJ@3PZkI$mAw5?BI^4b>9Yh?11Vl2ohYqEsNoU}Ruu zscT@YYh(~&U}D%##^KM{a&fW?Ch79Uu+gXMY4mxFpDm;QX|b o^2DN42FH~Aq*MjZ+{EFVdQ&MBb@0N_Ui761SM delta 1035 zcmV+m1oZof1)m6zBYy+tNklT5P!m2;ZuFj1R#VE{kUUHLX*n;73C3SbAt)xN7 zhg}Ol)r=*qr5eK+NFg#Zhc;YbE7o8*T1nX>Sm;MFQhzXpGt6WI4zAFe#cZbz=}AaQ zZs9;etfX!(LNE4{mS!AhGZDOGi)P(tK0`UdSaQ*l9V7^Wm6TWJ`aNcoCQRidUvP*^ zcsNfbifH-`%|Ff`bP8!)Npr6fvXjph>Z5tjxrxbzupi@1X~D;ywNwg;J=14dgoG( zVytEYn>fpKzTpY8G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j@{j=MkZf)!U@90p0a+d z^mWDqsypo9WVhNLfJ!*<}`U>pUMDYZLdX20$7N5Dr&v!>IDT3TcnnM@yZ` zU+xu=Zv4a7q37aa&`9!fNCcS z-Bsar-Ti`DHWiLh3g8;e>j_Y1ipl0!F3q}GqGviG8bKl=x5N1_E(20~;71L+XD zc~^S8?mo51ET5WbA)w53uX@^phPYBc_xr#COZ9P@k6oq0Ekb_ACh}KjH!!y!ZWfUC zZpOg5p$K6MqiV{B*v+YKGSJ0t@tqR=^>nr?jP!)3JZzZjo#n4ia*>@q;C^4aLrB<3 ze@}SVd+u?lT+x8L`G9hxY$3!y1))H%)${Ijn2)4h;LRwu`o97|NYHd$n zvnD_YxteMwDYBT*%FYhe*Q4`R_fjDKiHKC_xVm_3*9a*i-l~vmPeaYMN;YoSaDW1%rB^A@$7VwO`)C`- zw;gwD>HJh$Lkwy-Kl%Kq_OT$KNImzORsdHJW(>gsGUZpsoMS)I4A z`OEDtx}dZCbd<+`46%K|Lmj{Bv3Pjd2Q>?-Dk@Ut{=ZgQuEd@h0TQWXMc#sf4_XcD zaQY6vJFYO|x%jW(syI10q1ECppBIhqKVF*S|y2c3t*uJt}!a{B!s}ImqXl^negs00000NkvXXu0mjfkkn=- diff --git a/src/comic_dl/comic_dl.UWP/comic_dl.UWP.csproj b/src/comic_dl/comic_dl.UWP/comic_dl.UWP.csproj index de0d02c..1b89617 100644 --- a/src/comic_dl/comic_dl.UWP/comic_dl.UWP.csproj +++ b/src/comic_dl/comic_dl.UWP/comic_dl.UWP.csproj @@ -99,6 +99,7 @@ App.xaml + @@ -189,6 +190,9 @@ 1.9.1 + + 10.1705.16001 + 12.0.1 @@ -207,8 +211,14 @@ comic_dl + - + + Microsoft Advertising SDK for XAML + + + Visual C++ 2015 Runtime for Universal Windows Platform Apps + 14.0 diff --git a/src/comic_dl/comic_dl.UWP/customRenderer/AdViewRenderer.cs b/src/comic_dl/comic_dl.UWP/customRenderer/AdViewRenderer.cs new file mode 100644 index 0000000..033e074 --- /dev/null +++ b/src/comic_dl/comic_dl.UWP/customRenderer/AdViewRenderer.cs @@ -0,0 +1,55 @@ +using System; +using Xamarin.Forms; +using Xamarin.Forms.Platform.UWP; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.Advertising.Ads; +using Microsoft.Advertising.WinRT.UI; +using Windows.System.Profile; + +[assembly: ExportRenderer(typeof(comic_dl.Controls.AdControlView), typeof(comic_dl.UWP.customRenderer.AdViewRenderer))] +namespace comic_dl.UWP.customRenderer +{ +#pragma warning disable CS0618 // Type or member is obsolete + public class AdViewRenderer : ViewRenderer + { + string bannerId = "1100041955"; + AdControl adView; + string applicationID = "9n81f8b5ww93"; + void CreateNativeAdControl() + { + if (adView != null) + return; + + var width = 300; + var height = 50; + if (AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Desktop") + { + width = 728; + height = 90; + } + // Setup your BannerView, review AdSizeCons class for more Ad sizes. + adView = new AdControl + { + ApplicationId = applicationID, + AdUnitId = bannerId, + HorizontalAlignment = Windows.UI.Xaml.HorizontalAlignment.Center, + VerticalAlignment = Windows.UI.Xaml.VerticalAlignment.Bottom, + Height = height, + Width = width + }; + + } + + protected override void OnElementChanged(ElementChangedEventArgs e) + { + base.OnElementChanged(e); + if (Control == null) + { + CreateNativeAdControl(); + //SetNativeControl(adView); + } + } + } +#pragma warning restore CS0618 // Type or member is obsolete +} diff --git a/src/comic_dl/comic_dl.UWP/dependencyServices/DirectoryHelper.cs b/src/comic_dl/comic_dl.UWP/dependencyServices/DirectoryHelper.cs index a9681f3..a4ccbf3 100644 --- a/src/comic_dl/comic_dl.UWP/dependencyServices/DirectoryHelper.cs +++ b/src/comic_dl/comic_dl.UWP/dependencyServices/DirectoryHelper.cs @@ -6,6 +6,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using Windows.Storage; using Xamarin.Forms; [assembly: Dependency(typeof(DirectoryHelper))] @@ -48,23 +49,39 @@ public bool CheckExisingFile(string fileAddress) return false; } - public bool CreateFile(string directoryName, byte[] contentToWrite) + public async Task CreateFile(string directoryName, byte[] contentToWrite) { - //var filePath = Path.Combine(documentBasePath, directoryName); - var filePath = Windows.Storage.DownloadsFolder.CreateFileAsync(directoryName); - if (!File.Exists(Convert.ToString(filePath))) + List fileNames = directoryName.Split('/').ToList(); + string downloadType = fileNames[1]; + string comicName = fileNames[2]; + string comicChapter = fileNames[3]; + string comicFileName = fileNames[4]; + StorageFile destinationFile; + StorageFolder downloadsFolder; + try { - try + downloadsFolder = await DownloadsFolder.CreateFolderAsync(downloadType + @"\" + comicName + @"\" + comicChapter + @"\"); + string folderToken = Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.Add(downloadsFolder); + ApplicationData.Current.LocalSettings.Values["folderToken"] = folderToken; + destinationFile = await downloadsFolder.CreateFileAsync(comicFileName, CreationCollisionOption.ReplaceExisting); + + await Windows.Storage.FileIO.WriteBytesAsync(destinationFile, contentToWrite); + return true; + // File.WriteAllBytes(destinationFile.Path, contentToWrite); + } + catch (Exception ex) + { + if (ApplicationData.Current.LocalSettings.Values["folderToken"] != null) { - File.WriteAllBytes(directoryName, contentToWrite); + string token = ApplicationData.Current.LocalSettings.Values["folderToken"].ToString(); + downloadsFolder = await Windows.Storage.AccessCache.StorageApplicationPermissions.FutureAccessList.GetFolderAsync(token); + destinationFile = await downloadsFolder.CreateFileAsync(comicFileName, CreationCollisionOption.ReplaceExisting); + //File.WriteAllBytes(destinationFile.Path, contentToWrite); + await Windows.Storage.FileIO.WriteBytesAsync(destinationFile, contentToWrite); return true; } - catch (Exception) - { - return false; - } + return false; } - return false; } } } diff --git a/src/comic_dl/comic_dl.iOS/comic_dl.iOS.csproj b/src/comic_dl/comic_dl.iOS/comic_dl.iOS.csproj index e15e30f..946b27a 100644 --- a/src/comic_dl/comic_dl.iOS/comic_dl.iOS.csproj +++ b/src/comic_dl/comic_dl.iOS/comic_dl.iOS.csproj @@ -621,6 +621,9 @@ 1.9.1 + + 10.1705.16001 + 12.0.1 @@ -643,16 +646,15 @@ - - - - - - + + + + + diff --git a/src/comic_dl/comic_dl.iOS/dependencyServices/DirectoryHelper.cs b/src/comic_dl/comic_dl.iOS/dependencyServices/DirectoryHelper.cs index db66637..bc6a955 100644 --- a/src/comic_dl/comic_dl.iOS/dependencyServices/DirectoryHelper.cs +++ b/src/comic_dl/comic_dl.iOS/dependencyServices/DirectoryHelper.cs @@ -8,6 +8,7 @@ using UIKit; using Xamarin.Forms; using comic_dl.interace; +using System.Threading.Tasks; [assembly: Dependency(typeof(DirectoryHelper))] namespace comic_dl.iOS @@ -47,7 +48,7 @@ public bool CheckExisingFile(string fileAddress) return false; } - public bool CreateFile(string directoryName, byte[] contentToWrite) + public Task CreateFile(string directoryName, byte[] contentToWrite) { var filePath = documentBasePath + directoryName; if (!File.Exists(filePath)) @@ -55,14 +56,14 @@ public bool CreateFile(string directoryName, byte[] contentToWrite) try { File.WriteAllBytes(directoryName, contentToWrite); - return true; + return Task.FromResult(true); } catch (Exception) { - return false; + return Task.FromResult(false); } } - return false; + return Task.FromResult(false); } } } \ No newline at end of file diff --git a/src/comic_dl/comic_dl/_comic/downloader/ComicDownloader.cs b/src/comic_dl/comic_dl/_comic/downloader/ComicDownloader.cs index 1d1fcd0..c17b5f1 100644 --- a/src/comic_dl/comic_dl/_comic/downloader/ComicDownloader.cs +++ b/src/comic_dl/comic_dl/_comic/downloader/ComicDownloader.cs @@ -55,7 +55,7 @@ public async Task FilesDownloader(List listOfUrl, string comicName if (contents == null) // If there's nothing, just move onto the next loop. continue; - bool isFileDownloaded = DependencyService.Get().CreateFile(filePath, contents); + bool isFileDownloaded = await DependencyService.Get().CreateFile(filePath, contents); if (!isFileDownloaded) diff --git a/src/comic_dl/comic_dl/_manga/downloader/Downloader.cs b/src/comic_dl/comic_dl/_manga/downloader/Downloader.cs index 5d1d501..274ad5c 100644 --- a/src/comic_dl/comic_dl/_manga/downloader/Downloader.cs +++ b/src/comic_dl/comic_dl/_manga/downloader/Downloader.cs @@ -53,7 +53,7 @@ public async Task FilesDownloader(List listOfUrl, string mangaName if (contents == null) // If there's nothing, just move onto the next loop. continue; - bool isFileDownloaded = DependencyService.Get().CreateFile(filePath, contents); + bool isFileDownloaded = await DependencyService.Get().CreateFile(filePath, contents); if (!isFileDownloaded) diff --git a/src/comic_dl/comic_dl/comic_dl.csproj b/src/comic_dl/comic_dl/comic_dl.csproj index 6e12c8b..f111093 100644 --- a/src/comic_dl/comic_dl/comic_dl.csproj +++ b/src/comic_dl/comic_dl/comic_dl.csproj @@ -10,6 +10,7 @@ + diff --git a/src/comic_dl/comic_dl/interace/IDirectory.cs b/src/comic_dl/comic_dl/interace/IDirectory.cs index 7e4778b..70d4708 100644 --- a/src/comic_dl/comic_dl/interace/IDirectory.cs +++ b/src/comic_dl/comic_dl/interace/IDirectory.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Text; +using System.Threading.Tasks; namespace comic_dl.interace { @@ -9,6 +10,6 @@ public interface IDirectory string GetBasePath(); string CreateDirectory(string directoryName); bool CheckExisingFile(string filePath); - bool CreateFile(string directoryName, byte[] contentToWrite); + Task CreateFile(string directoryName, byte[] contentToWrite); } }