message: Remove left padding on Toolbar to align TitleBarView correctly.
diff: package com.navigation.reactnative;
  +import android.content.Context;
  +import android.content.res.Resources;
  +import android.content.res.TypedArray;
  import android.view.MenuItem;
  import android.view.View;
  @@ -47,11 +50,14 @@ public class NavigationBarManager extends ViewGroupManager<NavigationBarView> {
  Toolbar.LayoutParams.MATCH_PARENT
  );
  parent.toolbar.addView(child, index, layoutParams);
  + parent.toolbar.setContentInsetsRelative(0, 0);
  }
  @Override
  public void removeViewAt(NavigationBarView parent, int index) {
  parent.toolbar.removeViewAt(index);
  + int[] insets = getDefaultContentInsets(parent.getContext());
  + parent.toolbar.setContentInsetsRelative(insets[0], insets[1]);
  }
  @ReactProp(name = "title")
  @@ -97,4 +103,49 @@ public class NavigationBarManager extends ViewGroupManager<NavigationBarView> {
  "always", MenuItem.SHOW_AS_ACTION_ALWAYS,
  "ifRoom", MenuItem.SHOW_AS_ACTION_IF_ROOM));
  }
  +
  + private int[] getDefaultContentInsets(Context context) {
  + Resources.Theme theme = context.getTheme();
  + TypedArray toolbarStyle = null;
  + TypedArray contentInsets = null;
  +
  + try {
  + toolbarStyle =
  + theme.obtainStyledAttributes(new int[] {getIdentifier(context, "toolbarStyle")});
  +
  + int toolbarStyleResId = toolbarStyle.getResourceId(0, 0);
  +
  + contentInsets =
  + theme.obtainStyledAttributes(
  + toolbarStyleResId,
  + new int[] {
  + getIdentifier(context, "contentInsetStart"),
  + getIdentifier(context, "contentInsetEnd"),
  + });
  +
  + int contentInsetStart = contentInsets.getDimensionPixelSize(0, 0);
  + int contentInsetEnd = contentInsets.getDimensionPixelSize(1, 0);
  +
  + return new int[] {contentInsetStart, contentInsetEnd};
  + } finally {
  + recycleQuietly(toolbarStyle);
  + recycleQuietly(contentInsets);
  + }
  +
  + }
  +
  + private static void recycleQuietly(@Nullable TypedArray style) {
  + if (style != null) {
  + style.recycle();
  + }
  + }
  +
  + /**
  + * The appcompat-v7 BUCK dep is listed as a provided_dep, which complains that
  + * com.facebook.react.R doesn't exist. Since the attributes provided from a parent, we can access
  + * those attributes dynamically.
  + */
  + private static int getIdentifier(Context context, String name) {
  + return context.getResources().getIdentifier(name, "attr", context.getPackageName());
  + }
  }
  