Skip to content

Commit 5677c27

Browse files
committed
Uno platform
1 parent b7e6e8e commit 5677c27

File tree

104 files changed

+2263
-32
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+2263
-32
lines changed

.vsconfig

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"version": "1.0",
3+
"components": [
4+
"Microsoft.VisualStudio.Component.CoreEditor",
5+
"Microsoft.VisualStudio.Workload.CoreEditor",
6+
"Microsoft.NetCore.Component.Runtime.3.1",
7+
"Microsoft.NetCore.Component.SDK",
8+
"Microsoft.VisualStudio.Component.NuGet",
9+
"Microsoft.VisualStudio.Component.Roslyn.Compiler",
10+
"Microsoft.VisualStudio.Component.Roslyn.LanguageServices",
11+
"Microsoft.NetCore.Component.DevelopmentTools",
12+
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions",
13+
"Microsoft.VisualStudio.Component.DockerTools",
14+
"Microsoft.NetCore.Component.Web",
15+
"Microsoft.Net.ComponentGroup.DevelopmentPrerequisites",
16+
"Microsoft.VisualStudio.Component.TypeScript.4.0",
17+
"Microsoft.VisualStudio.Component.JavaScript.TypeScript",
18+
"Microsoft.VisualStudio.Component.JavaScript.Diagnostics",
19+
"Microsoft.Component.MSBuild",
20+
"Microsoft.VisualStudio.Component.TextTemplating",
21+
"Component.Microsoft.VisualStudio.RazorExtension",
22+
"Microsoft.VisualStudio.Component.IISExpress",
23+
"Microsoft.VisualStudio.Component.SQL.ADAL",
24+
"Microsoft.VisualStudio.Component.SQL.LocalDB.Runtime",
25+
"Microsoft.VisualStudio.Component.Common.Azure.Tools",
26+
"Microsoft.VisualStudio.Component.SQL.CLR",
27+
"Microsoft.VisualStudio.Component.MSODBC.SQL",
28+
"Microsoft.VisualStudio.Component.MSSQL.CMDLnUtils",
29+
"Microsoft.VisualStudio.Component.ManagedDesktop.Core",
30+
"Microsoft.VisualStudio.Component.SQL.SSDT",
31+
"Microsoft.VisualStudio.Component.SQL.DataSources",
32+
"Component.Microsoft.Web.LibraryManager",
33+
"Microsoft.VisualStudio.ComponentGroup.Web",
34+
"Microsoft.VisualStudio.Component.Web",
35+
"Microsoft.VisualStudio.Component.IntelliCode",
36+
"Component.Microsoft.VisualStudio.LiveShare",
37+
"Microsoft.VisualStudio.ComponentGroup.Web.Client",
38+
"Microsoft.Net.ComponentGroup.TargetingPacks.Common",
39+
"Component.Microsoft.VisualStudio.Web.AzureFunctions",
40+
"Microsoft.VisualStudio.ComponentGroup.AzureFunctions",
41+
"Microsoft.VisualStudio.Component.Azure.Compute.Emulator",
42+
"Microsoft.VisualStudio.Component.Azure.Storage.Emulator",
43+
"Microsoft.VisualStudio.Component.Azure.ClientLibs",
44+
"Microsoft.VisualStudio.Component.Azure.AuthoringTools",
45+
"Microsoft.VisualStudio.Component.CloudExplorer",
46+
"Microsoft.VisualStudio.ComponentGroup.Web.CloudTools",
47+
"Microsoft.VisualStudio.Component.DiagnosticTools",
48+
"Microsoft.VisualStudio.Component.EntityFramework",
49+
"Microsoft.VisualStudio.Component.AspNet45",
50+
"Microsoft.VisualStudio.Component.AppInsights.Tools",
51+
"Microsoft.VisualStudio.Component.WebDeploy",
52+
"Microsoft.VisualStudio.Workload.NetWeb",
53+
"Microsoft.VisualStudio.ComponentGroup.Azure.Prerequisites",
54+
"Microsoft.VisualStudio.Component.Azure.Waverton.BuildTools",
55+
"Microsoft.VisualStudio.Component.Azure.Waverton",
56+
"Microsoft.Component.Azure.DataLake.Tools",
57+
"Microsoft.VisualStudio.Component.Azure.Kubernetes.Tools",
58+
"Microsoft.VisualStudio.Component.Azure.ResourceManager.Tools",
59+
"Microsoft.VisualStudio.ComponentGroup.Azure.ResourceManager.Tools",
60+
"Microsoft.VisualStudio.ComponentGroup.Azure.CloudServices",
61+
"Microsoft.VisualStudio.Component.Azure.ServiceFabric.Tools",
62+
"Microsoft.VisualStudio.Workload.Azure",
63+
"Microsoft.VisualStudio.Component.VC.CoreIde",
64+
"Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
65+
"Microsoft.VisualStudio.Component.Graphics.Tools",
66+
"Microsoft.VisualStudio.Component.Windows10SDK.19041",
67+
"Microsoft.VisualStudio.Component.ManagedDesktop.Prerequisites",
68+
"Microsoft.ComponentGroup.Blend",
69+
"Microsoft.VisualStudio.Component.Debugger.JustInTime",
70+
"Microsoft.VisualStudio.ComponentGroup.MSIX.Packaging",
71+
"Microsoft.VisualStudio.Workload.ManagedDesktop",
72+
"Microsoft.VisualStudio.Component.Windows10SDK.18362",
73+
"Microsoft.Component.NetFX.Native",
74+
"Microsoft.VisualStudio.ComponentGroup.UWP.NetCoreAndStandard",
75+
"Microsoft.VisualStudio.Component.Graphics",
76+
"Microsoft.VisualStudio.ComponentGroup.UWP.Xamarin",
77+
"Microsoft.VisualStudio.ComponentGroup.UWP.Support",
78+
"Microsoft.VisualStudio.Component.VC.Tools.ARM64",
79+
"Microsoft.VisualStudio.Component.UWP.VC.ARM64",
80+
"Microsoft.VisualStudio.Component.VC.Tools.ARM",
81+
"Microsoft.VisualStudio.ComponentGroup.UWP.VC",
82+
"Microsoft.VisualStudio.Workload.Universal",
83+
"Component.OpenJDK",
84+
"Microsoft.VisualStudio.Component.MonoDebugger",
85+
"Microsoft.VisualStudio.Component.Merq",
86+
"Component.Xamarin.RemotedSimulator",
87+
"Microsoft.VisualStudio.ComponentGroup.WebToolsExtensions.TemplateEngine",
88+
"Component.Xamarin",
89+
"Component.Android.SDK28",
90+
"Microsoft.VisualStudio.Workload.NetCrossPlat",
91+
"Microsoft.VisualStudio.Workload.NetCoreTools",
92+
"Microsoft.VisualStudio.ComponentGroup.Maui.All",
93+
]
94+
}

