/*
 * Copyright 2019 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package io.material.catalog.bottomnav;

import io.material.catalog.R;

import android.os.Bundle;
import androidx.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import io.material.catalog.feature.DemoFragment;

/**
 * A fragment that displays a bottom nav that uses {@link
 * android.graphics.drawable.AnimatedStateListDrawable} for icons.
 */
public class BottomNavigationAnimatedDemoFragment extends DemoFragment {

  @Override
  public View onCreateDemoView(
      LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) {
    View view =
        layoutInflater.inflate(
            R.layout.cat_bottom_navs_animated, viewGroup, false /* attachToRoot */);
    return view;
  }
}

@@ -739,24 +739,91 @@
 n.Nullable;%0A
+import androidx.core.view.ViewCompat;%0Aimport android.view.Gravity;%0A
 import andro
@@ -903,16 +903,149 @@
 wGroup;%0A
+import androidx.coordinatorlayout.widget.CoordinatorLayout;%0Aimport androidx.coordinatorlayout.widget.CoordinatorLayout.LayoutParams;%0A
 import i
@@ -1585,11 +1585,683 @@
 iew;%0A  %7D
+%0A%0A  @Nullable%0A  @Override%0A  public View onCreateView(%0A      LayoutInflater layoutInflater, @Nullable ViewGroup viewGroup, @Nullable Bundle bundle) %7B%0A    View view = super.onCreateView(layoutInflater, viewGroup, bundle);%0A    CoordinatorLayout coordinatorLayout = view.findViewById(R.id.cat_demo_fragment_container);%0A    // For unknown reasons, setting this in the xml is cleared out but setting it here takes effect.%0A    CoordinatorLayout.LayoutParams lp =%0A        (LayoutParams) coordinatorLayout.getChildAt(0).getLayoutParams();%0A    lp.gravity = Gravity.BOTTOM;%0A    ViewCompat.setOnApplyWindowInsetsListener(coordinatorLayout, (v, insets) -%3E insets);%0A    return view;%0A  %7D
 %0A%7D%0A

Update BottomNavigationAnimatedDemoFragment to support edge to edge.