Skip to content

Commit

Permalink
Removed PancakeView (#107)
Browse files Browse the repository at this point in the history
  • Loading branch information
kycuff authored Jul 13, 2022
1 parent 3e81b41 commit ed9d612
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 14 deletions.
4 changes: 4 additions & 0 deletions DemoApp/DemoApp.Android/DemoApp.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/DemoApp.Android/Resources/Resource.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Src/Breadcrumb.Android/Breadcrumb.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
<AotAssemblies>false</AotAssemblies>
<EnableLLVM>false</EnableLLVM>
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
<BundleAssemblies>false</BundleAssemblies>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
Expand Down
2 changes: 1 addition & 1 deletion Src/Breadcrumb.Android/Resources/Resource.designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Src/Breadcrumb/Breadcrumb.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@
<ItemGroup>
<PackageReference Include="Xamarin.CommunityToolkit" Version="2.0.2" />
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2291" />
<PackageReference Include="Xamarin.Forms.PancakeView" Version="1.4.2" />
</ItemGroup>

</Project>
23 changes: 12 additions & 11 deletions Src/Breadcrumb/Breadcrumb.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.Linq;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.PancakeView;
using Xamarin.Forms.Xaml;

namespace Breadcrumb
Expand Down Expand Up @@ -59,11 +58,11 @@ public Color TextColor
}

// Corner radius
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(CornerRadius), typeof(Breadcrumb), new CornerRadius(10));
public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(CornerRadius), typeof(float), typeof(Breadcrumb), 10f);

public CornerRadius CornerRadius
public float CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
get => (float)GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}

Expand Down Expand Up @@ -95,11 +94,11 @@ public Color LastBreadcrumbTextColor
}

// LastBreadcrumbCornerRadius
public static readonly BindableProperty LastBreadcrumbCornerRadiusProperty = BindableProperty.Create(nameof(LastBreadcrumbCornerRadius), typeof(CornerRadius), typeof(Breadcrumb), new CornerRadius(10));
public static readonly BindableProperty LastBreadcrumbCornerRadiusProperty = BindableProperty.Create(nameof(LastBreadcrumbCornerRadius), typeof(float), typeof(Breadcrumb), 10f);

public CornerRadius LastBreadcrumbCornerRadius
public float LastBreadcrumbCornerRadius
{
get => (CornerRadius)GetValue(LastBreadcrumbCornerRadiusProperty);
get => (float)GetValue(LastBreadcrumbCornerRadiusProperty);
set => SetValue(LastBreadcrumbCornerRadiusProperty, value);
}

Expand Down Expand Up @@ -143,7 +142,7 @@ public Breadcrumb()
/// <param name="page"></param>
/// <param name="isLast"></param>
/// <param name="isFirst"></param>
private PancakeView BreadCrumbLabelCreator(Page page, bool isLast, bool isFirst)
private Frame BreadCrumbLabelCreator(Page page, bool isLast, bool isFirst)
{
// Create StackLayout to contain the label within a PancakeView
StackLayout stackLayout = new()
Expand Down Expand Up @@ -186,9 +185,11 @@ private PancakeView BreadCrumbLabelCreator(Page page, bool isLast, bool isFirst)
accessibilityContainer.VerticalOptions = LayoutOptions.Center;
accessibilityContainer.Content = stackLayout;

PancakeView container = new PancakeView
Frame container = new Frame
{
CornerRadius = isLast ? LastBreadcrumbCornerRadius : CornerRadius,
HasShadow = false,
Padding = 0,
Content = accessibilityContainer,
Margin = BreadcrumbMargin
};
Expand Down Expand Up @@ -281,7 +282,7 @@ private void LifecycleEffect_Loaded(object sender, System.EventArgs e)
if (!page.Equals(pages.LastOrDefault()))
{
// Create breadcrumb
PancakeView breadCrumb1 = BreadCrumbLabelCreator(page, false, page.Equals(pages.FirstOrDefault()));
Frame breadCrumb1 = BreadCrumbLabelCreator(page, false, page.Equals(pages.FirstOrDefault()));
// Add tap gesture
if (IsNavigationEnabled)
Expand Down Expand Up @@ -314,7 +315,7 @@ private void LifecycleEffect_Loaded(object sender, System.EventArgs e)
BreadCrumbContainer.ChildAdded += AnimatedStack_ChildAdded;
// Create selectedPage title label
PancakeView breadCrumb2 = BreadCrumbLabelCreator(page, true, page.Equals(pages.FirstOrDefault()));
Frame breadCrumb2 = BreadCrumbLabelCreator(page, true, page.Equals(pages.FirstOrDefault()));
// Move BreadCrumb of selectedPage to start the animation
breadCrumb2.TranslationX = Application.Current.MainPage.Width;
Expand Down

0 comments on commit ed9d612

Please sign in to comment.