How to set FAB in front of bottom app bar?





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







-2















How can I bring the floating action button in front of the bottom app bar?
In other words, how to set the bottom app bar to fill the entire row behind the fab?



From this:
enter image description here



To this:
enter image description here



Images via medium.com



According to this tutorial there should be an attribute named fabCradleDiameter but in reality there is no such attribute for this component.










share|improve this question

























  • what did you try?

    – Amit Jangid
    Nov 23 '18 at 5:48











  • Use a FrameLayout or one of it's descendants to house your FAB.

    – Taslim Oseni
    Nov 23 '18 at 6:28











  • Please paste your current code to see what have you tried so far..

    – ʍѳђઽ૯ท
    Nov 23 '18 at 7:03


















-2















How can I bring the floating action button in front of the bottom app bar?
In other words, how to set the bottom app bar to fill the entire row behind the fab?



From this:
enter image description here



To this:
enter image description here



Images via medium.com



According to this tutorial there should be an attribute named fabCradleDiameter but in reality there is no such attribute for this component.










share|improve this question

























  • what did you try?

    – Amit Jangid
    Nov 23 '18 at 5:48











  • Use a FrameLayout or one of it's descendants to house your FAB.

    – Taslim Oseni
    Nov 23 '18 at 6:28











  • Please paste your current code to see what have you tried so far..

    – ʍѳђઽ૯ท
    Nov 23 '18 at 7:03














-2












-2








-2








How can I bring the floating action button in front of the bottom app bar?
In other words, how to set the bottom app bar to fill the entire row behind the fab?



From this:
enter image description here



To this:
enter image description here



Images via medium.com



According to this tutorial there should be an attribute named fabCradleDiameter but in reality there is no such attribute for this component.










share|improve this question
















How can I bring the floating action button in front of the bottom app bar?
In other words, how to set the bottom app bar to fill the entire row behind the fab?



From this:
enter image description here



To this:
enter image description here



Images via medium.com



According to this tutorial there should be an attribute named fabCradleDiameter but in reality there is no such attribute for this component.







android android-layout android-styles floating-action-button android-bottomappbar






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 21:39







Mahozad

















asked Nov 21 '18 at 21:02









MahozadMahozad

1,79751335




1,79751335













  • what did you try?

    – Amit Jangid
    Nov 23 '18 at 5:48











  • Use a FrameLayout or one of it's descendants to house your FAB.

    – Taslim Oseni
    Nov 23 '18 at 6:28











  • Please paste your current code to see what have you tried so far..

    – ʍѳђઽ૯ท
    Nov 23 '18 at 7:03



















  • what did you try?

    – Amit Jangid
    Nov 23 '18 at 5:48











  • Use a FrameLayout or one of it's descendants to house your FAB.

    – Taslim Oseni
    Nov 23 '18 at 6:28











  • Please paste your current code to see what have you tried so far..

    – ʍѳђઽ૯ท
    Nov 23 '18 at 7:03

















what did you try?

– Amit Jangid
Nov 23 '18 at 5:48





what did you try?

– Amit Jangid
Nov 23 '18 at 5:48













Use a FrameLayout or one of it's descendants to house your FAB.

– Taslim Oseni
Nov 23 '18 at 6:28





Use a FrameLayout or one of it's descendants to house your FAB.

– Taslim Oseni
Nov 23 '18 at 6:28













Please paste your current code to see what have you tried so far..

– ʍѳђઽ૯ท
Nov 23 '18 at 7:03





Please paste your current code to see what have you tried so far..

– ʍѳђઽ૯ท
Nov 23 '18 at 7:03












3 Answers
3






active

oldest

votes


















1














Yes, there isn't an attribute named fabCradleDiameter, its fabCradleMargin



and make sure the version is after:



com.google.android.material:material:1.0.0-alpha3





