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;
}
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:
To this:
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
add a comment |
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:
To this:
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
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
add a comment |
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:
To this:
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
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:
To this:
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
android android-layout android-styles floating-action-button android-bottomappbar
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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
add a comment |
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" />
add a comment |
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>
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
add a comment |
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
add a comment |
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
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
answered Nov 21 '18 at 21:51
navylovernavylover
3,67031221
3,67031221
add a comment |
add a comment |
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" />
add a comment |
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" />
add a comment |
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" />
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" />
answered Nov 23 '18 at 5:49
Amit JangidAmit Jangid
1,2731917
1,2731917
add a comment |
add a comment |
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>
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
add a comment |
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>
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
add a comment |
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>
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>
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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