Esempio n. 1
0
 public override WindowInsets OnApplyWindowInsets(WindowInsets insets)
 {
     if (Build.VERSION.SdkInt >= Build.VERSION_CODES.Lollipop)
     {
         int paddingSize = insets.SystemWindowInsetBottom;
         int barSize     = mNavigationView.DefaultBarSize;
         paddingSize = paddingSize == barSize ? 0 : paddingSize;
         mContentLayout.SetPaddingRelative(0, 0, 0, paddingSize);
         RelativeLayout.LayoutParams layoutParams = (LayoutParams)mContentLayout.LayoutParameters;
         if (paddingSize > 0 && !mNavigationView.Landscape)
         {
             layoutParams.BottomMargin = -barSize;
         }
         else
         {
             layoutParams.BottomMargin = 0;
         }
         return(base.OnApplyWindowInsets(insets.ReplaceSystemWindowInsets(0, 0, 0, 0)));
     }
     else
     {
         return(insets);
     }
 }