What is ScrimInsetsFrameLayout?

What is

I am working in Navigation Drawer with ToolBar,In most of the tutorial they using ScrimInsetsFrameLayout,
For what purpose it use can any one explain breif?

  • Rendering SVG with OpenGL (and OpenGL ES)
  • AlarmManager does not always execute BroadcastReceiver
  • Can't add gms play services 9.0.1, google-services plugin wants 9.0.0
  • How to inhibit “Loud music may harm your hearing…” warning in Android
  • Is there a need to use super.onActivityResult() in onActivityResult()?
  • JSON jsonObject.optString() returns String “null”
  • Edittext in Listview android
  • java.lang.NoSuchMethodError: No interface method sort(Ljava/util/Comparator;) exception in sorting arraylist android
  • Optimal use of BitmapFactory.Options.inSampleSize for speed
  • Why does the play-services-analytics dependency not include GooglePlayServicesUtil or GoogleApiAvailability classes?
  • Difference between android.R.layout.simple_spinner_dropdown_item and android.R.layout.simple_spinner_item
  • Zipalign - Command not found - MAC terminal
  • One Solution collect form web for “What is ScrimInsetsFrameLayout?”

    It is part of a set of classes that appeared first (I think) in Googles iosched. Google have made the source code available on GitHub here.

    Its worth downloading and taking a look at it.

    ScrimInsetsFrameLayout has the comment – A layout that draws something in the insets passed to {@link #fitSystemWindows(Rect)}, i.e. the area above UI chrome
    (status and navigation bars, overlay action bars).

    If you download compile and install the App you can see the DrawerLayout is above the ToolBar and to the edges of the screen. ScrimInsetsFrameLayout is what allows you to do this.

    You can also see that ScrimInsetsFrameLayout extends FrameLayout which in turn extends ViewGroup and View. View has the reference to setFitsSystemWindows which allows you to set android:fitsSystemWindows=”true” in the xml file where you use ScrimInsetsFrameLayout.

    You can do DrawerLayout without it, but the look is very clean and matches Googles objectives for Material Design.

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.