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?

  • How to install/replace on Android without using Eclipse
  • Using Android Youtube API to play Live streams
  • Returning from a dialog or activity with result
  • WearableListenerService, onDataChanged() is not called
  • Attempt to invoke virtual method
  • Cannot commit android “gen” folder to Git
  • Related posts:

    Single TextView with multiple colored text
    proguard.cfg file missing
    Google's voice search speech recognition service
    resources.ap_ does not exist when compile my android project
    How to use Robolectric 2.4 in Android Studio 1.1.0 & gradle 2.2.1
    java.lang.ClassCastException: android.view.ViewGroup$LayoutParams cannot be cast to android.widget.R...
  • import android.support.wearable cannot be resolved
  • How to make widget of running application in android?
  • How do I expand CardViews to show more detail like Google Keep cards?
  • Android Compatibility package and getLoaderManager()
  • BaseAdapter notifyDatasetChanged() called but getView() is never called
  • How to put a button inside group item in an ExpandableListView?
  • 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.