forked from Roflin/gamenight
Added initial Uno Platform frontend project.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<application android:allowBackup="true" android:supportsRtl="true"></application>
|
||||
</manifest>
|
||||
@@ -0,0 +1,22 @@
|
||||
To add cross-platform image assets for your Uno Platform app, use the Assets folder
|
||||
in the shared project instead. Assets in this folder are Android-only assets.
|
||||
|
||||
Any raw assets you want to be deployed with your application can be placed in
|
||||
this directory (and child directories) and given a Build Action of "AndroidAsset".
|
||||
|
||||
These files will be deployed with you package and will be accessible using Android's
|
||||
AssetManager, like this:
|
||||
|
||||
public class ReadAsset : Activity
|
||||
{
|
||||
protected override void OnCreate (Bundle bundle)
|
||||
{
|
||||
base.OnCreate (bundle);
|
||||
|
||||
InputStream input = Assets.Open ("my_asset.txt");
|
||||
}
|
||||
}
|
||||
|
||||
Additionally, some Android functions will automatically load asset files:
|
||||
|
||||
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
|
||||
@@ -0,0 +1,43 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Android.OS;
|
||||
using Android.Runtime;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
using Com.Nostra13.Universalimageloader.Core;
|
||||
using Microsoft.UI.Xaml.Media;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace FrontendPlatformUno.Droid
|
||||
{
|
||||
[global::Android.App.ApplicationAttribute(
|
||||
Label = "@string/ApplicationName",
|
||||
Icon = "@mipmap/iconapp",
|
||||
LargeHeap = true,
|
||||
HardwareAccelerated = true,
|
||||
Theme = "@style/AppTheme"
|
||||
)]
|
||||
public class Application : Microsoft.UI.Xaml.NativeApplication
|
||||
{
|
||||
public Application(IntPtr javaReference, JniHandleOwnership transfer)
|
||||
: base(() => new AppHead(), javaReference, transfer)
|
||||
{
|
||||
ConfigureUniversalImageLoader();
|
||||
}
|
||||
|
||||
private static void ConfigureUniversalImageLoader()
|
||||
{
|
||||
// Create global configuration and initialize ImageLoader with this config
|
||||
ImageLoaderConfiguration config = new ImageLoaderConfiguration
|
||||
.Builder(Context)
|
||||
.Build();
|
||||
|
||||
ImageLoader.Instance.Init(config);
|
||||
|
||||
ImageSource.DefaultImageLoader = ImageLoader.Instance.LoadImageAsync;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
using Android.App;
|
||||
using Android.Content.PM;
|
||||
using Android.OS;
|
||||
using Android.Views;
|
||||
using Android.Widget;
|
||||
|
||||
namespace FrontendPlatformUno.Droid
|
||||
{
|
||||
[Activity(
|
||||
MainLauncher = true,
|
||||
ConfigurationChanges = global::Uno.UI.ActivityHelper.AllConfigChanges,
|
||||
WindowSoftInputMode = SoftInput.AdjustNothing | SoftInput.StateHidden
|
||||
)]
|
||||
public class MainActivity : Microsoft.UI.Xaml.ApplicationActivity
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
To add cross-platform image assets for your Uno Platform app, use the Assets folder
|
||||
in the shared project instead. Resources in this folder are Android-only.
|
||||
|
||||
Images, layout descriptions, binary blobs and string dictionaries can be included
|
||||
in your application as resource files. Various Android APIs are designed to
|
||||
operate on the resource IDs instead of dealing with images, strings or binary blobs
|
||||
directly.
|
||||
|
||||
For example, a sample Android app that contains a user interface layout (main.axml),
|
||||
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
|
||||
would keep its resources in the "Resources" directory of the application:
|
||||
|
||||
Resources/
|
||||
drawable/
|
||||
icon.png
|
||||
|
||||
layout/
|
||||
main.axml
|
||||
|
||||
values/
|
||||
strings.xml
|
||||
|
||||
In order to get the build system to recognize Android resources, set the build action to
|
||||
"AndroidResource". The native Android APIs do not operate directly with filenames, but
|
||||
instead operate on resource IDs. When you compile an Android application that uses resources,
|
||||
the build system will package the resources for distribution and generate a class called "R"
|
||||
(this is an Android convention) that contains the tokens for each one of the resources
|
||||
included. For example, for the above Resources layout, this is what the R class would expose:
|
||||
|
||||
public class R {
|
||||
public class drawable {
|
||||
public const int icon = 0x123;
|
||||
}
|
||||
|
||||
public class layout {
|
||||
public const int main = 0x456;
|
||||
}
|
||||
|
||||
public class strings {
|
||||
public const int first_string = 0xabc;
|
||||
public const int second_string = 0xbcd;
|
||||
}
|
||||
}
|
||||
|
||||
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
|
||||
to reference the layout/main.axml file, or R.strings.first_string to reference the first
|
||||
string in the dictionary file values/strings.xml.
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
<string name="Hello">Hello World, Click Me!</string>
|
||||
<string name="ApplicationName">FrontendPlatformUno</string>
|
||||
</resources>
|
||||
@@ -0,0 +1,23 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<resources>
|
||||
<style name="AppTheme" parent="Theme.AppCompat.Light">
|
||||
|
||||
<!-- This removes the ActionBar -->
|
||||
<item name="windowActionBar">false</item>
|
||||
<item name="android:windowActionBar">false</item>
|
||||
<item name="windowNoTitle">true</item>
|
||||
<item name="android:windowNoTitle">true</item>
|
||||
|
||||
<!-- This property is used for the splash screen -->
|
||||
<item name="android:windowSplashScreenBackground">#FFFFFF</item>
|
||||
<item name="android:windowBackground">@drawable/splash_screen</item>
|
||||
<item name="android:windowSplashScreenAnimatedIcon">@drawable/splash_screen</item>
|
||||
<!--<item name="android:windowSplashScreenBehavior">1</item>-->
|
||||
|
||||
</style>
|
||||
<style name="Theme.AppCompat.Translucent">
|
||||
<item name="android:windowIsTranslucent">true</item>
|
||||
<item name="android:windowAnimationStyle">@android:style/Animation</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
@@ -0,0 +1,2 @@
|
||||
# See this for more details: http://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/
|
||||
MONO_GC_PARAMS=bridge-implementation=tarjan,nursery-size=32m,soft-heap-limit=256m
|
||||
Reference in New Issue
Block a user