Skip to content

Commit

Permalink
Update to Android Support Library 28.0.0.1 and Xamarin Forms 4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
muhaym committed Jun 9, 2019
1 parent 123f092 commit 815f9b8
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 32 deletions.
16 changes: 8 additions & 8 deletions nuget/ElegantTabs.nuspec
@@ -1,7 +1,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>ElegantTabs</id>
<version>0.1.2-pre</version>
<version>0.2.2-pre</version>
<title>Elegant Tabs for Xamarin.Forms</title>
<iconUrl>https://raw.githubusercontent.com/muhaym/ElegantTabs/master/nuget/ElegantTabs.png</iconUrl>
<authors>Abdul Muhaymin Arif</authors>
Expand All @@ -14,24 +14,24 @@
<copyright>Copyright ©2018 Fantacode Solutions LLP</copyright>
<tags>xamarin xamarin.forms badge tab tabbar eleganttabs elegant tabs monodroid Xamarin.iOS android ios</tags>
<releaseNotes>
[0.1.0-pre]
Initial Prelaunch with limited features and potential issues.
[0.1.3-pre]
Minor Fix for Android Renderer
</releaseNotes>
<dependencies>
<group targetFramework="netstandard1.4">
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
<dependency id="Xamarin.Forms" version=" 3.6.0.220655" />
</group>
<group targetFramework="portable-net45+win+wpa81+wp80">
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
<dependency id="Xamarin.Forms" version=" 3.6.0.220655" />
</group>
<group targetFramework="MonoAndroid10">
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
<dependency id="Xamarin.Forms" version=" 3.6.0.220655" />
</group>
<group targetFramework="Xamarin.iOS10">
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
<dependency id="Xamarin.Forms" version=" 3.6.0.220655" />
</group>
<group targetFramework="net45">
<dependency id="Xamarin.Forms" version="3.1.0.583944" />
<dependency id="Xamarin.Forms" version=" 3.6.0.220655" />
</group>
</dependencies>
</metadata>
Expand Down
Expand Up @@ -5,7 +5,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.2.0.839982" />
<PackageReference Include="Xamarin.Forms" Version="4.0.0.482894" />
</ItemGroup>

</Project>
Expand Up @@ -11,6 +11,8 @@
using View = Android.Views.View;
using System.Linq;
using Android.Support.Design.Internal;
using Xamarin.Forms;
using Android.Support.Design.BottomNavigation;

namespace ElegantTabs.Droid
{
Expand Down Expand Up @@ -40,7 +42,7 @@ private int InitLayout()
{
_bottomNavigationView.SetOnNavigationItemSelectedListener(this);
_bottomNavigationView.ItemIconTintList = null;
_bottomNavigationView.SetShiftMode(false, false);
_bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled;
}
if (_bottomTabStrip == null)
{
Expand Down Expand Up @@ -68,7 +70,7 @@ private void UpdateIcons(int selectedIndex)
var icon = Transforms.GetSelectedIcon(page);
if (string.IsNullOrWhiteSpace(icon))
{
menu.GetItem(i).SetIcon(IdFromTitle(page.Icon, ResourceManager.DrawableClass));
menu.GetItem(i).SetIcon(IdFromTitle(page.IconImageSource ?? page.Icon, ResourceManager.DrawableClass));
}
else
{
Expand All @@ -77,17 +79,41 @@ private void UpdateIcons(int selectedIndex)
}
else
{
menu.GetItem(i).SetIcon(IdFromTitle(page.Icon, ResourceManager.DrawableClass));
menu.GetItem(i).SetIcon(IdFromTitle(page.IconImageSource ?? page.Icon, ResourceManager.DrawableClass));
}
}
else
{
menu.GetItem(i).SetIcon(IdFromTitle(page.Icon, ResourceManager.DrawableClass));
menu.GetItem(i).SetIcon(IdFromTitle(page.IconImageSource ?? page.Icon, ResourceManager.DrawableClass));
}
}
UpdateTabs();
}

private int IdFromTitle(ImageSource imageSource, Type type)
{
if (imageSource is FileImageSource)
{
string name = System.IO.Path.GetFileNameWithoutExtension((FileImageSource)imageSource);
int id = GetId(type, name);
return id;
}
else if (imageSource is FontImageSource)
{
throw new Exception("FontImageSource not yet supported");
}
else if (imageSource is StreamImageSource)
{
throw new Exception("StreamImageSource not yet supported");
}
else
{
//imageSource will be UriImageSource
throw new Exception("UriImageSource not yet supported");
}

}

public new bool OnNavigationItemSelected(IMenuItem item)
{
if (Element == null)
Expand All @@ -105,7 +131,7 @@ public new bool OnNavigationItemSelected(IMenuItem item)
Element.CurrentPage = Element.Children[selectedIndex];
UpdateIcons(selectedIndex);
}
else if(_bottomNavigationView.SelectedItemId == item.ItemId)
else if (_bottomNavigationView.SelectedItemId == item.ItemId)
{
UpdateIcons(selectedIndex);
}
Expand Down
Expand Up @@ -16,7 +16,7 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
Expand Down Expand Up @@ -52,14 +52,16 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Android.Support.Design">
<Version>28.0.0.1</Version>
</PackageReference>
<PackageReference Include="Xamarin.Forms">
<Version>3.4.0.1008975</Version>
<Version>4.0.0.482894</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="ElegantTabRenderer.cs" />
<Compile Include="Extension.cs" />
<Compile Include="Helpers.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
Expand Down
@@ -1,5 +1,5 @@
<?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="com.companyname.ElegantTabs.Android">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<application android:label="ElegantTabs.Android"></application>
</manifest>
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="ElegantTabs.Android"></application>
</manifest>
Expand Up @@ -56,7 +56,7 @@ public override void ViewWillAppear(bool animated)

async protected override Task<Tuple<UIImage, UIImage>> GetIcon(Page page)
{
var pageIcon = page.Icon?.File;
var pageIcon = ((FileImageSource)page.IconImageSource).File ?? page.Icon?.File;
if (!string.IsNullOrWhiteSpace(pageIcon))
{
var icon = UIImage.FromBundle(pageIcon);
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props')" />
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.props" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
Expand Down Expand Up @@ -39,16 +39,16 @@
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Xamarin.Forms.Core, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.482894\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
<Reference Include="Xamarin.Forms.Platform, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.482894\lib\Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform.iOS, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.482894\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml, Version=2.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\..\packages\Xamarin.Forms.3.4.0.1008975\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
<HintPath>..\..\packages\Xamarin.Forms.4.0.0.482894\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.iOS" />
</ItemGroup>
Expand All @@ -73,8 +73,8 @@
<PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.props'))" />
<Error Condition="!Exists('..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.targets'))" />
</Target>
<Import Project="..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.3.4.0.1008975\build\Xamarin.Forms.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.4.0.0.482894\build\Xamarin.Forms.targets')" />
</Project>
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="3.4.0.1008975" targetFramework="xamarinios10" />
<package id="Xamarin.Forms" version="4.0.0.482894" targetFramework="xamarinios10" />
</packages>

0 comments on commit 815f9b8

Please sign in to comment.