Skip to content

Commit

Permalink
Migrate Module app to Sample Template
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Jan 10, 2020
1 parent 1a6c263 commit c4716a2
Show file tree
Hide file tree
Showing 171 changed files with 1,098 additions and 555 deletions.
234 changes: 234 additions & 0 deletions 10-Modules/PrismSample.sln

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions 10-Modules/ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Modules

This sample shows a basic use of adding a Module to a Prism Application and manually loading it.
326 changes: 0 additions & 326 deletions 10-Modules/UsingModules.sln

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
using System;

using Android.App;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace UsingModules.Droid
namespace PrismSample.Droid
{
[Activity(Label = "UsingModules", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
[Activity(Theme = "@style/MainTheme",
ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
Expand Down
18 changes: 18 additions & 0 deletions 10-Modules/src/PrismSample.Android/MainApplication.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using Android.App;
using Android.Runtime;

namespace PrismSample.Droid
{
[Application(
Label = "Prism Sample",
Icon = "@mipmap/icon"
)]
public class MainApplication : Application
{
public MainApplication(IntPtr javaReference, JniHandleOwnership transfer)
: base(javaReference, transfer)
{
}
}
}
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
<?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">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{B07C1D9B-3929-49B4-9228-11DCC51F4E44}</ProjectGuid>
<ProjectGuid>{4E987D86-4E13-4BBC-9C3A-69006801D049}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>UsingModules.Droid</RootNamespace>
<AssemblyName>UsingModules.Android</AssemblyName>
<RootNamespace>PrismSample.Droid</RootNamespace>
<AssemblyName>PrismSample.Android</AssemblyName>
<AndroidApplication>True</AndroidApplication>
<AndroidUseIntermediateDesignerFile>true</AndroidUseIntermediateDesignerFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
Expand Down Expand Up @@ -53,11 +52,17 @@
<Reference Include="System.Numerics.Vectors" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms">
<Version>7.2.0.1422</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.3.0.991211" />
<PackageReference Include="Xamarin.Android.Support.Core.Utils" Version="28.0.0.3" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="MainApplication.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="SplashActivity.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
Expand All @@ -81,17 +86,21 @@
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
<AndroidResource Include="Resources\drawable-mdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="Resources\drawable\" />
<ProjectReference Include="..\PrismSample\PrismSample.csproj">
<Project>{5767A715-87A6-4303-9D79-D9E43EAF262E}</Project>
<Name>PrismSample</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UsingModules\UsingModules.csproj">
<Name>UsingModules</Name>
</ProjectReference>
<ProjectReference Include="..\UsingModules.SampleModule\UsingModules.SampleModule.csproj">
<Name>UsingModules.SampleModule</Name>
</ProjectReference>
<AndroidResource Include="Resources\drawable\splash_screen.xml" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
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" android:versionCode="1" android:versionName="1.0" package="com.prismlibrary.modules">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="Prism Modules"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("UsingModules.Android")]
[assembly: AssemblyTitle("PrismSample.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UsingModules.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyProduct("PrismSample.Android")]
[assembly: AssemblyCopyright("Copyright © Prism Library 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/launcher_background"/>
<item>
<bitmap android:gravity="center"
android:src="@drawable/icon" />
</item>
</layer-list>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_background">#FFFFFF</color>
<color name="colorPrimary">#7E7D81</color>
<color name="colorPrimaryDark">#5f5f61</color>
<color name="colorAccent">#00A5F2</color>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,12 @@
<style name="AppCompatDialogStyle" parent="Theme.AppCompat.Light.Dialog">
<item name="colorAccent">#FF4081</item>
</style>

<style name="MainTheme.Splash" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:windowBackground">@drawable/splash_screen</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowFullscreen">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowActionBar">true</item>
</style>
</resources>
29 changes: 29 additions & 0 deletions 10-Modules/src/PrismSample.Android/SplashActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Android.App;
using Android.OS;
using Android.Support.V7.App;
using Android.Content;
using Android.Util;

namespace PrismSample.Droid
{
[Activity(Theme = "@style/MainTheme.Splash",
MainLauncher = true,
NoHistory = true)]
public class SplashActivity : AppCompatActivity
{
static readonly string TAG = "X:" + typeof(SplashActivity).Name;

public override void OnCreate(Bundle savedInstanceState, PersistableBundle persistentState)
{
base.OnCreate(savedInstanceState, persistentState);
Log.Debug(TAG, "SplashActivity.OnCreate");
}

// Launches the startup task
protected override void OnResume()
{
base.OnResume();
StartActivity(new Intent(Application.Context, typeof(MainActivity)));
}
}
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
using Prism.Ioc;
using Prism.Modularity;
using UsingModules.SampleModule.Views;
using UsingModules.SampleModule.ViewModels;
using PrismSample.SampleModule.Views;
using PrismSample.SampleModule.ViewModels;
using Xamarin.Forms.Xaml;

[assembly: XamlCompilation(XamlCompilationOptions.Compile)]
namespace UsingModules.SampleModule
namespace PrismSample.SampleModule
{
public class SampleModule : IModule
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
using Prism.Mvvm;
using Prism.Navigation;

namespace UsingModules.SampleModule.ViewModels
namespace PrismSample.SampleModule.ViewModels
{
public class SamplePageViewModel : BindableBase, INavigationAware
{
private string _title;
public string Title
{
get { return _title; }
set { SetProperty(ref _title, value); }
get => _title;
set => SetProperty(ref _title, value);
}

public void OnNavigatedFrom(INavigationParameters parameters)
Expand All @@ -26,11 +26,5 @@ public void OnNavigatedTo(INavigationParameters parameters)
if (parameters.ContainsKey(parameterName))
Title += " - parameter: " + (string)parameters[parameterName];
}

public void OnNavigatingTo(INavigationParameters parameters)
{
//Called before the implementor has been navigated to - but not called when using
// device hardware or software back buttons.
}
}
}
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="UsingModules.SampleModule.Views.SamplePage"
x:Class="PrismSample.SampleModule.Views.SamplePage"
Title="SamplePage">
<StackLayout HorizontalOptions="Center" VerticalOptions="Center">
<Label Text="{Binding Title}" />
<Label Text="{Binding Title}" />
</StackLayout>
</ContentPage>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace UsingModules.SampleModule.Views
namespace PrismSample.SampleModule.Views
{
public partial class SamplePage
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Application
x:Class="UsingModules.UWP.App"
x:Class="PrismSample.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UsingModules.UWP"
xmlns:local="using:PrismSample.UWP"
RequestedTheme="Light">

</Application>
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace UsingModules.UWP
namespace PrismSample.UWP
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<forms:WindowsPage
x:Class="UsingModules.UWP.MainPage"
x:Class="PrismSample.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:UsingModules.UWP"
xmlns:local="using:PrismSample.UWP"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;

namespace UsingModules.UWP
namespace PrismSample.UWP
{
public sealed partial class MainPage
{
public MainPage()
{
this.InitializeComponent();

LoadApplication(new UsingModules.App());
LoadApplication(new PrismSample.App());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
IgnorableNamespaces="uap mp">

<Identity
Name="be078413-8109-406a-bef7-4df30f20cd4b"
Publisher="CN=049accdb-80d5-4843-ba39-7c7ee53deb63"
Name="b2a0118b-9f2c-4bf5-ae61-b28be0edc25a"
Publisher="CN=bd7518f2-03fc-45a4-b350-42248a9373f1"
Version="1.0.0.0" />

<mp:PhoneIdentity PhoneProductId="ec0cc741-fd3e-485c-81be-68815c480690" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>

<Properties>
<DisplayName>UsingModules.UWP</DisplayName>
<PublisherDisplayName>049accdb-80d5-4843-ba39-7c7ee53deb63</PublisherDisplayName>
<DisplayName>Prism Modules</DisplayName>
<PublisherDisplayName>bd7518f2-03fc-45a4-b350-42248a9373f1</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>

Expand All @@ -30,12 +30,12 @@
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="UsingModules.UWP.App">
EntryPoint="PrismSample.UWP.App">
<uap:VisualElements
DisplayName="UsingModules.UWP"
DisplayName="Prism Modules"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="UsingModules.UWP"
Description="PrismSample.UWP"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
<uap:ShowNameOnTiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{562D9434-B7EA-45AE-9A44-425F672A0D6E}</ProjectGuid>
<ProjectGuid>{A34F7AAD-DE91-4A1A-B5DE-1B1F5769E483}</ProjectGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>UsingModules.UWP</RootNamespace>
<AssemblyName>UsingModules.UWP</AssemblyName>
<RootNamespace>PrismSample.UWP</RootNamespace>
<AssemblyName>PrismSample.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.18362.0</TargetPlatformVersion>
<TargetPlatformVersion>10.0.16299.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
Expand Down Expand Up @@ -143,15 +143,16 @@
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Prism.DryIoc.Forms">
<Version>7.2.0.1422</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms" Version="4.3.0.991211" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9"/>
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.9" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\UsingModules\UsingModules.csproj">
<Name>UsingModules</Name>
</ProjectReference>
<ProjectReference Include="..\UsingModules.SampleModule\UsingModules.SampleModule.csproj">
<Name>UsingModules.SampleModule</Name>
<ProjectReference Include="..\PrismSample\PrismSample.csproj">
<Project>{0C2D6820-FA64-4050-9546-BF034329D363}</Project>
<Name>PrismSample</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
Expand Down
Loading

0 comments on commit c4716a2

Please sign in to comment.