Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual Challenge - Twitter #54

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions VisualChallenge/VisualChallenge.Android/MainActivity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,9 @@ protected override void OnCreate(Bundle savedInstanceState)

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental", "FastRenderers_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);
LoadApplication(new App());
global::Xamarin.Forms.FormsMaterial.Init(this, savedInstanceState);

LoadApplication(new App());
}
}
}
31 changes: 31 additions & 0 deletions VisualChallenge/VisualChallenge.Android/NoShiftEffect.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using Android.App;
using Android.Support.Design.BottomNavigation;
using Android.Support.Design.Widget;
using Android.Views;
using VisualChallenge.Droid;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ResolutionGroupName("VisualChallenge")]
[assembly: ExportEffect(typeof(NoShiftEffect), "NoShiftEffect")]
namespace VisualChallenge.Droid
{
public class NoShiftEffect : PlatformEffect
{
protected override void OnAttached()
{
if (!(Container.GetChildAt(0) is ViewGroup layout))
return;

if (!(layout.GetChildAt(1) is BottomNavigationView bottomNavigationView))
return;

// This is what we set to adjust if the shifting happens
bottomNavigationView.LabelVisibilityMode = LabelVisibilityMode.LabelVisibilityLabeled;
}

protected override void OnDetached()
{
}
}
}
Loading