Skip to content

Commit

Permalink
Sample added
Browse files Browse the repository at this point in the history
  • Loading branch information
swethasf3977 committed Dec 4, 2023
1 parent 07370af commit 9cd35f2
Show file tree
Hide file tree
Showing 39 changed files with 1,122 additions and 0 deletions.
14 changes: 14 additions & 0 deletions AvatarViewSample/App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version = "1.0" encoding = "UTF-8" ?>
<Application xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AvatarViewSample"
x:Class="AvatarViewSample.App">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Resources/Styles/Colors.xaml" />
<ResourceDictionary Source="Resources/Styles/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
9 changes: 9 additions & 0 deletions AvatarViewSample/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace AvatarViewSample {
public partial class App : Application {
public App() {
InitializeComponent();

MainPage = new AppShell();
}
}
}
15 changes: 15 additions & 0 deletions AvatarViewSample/AppShell.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Shell
x:Class="AvatarViewSample.AppShell"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:AvatarViewSample"
Shell.FlyoutBehavior="Disabled"
Title="AvatarViewSample">

<ShellContent
Title="Home"
ContentTemplate="{DataTemplate local:MainPage}"
Route="MainPage" />

</Shell>
7 changes: 7 additions & 0 deletions AvatarViewSample/AppShell.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace AvatarViewSample {
public partial class AppShell : Shell {
public AppShell() {
InitializeComponent();
}
}
}
80 changes: 80 additions & 0 deletions AvatarViewSample/AvatarViewSample.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net8.0-windows10.0.19041.0</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net8.0-tizen</TargetFrameworks> -->

<!-- Note for MacCatalyst:
The default runtime is maccatalyst-x64, except in Release config, in which case the default is maccatalyst-x64;maccatalyst-arm64.
When specifying both architectures, use the plural <RuntimeIdentifiers> instead of the singular <RuntimeIdentifer>.
The Mac App Store will NOT accept apps with ONLY maccatalyst-arm64 indicated;
either BOTH runtimes must be indicated or ONLY macatalyst-x64. -->
<!-- For example: <RuntimeIdentifiers>maccatalyst-x64;maccatalyst-arm64</RuntimeIdentifiers> -->

<OutputType>Exe</OutputType>
<RootNamespace>AvatarViewSample</RootNamespace>
<UseMaui>true</UseMaui>
<SingleProject>true</SingleProject>
<ImplicitUsings>enable</ImplicitUsings>

<!-- Display name -->
<ApplicationTitle>AvatarViewSample</ApplicationTitle>

<!-- App Identifier -->
<ApplicationId>com.companyname.avatarviewsample</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">11.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">13.1</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" />

<!-- Splash Screen -->
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" />

<!-- Images -->
<MauiImage Include="Resources\Images\*" />
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" />

<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />

<!-- Raw Assets (also remove the "Resources\Raw" prefix) -->
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\Fonts\SegmentIcon.ttf" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Maui.Controls.Compatibility" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="8.0.0-rc.2.23479.6" />
<PackageReference Include="Syncfusion.Maui.Core" Version="23.2.6" />
<PackageReference Include="Syncfusion.Maui.TabView" Version="23.2.6" />
</ItemGroup>

<!-- Build Properties must be defined within these property groups to ensure successful publishing
to the Mac App Store. See: https://aka.ms/maui-publish-app-store#define-build-properties-in-your-project-file -->
<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Debug'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Debug.plist</CodesignEntitlements>
</PropertyGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-maccatalyst')) and '$(Configuration)' == 'Release'">
<CodesignEntitlements>Platforms/MacCatalyst/Entitlements.Release.plist</CodesignEntitlements>
<UseHardenedRuntime>true</UseHardenedRuntime>
</PropertyGroup>
</Project>
18 changes: 18 additions & 0 deletions AvatarViewSample/AvatarViewSample.csproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<IsFirstTimeProjectOpen>False</IsFirstTimeProjectOpen>
<ActiveDebugFramework>net8.0-windows10.0.19041.0</ActiveDebugFramework>
<ActiveDebugProfile>Windows Machine</ActiveDebugProfile>
<SelectedPlatformGroup>Emulator</SelectedPlatformGroup>
<DefaultDevice>pixel_5_-_api_34</DefaultDevice>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Debug|net8.0-android|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<ItemGroup>
<None Update="Platforms\Windows\Package.appxmanifest">
<SubType>Designer</SubType>
</None>
</ItemGroup>
</Project>
27 changes: 27 additions & 0 deletions AvatarViewSample/AvatarViewSample.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.8.34212.112
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AvatarViewSample", "AvatarViewSample.csproj", "{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Release|Any CPU.Build.0 = Release|Any CPU
{7A8607D9-6488-4DD8-A6A1-03A7C7D680A1}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {85FCC86B-65AF-4DEF-BFDC-2F33D5365724}
EndGlobalSection
EndGlobal
38 changes: 38 additions & 0 deletions AvatarViewSample/MainPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="AvatarViewSample.MainPage"
xmlns:core="clr-namespace:Syncfusion.Maui.Core;assembly=Syncfusion.Maui.Core"
xmlns:local="clr-namespace:AvatarViewSample">


<Grid>
<core:SfBadgeView
BadgeText="&#xEB52;"
HeightRequest="65"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="65">
<core:SfBadgeView.Content>
<Grid>
<core:SfAvatarView
AvatarName="Alex"
ContentType="Initials"
CornerRadius="25"
HeightRequest="50"
HorizontalOptions="Center"
VerticalOptions="Center"
WidthRequest="50" />
</Grid>
</core:SfBadgeView.Content>
<core:SfBadgeView.BadgeSettings>
<core:BadgeSettings
Position="BottomRight"
FontFamily="SegmentIcon"
Offset="-5,-5" />
</core:SfBadgeView.BadgeSettings>
</core:SfBadgeView>
</Grid>


</ContentPage>
11 changes: 11 additions & 0 deletions AvatarViewSample/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
namespace AvatarViewSample
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
}

}
}
24 changes: 24 additions & 0 deletions AvatarViewSample/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using Microsoft.Extensions.Logging;
using Syncfusion.Maui.Core.Hosting;

