Example #1
0
 /// <summary>
 /// CollapsingToolbarLayout״̬À¸
 /// </summary>
 /// <param name="activity"></param>
 /// <param name="coordinatorLayout"></param>
 /// <param name="appBarLayout"></param>
 /// <param name="imageView"></param>
 /// <param name="toolbar"></param>
 public static void SetCollapsingToolbar(Activity activity, CoordinatorLayout coordinatorLayout, AppBarLayout appBarLayout, View view, Toolbar toolbar)
 {
     if (Build.VERSION.SdkInt == BuildVersionCodes.Kitkat)
     {
         coordinatorLayout.SetFitsSystemWindows(false);
         appBarLayout.SetFitsSystemWindows(false);
         view.SetFitsSystemWindows(false);
         toolbar.SetFitsSystemWindows(true);
         CollapsingToolbarLayout.LayoutParams lp = (CollapsingToolbarLayout.LayoutParams)toolbar.LayoutParameters;
         lp.Height = (int)(GetStatusBarHeight(activity) +
                           activity.Resources.GetDimension(Resource.Dimension.abc_action_bar_default_height_material));
         toolbar.LayoutParameters = lp;
         SetKKStatusBar(activity, Resource.Color.statusBar);
         SetCollapsingToolbarStatus(appBarLayout);
     }
 }