updated launcher icon, code cleanup, target 33
@ -5,14 +5,14 @@ using Android.Webkit;
|
|||||||
|
|
||||||
namespace dashboard
|
namespace dashboard
|
||||||
{
|
{
|
||||||
[Activity(Label = "Mayer Dashboard", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen", LaunchMode = Android.Content.PM.LaunchMode.SingleTask)]
|
[Activity(Label = "@string/app_name", MainLauncher = true, LaunchMode = Android.Content.PM.LaunchMode.SingleTask)]
|
||||||
[IntentFilter(new[] { "android.intent.action.MAIN" }, Categories = new[] { "android.intent.category.HOME", "android.intent.category.DEFAULT" })]
|
[IntentFilter(new[] { "android.intent.action.MAIN" }, Categories = new[] { "android.intent.category.HOME", "android.intent.category.DEFAULT" })]
|
||||||
public class MainActivity : Activity
|
public class MainActivity : Activity
|
||||||
{
|
{
|
||||||
protected override void OnCreate(Bundle savedInstanceState)
|
protected override void OnCreate(Bundle savedInstanceState)
|
||||||
{
|
{
|
||||||
base.OnCreate(savedInstanceState);
|
base.OnCreate(savedInstanceState);
|
||||||
SetContentView(Resource.Layout.Main);
|
SetContentView(Resource.Layout.main);
|
||||||
|
|
||||||
var webView = FindViewById<WebView>(Resource.Id.webView);
|
var webView = FindViewById<WebView>(Resource.Id.webView);
|
||||||
webView.Settings.JavaScriptEnabled = true;
|
webView.Settings.JavaScriptEnabled = true;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="life.mayer.dashboard">
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="life.mayer.dashboard" android:installLocation="auto">
|
||||||
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="28" />
|
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="33" />
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
<application android:allowBackup="true" android:label="@string/app_name" android:theme="@android:style/Theme.Holo"></application>
|
<application android:allowBackup="true" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"></application>
|
||||||
</manifest>
|
</manifest>
|
@ -1,44 +0,0 @@
|
|||||||
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.
|
|
40
dashboard/Resources/Resource.designer.cs
generated
@ -14,7 +14,7 @@ namespace dashboard
|
|||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
|
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "13.0.0.73")]
|
||||||
public partial class Resource
|
public partial class Resource
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -40,11 +40,27 @@ namespace dashboard
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public partial class Id
|
public partial class Color
|
||||||
{
|
{
|
||||||
|
|
||||||
// aapt resource value: 0x7F010000
|
// aapt resource value: 0x7F010000
|
||||||
public const int webView = 2130771968;
|
public const int ic_launcher_background = 2130771968;
|
||||||
|
|
||||||
|
static Color()
|
||||||
|
{
|
||||||
|
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
|
||||||
|
}
|
||||||
|
|
||||||
|
private Color()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public partial class Id
|
||||||
|
{
|
||||||
|
|
||||||
|
// aapt resource value: 0x7F020000
|
||||||
|
public const int webView = 2130837504;
|
||||||
|
|
||||||
static Id()
|
static Id()
|
||||||
{
|
{
|
||||||
@ -59,8 +75,8 @@ namespace dashboard
|
|||||||
public partial class Layout
|
public partial class Layout
|
||||||
{
|
{
|
||||||
|
|
||||||
// aapt resource value: 0x7F020000
|
// aapt resource value: 0x7F030000
|
||||||
public const int Main = 2130837504;
|
public const int main = 2130903040;
|
||||||
|
|
||||||
static Layout()
|
static Layout()
|
||||||
{
|
{
|
||||||
@ -75,8 +91,14 @@ namespace dashboard
|
|||||||
public partial class Mipmap
|
public partial class Mipmap
|
||||||
{
|
{
|
||||||
|
|
||||||
// aapt resource value: 0x7F030000
|
// aapt resource value: 0x7F040000
|
||||||
public const int Icon = 2130903040;
|
public const int ic_launcher = 2130968576;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7F040001
|
||||||
|
public const int ic_launcher_foreground = 2130968577;
|
||||||
|
|
||||||
|
// aapt resource value: 0x7F040002
|
||||||
|
public const int ic_launcher_round = 2130968578;
|
||||||
|
|
||||||
static Mipmap()
|
static Mipmap()
|
||||||
{
|
{
|
||||||
@ -91,8 +113,8 @@ namespace dashboard
|
|||||||
public partial class String
|
public partial class String
|
||||||
{
|
{
|
||||||
|
|
||||||
// aapt resource value: 0x7F040000
|
// aapt resource value: 0x7F050000
|
||||||
public const int app_name = 2130968576;
|
public const int app_name = 2131034112;
|
||||||
|
|
||||||
static String()
|
static String()
|
||||||
{
|
{
|
||||||
|
@ -1,4 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:minWidth="25px" android:minHeight="25px">
|
<LinearLayout
|
||||||
<WebView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/webView" />
|
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:minWidth="25px"
|
||||||
|
android:minHeight="25px">
|
||||||
|
<WebView
|
||||||
|
android:layout_width="match_parent"
|
||||||
|
android:layout_height="match_parent"
|
||||||
|
android:id="@+id/webView" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
5
dashboard/Resources/mipmap-anydpi-v26/ic_launcher.xml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<background android:drawable="@color/ic_launcher_background"/>
|
||||||
|
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
|
||||||
|
</adaptive-icon>
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
BIN
dashboard/Resources/mipmap-hdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 3.6 KiB |
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
BIN
dashboard/Resources/mipmap-mdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
BIN
dashboard/Resources/mipmap-xhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 4.7 KiB |
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
BIN
dashboard/Resources/mipmap-xxhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
BIN
dashboard/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png
Normal file
After Width: | Height: | Size: 11 KiB |
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<resources>
|
<resources>
|
||||||
<string name="app_name">Mayer Dashboard</string>
|
<string name="app_name">Mayer Dashboard</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
4
dashboard/Resources/values/ic_launcher_background.xml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<resources>
|
||||||
|
<color name="ic_launcher_background">#666666</color>
|
||||||
|
</resources>
|
@ -1,4 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
@ -8,7 +8,7 @@
|
|||||||
<OutputType>Library</OutputType>
|
<OutputType>Library</OutputType>
|
||||||
<RootNamespace>dashboard</RootNamespace>
|
<RootNamespace>dashboard</RootNamespace>
|
||||||
<AssemblyName>dashboard</AssemblyName>
|
<AssemblyName>dashboard</AssemblyName>
|
||||||
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
|
<TargetFrameworkVersion>v13.0</TargetFrameworkVersion>
|
||||||
<AndroidApplication>True</AndroidApplication>
|
<AndroidApplication>True</AndroidApplication>
|
||||||
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
|
||||||
<AndroidResgenClass>Resource</AndroidResgenClass>
|
<AndroidResgenClass>Resource</AndroidResgenClass>
|
||||||
@ -25,6 +25,10 @@
|
|||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
<AndroidLinkMode>None</AndroidLinkMode>
|
<AndroidLinkMode>None</AndroidLinkMode>
|
||||||
|
<AotAssemblies>false</AotAssemblies>
|
||||||
|
<EnableLLVM>false</EnableLLVM>
|
||||||
|
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
|
||||||
|
<BundleAssemblies>false</BundleAssemblies>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
<DebugSymbols>true</DebugSymbols>
|
<DebugSymbols>true</DebugSymbols>
|
||||||
@ -48,18 +52,12 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="Resources\AboutResources.txt" />
|
|
||||||
<None Include="Properties\AndroidManifest.xml" />
|
<None Include="Properties\AndroidManifest.xml" />
|
||||||
<None Include="Assets\AboutAssets.txt" />
|
<None Include="Assets\AboutAssets.txt" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AndroidResource Include="Resources\layout\Main.axml" />
|
<AndroidResource Include="Resources\layout\main.axml" />
|
||||||
<AndroidResource Include="Resources\values\Strings.xml" />
|
<AndroidResource Include="Resources\values\strings.xml" />
|
||||||
<AndroidResource Include="Resources\mipmap-hdpi\Icon.png" />
|
|
||||||
<AndroidResource Include="Resources\mipmap-mdpi\Icon.png" />
|
|
||||||
<AndroidResource Include="Resources\mipmap-xhdpi\Icon.png" />
|
|
||||||
<AndroidResource Include="Resources\mipmap-xxhdpi\Icon.png" />
|
|
||||||
<AndroidResource Include="Resources\mipmap-xxxhdpi\Icon.png" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Resources\mipmap-hdpi\" />
|
<Folder Include="Resources\mipmap-hdpi\" />
|
||||||
|