Skip to content

Commit ee027e1

Browse files
committed
Added csproj changes to generate NuGet packages.
Added bug fix to NavigationFrame in Android where exception thrown during navigate back when on final page in backstack.
1 parent 8306489 commit ee027e1

10 files changed

Lines changed: 114 additions & 28 deletions

File tree

MADE.App.Mvvm/MADE.App.Mvvm.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
7+
<Version>1.0.0.0</Version>
8+
<Authors>MADE Apps</Authors>
9+
<Company>MADE Apps</Company>
10+
<Product>MADE App MVVM Library</Product>
11+
<Description>Making App Development Easier with a collection of common MVVM helpers and extensions for .NET projects across Windows, Android, and iOS.</Description>
12+
<Copyright>Copyright (C) MADE Apps. All rights reserved.</Copyright>
13+
<PackageLicenseUrl>https://github.com/MADE-Apps/MADE-App-Components/blob/master/LICENSE</PackageLicenseUrl>
14+
<PackageProjectUrl>https://github.com/MADE-Apps/MADE-App-Components</PackageProjectUrl>
15+
<PackageIconUrl>https://pbs.twimg.com/profile_images/927154020422160385/6HSRU36P_400x400.jpg</PackageIconUrl>
16+
<RepositoryUrl>https://github.com/MADE-Apps/MADE-App-Components</RepositoryUrl>
17+
<RepositoryType>git</RepositoryType>
18+
<PackageTags>MADE App Development MVVM RelayCommand Data Binding Windows Android iOS Xamarin</PackageTags>
519
</PropertyGroup>
620

721
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

MADE.App.Views.Navigation/MADE.App.Views.Navigation.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,20 @@
2626

2727
<PropertyGroup>
2828
<LogFile>Docfx-$(TargetFramework).log</LogFile>
29+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
30+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
31+
<Version>1.0.0.0</Version>
32+
<Authors>MADE Apps</Authors>
33+
<Company>MADE Apps</Company>
34+
<Product>MADE App View Navigation Library</Product>
35+
<Description>Making App Development Easier with a collection of easy to use components for building page to page navigation for .NET projects across Windows, Android, and iOS.</Description>
36+
<Copyright>Copyright (C) MADE Apps. All rights reserved.</Copyright>
37+
<PackageLicenseUrl>https://github.com/MADE-Apps/MADE-App-Components/blob/master/LICENSE</PackageLicenseUrl>
38+
<PackageProjectUrl>https://github.com/MADE-Apps/MADE-App-Components</PackageProjectUrl>
39+
<RepositoryUrl>https://github.com/MADE-Apps/MADE-App-Components</RepositoryUrl>
40+
<RepositoryType>git</RepositoryType>
41+
<PackageIconUrl>https://pbs.twimg.com/profile_images/927154020422160385/6HSRU36P_400x400.jpg</PackageIconUrl>
42+
<PackageTags>MADE App Development View Navigation Service Frame Windows Android iOS Xamarin</PackageTags>
2943
</PropertyGroup>
3044

3145
<ItemGroup>

MADE.App.Views.Navigation/NavigationFrame.Android.cs

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,23 @@ public void GoBack()
8888
}
8989

9090
NavigationEventArgs currentPageEvent = this.GetNavigationEvent(this.BackStackDepth);
91-
currentPageEvent.NavigationMode = NavigationMode.Back;
91+
if (currentPageEvent != null)
92+
{
93+
currentPageEvent.NavigationMode = NavigationMode.Back;
94+
}
9295

9396
NavigationEventArgs previousPageEvent = this.GetNavigationEvent(this.BackStackDepth - 1);
94-
previousPageEvent.NavigationMode = NavigationMode.Back;
97+
if (previousPageEvent != null)
98+
{
99+
previousPageEvent.NavigationMode = NavigationMode.Back;
100+
}
95101

