Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Snackbar #49

Closed
silverboyir opened this issue Jul 1, 2016 · 7 comments
Closed

Using Snackbar #49

silverboyir opened this issue Jul 1, 2016 · 7 comments
Milestone

Comments

@silverboyir
Copy link

Hi
how i can use snackbar when using bottom navigation in activity ?
I'm not getting any error , just its not showing , maybe its showing under the bottom bar ?

@Arlem
Copy link

Arlem commented Jul 1, 2016

Hi,
have you tried using a CoordinatorLayout? Snackbar will appear at the bottom of CoordinatorLayout instead of screen.

@silverboyir
Copy link
Author

Hi
yes , parent of layout is a CoordinatorLayout , and snackbar work in other activities , that dosent have bottom navigation

@Arlem
Copy link

Arlem commented Jul 1, 2016

I do use snackbars in my app and my xml looks like this:

<LinearLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_height="match_parent"
    android:layout_width="match_parent"
    android:orientation="vertical">
    <FrameLayout
        android:id="@+id/main_container"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        tools:context=".activity.MainActivity"
        tools:ignore="MergeRootFrame"/>
    <com.ashokvarma.bottomnavigation.BottomNavigationBar
        android:layout_gravity="bottom"
        android:id="@+id/bottom_navigation_bar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>
</LinearLayout>

Snackbar appears at bottom of FrameLayout; my CoordinatorLayout has layout_height:match_parent, but I don't know if that matters.
P.S. FrameLayout is the placeholder for fragments, layout is not as simple as it looks.

@silverboyir
Copy link
Author

Thanks
this is my layout
http://codebeautify.org/xmlviewer/cb0f832f
can you please check that and say what is wrong with that ?

@Arlem
Copy link

Arlem commented Jul 1, 2016

http://pastebin.com/ZmB8jERq

I copied (and adapted) your xml and this is the initialization in activity; the snackbar appears at the bottom of the scrollview.

@Ashok-Varma
Copy link
Owner

@Arlem @silverboyir no need of using two co-ordinator layouts. I am pushing an update for the library to night which will take care of all those

@Ashok-Varma Ashok-Varma added this to the 1.3.0 milestone Jul 2, 2016
@Ashok-Varma
Copy link
Owner

Pushed 1.3.0 to you can use SnackBar with version 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants