From 3dc868840b350a3f9a1df535dcb3031f2c7b9be7 Mon Sep 17 00:00:00 2001 From: Mondonno Date: Wed, 4 Aug 2021 11:59:48 +0200 Subject: [PATCH 1/2] feat: 2.0 Added all new rewrite files --- .gitignore | 1 + CPopUpLibrary/Downloads/CPopupLibrary.iOS.zip | Bin 3623 -> 0 bytes .../Downloads/CPopupLibraryDEMO.iOS.zip | Bin 4841 -> 0 bytes .../CustomPopUpViewController.cs | 105 ------------------ .../Source/CPopupLibrary.iOS/PopUpsObjects.cs | 35 ------ .../CPopupLibrary.iOS/YourCustomizePopup.cs | 74 ------------ .../CustomPopUpViewController.cs | 104 ----------------- .../CPopupLibraryDEMO.iOS/PopUpsObjects.cs | 35 ------ .../YourCustomizePopup.cs | 94 ---------------- CustomPopUps.iOS.sln | 73 ++++++++++++ CustomPopUps/.gitignore | 2 + CustomPopUps/BasePopUp.cs | 70 ++++++++++++ CustomPopUps/Constants.cs | 15 +++ CustomPopUps/CustomPopUps.csproj | 50 +++++++++ CustomPopUps/PopUp.cs | 16 +++ CustomPopUps/PopUpStack.cs | 44 ++++++++ .../Properties/AssemblyInfo.cs | 4 +- Examples/{PopUpsCode => }/#1PopBasicCode.txt | 0 .../{PopUpsCode => }/#2ActivityPopCode.txt | 0 .../{PopUpsCode => }/#3WebViewPopCode.txt | 0 .../CustomPopUpViewController.cs | 101 ----------------- .../CPopupLibrary/PopUpsObjects.cs | 22 ---- .../CPopupLibrary/YourCustomizePopup.cs | 99 ----------------- .../Projects/CustomPopUpDemo/Main.storyboard | 27 ----- .../CustomPopUpDemo/ViewController.cs | 51 --------- Test.iOS/.gitignore | 2 + .../AppDelegate.cs | 3 +- .../AppIcon.appiconset/Contents.json | 0 .../AppIcon.appiconset/Icon1024.png | Bin .../AppIcon.appiconset/Icon120.png | Bin .../AppIcon.appiconset/Icon152.png | Bin .../AppIcon.appiconset/Icon167.png | Bin .../AppIcon.appiconset/Icon180.png | Bin .../AppIcon.appiconset/Icon20.png | Bin .../AppIcon.appiconset/Icon29.png | Bin .../AppIcon.appiconset/Icon40.png | Bin .../AppIcon.appiconset/Icon58.png | Bin .../AppIcon.appiconset/Icon60.png | Bin .../AppIcon.appiconset/Icon76.png | Bin .../AppIcon.appiconset/Icon80.png | Bin .../AppIcon.appiconset/Icon87.png | Bin .../Entitlements.plist | 0 .../CustomPopUpDemo => Test.iOS}/Info.plist | 10 +- .../LaunchScreen.storyboard | 2 +- .../CustomPopUpDemo => Test.iOS}/Main.cs | 2 +- Test.iOS/Main.storyboard | 46 ++++++++ Test.iOS/Properties/AssemblyInfo.cs | 36 ++++++ .../Resources/LaunchScreen.xib | 2 +- .../SceneDelegate.cs | 2 +- .../Test.iOS.csproj | 23 ++-- Test.iOS/ViewController.cs | 104 +++++++++++++++++ .../ViewController.designer.cs | 2 +- 52 files changed, 489 insertions(+), 767 deletions(-) create mode 100644 .gitignore delete mode 100644 CPopUpLibrary/Downloads/CPopupLibrary.iOS.zip delete mode 100644 CPopUpLibrary/Downloads/CPopupLibraryDEMO.iOS.zip delete mode 100644 CPopUpLibrary/Source/CPopupLibrary.iOS/CustomPopUpViewController.cs delete mode 100644 CPopUpLibrary/Source/CPopupLibrary.iOS/PopUpsObjects.cs delete mode 100644 CPopUpLibrary/Source/CPopupLibrary.iOS/YourCustomizePopup.cs delete mode 100644 CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/CustomPopUpViewController.cs delete mode 100644 CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/PopUpsObjects.cs delete mode 100644 CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/YourCustomizePopup.cs create mode 100644 CustomPopUps.iOS.sln create mode 100644 CustomPopUps/.gitignore create mode 100644 CustomPopUps/BasePopUp.cs create mode 100644 CustomPopUps/Constants.cs create mode 100644 CustomPopUps/CustomPopUps.csproj create mode 100644 CustomPopUps/PopUp.cs create mode 100644 CustomPopUps/PopUpStack.cs rename {Examples/Projects/CustomPopUpDemo => CustomPopUps}/Properties/AssemblyInfo.cs (93%) rename Examples/{PopUpsCode => }/#1PopBasicCode.txt (100%) rename Examples/{PopUpsCode => }/#2ActivityPopCode.txt (100%) rename Examples/{PopUpsCode => }/#3WebViewPopCode.txt (100%) delete mode 100644 Examples/Projects/CustomPopUpDemo/CPopupLibrary/CustomPopUpViewController.cs delete mode 100644 Examples/Projects/CustomPopUpDemo/CPopupLibrary/PopUpsObjects.cs delete mode 100644 Examples/Projects/CustomPopUpDemo/CPopupLibrary/YourCustomizePopup.cs delete mode 100644 Examples/Projects/CustomPopUpDemo/Main.storyboard delete mode 100644 Examples/Projects/CustomPopUpDemo/ViewController.cs create mode 100644 Test.iOS/.gitignore rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/AppDelegate.cs (98%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Contents.json (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon1024.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon120.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon152.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon167.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon180.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon20.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon29.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon40.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon58.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon60.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon76.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon80.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Assets.xcassets/AppIcon.appiconset/Icon87.png (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Entitlements.plist (100%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Info.plist (87%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/LaunchScreen.storyboard (99%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Main.cs (93%) create mode 100644 Test.iOS/Main.storyboard create mode 100644 Test.iOS/Properties/AssemblyInfo.cs rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/Resources/LaunchScreen.xib (95%) rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/SceneDelegate.cs (99%) rename Examples/Projects/CustomPopUpDemo/CustomPopUpDemo.csproj => Test.iOS/Test.iOS.csproj (91%) create mode 100644 Test.iOS/ViewController.cs rename {Examples/Projects/CustomPopUpDemo => Test.iOS}/ViewController.designer.cs (93%) diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a4d6d9c --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.vs/ \ No newline at end of file diff --git a/CPopUpLibrary/Downloads/CPopupLibrary.iOS.zip b/CPopUpLibrary/Downloads/CPopupLibrary.iOS.zip deleted file mode 100644 index 640da83ab7fad9de09ebdb43b4c6d5d1ec879b2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3623 zcmbtXc|4SR7oUl-E6X5TLSxBZLS%33%g8?VEo2{S;)XF{vJTm@hLJUi3`v$qSxOSu zmZcD88nRPf)4krh-QLgVecyYY&-46#&p+SuJLmbHbG{Eumy8??AX!rZ#OT}R&j%CW zBtRYJ;~VI!=kADbKwK4fH#C+oHK7MkMh+U=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2BZ5+<`GI7XC)4CEQ_T*SDW$rzP`i1|7WF9uOXgD)&jhB=a_1O21PqVbVgEHXt zKE>7KetR{~=Yn%+k{J&#uE@4WD1NikC&TMrQ*}nmn^Y6Ivb-{@m*L-CxLn+aA( zU#zaiH6mbkTkTlD>XZEC;GV*K+hZITb-;w9k2e=#JO0)R*{uT+#sN37&+YLlI8Q3I zZS?5qn7_*v8&*mSUewzn;2srqA(sQ>J=-EU$4+>S;j!&ROF|p9r z{o+h~)q-9#E}Z+gZA9H7vM@4uUv4*J7r$@4bnKy2Zp`o?;X>K?w$4Nf8T({(E2unB zdHqp>IF}$9Tf&6j?hy41LCN%%^`pie-1Y>%GQ@06vR-vy8Z0Hm%4(*+&@ll^C%|EJ^!;8jVxze)4|LiPWFf2jL^ zl+GmGe`xqf*unOn`~@6FLh?kC;yHX-GG@yR`l%xT5XvL8m6u)x%PsSBY7j%FL0DulIks|=W94+bXUv^LQ A&Hw-a diff --git a/CPopUpLibrary/Downloads/CPopupLibraryDEMO.iOS.zip b/CPopUpLibrary/Downloads/CPopupLibraryDEMO.iOS.zip deleted file mode 100644 index e446d78ea29c95e5e4e2c6b90afbf7457e2adb6a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4841 zcmbVP2{e>_`yR$Hb|Fiakg=3us4OXD9}JUytFecS?38+~BU_9m8kAkhR-z(Vv+p~} zzOPwIOyob)_xIM@@qXuhzxz4Q{GK__IrshC+jXuBsR<-w1`w@04RYnj!~g%V0C)gO z$eS*nE?N#&ZkBGhlvNNqq7FKGVg~xO0E&QKJrss;-y__fKGXmbvM(e6zz<)@A3nhV z@LzoP5d88GE))uJSxHCFSWFakr2D^kPqjAs-Mh8LaqH_ARu=0BEyHzs!%(C@DV7Z= z$iP9eLCQnEAtufM;#5)$Ow+!V&k4ACY#1Sj5Ut6Kc2d} zJY^D_#9^9Z${hRfT3a<%9~)<4Ze{V@ALs};6$@|jX96HKDZmM1q)*X=k0&PZGqt4f zpXJH|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nde8%@oNX|602S}R<0rNfualb0oXam|I;uKIOgC7@I# zUBd4#1!Te;^u{*tv&vjb>sJGF=ML*qO{eel4{txqySEUqriEI+&84* z=0&j6IS#RHtswT}D_YVm8X$?a z*Xyi{W1bVwG|4rWH!_9ceW&ij8eF|(5Uv{=At9r0X6S@@y266i%BImzPq+0)CdWqH zH`8{>rB)qr&}rDhT%4FtG+uwinJW5u9z z{M+~F^35>G19x9DuBCR5XlUfCbtxj)CC|!+pb20{gtViB1ZRo(3n0h;Pr%1DZQa>3#85>&`!;(8=gr-J>o}MnFrtSk^VEU2(2_-!_`5(dM zAK%Y#rdjA-*0ysE3#hSG6|iG5e6?QOmoe40SAh+D9~a)XSsA?eD!nj?kj$Pqg9*!xHvVzyFodD}B>->`k z3m8yPmh?`&?PuCkX@yq7_!KTE|K_;dOcYSuCQ<*igg>wxR$fg^ zEmF|GgUfH9S%H{7OBD!spPk0*nbedUVwPNe2BIn8<8?g#jY7Ikc>Rb@1N> x{>S@%1kd?B{;!iw1e-(43K*sR2X+6)pK=8BAT>ec#BdaZ3r=WqI6d*-{{ehiwI=`o diff --git a/CPopUpLibrary/Source/CPopupLibrary.iOS/CustomPopUpViewController.cs b/CPopUpLibrary/Source/CPopupLibrary.iOS/CustomPopUpViewController.cs deleted file mode 100644 index 73730ae..0000000 --- a/CPopUpLibrary/Source/CPopupLibrary.iOS/CustomPopUpViewController.cs +++ /dev/null @@ -1,105 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using UIKit; -using CoreGraphics; -using Foundation; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class CustomPopUpViewController : UIView - { - public delegate void PopWillOpenHandler(); - - public delegate void PopWillCloseHandler(); - - //You can use it to handle the closing PopUp event - public event PopWillCloseHandler PopUpWillClose; - public event PopWillOpenHandler PopUpWillOpen; - - private UIVisualEffectView effectView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark)); - - //Initializing PopUp - public void CustomPopUpInit(CGSize size, nfloat? FrameRadius = null) - { - //Setting size and makeing effects - nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; - nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; - this.Frame = new CGRect(new CGPoint(lx, ly), size); - if(FrameRadius == null) FrameRadius = 0; - this.Layer.CornerRadius = FrameRadius; - effectView.Alpha = 0; - } - - //PopUp Showing - public void PopUp( bool animated = true, Action popAnimationFinish = null) - { - //Setting UIWindow to show popup - UIWindow window = UIApplication.SharedApplication.KeyWindow; - //Setting effect view frame - effectView.Frame = window.Bounds; - //Editing windows - window.EndEditing(true); - window.AddSubview(effectView); - window.AddSubview(this); - //Checking if animated - if (animated) - { - //Transforming to 0.1f Scale to make animation - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(1, 1); - effectView.Alpha = 0.8f; - }, delegate { - //Running event - if (null != PopUpWillOpen) - PopUpWillOpen(); - }); - } - else - { - //Changing alpha in effect view - effectView.Alpha = 0.8f; - } - } - - //Closing PopUp - public void Close(bool animated = true) - { - //Checking if animated - if (animated) - { - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - effectView.Alpha = 0; - }, delegate { - //Removing from View Controller PopUp and Effects - this.RemoveFromSuperview(); - effectView.RemoveFromSuperview(); - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - }); - } - else - { - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - } - - } - - } -} \ No newline at end of file diff --git a/CPopUpLibrary/Source/CPopupLibrary.iOS/PopUpsObjects.cs b/CPopUpLibrary/Source/CPopupLibrary.iOS/PopUpsObjects.cs deleted file mode 100644 index ba7d464..0000000 --- a/CPopUpLibrary/Source/CPopupLibrary.iOS/PopUpsObjects.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class PopUpsObjects : CustomPopUpViewController - { - //Give {get; set;} if you wan't to set popup settings in your code - //Set your popup size! - public double PopUpWidth { get; set; } - public double PopUpHeight { get; set; } - //Set your popup radius! (0 for any radius OR 6f for all rounded) - public double FrameRadius { get; set; } - - //Custom background RGB color (you can set it here, in the popup object, or in YourPopUpCode() method with this.BackgroundColor - //SOON - nfloat[] RGBColors = { 12,12,12 }; - - public enum AniamtionType - { - Normal, - Bounce - } - public enum Animated - { - Yes, - No, - } - public enum PopActionType - { - Close, - Show - } - } -} diff --git a/CPopUpLibrary/Source/CPopupLibrary.iOS/YourCustomizePopup.cs b/CPopUpLibrary/Source/CPopupLibrary.iOS/YourCustomizePopup.cs deleted file mode 100644 index de1c11e..0000000 --- a/CPopUpLibrary/Source/CPopupLibrary.iOS/YourCustomizePopup.cs +++ /dev/null @@ -1,74 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using System.Threading.Tasks; -using UIKit; -using Foundation; -using CoreGraphics; - -namespace CPopupLibrary -{ - public class YourCustomizePopup : PopUpsObjects - { - #region PUSS | PopUps System Settings - public async Task ShowPopUp() - { - await YourPopUpCode(); - } - private protected async Task Init() - { - //You can set if you want to get animated popup by changing the true value! - //Adding the PopUp Closing handler - PopUpWillClose += PopWillClose; - - PopUp(true,//Here you can chenge animating! - async delegate { - //Do stuff when the popup will be opened - //Or you can add here handling method - await OpenHandler(); - }); - } - #endregion - - public YourCustomizePopup() - { - - } - - private protected async Task OpenHandler() - { - //This code below will be started when the popup will be opened! - //Do stuff! - - } - private protected async void PopWillClose() - { - //This code below will be started when the PopUp will be Closed! - //Do stuff! - - } - - private async Task YourPopUpCode() - { - #region Starting - CGSize PopUpSize = new CGSize(PopUpWidth, PopUpHeight); - CustomPopUpInit(PopUpSize, (nfloat) FrameRadius); - #endregion - - // Here write your PopUp code and declare the objects - - #region Initializing - //IMPORTANT! DO NOT CHANGE THIS! - await Init(); - #endregion - } - } -} diff --git a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/CustomPopUpViewController.cs b/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/CustomPopUpViewController.cs deleted file mode 100644 index 577d3f9..0000000 --- a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/CustomPopUpViewController.cs +++ /dev/null @@ -1,104 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using UIKit; -using CoreGraphics; -using Foundation; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class CustomPopUpViewController : UIView - { - - public delegate void PopWillCloseHandler(); - - //You can use it to handle the closing PopUp event - public event PopWillCloseHandler PopUpWillClose; - - private UIVisualEffectView effectView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark)); - - //Initializing PopUp - public void CustomPopUpInit(CGSize size, nfloat? FrameRadius = null) - { - //Setting size and makeing effects - nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; - nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; - this.Frame = new CGRect(new CGPoint(lx, ly), size); - if(FrameRadius == null) FrameRadius = 0; - this.Layer.CornerRadius = FrameRadius; - effectView.Alpha = 0; - } - - //PopUp Showing - public void PopUp( bool animated = true, Action popAnimationFinish = null) - { - //Setting UIWindow to show popup - UIWindow window = UIApplication.SharedApplication.KeyWindow; - //Setting effect view frame - effectView.Frame = window.Bounds; - //Editing windows - window.EndEditing(true); - window.AddSubview(effectView); - window.AddSubview(this); - //Checking if animated - if (animated) - { - //Transforming to 0.1f Scale to make animation - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(1, 1); - effectView.Alpha = 0.8f; - }, delegate { - - //Running event - if (null != PopUpWillOpen) - PopUpWillOpen(); - }); - } - else - { - //Changing alpha in effect view - effectView.Alpha = 0.8f; - } - } - - //Closing PopUp - public void Close(bool animated = true) - { - //Checking if animated - if (animated) - { - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - effectView.Alpha = 0; - }, delegate { - //Removing from View Controller PopUp and Effects - this.RemoveFromSuperview(); - effectView.RemoveFromSuperview(); - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - }); - } - else - { - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - } - - } - - } -} \ No newline at end of file diff --git a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/PopUpsObjects.cs b/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/PopUpsObjects.cs deleted file mode 100644 index ba7d464..0000000 --- a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/PopUpsObjects.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class PopUpsObjects : CustomPopUpViewController - { - //Give {get; set;} if you wan't to set popup settings in your code - //Set your popup size! - public double PopUpWidth { get; set; } - public double PopUpHeight { get; set; } - //Set your popup radius! (0 for any radius OR 6f for all rounded) - public double FrameRadius { get; set; } - - //Custom background RGB color (you can set it here, in the popup object, or in YourPopUpCode() method with this.BackgroundColor - //SOON - nfloat[] RGBColors = { 12,12,12 }; - - public enum AniamtionType - { - Normal, - Bounce - } - public enum Animated - { - Yes, - No, - } - public enum PopActionType - { - Close, - Show - } - } -} diff --git a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/YourCustomizePopup.cs b/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/YourCustomizePopup.cs deleted file mode 100644 index 0e2f87c..0000000 --- a/CPopUpLibrary/Source/CPopupLibraryDEMO.iOS/YourCustomizePopup.cs +++ /dev/null @@ -1,94 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using System.Threading.Tasks; -using UIKit; -using Foundation; -using CoreGraphics; - -namespace CPopupLibrary -{ - public class YourCustomizePopup : PopUpsObjects - { - #region PUSS | PopUps System Settings - public async Task ShowPopUp() - { - await YourPopUpCode(); - } - private protected async Task Init() - { - //You can set if you want to get animated popup by changing the true value! - //Adding the PopUp Closing handler - PopUpWillClose += PopWillClose; - - PopUp(true,//Here you can chenge animating! - async delegate { - //Do stuff when the popup will be opened - //Or you can add here handling method - await OpenHandler(); - }); - } - #endregion - - public YourCustomizePopup() - { - - } - - private protected async Task OpenHandler() - { - //This code below will be started when the popup will be opened! - //Do stuff! - - } - private protected async void PopWillClose() - { - //This code below will be started when the PopUp will be Closed! - //Do stuff! - - } - - - - private async Task YourPopUpCode() - { - #region Starting - CGSize PopUpSize = new CGSize(PopUpWidth, PopUpHeight); - CustomPopUpInit(PopUpSize, (nfloat) FrameRadius); - #endregion - - // Here write your PopUp code and declare the objects - - UIButton btnClose = new UIButton(UIButtonType.System); - nfloat btnHeight = 40; - btnClose.SetTitle("Close", UIControlState.Normal); - btnClose.Frame = new CGRect(0, this.Frame.Height - btnHeight, this.Frame.Width, btnHeight); - btnClose.TouchUpInside += delegate { - Close(); - }; - - - btnClose.TitleShadowOffset = new CGSize(0, 1); - this.BackgroundColor = UIColor.White; - btnClose.BackgroundColor = UIColor.White; - btnClose.TintColor = UIColor.Black; - btnClose.Font = UIFont.FromName("Futura", 30); - - this.AddSubview(btnClose); - - - #region Initializing - //IMPORTANT! DO NOT CHANGE THIS! - await Init(); - #endregion - } - } -} diff --git a/CustomPopUps.iOS.sln b/CustomPopUps.iOS.sln new file mode 100644 index 0000000..3244993 --- /dev/null +++ b/CustomPopUps.iOS.sln @@ -0,0 +1,73 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.6.30114.105 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomPopUps", "CustomPopUps\CustomPopUps.csproj", "{E50C90AE-46EE-4D82-BA91-723EC7C9621D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test.iOS", "Test.iOS\Test.iOS.csproj", "{A24D5A98-38DE-453D-B432-7A3C8CA92DC3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + Debug|iPhoneSimulator = Debug|iPhoneSimulator + Release|iPhoneSimulator = Release|iPhoneSimulator + Debug|iPhone = Debug|iPhone + Release|iPhone = Release|iPhone + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|x64.ActiveCfg = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|x64.Build.0 = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|x86.ActiveCfg = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|x86.Build.0 = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|Any CPU.Build.0 = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|x64.ActiveCfg = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|x64.Build.0 = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|x86.ActiveCfg = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|x86.Build.0 = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Debug|iPhone.Build.0 = Debug|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|iPhone.ActiveCfg = Release|Any CPU + {E50C90AE-46EE-4D82-BA91-723EC7C9621D}.Release|iPhone.Build.0 = Release|Any CPU + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|x86.Build.0 = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|x64.Build.0 = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|x86.Build.0 = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|iPhone.ActiveCfg = Debug|iPhone + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Debug|iPhone.Build.0 = Debug|iPhone + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|iPhone.ActiveCfg = Release|iPhone + {A24D5A98-38DE-453D-B432-7A3C8CA92DC3}.Release|iPhone.Build.0 = Release|iPhone + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = PrefixedHierarchical + EndGlobalSection +EndGlobal diff --git a/CustomPopUps/.gitignore b/CustomPopUps/.gitignore new file mode 100644 index 0000000..d86ba9f --- /dev/null +++ b/CustomPopUps/.gitignore @@ -0,0 +1,2 @@ +obj/ +bin/ \ No newline at end of file diff --git a/CustomPopUps/BasePopUp.cs b/CustomPopUps/BasePopUp.cs new file mode 100644 index 0000000..3461c84 --- /dev/null +++ b/CustomPopUps/BasePopUp.cs @@ -0,0 +1,70 @@ +using System; +using UIKit; +using CoreGraphics; + +namespace CustomPopUps +{ + public class BasePopUp : UIView + { + public BasePopUp(CGSize size) : base() + { + nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; + nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; + + Frame = new CGRect(new CGPoint(lx, ly), size); + Layer.CornerRadius = Constants.LayerRadius; + + clickOutCloseView.AddGestureRecognizer(new UITapGestureRecognizer(() => Close())); + } + + private UIView clickOutCloseView = new UIView(); + private UIVisualEffectView EffectView = new UIVisualEffectView(UIBlurEffect.FromStyle(Constants.BlurEffect)); + + public delegate void OnCloseHandler(); + public delegate void OnOpenHandler(); + + public event OnCloseHandler OnClose; + public event OnOpenHandler OnOpen; + + public void Show() + { + UIWindow window = UIApplication.SharedApplication.KeyWindow; + + if (window != null) + { + EffectView.Frame = window.Bounds; + + window.EndEditing(true); + window.AddSubview(EffectView); + + clickOutCloseView.BackgroundColor = null; + clickOutCloseView.Frame = window.Frame; + + window.AddSubview(clickOutCloseView); + window.AddSubview(this); + } + + Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); + Animate(Constants.AnimationDuration, delegate { + Transform = CGAffineTransform.MakeScale(1, 1); + EffectView.Alpha = Constants.EffectViewAlpha; + }, delegate { + OnOpen?.Invoke(); + }); + } + + public void Close() + { + Animate(Constants.AnimationDuration, delegate { + Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); + EffectView.Alpha = 0; + }, delegate { + RemoveFromSuperview(); + clickOutCloseView.RemoveFromSuperview(); + EffectView.RemoveFromSuperview(); + + OnClose?.Invoke(); + }); + } + } +} diff --git a/CustomPopUps/Constants.cs b/CustomPopUps/Constants.cs new file mode 100644 index 0000000..7c3f864 --- /dev/null +++ b/CustomPopUps/Constants.cs @@ -0,0 +1,15 @@ +using System; +using UIKit; + +namespace CustomPopUps +{ + public static class Constants + { + public static double AnimationDuration { get; } = 0.15; + public static nfloat EffectViewAlpha { get; } = 0.8f; + + public static nfloat LayerRadius { get; } = 0; + public static UIColor Color { get; } = UIColor.White; + public static UIBlurEffectStyle BlurEffect { get; } = UIBlurEffectStyle.Dark; + } +} diff --git a/CustomPopUps/CustomPopUps.csproj b/CustomPopUps/CustomPopUps.csproj new file mode 100644 index 0000000..4b6e72e --- /dev/null +++ b/CustomPopUps/CustomPopUps.csproj @@ -0,0 +1,50 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {E50C90AE-46EE-4D82-BA91-723EC7C9621D} + {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {a52b8a63-bc84-4b47-910d-692533484892} + Library + CustomPopUps + Resources + CustomPopUps + PackageReference + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + + + full + true + bin\Release + prompt + 4 + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CustomPopUps/PopUp.cs b/CustomPopUps/PopUp.cs new file mode 100644 index 0000000..7628d88 --- /dev/null +++ b/CustomPopUps/PopUp.cs @@ -0,0 +1,16 @@ +using System; +using CoreGraphics; + +namespace CustomPopUps +{ + public class PopUp : BasePopUp + { + public PopUp(CGSize size) : base(size) { + BackgroundColor = Constants.Color; + } + public PopUp(CGSize size, Action init) : this(size) + { + init(this); + } + } +} diff --git a/CustomPopUps/PopUpStack.cs b/CustomPopUps/PopUpStack.cs new file mode 100644 index 0000000..8714efa --- /dev/null +++ b/CustomPopUps/PopUpStack.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; + +namespace CustomPopUps +{ + public class PopUpStack + { + public List PopUps { get; set; } + + public PopUpStack() + { + PopUps = new List(); + } + + public void Add(PopUp pop) + { + PopUps.Add(pop); + } + + public void Show(PopUp popUp) + { + Add(popUp); + Show(PopUps.Count - 1); + } + + public void Show(int index) + { + Hide(index - 1); + PopUps[index].Show(); + } + + public void Remove(int index) + { + Hide(index); + PopUps.RemoveAt(index); + if (index - 1 >= 0) Show(index - 1); + } + + public void Hide(int index) + { + PopUps[index].Close(); + } + } +} diff --git a/Examples/Projects/CustomPopUpDemo/Properties/AssemblyInfo.cs b/CustomPopUps/Properties/AssemblyInfo.cs similarity index 93% rename from Examples/Projects/CustomPopUpDemo/Properties/AssemblyInfo.cs rename to CustomPopUps/Properties/AssemblyInfo.cs index 8156237..c9a4529 100644 --- a/Examples/Projects/CustomPopUpDemo/Properties/AssemblyInfo.cs +++ b/CustomPopUps/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("CustomPopUpDemo")] +[assembly: AssemblyTitle("CustomPopUps")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("CustomPopUpDemo")] +[assembly: AssemblyProduct("CustomPopUps")] [assembly: AssemblyCopyright("Copyright © 2017")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/Examples/PopUpsCode/#1PopBasicCode.txt b/Examples/#1PopBasicCode.txt similarity index 100% rename from Examples/PopUpsCode/#1PopBasicCode.txt rename to Examples/#1PopBasicCode.txt diff --git a/Examples/PopUpsCode/#2ActivityPopCode.txt b/Examples/#2ActivityPopCode.txt similarity index 100% rename from Examples/PopUpsCode/#2ActivityPopCode.txt rename to Examples/#2ActivityPopCode.txt diff --git a/Examples/PopUpsCode/#3WebViewPopCode.txt b/Examples/#3WebViewPopCode.txt similarity index 100% rename from Examples/PopUpsCode/#3WebViewPopCode.txt rename to Examples/#3WebViewPopCode.txt diff --git a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/CustomPopUpViewController.cs b/Examples/Projects/CustomPopUpDemo/CPopupLibrary/CustomPopUpViewController.cs deleted file mode 100644 index 18904be..0000000 --- a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/CustomPopUpViewController.cs +++ /dev/null @@ -1,101 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using UIKit; -using CoreGraphics; -using Foundation; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class CustomPopUpViewController : UIView - { - - public delegate void PopWillCloseHandler(); - - //You can use it to handle the closing PopUp event - public event PopWillCloseHandler PopUpWillClose; - - private UIVisualEffectView effectView = new UIVisualEffectView(UIBlurEffect.FromStyle(UIBlurEffectStyle.Dark)); - - //Initializing PopUp - public void CustomPopUpInit(CGSize size, nfloat? frame_radius = null) - { - //Setting size and makeing effects - nfloat lx = (UIScreen.MainScreen.Bounds.Width - size.Width) / 2; - nfloat ly = (UIScreen.MainScreen.Bounds.Height - size.Height) / 2; - this.Frame = new CGRect(new CGPoint(lx, ly), size); - effectView.Alpha = 0; - } - - //PopUp Showing - public void PopUp( bool animated = true, Action popAnimationFinish = null) - { - //Setting UIWindow to show popup - UIWindow window = UIApplication.SharedApplication.KeyWindow; - //Setting effect view frame - effectView.Frame = window.Bounds; - //Editing windows - window.EndEditing(true); - window.AddSubview(effectView); - window.AddSubview(this); - //Checking if animated - if (animated) - { - //Transforming to 0.1f Scale to make animation - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(1, 1); - effectView.Alpha = 0.8f; - }, delegate { - //Running event (popAnimationFinish) - if (null != popAnimationFinish) - popAnimationFinish(); - }); - } - else - { - //Changing alpha in effect view - effectView.Alpha = 0.8f; - } - } - - //Closing PopUp - public void Close(bool animated = true) - { - //Checking if animated - if (animated) - { - //Animating UIView by Core Grpahics - UIView.Animate(0.15, delegate { - //Making other animations - Transform = CGAffineTransform.MakeScale(0.1f, 0.1f); - effectView.Alpha = 0; - }, delegate { - //Removing from View Controller PopUp and Effects - this.RemoveFromSuperview(); - effectView.RemoveFromSuperview(); - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - }); - } - else - { - //Running event (PopUpWillClose) - if (null != PopUpWillClose) PopUpWillClose(); - } - - } - - } -} \ No newline at end of file diff --git a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/PopUpsObjects.cs b/Examples/Projects/CustomPopUpDemo/CPopupLibrary/PopUpsObjects.cs deleted file mode 100644 index ccbf582..0000000 --- a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/PopUpsObjects.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Threading.Tasks; - -namespace CPopupLibrary -{ - public class PopUpsObjects : CustomPopUpViewController - { - //Working on it... (Alpha) - - public enum AniamtionType - { - Normal, - Slide, - Bounce - } - public enum Animated - { - Yes, - No, - } - } -} diff --git a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/YourCustomizePopup.cs b/Examples/Projects/CustomPopUpDemo/CPopupLibrary/YourCustomizePopup.cs deleted file mode 100644 index 94f92a4..0000000 --- a/Examples/Projects/CustomPopUpDemo/CPopupLibrary/YourCustomizePopup.cs +++ /dev/null @@ -1,99 +0,0 @@ - -// <-----/ FAQ \-----> -// Q. What happen when i do this.ShowPopUp() here? -// A. The app will be show 2 popups, do not reccomended -// Q. Where i can find an updates for this library? -// A. You can find us on github: https://github.com/Mondonno/CustomPopUps.iOS/ -// Q. Where i can find full tutorial how to customize this popup? -// A. Soon we share some tutorials on our project github wiki -// <-----/ FAQ \-----> - -using System; -using System.Threading.Tasks; -using UIKit; -using Foundation; -using CoreGraphics; - -namespace CPopupLibrary -{ - public class YourCustomizePopup : PopUpsObjects - { - //Set your popup size! - public double PopUpWidth = 300; - public double PopUpHeight = 500; - //Set your popup radius! (0 for any radius) SOON! - public nfloat FrameRadius = 10; - - #region PUSS | PopUps System Settings - public async Task ShowPopUp() - { - await YourPopUpCode(); - } - private protected async Task Init() - { - //You can set if you want to get animated popup by changing the true value! - //Adding the PopUp Closing handler - PopUpWillClose += PopWillClose; - - PopUp(true,//Here you can chenge animating! - async delegate { - //Do stuff when the popup will be opened - //Or you can add here handling method - await OpenHandler(); - }); - } - #endregion - - public YourCustomizePopup() - { - - } - - private protected async Task OpenHandler() - { - //This code below will be started when the popup will be opened! - //Do stuff! - - } - private protected async void PopWillClose() - { - //This code below will be started when the PopUp will be Closed! - //Do stuff! - - } - - - - private async Task YourPopUpCode() - { - #region Starting - CGSize PopUpSize = new CGSize(PopUpWidth, PopUpHeight); - CustomPopUpInit(PopUpSize); - #endregion - - // Here write your PopUp code and declare the objects - - UIButton btnClose = new UIButton(UIButtonType.System); - - nfloat btnHeight = 40; - btnClose.SetTitle("Close", UIControlState.Normal); - btnClose.Frame = new CGRect(0, this.Frame.Height - btnHeight, this.Frame.Width, btnHeight); - btnClose.TouchUpInside += delegate { - Close(); - }; - - btnClose.TitleShadowOffset = new CGSize(0, 1); - this.BackgroundColor = UIColor.White; - btnClose.BackgroundColor = UIColor.White; - btnClose.TintColor = UIColor.Black; - btnClose.Font = UIFont.FromName("Futura", 30); - - this.AddSubview(btnClose); - - #region Initializing - //IMPORTANT! DO NOT CHANGE THIS! - await Init(); - #endregion - } - } -} diff --git a/Examples/Projects/CustomPopUpDemo/Main.storyboard b/Examples/Projects/CustomPopUpDemo/Main.storyboard deleted file mode 100644 index a3f40d6..0000000 --- a/Examples/Projects/CustomPopUpDemo/Main.storyboard +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/Examples/Projects/CustomPopUpDemo/ViewController.cs b/Examples/Projects/CustomPopUpDemo/ViewController.cs deleted file mode 100644 index fd6854d..0000000 --- a/Examples/Projects/CustomPopUpDemo/ViewController.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Foundation; -using System; -using UIKit; -using CPopupLibrary; -using CoreGraphics; - -namespace CustomPopUpDemo -{ - public partial class ViewController : UIViewController - { - public ViewController(IntPtr handle) : base(handle) - { - } - public void PopWillClose() - { - - } - public async override void ViewDidLoad() - { - base.ViewDidLoad(); - // Perform any additional setup after loading the view, typically from a nib. - - UILabel label = new UILabel(new CGRect(100, 100, 70, 40)); - label.Font = UIFont.SystemFontOfSize(30); - - this.View.AddSubview(label); - this.View.AddGestureRecognizer(new UITapGestureRecognizer(async () => { - YourCustomizePopup popup = new YourCustomizePopup(); - popup.PopUpWidth = 300; - popup.PopUpHeight = 200; - await popup.ShowPopUp(); - void PopWillClose() - { - label.Text = popup.DemoTextView.Text; - } - popup.PopUpWillClose += PopWillClose; - })); - - - - - - } - - public override void DidReceiveMemoryWarning() - { - base.DidReceiveMemoryWarning(); - // Release any cached data, images, etc that aren't in use. - } - } -} \ No newline at end of file diff --git a/Test.iOS/.gitignore b/Test.iOS/.gitignore new file mode 100644 index 0000000..cbbd0b5 --- /dev/null +++ b/Test.iOS/.gitignore @@ -0,0 +1,2 @@ +bin/ +obj/ \ No newline at end of file diff --git a/Examples/Projects/CustomPopUpDemo/AppDelegate.cs b/Test.iOS/AppDelegate.cs similarity index 98% rename from Examples/Projects/CustomPopUpDemo/AppDelegate.cs rename to Test.iOS/AppDelegate.cs index 2d69832..69a711f 100644 --- a/Examples/Projects/CustomPopUpDemo/AppDelegate.cs +++ b/Test.iOS/AppDelegate.cs @@ -1,7 +1,7 @@ using Foundation; using UIKit; -namespace CustomPopUpDemo +namespace Test.iOS { // The UIApplicationDelegate for the application. This class is responsible for launching the // User Interface of the application, as well as listening (and optionally responding) to application events from iOS. @@ -17,6 +17,7 @@ public bool FinishedLaunching(UIApplication application, NSDictionary launchOpti { // Override point for customization after application launch. // If not required for your application you can safely delete this method + return true; } diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Contents.json rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon1024.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon1024.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon120.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon120.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon152.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon152.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon167.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon167.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon180.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon180.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon20.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon20.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon29.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon29.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon40.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon40.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon58.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon58.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon60.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon60.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon76.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon76.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon80.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon80.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png diff --git a/Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon87.png b/Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Assets.xcassets/AppIcon.appiconset/Icon87.png rename to Test.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png diff --git a/Examples/Projects/CustomPopUpDemo/Entitlements.plist b/Test.iOS/Entitlements.plist similarity index 100% rename from Examples/Projects/CustomPopUpDemo/Entitlements.plist rename to Test.iOS/Entitlements.plist diff --git a/Examples/Projects/CustomPopUpDemo/Info.plist b/Test.iOS/Info.plist similarity index 87% rename from Examples/Projects/CustomPopUpDemo/Info.plist rename to Test.iOS/Info.plist index 14af8d7..8f5b286 100644 --- a/Examples/Projects/CustomPopUpDemo/Info.plist +++ b/Test.iOS/Info.plist @@ -3,9 +3,9 @@ CFBundleDisplayName - CustomPopUpDemo + Test.iOS CFBundleIdentifier - com.companyname.CustomPopUpDemo + com.CustomPopUps.Test-iOS CFBundleShortVersionString 1.0 CFBundleVersion @@ -32,7 +32,7 @@ MinimumOSVersion - 11.1 + 12.0 UIDeviceFamily 1 @@ -63,5 +63,9 @@ XSAppIconAssets Assets.xcassets/AppIcon.appiconset + NSCameraUsageDescription + Need to get a preety nice photo + NSPhotoLibraryUsageDescription + Need to stalk you :) diff --git a/Examples/Projects/CustomPopUpDemo/LaunchScreen.storyboard b/Test.iOS/LaunchScreen.storyboard similarity index 99% rename from Examples/Projects/CustomPopUpDemo/LaunchScreen.storyboard rename to Test.iOS/LaunchScreen.storyboard index f18534b..5d2e905 100644 --- a/Examples/Projects/CustomPopUpDemo/LaunchScreen.storyboard +++ b/Test.iOS/LaunchScreen.storyboard @@ -24,4 +24,4 @@ - \ No newline at end of file + diff --git a/Examples/Projects/CustomPopUpDemo/Main.cs b/Test.iOS/Main.cs similarity index 93% rename from Examples/Projects/CustomPopUpDemo/Main.cs rename to Test.iOS/Main.cs index cf64215..fb48624 100644 --- a/Examples/Projects/CustomPopUpDemo/Main.cs +++ b/Test.iOS/Main.cs @@ -1,6 +1,6 @@ using UIKit; -namespace CustomPopUpDemo +namespace Test.iOS { public class Application { diff --git a/Test.iOS/Main.storyboard b/Test.iOS/Main.storyboard new file mode 100644 index 0000000..28ab6b9 --- /dev/null +++ b/Test.iOS/Main.storyboard @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Test.iOS/Properties/AssemblyInfo.cs b/Test.iOS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..ecd1820 --- /dev/null +++ b/Test.iOS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Test.iOS")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Test.iOS")] +[assembly: AssemblyCopyright("Copyright © 2017")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("50c7b8c9-e664-45af-b88e-0c9b8b9c1be1")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Examples/Projects/CustomPopUpDemo/Resources/LaunchScreen.xib b/Test.iOS/Resources/LaunchScreen.xib similarity index 95% rename from Examples/Projects/CustomPopUpDemo/Resources/LaunchScreen.xib rename to Test.iOS/Resources/LaunchScreen.xib index 77f6ec3..97f5e88 100644 --- a/Examples/Projects/CustomPopUpDemo/Resources/LaunchScreen.xib +++ b/Test.iOS/Resources/LaunchScreen.xib @@ -18,7 +18,7 @@ -