namespace AvatarViewSample {
public static class MauiProgram {
public static MauiApp CreateMauiApp() {
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureSyncfusionCore()
.ConfigureFonts(fonts => {
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("SegmentIcon.ttf", "SegmentIcon");
});

#if DEBUG
builder.Logging.AddDebug();
#endif

return builder.Build();
}
}
}
6 changes: 6 additions & 0 deletions AvatarViewSample/Platforms/Android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>
9 changes: 9 additions & 0 deletions AvatarViewSample/Platforms/Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Android.App;
using Android.Content.PM;
using Android.OS;

namespace AvatarViewSample {
[Activity(Theme = "@style/Maui.SplashTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize | ConfigChanges.Density)]
public class MainActivity : MauiAppCompatActivity {
}
}
13 changes: 13 additions & 0 deletions AvatarViewSample/Platforms/Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using Android.App;
using Android.Runtime;

namespace AvatarViewSample {
[Application]
public class MainApplication : MauiApplication {
public MainApplication(IntPtr handle, JniHandleOwnership ownership)
: base(handle, ownership) {
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="colorPrimary">#512BD4</color>
<color name="colorPrimaryDark">#2B0B98</color>
<color name="colorAccent">#2B0B98</color>
</resources>
8 changes: 8 additions & 0 deletions AvatarViewSample/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
using Foundation;

namespace AvatarViewSample {
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate {
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
}
11 changes: 11 additions & 0 deletions AvatarViewSample/Platforms/MacCatalyst/Entitlements.Debug.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- Enable this value to use browser developer tools while debugging.-->
<!-- See https://aka.ms/blazor-hybrid-developer-tools -->
<key>com.apple.security.get-task-allow</key>
<true/>
</dict>
</plist>

12 changes: 12 additions & 0 deletions AvatarViewSample/Platforms/MacCatalyst/Entitlements.Release.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
</dict>
</plist>

38 changes: 38 additions & 0 deletions AvatarViewSample/Platforms/MacCatalyst/Info.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<!-- The Mac App Store requires you specify if the app uses encryption. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/itsappusesnonexemptencryption -->
<!-- <key>ITSAppUsesNonExemptEncryption</key> -->
<!-- Please indicate <true/> or <false/> here. -->

<!-- Specify the category for your app here. -->
<!-- Please consult https://developer.apple.com/documentation/bundleresources/information_property_list/lsapplicationcategorytype -->
<!-- <key>LSApplicationCategoryType</key> -->
<!-- <string>public.app-category.YOUR-CATEGORY-HERE</string> -->
<key>UIDeviceFamily</key>
<array>
<integer>2</integer>
</array>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
<key>XSAppIconAssets</key>
<string>Assets.xcassets/appicon.appiconset</string>
</dict>
</plist>
13 changes: 13 additions & 0 deletions AvatarViewSample/Platforms/MacCatalyst/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
using ObjCRuntime;
using UIKit;

namespace AvatarViewSample {
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));
}
}
}
14 changes: 14 additions & 0 deletions AvatarViewSample/Platforms/Tizen/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using System;

namespace AvatarViewSample {
internal class Program : MauiApplication {
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

static void Main(string[] args) {
var app = new Program();
app.Run(args);
}
}
}
Loading

0 comments on commit 9cd35f2

Please sign in to comment.