diff --git a/README.md b/README.md index 2582fde..9996c29 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,4 @@ -# dashboard-android-app +# Mayer dashboard -xamarin.android app for tolino \ No newline at end of file +Android App for displaying the dashboard from mayer.life +App created for the tolino e-book reader \ No newline at end of file diff --git a/dashboard.sln b/dashboard.sln new file mode 100644 index 0000000..d35a527 --- /dev/null +++ b/dashboard.sln @@ -0,0 +1,43 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "dashboard", "dashboard\dashboard.csproj", "{5FCA6C48-A707-4298-A32E-45E47EC31451}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {5FCA6C48-A707-4298-A32E-45E47EC31451}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5FCA6C48-A707-4298-A32E-45E47EC31451}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5FCA6C48-A707-4298-A32E-45E47EC31451}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5FCA6C48-A707-4298-A32E-45E47EC31451}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(MonoDevelopProperties) = preSolution + Policies = $0 + $0.DotNetNamingPolicy = $1 + $1.DirectoryNamespaceAssociation = PrefixedHierarchical + $0.TextStylePolicy = $2 + $2.inheritsSet = null + $2.scope = text/x-csharp + $0.CSharpFormattingPolicy = $3 + $3.scope = text/x-csharp + $0.TextStylePolicy = $4 + $4.FileWidth = 80 + $4.TabsToSpaces = True + $4.scope = text/plain + $0.TextStylePolicy = $5 + $5.inheritsSet = null + $5.scope = application/xml + $0.XmlFormattingPolicy = $6 + $6.scope = application/xml + $0.TextStylePolicy = $7 + $7.inheritsSet = null + $7.scope = application/android+xml + $0.XmlFormattingPolicy = $8 + $8.inheritsSet = null + $8.scope = application/android+xml + $0.VersionControlPolicy = $9 + EndGlobalSection +EndGlobal diff --git a/dashboard/Assets/AboutAssets.txt b/dashboard/Assets/AboutAssets.txt new file mode 100644 index 0000000..a9b0638 --- /dev/null +++ b/dashboard/Assets/AboutAssets.txt @@ -0,0 +1,19 @@ +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 your 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"); diff --git a/dashboard/MainActivity.cs b/dashboard/MainActivity.cs new file mode 100644 index 0000000..45f5abf --- /dev/null +++ b/dashboard/MainActivity.cs @@ -0,0 +1,28 @@ +using Android.App; +using Android.OS; +using Android.Webkit; + +namespace dashboard +{ + [Activity(Label = "Mayer Dashboard", MainLauncher = true, Icon = "@mipmap/icon", Theme = "@android:style/Theme.Black.NoTitleBar.Fullscreen", LaunchMode = Android.Content.PM.LaunchMode.SingleTask)] + [IntentFilter(new[] { "android.intent.action.MAIN" }, Categories = new[] { "android.intent.category.HOME", "android.intent.category.DEFAULT" })] + public class MainActivity : Activity + { + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + SetContentView(Resource.Layout.Main); + + var webView = FindViewById(Resource.Id.webView); + webView.Settings.JavaScriptEnabled = true; + + // Use subclassed WebViewClient to hide default chrome (url bar and stuff) + webView.SetWebViewClient(new HybridWebViewClient()); + + webView.LoadUrl("https://mayer.life/dashboard/"); + } + + private class HybridWebViewClient : WebViewClient { } + } +} + diff --git a/dashboard/Properties/AndroidManifest.xml b/dashboard/Properties/AndroidManifest.xml new file mode 100644 index 0000000..e7dd192 --- /dev/null +++ b/dashboard/Properties/AndroidManifest.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/dashboard/Properties/AssemblyInfo.cs b/dashboard/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e4bb019 --- /dev/null +++ b/dashboard/Properties/AssemblyInfo.cs @@ -0,0 +1,27 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using Android.App; + +// Information about this assembly is defined by the following attributes. +// Change them to the values specific to your project. + +[assembly: AssemblyTitle("dashboard")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}". +// The form "{Major}.{Minor}.*" will automatically update the build and revision, +// and "{Major}.{Minor}.{Build}.*" will update just the revision. + +[assembly: AssemblyVersion("1.0.0")] + +// The following attributes are used to specify the signing key for the assembly, +// if desired. See the Mono documentation for more information about signing. + +//[assembly: AssemblyDelaySign(false)] +//[assembly: AssemblyKeyFile("")] diff --git a/dashboard/Resources/AboutResources.txt b/dashboard/Resources/AboutResources.txt new file mode 100644 index 0000000..10f52d4 --- /dev/null +++ b/dashboard/Resources/AboutResources.txt @@ -0,0 +1,44 @@ +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. diff --git a/dashboard/Resources/Resource.designer.cs b/dashboard/Resources/Resource.designer.cs new file mode 100644 index 0000000..3d7798b --- /dev/null +++ b/dashboard/Resources/Resource.designer.cs @@ -0,0 +1,109 @@ +#pragma warning disable 1591 +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +[assembly: global::Android.Runtime.ResourceDesignerAttribute("dashboard.Resource", IsApplication=true)] + +namespace dashboard +{ + + + [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")] + public partial class Resource + { + + static Resource() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + public static void UpdateIdValues() + { + } + + public partial class Attribute + { + + static Attribute() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Attribute() + { + } + } + + public partial class Id + { + + // aapt resource value: 0x7f050000 + public const int webView = 2131034112; + + static Id() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Id() + { + } + } + + public partial class Layout + { + + // aapt resource value: 0x7f030000 + public const int Main = 2130903040; + + static Layout() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Layout() + { + } + } + + public partial class Mipmap + { + + // aapt resource value: 0x7f020000 + public const int Icon = 2130837504; + + static Mipmap() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private Mipmap() + { + } + } + + public partial class String + { + + // aapt resource value: 0x7f040000 + public const int app_name = 2130968576; + + static String() + { + global::Android.Runtime.ResourceIdManager.UpdateIdValues(); + } + + private String() + { + } + } + } +} +#pragma warning restore 1591 diff --git a/dashboard/Resources/layout/Main.axml b/dashboard/Resources/layout/Main.axml new file mode 100644 index 0000000..6295dba --- /dev/null +++ b/dashboard/Resources/layout/Main.axml @@ -0,0 +1,4 @@ + + + + diff --git a/dashboard/Resources/mipmap-hdpi/Icon.png b/dashboard/Resources/mipmap-hdpi/Icon.png new file mode 100644 index 0000000..2a4cce8 Binary files /dev/null and b/dashboard/Resources/mipmap-hdpi/Icon.png differ diff --git a/dashboard/Resources/mipmap-mdpi/Icon.png b/dashboard/Resources/mipmap-mdpi/Icon.png new file mode 100644 index 0000000..2b678c5 Binary files /dev/null and b/dashboard/Resources/mipmap-mdpi/Icon.png differ diff --git a/dashboard/Resources/mipmap-xhdpi/Icon.png b/dashboard/Resources/mipmap-xhdpi/Icon.png new file mode 100644 index 0000000..0a2a17e Binary files /dev/null and b/dashboard/Resources/mipmap-xhdpi/Icon.png differ diff --git a/dashboard/Resources/mipmap-xxhdpi/Icon.png b/dashboard/Resources/mipmap-xxhdpi/Icon.png new file mode 100644 index 0000000..f28ed2a Binary files /dev/null and b/dashboard/Resources/mipmap-xxhdpi/Icon.png differ diff --git a/dashboard/Resources/mipmap-xxxhdpi/Icon.png b/dashboard/Resources/mipmap-xxxhdpi/Icon.png new file mode 100644 index 0000000..d374738 Binary files /dev/null and b/dashboard/Resources/mipmap-xxxhdpi/Icon.png differ diff --git a/dashboard/Resources/values/Strings.xml b/dashboard/Resources/values/Strings.xml new file mode 100644 index 0000000..0432fab --- /dev/null +++ b/dashboard/Resources/values/Strings.xml @@ -0,0 +1,4 @@ + + + Mayer Dashboard + diff --git a/dashboard/dashboard.csproj b/dashboard/dashboard.csproj new file mode 100644 index 0000000..90d567f --- /dev/null +++ b/dashboard/dashboard.csproj @@ -0,0 +1,73 @@ + + + + Debug + AnyCPU + {5FCA6C48-A707-4298-A32E-45E47EC31451} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + dashboard + dashboard + v9.0 + True + Resources\Resource.designer.cs + Resource + Properties\AndroidManifest.xml + Resources + Assets + + + true + full + false + bin\Debug + DEBUG; + prompt + 4 + None + + + true + pdbonly + true + bin\Release + prompt + 4 + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file