diff --git a/GenZFavouriteSocialMedia/App.xaml b/GenZFavouriteSocialMedia/App.xaml new file mode 100644 index 0000000..58d5812 --- /dev/null +++ b/GenZFavouriteSocialMedia/App.xaml @@ -0,0 +1,15 @@ + + + + + + + + + + + + diff --git a/GenZFavouriteSocialMedia/App.xaml.cs b/GenZFavouriteSocialMedia/App.xaml.cs new file mode 100644 index 0000000..f7e3ea9 --- /dev/null +++ b/GenZFavouriteSocialMedia/App.xaml.cs @@ -0,0 +1,16 @@ + +namespace GenZFavouriteSocialMedia +{ + public partial class App : Application + { + public App() + { + InitializeComponent(); + } + + protected override Window CreateWindow(IActivationState? activationState) + { + return new Window(new MainPage()); + } + } +} diff --git a/GenZFavouriteSocialMedia/AppShell.xaml b/GenZFavouriteSocialMedia/AppShell.xaml new file mode 100644 index 0000000..633c410 --- /dev/null +++ b/GenZFavouriteSocialMedia/AppShell.xaml @@ -0,0 +1,15 @@ + + + + + + diff --git a/GenZFavouriteSocialMedia/AppShell.xaml.cs b/GenZFavouriteSocialMedia/AppShell.xaml.cs new file mode 100644 index 0000000..a2c27e8 --- /dev/null +++ b/GenZFavouriteSocialMedia/AppShell.xaml.cs @@ -0,0 +1,10 @@ +namespace GenZFavouriteSocialMedia +{ + public partial class AppShell : Shell + { + public AppShell() + { + InitializeComponent(); + } + } +} diff --git a/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj new file mode 100644 index 0000000..fd0be12 --- /dev/null +++ b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj @@ -0,0 +1,114 @@ + + + + net9.0-android;net9.0-ios;net9.0-maccatalyst + $(TargetFrameworks);net9.0-windows10.0.19041.0 + + + + + + + Exe + GenZFavouriteSocialMedia + true + true + enable + enable + + + GenZFavouriteSocialMedia + + + com.companyname.genzfavouritesocialmedia + + + 1.0 + 1 + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + 6.5 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj.user b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj.user new file mode 100644 index 0000000..5a9e933 --- /dev/null +++ b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.csproj.user @@ -0,0 +1,16 @@ + + + + False + net9.0-windows10.0.19041.0 + Windows Machine + Emulator + pixel_5_-_api_34 + + + ProjectDebugger + + + ProjectDebugger + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.sln b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.sln new file mode 100644 index 0000000..7eb6c00 --- /dev/null +++ b/GenZFavouriteSocialMedia/GenZFavouriteSocialMedia.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35208.52 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "GenZFavouriteSocialMedia", "GenZFavouriteSocialMedia.csproj", "{E803B9F4-1C88-4532-A374-FC2E0BF42F43}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + Release-Xml|Any CPU = Release-Xml|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Debug|Any CPU.Deploy.0 = Debug|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release|Any CPU.Build.0 = Release|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release|Any CPU.Deploy.0 = Release|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release-Xml|Any CPU.ActiveCfg = Release|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release-Xml|Any CPU.Build.0 = Release|Any CPU + {E803B9F4-1C88-4532-A374-FC2E0BF42F43}.Release-Xml|Any CPU.Deploy.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {93D94DB9-F80D-4CBE-AE53-FE4390891D8A} + EndGlobalSection +EndGlobal diff --git a/GenZFavouriteSocialMedia/MainPage.xaml b/GenZFavouriteSocialMedia/MainPage.xaml new file mode 100644 index 0000000..9d951b8 --- /dev/null +++ b/GenZFavouriteSocialMedia/MainPage.xaml @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GenZFavouriteSocialMedia/MainPage.xaml.cs b/GenZFavouriteSocialMedia/MainPage.xaml.cs new file mode 100644 index 0000000..30c1d4f --- /dev/null +++ b/GenZFavouriteSocialMedia/MainPage.xaml.cs @@ -0,0 +1,26 @@ +namespace GenZFavouriteSocialMedia +{ + public partial class MainPage : ContentPage + { + + public MainPage() + { + InitializeComponent(); + } + + private void SfButton_Clicked(object sender, EventArgs e) + { + if (App.Current != null) + { + if (App.Current.RequestedTheme == AppTheme.Light) + { + App.Current.UserAppTheme = AppTheme.Dark; + } + else + { + App.Current.UserAppTheme = AppTheme.Light; + } + } + } + } +} diff --git a/GenZFavouriteSocialMedia/MauiProgram.cs b/GenZFavouriteSocialMedia/MauiProgram.cs new file mode 100644 index 0000000..af193dc --- /dev/null +++ b/GenZFavouriteSocialMedia/MauiProgram.cs @@ -0,0 +1,34 @@ +using Microsoft.Extensions.Logging; +using Syncfusion.Maui.Toolkit.Hosting; +using Syncfusion.Maui.Core.Hosting; + +namespace GenZFavouriteSocialMedia +{ + public static class MauiProgram + { + public static MauiApp CreateMauiApp() + { + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .ConfigureSyncfusionToolkit() + .ConfigureSyncfusionCore() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + fonts.AddFont("Roboto-Medium.ttf", "RobotoMedium"); + fonts.AddFont("Roboto-Regular.ttf", "RobotoRegular"); + fonts.AddFont("Inter-Regular.ttf", "InterRegular"); + fonts.AddFont("Inter-Medium.ttf", "InterMedium"); + fonts.AddFont("Segoe-UI-Regular.ttf", "SegoeUIRegular"); + }); + +#if DEBUG + builder.Logging.AddDebug(); +#endif + + return builder.Build(); + } + } +} diff --git a/GenZFavouriteSocialMedia/Model/SocialMediaPlatform.cs b/GenZFavouriteSocialMedia/Model/SocialMediaPlatform.cs new file mode 100644 index 0000000..26bd48c --- /dev/null +++ b/GenZFavouriteSocialMedia/Model/SocialMediaPlatform.cs @@ -0,0 +1,9 @@ +namespace GenZFavouriteSocialMedia +{ + public class SocialMediaPlatform + { + public string Name { get; set; } = string.Empty; + + public double Popularity { get; set; } + } +} diff --git a/GenZFavouriteSocialMedia/Neumorphism/ChartExtension.cs b/GenZFavouriteSocialMedia/Neumorphism/ChartExtension.cs new file mode 100644 index 0000000..11ede81 --- /dev/null +++ b/GenZFavouriteSocialMedia/Neumorphism/ChartExtension.cs @@ -0,0 +1,70 @@ +using Syncfusion.Maui.Toolkit.Charts; +using System.ComponentModel; + +namespace GenZFavouriteSocialMedia +{ + public class SfNeumorphismColumnSeries : ColumnSeries + { + public SfNeumorphismDrawer Drawable + { + get { return (SfNeumorphismDrawer)GetValue(DrawableProperty); } + set { SetValue(DrawableProperty, value); } + } + + public static readonly BindableProperty DrawableProperty = + BindableProperty.Create(nameof(Drawable), typeof(SfNeumorphismDrawer), typeof(SfNeumorphismColumnSeries), defaultValue: null, propertyChanged: OnDrawablePropertyChanged); + + protected override ChartSegment CreateSegment() + { + return new SfNeumorphismColumnSegment(Drawable); + } + + protected static void OnDrawablePropertyChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is SfNeumorphismColumnSeries series) + { + if (oldValue is SfNeumorphismDrawer oldDrawer) + { + oldDrawer.PropertyChanged -= series.DrawerPropertyChanged; + oldDrawer.Parent = null; + } + + if (newValue is SfNeumorphismDrawer newDrawer) + { + newDrawer.PropertyChanged += series.DrawerPropertyChanged; + newDrawer.Parent = series; + } + } + } + + private void DrawerPropertyChanged(object? sender, PropertyChangedEventArgs e) + { + } + } + + public class SfNeumorphismColumnSegment : ColumnSegment + { + + private SfNeumorphismDrawer Drawable; + + public SfNeumorphismColumnSegment(SfNeumorphismDrawer drawable) + { + Drawable = drawable; + } + + protected override void Draw(ICanvas canvas) + { + if (Series is ColumnSeries series && series.ActualYAxis is NumericalAxis yAxis) + { + var top = yAxis.ValueToPoint(Convert.ToDouble(yAxis.Maximum ?? double.NaN)); + + var trackRect = new RectF() { Left = Left, Top = top, Right = Right, Bottom = Bottom }; + + Drawable.Draw(canvas, trackRect); + } + + base.Draw(canvas); + } + + } +} diff --git a/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphicContentView.cs b/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphicContentView.cs new file mode 100644 index 0000000..49211ae --- /dev/null +++ b/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphicContentView.cs @@ -0,0 +1,86 @@ +using System.ComponentModel; + +namespace GenZFavouriteSocialMedia; + +public class SfNeumorphicContentView : ContentView +{ + internal readonly Grid grid; + + internal readonly GraphicsView graphicsView; + + public static readonly BindableProperty DrawableProperty = BindableProperty.Create(nameof(Drawable), typeof(SfNeumorphismDrawer), typeof(SfNeumorphicContentView), defaultValue: null, propertyChanged: OnDrawablePropertyChanged); + + public static readonly new BindableProperty ContentProperty = BindableProperty.Create(nameof(Content), typeof(View), typeof(SfNeumorphicContentView), defaultValue: null, propertyChanged: OnContentPropertyChanged); + + public SfNeumorphismDrawer Drawable + { + get { return (SfNeumorphismDrawer)GetValue(DrawableProperty); } + set { SetValue(DrawableProperty, value); } + } + + public new View Content + { + get { return (View)GetValue(ContentProperty); } + set { SetValue(ContentProperty, value); } + } + + public SfNeumorphicContentView() + { + graphicsView = new GraphicsView(); + graphicsView.SetBinding(GraphicsView.DrawableProperty, new Binding() { Path = nameof(Drawable), Source = this }); + grid = new Grid() { }; + grid.Children.Add(graphicsView); + base.Content = grid; + } + + static void OnDrawablePropertyChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is SfNeumorphicContentView view) + { + if (view.graphicsView == null) return; + + if (oldValue is SfNeumorphismDrawer oldDrawer) + { + oldDrawer.PropertyChanged -= view.Drawer_PropertyChanged; + oldDrawer.Parent = null; + } + + if (newValue is SfNeumorphismDrawer newDrawer) + { + newDrawer.PropertyChanged += view.Drawer_PropertyChanged; + newDrawer.Parent = view; + } + + view.graphicsView.Drawable = newValue as IDrawable; + view.graphicsView.Invalidate(); // Redraws the content + } + } + + void Drawer_PropertyChanged(object? sender, PropertyChangedEventArgs e) + { + graphicsView.Invalidate(); + } + + static void OnContentPropertyChanged(BindableObject bindable, object oldValue, object newValue) + { + if (bindable is SfNeumorphicContentView view) + { + if (oldValue is View oldView) + { + if (view.grid.Children.Contains(oldView)) + { + view.grid.Children.Remove(oldView); + } + } + + if (newValue is View newView) + { + if (!view.grid.Children.Contains(newView)) + { + view.grid.Children.Add(newView); + } + } + } + } +} + diff --git a/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphismDrawer.cs b/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphismDrawer.cs new file mode 100644 index 0000000..085e3ec --- /dev/null +++ b/GenZFavouriteSocialMedia/Neumorphism/SfNeumorphismDrawer.cs @@ -0,0 +1,88 @@ +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace GenZFavouriteSocialMedia +{ + public class SfNeumorphismDrawer : Element, IDrawable + { + public static readonly BindableProperty BackgroundProperty = BindableProperty.Create(nameof(Background), typeof(Brush), typeof(SfNeumorphismDrawer), defaultValue: new SolidColorBrush(Colors.Transparent)); + + public static readonly BindableProperty StrokeProperty = BindableProperty.Create(nameof(Stroke), typeof(SolidColorBrush), typeof(SfNeumorphismDrawer), defaultValue: new SolidColorBrush(Colors.Transparent)); + + public static readonly BindableProperty StrokeWidthProperty = BindableProperty.Create(nameof(StrokeWidth), typeof(float), typeof(SfNeumorphismDrawer), defaultValue: 2f); + + public static readonly BindableProperty PaddingProperty = BindableProperty.Create(nameof(Padding), typeof(Thickness), typeof(SfNeumorphismDrawer), defaultValue: new Thickness(0)); + + public static readonly BindableProperty ShadowColorProperty = BindableProperty.Create(nameof(ShadowColor), typeof(Color), typeof(SfNeumorphismDrawer), defaultValue: Colors.Transparent); + + public static readonly BindableProperty ShadowOffsetProperty = BindableProperty.Create(nameof(ShadowOffset), typeof(SizeF), typeof(SfNeumorphismDrawer), defaultValue: new SizeF(0, 0)); + + public static readonly BindableProperty ShadowBlurProperty = BindableProperty.Create(nameof(ShadowBlur), typeof(float), typeof(SfNeumorphismDrawer), defaultValue: 0f); + + public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(CornerRadius), typeof(SfNeumorphismDrawer), defaultValue: new CornerRadius(5)); + + [TypeConverter(typeof(BrushTypeConverter))] + public Brush Background + { + get { return (Brush)GetValue(BackgroundProperty); } + set { SetValue(BackgroundProperty, value); } + } + + public SolidColorBrush Stroke + { + get { return (SolidColorBrush)GetValue(StrokeProperty); } + set { SetValue(StrokeProperty, value); } + } + + public float StrokeWidth + { + get { return (float)GetValue(StrokeWidthProperty); } + set { SetValue(StrokeWidthProperty, value); } + } + + public Thickness Padding + { + get { return (Thickness)GetValue(PaddingProperty); } + set { SetValue(PaddingProperty, value); } + } + + public Color ShadowColor + { + get { return (Color)GetValue(ShadowColorProperty); } + set { SetValue(ShadowColorProperty, value); } + } + + public float ShadowBlur + { + get { return (float)GetValue(ShadowBlurProperty); } + set { SetValue(ShadowBlurProperty, value); } + } + + public SizeF ShadowOffset + { + get { return (SizeF)GetValue(ShadowOffsetProperty); } + set { SetValue(ShadowOffsetProperty, value); } + } + + public CornerRadius CornerRadius + { + get { return (CornerRadius)GetValue(CornerRadiusProperty); } + set { SetValue(CornerRadiusProperty, value); } + } + + public void Draw(ICanvas canvas, RectF dirtyRect) + { + var paddingRect = new RectF() { Left = dirtyRect.Left + (float)Padding.Left, Top = dirtyRect.Top + (float)Padding.Top, Right = dirtyRect.Right - (float)Padding.Right, Bottom = dirtyRect.Bottom - (float)Padding.Bottom }; + double cornerRadius = CornerRadius.TopLeft > paddingRect.Width / 2 ? paddingRect.Width / 2 : CornerRadius.TopLeft; + //To create the Background and Shadow effect + canvas.SetShadow(ShadowOffset, ShadowBlur, ShadowColor.WithAlpha(0.5f)); + canvas.SetFillPaint(Background, paddingRect); + canvas.FillRoundedRectangle(paddingRect, cornerRadius); + //To create the stroke effect for the content view + var strokeRect = new RectF() { Left = paddingRect.Left - StrokeWidth / 2, Top = paddingRect.Top - StrokeWidth / 2, Right = paddingRect.Right + StrokeWidth / 2, Bottom = paddingRect.Bottom + StrokeWidth / 2 }; + canvas.StrokeColor = Stroke.Color; + canvas.StrokeSize = StrokeWidth; + canvas.DrawRoundedRectangle(strokeRect, cornerRadius); + } + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/Android/AndroidManifest.xml b/GenZFavouriteSocialMedia/Platforms/Android/AndroidManifest.xml new file mode 100644 index 0000000..e9937ad --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Android/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Platforms/Android/MainActivity.cs b/GenZFavouriteSocialMedia/Platforms/Android/MainActivity.cs new file mode 100644 index 0000000..46eb03b --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Android/MainActivity.cs @@ -0,0 +1,11 @@ +using Android.App; +using Android.Content.PM; +using Android.OS; + +namespace GenZFavouriteSocialMedia +{ + [Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ScreenOrientation = ScreenOrientation.Landscape, LaunchMode = LaunchMode.SingleTop, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)] + public class MainActivity : MauiAppCompatActivity + { + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/Android/MainApplication.cs b/GenZFavouriteSocialMedia/Platforms/Android/MainApplication.cs new file mode 100644 index 0000000..01d8fbc --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Android/MainApplication.cs @@ -0,0 +1,16 @@ +using Android.App; +using Android.Runtime; + +namespace GenZFavouriteSocialMedia +{ + [Application] + public class MainApplication : MauiApplication + { + public MainApplication(IntPtr handle, JniHandleOwnership ownership) + : base(handle, ownership) + { + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/Android/Resources/values/colors.xml b/GenZFavouriteSocialMedia/Platforms/Android/Resources/values/colors.xml new file mode 100644 index 0000000..c04d749 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Android/Resources/values/colors.xml @@ -0,0 +1,6 @@ + + + #512BD4 + #2B0B98 + #2B0B98 + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Platforms/MacCatalyst/AppDelegate.cs b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/AppDelegate.cs new file mode 100644 index 0000000..7726070 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace GenZFavouriteSocialMedia +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Entitlements.plist b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Entitlements.plist new file mode 100644 index 0000000..de4adc9 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Entitlements.plist @@ -0,0 +1,14 @@ + + + + + + + com.apple.security.app-sandbox + + + com.apple.security.network.client + + + + diff --git a/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Info.plist b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Info.plist new file mode 100644 index 0000000..7268977 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Info.plist @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + UIDeviceFamily + + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Program.cs b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Program.cs new file mode 100644 index 0000000..96ee338 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/MacCatalyst/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace GenZFavouriteSocialMedia +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/Tizen/Main.cs b/GenZFavouriteSocialMedia/Platforms/Tizen/Main.cs new file mode 100644 index 0000000..6593d23 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Tizen/Main.cs @@ -0,0 +1,17 @@ +using Microsoft.Maui; +using Microsoft.Maui.Hosting; +using System; + +namespace GenZFavouriteSocialMedia +{ + internal class Program : MauiApplication + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + + static void Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/Tizen/tizen-manifest.xml b/GenZFavouriteSocialMedia/Platforms/Tizen/tizen-manifest.xml new file mode 100644 index 0000000..4852da9 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Tizen/tizen-manifest.xml @@ -0,0 +1,15 @@ + + + + + + maui-appicon-placeholder + + + + + http://tizen.org/privilege/internet + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml b/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml new file mode 100644 index 0000000..722ebdb --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml @@ -0,0 +1,8 @@ + + + diff --git a/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml.cs b/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml.cs new file mode 100644 index 0000000..fbe3c13 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Windows/App.xaml.cs @@ -0,0 +1,25 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace GenZFavouriteSocialMedia.WinUI +{ + /// + /// Provides application-specific behavior to supplement the default Application class. + /// + public partial class App : MauiWinUIApplication + { + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + this.InitializeComponent(); + } + + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } + +} diff --git a/GenZFavouriteSocialMedia/Platforms/Windows/Package.appxmanifest b/GenZFavouriteSocialMedia/Platforms/Windows/Package.appxmanifest new file mode 100644 index 0000000..64894f1 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Windows/Package.appxmanifest @@ -0,0 +1,46 @@ + + + + + + + + + $placeholder$ + User Name + $placeholder$.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GenZFavouriteSocialMedia/Platforms/Windows/app.manifest b/GenZFavouriteSocialMedia/Platforms/Windows/app.manifest new file mode 100644 index 0000000..fdff00d --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/Windows/app.manifest @@ -0,0 +1,15 @@ + + + + + + + + true/PM + PerMonitorV2, PerMonitor + + + diff --git a/GenZFavouriteSocialMedia/Platforms/iOS/AppDelegate.cs b/GenZFavouriteSocialMedia/Platforms/iOS/AppDelegate.cs new file mode 100644 index 0000000..7726070 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/iOS/AppDelegate.cs @@ -0,0 +1,10 @@ +using Foundation; + +namespace GenZFavouriteSocialMedia +{ + [Register("AppDelegate")] + public class AppDelegate : MauiUIApplicationDelegate + { + protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp(); + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/iOS/Info.plist b/GenZFavouriteSocialMedia/Platforms/iOS/Info.plist new file mode 100644 index 0000000..0e89139 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/iOS/Info.plist @@ -0,0 +1,31 @@ + + + + + LSRequiresIPhoneOS + + UIDeviceFamily + + 1 + 2 + + UIRequiredDeviceCapabilities + + arm64 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + XSAppIconAssets + Assets.xcassets/appicon.appiconset + + diff --git a/GenZFavouriteSocialMedia/Platforms/iOS/Program.cs b/GenZFavouriteSocialMedia/Platforms/iOS/Program.cs new file mode 100644 index 0000000..96ee338 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/iOS/Program.cs @@ -0,0 +1,16 @@ +using ObjCRuntime; +using UIKit; + +namespace GenZFavouriteSocialMedia +{ + public class Program + { + // This is the main entry point of the application. + static void Main(string[] args) + { + // if you want to use a different Application Delegate class from "AppDelegate" + // you can specify it here. + UIApplication.Main(args, null, typeof(AppDelegate)); + } + } +} diff --git a/GenZFavouriteSocialMedia/Platforms/iOS/Resources/PrivacyInfo.xcprivacy b/GenZFavouriteSocialMedia/Platforms/iOS/Resources/PrivacyInfo.xcprivacy new file mode 100644 index 0000000..24ab3b4 --- /dev/null +++ b/GenZFavouriteSocialMedia/Platforms/iOS/Resources/PrivacyInfo.xcprivacy @@ -0,0 +1,51 @@ + + + + + + NSPrivacyAccessedAPITypes + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryFileTimestamp + NSPrivacyAccessedAPITypeReasons + + C617.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategorySystemBootTime + NSPrivacyAccessedAPITypeReasons + + 35F9.1 + + + + NSPrivacyAccessedAPIType + NSPrivacyAccessedAPICategoryDiskSpace + NSPrivacyAccessedAPITypeReasons + + E174.1 + + + + + + diff --git a/GenZFavouriteSocialMedia/Properties/launchSettings.json b/GenZFavouriteSocialMedia/Properties/launchSettings.json new file mode 100644 index 0000000..edf8aad --- /dev/null +++ b/GenZFavouriteSocialMedia/Properties/launchSettings.json @@ -0,0 +1,8 @@ +{ + "profiles": { + "Windows Machine": { + "commandName": "MsixPackage", + "nativeDebugging": false + } + } +} \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Resources/AppIcon/appicon.svg b/GenZFavouriteSocialMedia/Resources/AppIcon/appicon.svg new file mode 100644 index 0000000..9d63b65 --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/AppIcon/appicon.svg @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Resources/AppIcon/appiconfg.svg b/GenZFavouriteSocialMedia/Resources/AppIcon/appiconfg.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/AppIcon/appiconfg.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Medium.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Medium.ttf new file mode 100644 index 0000000..a01f377 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Medium.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Regular.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Regular.ttf new file mode 100644 index 0000000..5e4851f Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/Inter-Regular.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Regular.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Regular.ttf new file mode 100644 index 0000000..2291fcb Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Regular.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Semibold.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Semibold.ttf new file mode 100644 index 0000000..3cbe2f8 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/OpenSans-Semibold.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Medium.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..ac0f908 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Medium.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Regular.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..ddf4bfa Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/Roboto-Regular.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Fonts/Segoe-UI-Regular.ttf b/GenZFavouriteSocialMedia/Resources/Fonts/Segoe-UI-Regular.ttf new file mode 100644 index 0000000..4e98f11 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Fonts/Segoe-UI-Regular.ttf differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/bereal.png b/GenZFavouriteSocialMedia/Resources/Images/bereal.png new file mode 100644 index 0000000..49fa8f9 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/bereal.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/dotnet_bot.png b/GenZFavouriteSocialMedia/Resources/Images/dotnet_bot.png new file mode 100644 index 0000000..f93ce02 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/dotnet_bot.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/facebook.png b/GenZFavouriteSocialMedia/Resources/Images/facebook.png new file mode 100644 index 0000000..75796ac Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/facebook.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/instagram.png b/GenZFavouriteSocialMedia/Resources/Images/instagram.png new file mode 100644 index 0000000..029909d Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/instagram.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/linkedin.png b/GenZFavouriteSocialMedia/Resources/Images/linkedin.png new file mode 100644 index 0000000..4fcaa76 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/linkedin.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/pinterest.png b/GenZFavouriteSocialMedia/Resources/Images/pinterest.png new file mode 100644 index 0000000..1d37f77 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/pinterest.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/reddit.png b/GenZFavouriteSocialMedia/Resources/Images/reddit.png new file mode 100644 index 0000000..bf9ccc5 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/reddit.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/snapchat.png b/GenZFavouriteSocialMedia/Resources/Images/snapchat.png new file mode 100644 index 0000000..91bd10d Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/snapchat.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/tiktok.png b/GenZFavouriteSocialMedia/Resources/Images/tiktok.png new file mode 100644 index 0000000..64a1948 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/tiktok.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/whatsapp.png b/GenZFavouriteSocialMedia/Resources/Images/whatsapp.png new file mode 100644 index 0000000..8efcdab Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/whatsapp.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/x.png b/GenZFavouriteSocialMedia/Resources/Images/x.png new file mode 100644 index 0000000..21ba26e Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/x.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Images/youtube.png b/GenZFavouriteSocialMedia/Resources/Images/youtube.png new file mode 100644 index 0000000..f1fdbc4 Binary files /dev/null and b/GenZFavouriteSocialMedia/Resources/Images/youtube.png differ diff --git a/GenZFavouriteSocialMedia/Resources/Raw/AboutAssets.txt b/GenZFavouriteSocialMedia/Resources/Raw/AboutAssets.txt new file mode 100644 index 0000000..89dc758 --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/Raw/AboutAssets.txt @@ -0,0 +1,15 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories). Deployment of the asset to your application +is automatically handled by the following `MauiAsset` Build Action within your `.csproj`. + + + +These files will be deployed with your package and will be accessible using Essentials: + + async Task LoadMauiAsset() + { + using var stream = await FileSystem.OpenAppPackageFileAsync("AboutAssets.txt"); + using var reader = new StreamReader(stream); + + var contents = reader.ReadToEnd(); + } diff --git a/GenZFavouriteSocialMedia/Resources/Splash/splash.svg b/GenZFavouriteSocialMedia/Resources/Splash/splash.svg new file mode 100644 index 0000000..21dfb25 --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/Splash/splash.svg @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Resources/Styles/Colors.xaml b/GenZFavouriteSocialMedia/Resources/Styles/Colors.xaml new file mode 100644 index 0000000..30307a5 --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/Styles/Colors.xaml @@ -0,0 +1,45 @@ + + + + + + + #512BD4 + #ac99ea + #242424 + #DFD8F7 + #9880e5 + #2B0B98 + + White + Black + #D600AA + #190649 + #1f1f1f + + #E1E1E1 + #C8C8C8 + #ACACAC + #919191 + #6E6E6E + #404040 + #212121 + #141414 + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/GenZFavouriteSocialMedia/Resources/Styles/Styles.xaml b/GenZFavouriteSocialMedia/Resources/Styles/Styles.xaml new file mode 100644 index 0000000..6641e3a --- /dev/null +++ b/GenZFavouriteSocialMedia/Resources/Styles/Styles.xaml @@ -0,0 +1,427 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/GenZFavouriteSocialMedia/ViewModel/SocialMediaAppInfo.cs b/GenZFavouriteSocialMedia/ViewModel/SocialMediaAppInfo.cs new file mode 100644 index 0000000..dbd43ef --- /dev/null +++ b/GenZFavouriteSocialMedia/ViewModel/SocialMediaAppInfo.cs @@ -0,0 +1,27 @@ +using System.Collections.ObjectModel; + +namespace GenZFavouriteSocialMedia +{ + public class SocialMediaAppInfo + { + public ObservableCollection ApplicationData { get; set; } + + public SocialMediaAppInfo() + { + ApplicationData = new ObservableCollection() + { + new SocialMediaPlatform() {Name = "Youtube", Popularity = 93}, + new SocialMediaPlatform() {Name = "Instagram", Popularity = 78}, + new SocialMediaPlatform() {Name = "Facebook", Popularity = 67}, + new SocialMediaPlatform() {Name = "Snapchat", Popularity = 65}, + new SocialMediaPlatform() {Name = "Tiktok", Popularity = 62}, + new SocialMediaPlatform() {Name = "Pinterest", Popularity = 45}, + new SocialMediaPlatform() {Name = "Reddit", Popularity = 44}, + new SocialMediaPlatform() {Name = "X", Popularity = 42}, + new SocialMediaPlatform() {Name = "LinkedIn", Popularity = 32}, + new SocialMediaPlatform() {Name = "WhatsApp", Popularity = 32}, + new SocialMediaPlatform() {Name = "BeReal", Popularity = 12}, + }; + } + } +} diff --git a/README.md b/README.md index 8c6abd2..e38fbb8 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,42 @@ -# Building-a-Neumorphic-Chart-to-Visualize-Gen-Z-s-Favorite-Social-Media-with-Syncfusion-MAUI -Learn how to build a Neumorphic column chart using Syncfusion's .NET MAUI Charts to visualize Gen Z's favorite social media platforms based on U.S. adult usage data. This project features a modern design that adapts to both light and dark themes, creating a sleek and engaging user experience. +# Building a Neumorphic Column Chart to Visualize Gen Z's Favorite Social Media Platforms + +We're excited to demonstrate how to build a visually stunning Neumorphic Column Chart using the [Syncfusion .NET MAUI Charts control](https://www.syncfusion.com/maui-controls/maui-cartesian-charts). This chart provides a modern, sleek way to visualize Gen Z's favorite social media platforms while integrating Neumorphic design principles. + +## Column Chart + +Column charts are ideal for representing and comparing categorical data. With vertical bars to display values, they are intuitive and widely used for data visualization. + +## Add Neumorphic Effects to the Chart +[Syncfusion’s .NET MAUI Cartesian Chart](https://www.syncfusion.com/maui-controls/maui-cartesian-charts) supports customizing the chart's appearance with creative designs. To achieve a Neumorphic look, follow these steps: + +### Background Design +Customize the chart’s background with a Neumorphic effect using a combination of shadows and gradients. Wrap the chart in a NeumorphicContentView for this design. + +### Custom Column Segments +Create a Neumorphic effect for column segments by applying shadows and gradients that adapt to light and dark themes. + +## Apply Gradient Backgrounds to Chart +The Neumorphic style is brought to life using gradient backgrounds for the column segments. Use the LinearGradientBrush to define a smooth gradient that responds dynamically to theme changes. Adjust StartPoint and EndPoint for the gradient’s direction and use GradientStop elements to define precise color transitions. + +## Customizing the Chart for Light and Dark Themes +Adapt the chart seamlessly to light and dark modes using AppThemeBinding. This ensures the Neumorphic design remains consistent and visually appealing across different themes. + +## Visual Appeal +This Neumorphic Column Chart stands out with: + +* Dynamic Neumorphic design. +* Gradient-filled column segments. +* Light and dark theme adaptability. + +![ScreenCapture_20-11-202423 59 00-ezgif com-video-to-gif-converter](https://github.com/user-attachments/assets/c8f893f9-dc8d-45e5-babd-0ade445bf0b4) + +## Troubleshooting +#### Path too long exception +If you encounter a Path Too Long Exception while building the project: + + 1. Close Visual Studio. + 2. Rename the repository to a shorter name. + 3. Rebuild the project. + +## For a step-by-step procedure +Refer to the blog, ["Visualizing Gen Z's Favorite Social Media Platforms with a Neumorphic UI in .NET MAUI"]() for detailed instructions and code examples.