share|improve this answer































    1














    Try this it worked for me.. may work for you as well.



    <android.support.design.bottomappbar.BottomAppBar
    android:id="@+id/bottomAppBar"
    style="@style/Widget.MaterialComponents.BottomAppBar"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    app:backgroundTint="@color/colorPrimary"
    app:fabAlignmentMode="center"
    app:fabCradleMargin="0dp"
    app:fabCradleRoundedCornerRadius="0dp"
    app:hideOnScroll="true"
    app:navigationIcon="@drawable/ic_menu_black_24dp" />

    <android.support.design.widget.FloatingActionButton
    android:id="@+id/fab"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="centerCrop"
    android:src="@drawable/ic_favorite_red_24dp"
    app:borderWidth="0dp"
    app:fabSize="normal"
    app:layout_anchor="@id/bottomAppBar" />





    share|improve this answer































      0














      Key is to use new material theme. Also your container layout should be coordinator layout. Use below code to change your layout.



      <android.support.design.widget.CoordinatorLayout
      xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      android:layout_width="match_parent"
      android:layout_height="match_parent">

      <!-- Other components and views -->

      <com.google.android.material.bottomappbar.BottomAppBar
      android:id="@+id/bar"
      android:layout_width="match_parent"
      android:layout_height="wrap_content"
      android:layout_gravity="bottom"
      style="@style/Widget.MaterialComponents.BottomAppBar" //Material style.
      app:navigationIcon="@drawable/ic_menu_24"/>

      <com.google.android.material.floatingactionbutton.FloatingActionButton
      android:id="@+id/fab"
      android:layout_width="wrap_content"
      android:layout_height="wrap_content"
      app:layout_anchor="@id/bar"/>

      </android.support.design.widget.CoordinatorLayout>





      share|improve this answer
























      • I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

        – Mahozad
        Nov 23 '18 at 21:15












      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420430%2fhow-to-set-fab-in-front-of-bottom-app-bar%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      3 Answers
      3






      active

      oldest

      votes








      3 Answers
      3






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      Yes, there isn't an attribute named fabCradleDiameter, its fabCradleMargin



      and make sure the version is after:



      com.google.android.material:material:1.0.0-alpha3





      share|improve this answer




























        1














        Yes, there isn't an attribute named fabCradleDiameter, its fabCradleMargin



        and make sure the version is after:



        com.google.android.material:material:1.0.0-alpha3





        share|improve this answer


























          1












          1








          1







          Yes, there isn't an attribute named fabCradleDiameter, its fabCradleMargin



          and make sure the version is after:



          com.google.android.material:material:1.0.0-alpha3





          share|improve this answer













          Yes, there isn't an attribute named fabCradleDiameter, its fabCradleMargin



          and make sure the version is after:



          com.google.android.material:material:1.0.0-alpha3






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 21:51









          navylovernavylover

          3,67031221




          3,67031221

























              1














              Try this it worked for me.. may work for you as well.



              <android.support.design.bottomappbar.BottomAppBar
              android:id="@+id/bottomAppBar"
              style="@style/Widget.MaterialComponents.BottomAppBar"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:layout_gravity="bottom"
              app:backgroundTint="@color/colorPrimary"
              app:fabAlignmentMode="center"
              app:fabCradleMargin="0dp"
              app:fabCradleRoundedCornerRadius="0dp"
              app:hideOnScroll="true"
              app:navigationIcon="@drawable/ic_menu_black_24dp" />

              <android.support.design.widget.FloatingActionButton
              android:id="@+id/fab"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:scaleType="centerCrop"
              android:src="@drawable/ic_favorite_red_24dp"
              app:borderWidth="0dp"
              app:fabSize="normal"
              app:layout_anchor="@id/bottomAppBar" />





              share|improve this answer




























                1














                Try this it worked for me.. may work for you as well.



                <android.support.design.bottomappbar.BottomAppBar
                android:id="@+id/bottomAppBar"
                style="@style/Widget.MaterialComponents.BottomAppBar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom"
                app:backgroundTint="@color/colorPrimary"
                app:fabAlignmentMode="center"
                app:fabCradleMargin="0dp"
                app:fabCradleRoundedCornerRadius="0dp"
                app:hideOnScroll="true"
                app:navigationIcon="@drawable/ic_menu_black_24dp" />

                <android.support.design.widget.FloatingActionButton
                android:id="@+id/fab"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:scaleType="centerCrop"
                android:src="@drawable/ic_favorite_red_24dp"
                app:borderWidth="0dp"
                app:fabSize="normal"
                app:layout_anchor="@id/bottomAppBar" />





                share|improve this answer


























                  1












                  1








                  1







                  Try this it worked for me.. may work for you as well.



                  <android.support.design.bottomappbar.BottomAppBar
                  android:id="@+id/bottomAppBar"
                  style="@style/Widget.MaterialComponents.BottomAppBar"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom"
                  app:backgroundTint="@color/colorPrimary"
                  app:fabAlignmentMode="center"
                  app:fabCradleMargin="0dp"
                  app:fabCradleRoundedCornerRadius="0dp"
                  app:hideOnScroll="true"
                  app:navigationIcon="@drawable/ic_menu_black_24dp" />

                  <android.support.design.widget.FloatingActionButton
                  android:id="@+id/fab"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:scaleType="centerCrop"
                  android:src="@drawable/ic_favorite_red_24dp"
                  app:borderWidth="0dp"
                  app:fabSize="normal"
                  app:layout_anchor="@id/bottomAppBar" />





                  share|improve this answer













                  Try this it worked for me.. may work for you as well.



                  <android.support.design.bottomappbar.BottomAppBar
                  android:id="@+id/bottomAppBar"
                  style="@style/Widget.MaterialComponents.BottomAppBar"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_gravity="bottom"
                  app:backgroundTint="@color/colorPrimary"
                  app:fabAlignmentMode="center"
                  app:fabCradleMargin="0dp"
                  app:fabCradleRoundedCornerRadius="0dp"
                  app:hideOnScroll="true"
                  app:navigationIcon="@drawable/ic_menu_black_24dp" />

                  <android.support.design.widget.FloatingActionButton
                  android:id="@+id/fab"
                  android:layout_width="wrap_content"
                  android:layout_height="wrap_content"
                  android:scaleType="centerCrop"
                  android:src="@drawable/ic_favorite_red_24dp"
                  app:borderWidth="0dp"
                  app:fabSize="normal"
                  app:layout_anchor="@id/bottomAppBar" />






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 23 '18 at 5:49









                  Amit JangidAmit Jangid

                  1,2731917




                  1,2731917























                      0














                      Key is to use new material theme. Also your container layout should be coordinator layout. Use below code to change your layout.



                      <android.support.design.widget.CoordinatorLayout
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent">

                      <!-- Other components and views -->

                      <com.google.android.material.bottomappbar.BottomAppBar
                      android:id="@+id/bar"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom"
                      style="@style/Widget.MaterialComponents.BottomAppBar" //Material style.
                      app:navigationIcon="@drawable/ic_menu_24"/>

                      <com.google.android.material.floatingactionbutton.FloatingActionButton
                      android:id="@+id/fab"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      app:layout_anchor="@id/bar"/>

                      </android.support.design.widget.CoordinatorLayout>





                      share|improve this answer
























                      • I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                        – Mahozad
                        Nov 23 '18 at 21:15
















                      0














                      Key is to use new material theme. Also your container layout should be coordinator layout. Use below code to change your layout.



                      <android.support.design.widget.CoordinatorLayout
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent">

                      <!-- Other components and views -->

                      <com.google.android.material.bottomappbar.BottomAppBar
                      android:id="@+id/bar"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom"
                      style="@style/Widget.MaterialComponents.BottomAppBar" //Material style.
                      app:navigationIcon="@drawable/ic_menu_24"/>

                      <com.google.android.material.floatingactionbutton.FloatingActionButton
                      android:id="@+id/fab"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      app:layout_anchor="@id/bar"/>

                      </android.support.design.widget.CoordinatorLayout>





                      share|improve this answer
























                      • I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                        – Mahozad
                        Nov 23 '18 at 21:15














                      0












                      0








                      0







                      Key is to use new material theme. Also your container layout should be coordinator layout. Use below code to change your layout.



                      <android.support.design.widget.CoordinatorLayout
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent">

                      <!-- Other components and views -->

                      <com.google.android.material.bottomappbar.BottomAppBar
                      android:id="@+id/bar"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom"
                      style="@style/Widget.MaterialComponents.BottomAppBar" //Material style.
                      app:navigationIcon="@drawable/ic_menu_24"/>

                      <com.google.android.material.floatingactionbutton.FloatingActionButton
                      android:id="@+id/fab"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      app:layout_anchor="@id/bar"/>

                      </android.support.design.widget.CoordinatorLayout>





                      share|improve this answer













                      Key is to use new material theme. Also your container layout should be coordinator layout. Use below code to change your layout.



                      <android.support.design.widget.CoordinatorLayout
                      xmlns:android="http://schemas.android.com/apk/res/android"
                      xmlns:app="http://schemas.android.com/apk/res-auto"
                      android:layout_width="match_parent"
                      android:layout_height="match_parent">

                      <!-- Other components and views -->

                      <com.google.android.material.bottomappbar.BottomAppBar
                      android:id="@+id/bar"
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_gravity="bottom"
                      style="@style/Widget.MaterialComponents.BottomAppBar" //Material style.
                      app:navigationIcon="@drawable/ic_menu_24"/>

                      <com.google.android.material.floatingactionbutton.FloatingActionButton
                      android:id="@+id/fab"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      app:layout_anchor="@id/bar"/>

                      </android.support.design.widget.CoordinatorLayout>






                      share|improve this answer












                      share|improve this answer



                      share|improve this answer










                      answered Nov 23 '18 at 6:14









                      Karan MerKaran Mer

                      5,68632966




                      5,68632966













                      • I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                        – Mahozad
                        Nov 23 '18 at 21:15



















                      • I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                        – Mahozad
                        Nov 23 '18 at 21:15

















                      I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                      – Mahozad
                      Nov 23 '18 at 21:15





                      I think as soon as you read the first sentence of my question, you rushed to put an answer here. Please read the question carefully.

                      – Mahozad
                      Nov 23 '18 at 21:15


















                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53420430%2fhow-to-set-fab-in-front-of-bottom-app-bar%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Guess what letter conforming each word

                      Port of Spain

                      Run scheduled task as local user group (not BUILTIN)