NuGet.config

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<configuration>
3+
<packageSources>
4+
<add key="NuGet official package source" value="https://api.nuget.org/v3/index.json" />
5+
</packageSources>
6+
</configuration>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.companyname.SmartImage.App" android:versionCode="1" android:versionName="1.0">
3+
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
4+
<application android:label="SmartImage.App"></application>
5+
</manifest>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
To add cross-platform image assets for your Uno Platform app, use the Assets folder
2+
in the shared project instead. Assets in this folder are Android-only assets.
3+
4+
Any raw assets you want to be deployed with your application can be placed in
5+
this directory (and child directories) and given a Build Action of "AndroidAsset".
6+
7+
These files will be deployed with you package and will be accessible using Android's
8+
AssetManager, like this:
9+
10+
public class ReadAsset : Activity
11+
{
12+
protected override void OnCreate (Bundle bundle)
13+
{
14+
base.OnCreate (bundle);
15+
16+
InputStream input = Assets.Open ("my_asset.txt");
17+
}
18+
}
19+
20+
Additionally, some Android functions will automatically load asset files:
21+
22+
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Binary file not shown.
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
using Android.App;
2+
using Android.Content;
3+
using Android.OS;
4+
using Android.Runtime;
5+
using Android.Views;
6+
using Android.Widget;
7+
using Com.Nostra13.Universalimageloader.Core;
8+
using Microsoft.UI.Xaml.Media;
9+
using System;
10+
using System.Collections.Generic;
11+
using System.Linq;
12+
using System.Text;
13+
14+
namespace SmartImage.App.Droid
15+
{
16+
[global::Android.App.ApplicationAttribute(
17+
Label = "@string/ApplicationName",
18+
Icon = "@mipmap/icon",
19+
LargeHeap = true,
20+
HardwareAccelerated = true,
21+
Theme = "@style/AppTheme"
22+
)]
23+
public class Application : Microsoft.UI.Xaml.NativeApplication
24+
{
25+
public Application(IntPtr javaReference, JniHandleOwnership transfer)
26+
: base(() => new App(), javaReference, transfer)
27+
{
28+
ConfigureUniversalImageLoader();
29+
}
30+
31+
private static void ConfigureUniversalImageLoader()
32+
{
33+
// Create global configuration and initialize ImageLoader with this config
34+
ImageLoaderConfiguration config = new ImageLoaderConfiguration
35+
.Builder(Context)
36+
.Build();
37+
38+
ImageLoader.Instance.Init(config);
39+
40+
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
41+
}
42+
}
43+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
using Android.App;
2+
using Android.Content.PM;
3+
using Android.OS;
4+
using Android.Views;
5+
using Android.Widget;
6+
7+
namespace SmartImage.App
8+
{
9+
[Activity(
10+
MainLauncher = true,
11+
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
12+
WindowSoftInputMode = SoftInput.AdjustPan | SoftInput.StateHidden
13+
)]
14+
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
15+
{
16+
}
17+
}
18+
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
To add cross-platform image assets for your Uno Platform app, use the Assets folder
2+
in the shared project instead. Resources in this folder are Android-only.
3+
4+
Images, layout descriptions, binary blobs and string dictionaries can be included
5+
in your application as resource files. Various Android APIs are designed to
6+
operate on the resource IDs instead of dealing with images, strings or binary blobs
7+
directly.
8+
9+
For example, a sample Android app that contains a user interface layout (main.axml),
10+
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
11+
would keep its resources in the "Resources" directory of the application:
12+
13+
Resources/
14+
drawable/
15+
icon.png
16+
17+
layout/
18+
main.axml
19+
20+
values/
21+
strings.xml
22+
23+
In order to get the build system to recognize Android resources, set the build action to
24+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
25+
instead operate on resource IDs. When you compile an Android application that uses resources,
26+
the build system will package the resources for distribution and generate a class called "R"
27+
(this is an Android convention) that contains the tokens for each one of the resources
28+
included. For example, for the above Resources layout, this is what the R class would expose:
29+
30+
public class R {
31+
public class drawable {
32+
public const int icon = 0x123;
33+
}
34+
35+
public class layout {
36+
public const int main = 0x456;
37+
}
38+
39+
public class strings {
40+
public const int first_string = 0xabc;
41+
public const int second_string = 0xbcd;
42+
}
43+
}
44+
45+
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
46+
to reference the layout/main.axml file, or R.strings.first_string to reference the first
47+
string in the dictionary file values/strings.xml.
2.55 KB
Loading
1.22 KB
Loading

0 commit comments

Comments
 (0)