96102
this.HandleNavigation(
97103
currentPageEvent,
98104
previousPageEvent,
99105
() =>
100106
{
101107
this.RemoveNavigationEvent(this.BackStackDepth);
102-
103108
this.SupportFragmentManager.PopBackStackImmediate();
104109
});
105110
}
@@ -203,11 +208,12 @@ private void HandleNavigation(
203208
navigationAction?.Invoke();
204209

205210
this.currentPage = this.SupportFragmentManager.GetCurrentFragment() as Page;
206-
this.currentPage?.OnNavigatedTo(newNavArgs);
207-
208-
this.CurrentSourcePageParameter = newNavArgs.Parameter;
209-
210-
this.PageNavigated?.Invoke(this, newNavArgs);
211+
if (this.currentPage != null)
212+
{
213+
this.currentPage.OnNavigatedTo(newNavArgs);
214+
this.CurrentSourcePageParameter = newNavArgs.Parameter;
215+
this.PageNavigated?.Invoke(this, newNavArgs);
216+
}
211217
}
212218

213219
private NavigationEventArgs GetNavigationEvent(int key)

MADE.App/MADE.App.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,20 @@
22

33
<PropertyGroup>
44
<TargetFramework>netstandard2.0</TargetFramework>
5+
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
6+
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
7+
<Version>1.0.0.0</Version>
8+
<Authors>MADE Apps</Authors>
9+
<Company>MADE Apps</Company>
10+
<Product>MADE App Common Library</Product>
11+
<Description>Making App Development Easier with a collection of common helpers and extensions for .NET projects across Windows, Android, iOS and Web.</Description>
12+
<Copyright>Copyright (C) MADE Apps. All rights reserved.</Copyright>
13+
<PackageLicenseUrl>https://github.com/MADE-Apps/MADE-App-Components/blob/master/LICENSE</PackageLicenseUrl>
14+
<PackageProjectUrl>https://github.com/MADE-Apps/MADE-App-Components</PackageProjectUrl>
15+
<PackageIconUrl>https://pbs.twimg.com/profile_images/927154020422160385/6HSRU36P_400x400.jpg</PackageIconUrl>
16+
<RepositoryUrl>https://github.com/MADE-Apps/MADE-App-Components</RepositoryUrl>
17+
<RepositoryType>git</RepositoryType>
18+
<PackageTags>MADE App Development Windows Android iOS Xamarin Web</PackageTags>
519
</PropertyGroup>
620

721
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">

MADE.Samples.Android/Fragments/MainFragment.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
public class MainFragment : Page
66
{
7+
public override int LayoutId => Resource.Layout.MainFragment;
78
}
89
}

MADE.Samples.Android/Fragments/SecondFragment.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
public class SecondFragment : Page
66
{
7+
public override int LayoutId => Resource.Layout.SecondFragment;
78
}
89
}

MADE.Samples.Android/MADE.Samples.Android.csproj

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,16 @@
106106
<ItemGroup>
107107
<AndroidResource Include="Resources\values\Colors.xml" />
108108
</ItemGroup>
109+
<ItemGroup>
110+
<AndroidResource Include="Resources\layout\MainFragment.axml">
111+
<SubType>Designer</SubType>
112+
</AndroidResource>
113+
</ItemGroup>
114+
<ItemGroup>
115+
<AndroidResource Include="Resources\layout\SecondFragment.axml">
116+
<SubType>Designer</SubType>
117+
</AndroidResource>
118+
</ItemGroup>
109119
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
110120
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
111121
Other similar extension points exist, see Microsoft.Common.targets.

MADE.Samples.Android/Resources/Resource.Designer.cs

Lines changed: 26 additions & 20 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
<TextView
7+
android:layout_height="wrap_content"
8+
android:layout_width="match_parent"
9+
android:text="Hello from the Main Fragmnet" />
10+
</LinearLayout>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:orientation="vertical"
4+
android:layout_width="match_parent"
5+
android:layout_height="match_parent">
6+
<TextView
7+
android:layout_height="wrap_content"
8+
android:layout_width="match_parent"
9+
android:text="Hello from the Second Fragment" />
10+
</LinearLayout>

0 commit comments

Comments
 (0)