Code Monkey home page Code Monkey logo

smoothbottombar's Issues

SmoothBottomBar not supported as per NavController requirements

As per new guidelines by developer.android.com, Now BottomNavigationView is operated using ViewModel and NavController but SmoothBottomBar is unable to support that

error: no suitable method found for setupWithNavController(SmoothBottomBar,NavController)
        NavigationUI.setupWithNavController(navView, navController);
                    
    method NavigationUI.setupWithNavController(Toolbar,NavController) is not applicable
      (argument mismatch; SmoothBottomBar cannot be converted to Toolbar)
    method NavigationUI.setupWithNavController(NavigationView,NavController) is not applicable
      (argument mismatch; SmoothBottomBar cannot be converted to NavigationView)
    method NavigationUI.setupWithNavController(BottomNavigationView,NavController) is not applicable

Dynamically change bottom bar item

I want to show bottom bar item when user login check type of login user and based on user i want to show 2 tab or 3 tab dynamically change bottom items

Badge option no found

How to add notification badge on Bottom Navigation View?

Usually we do this :

val navBar  = findViewById<BottomNavigationView>(R.id.bottom_navigation)
navBar.getOrCreateBadge(R.id.action_stamp).number = 2

Set up with viewPager ?

Anyway to set this bottom bar with a viewpager ? So that I can swipe back and forth between fragments ?

Library support before Android X. Getting build error

My project is not currently supporting Android X.
Hence while integrating library, I am getting following build error:

Manifest merger failed : Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).

Is there any support before Android X for this library?

Thanks.

Not Detected in Instumentation Tests

I just tried to test my app interface, but it does not seem espresso can detect it. Neither manually code the test nor using record test (which is works when i use default navigation bar component). Anyone has tried to test it? Any workaround is appreciated since this library has good looking design for me.

Change Font famIly

How can we change the font family and change it to custom font in SmoothBottomBar? Please help.

Is it possible to hide fragment and icon in BottomNavigationBar

I have a requirement to hide the Fragment and its Icon in BottomNavigationBar if the boolean value is true. if(hideFrag){ select_fragment=null; }else{ select_fragment = new Fragment4();}

this one just hides the fragment but not the icon how to deal with it.

Text Wrapping issue

Item name that has more than 6 character cant be expanded? what to do with that?

Item gravity

How can we use this as an icon top and text bottom?

setCurrentItem method missing

setCurrentItem method is missing from the SmoothBottomBar class. This is required if I want to manually switch the tab programmatically.
Similarly getCurrentItem method is missing as well.

Please provide some workaround for this.

Thanks

backstack problem

on backpressed the bottomnavigation icon also must be changed it's not working
ezgif com-optimize

Same menu in Bottom in action bar

Hello @ibrahimsn98 @rezaepsilon0 @mayokunthefirst @brookmg @tobiasschuerg

Please look in to this issue, Bottom and action bar menus are same, if user want to show other menu option in toolbar with icon, then how they will show, because menu already occupied with bottom navigation. without this solution library not useful for live projects or apps, please solve that.

Thanks

exposing iconMargin attribute

Well done, you've done a great work. I was using SmoothBottomBar in my mTodo and I needed to change the icon margin, but it was not exposed to xml attrs. I had to fork and increase the value inside Constnats.kt. It would be nice to have control over it dynamically. I will submit a pull request for that matter. Keep good work up ๐Ÿ‘Œ๐Ÿป
[PR: #36 ]

Show/Hide Bottom Navigation Bar

Currently I'm using animate();, if it gets a native show/hide option to be used along with the recycler view scroll behavior it might work more efficiently

I want a java version

This library is amazing, I really want to try it, but I won't kotlin.Can you help me?
Thank you.

Crash - "IndexOutOfBoundsException" at starting of the app in Android 10

Device Info - Samsung Galaxy M10s, Android 10
-one thing I like to share here is I noticed that error occurred when the device is offline and I noticed this issue in -
Redmi Note 8, Android Version 9

In xml -
<me.ibrahimsn.lib.SmoothBottomBar
android:id="@+id/bottom_nav"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="?background_default_darker"
android:layout_marginBottom="12dp"
app:cornerRadius="8dp"
app:elevation="12dp"
app:iconSize="24dp"
app:iconTint="@color/grey500"
app:iconTintActive="@color/black"
app:indicatorColor="@color/greyF6"
app:itemFontFamily="@font/poppins"
app:menu="@menu/bottom_nav_home"
app:textColor="@color/black" />

In menu items, I used vector drawable.

crash info -
java.lang.IndexOutOfBoundsException: Empty list doesn't contain element at index 0.
at kotlin.collections.EmptyList.get(Collections.kt:35)
at kotlin.collections.EmptyList.get(Collections.kt:23)
at me.ibrahimsn.lib.SmoothBottomBar.onDraw(SmoothBottomBar.kt:391)
at android.view.View.draw(View.java:23191)
at android.view.View.updateDisplayListIfDirty(View.java:22066)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.draw(View.java:23194)
at android.view.View.updateDisplayListIfDirty(View.java:22066)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1277)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.draw(View.java:23194)
at android.view.View.updateDisplayListIfDirty(View.java:22066)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at androidx.drawerlayout.widget.DrawerLayout.drawChild(DrawerLayout.java:1426)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.updateDisplayListIfDirty(View.java:22052)
at android.view.View.draw(View.java:22921)
at android.view.ViewGroup.drawChild(ViewGroup.java:5230)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4987)
at android.view.View.draw(View.java:23194)
at com.android.internal.policy.DecorView.draw(DecorView.java:1117)
at android.view.View.updateDisplayListIfDirty(View.java:22066)
at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:588)
at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:594)
at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:667)
at android.view.ViewRootImpl.draw(ViewRootImpl.java:4267)
at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:4051)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:3324)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2204)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:9003)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:996)
at android.view.Choreographer.doCallbacks(Choreographer.java:794)
at android.view.Choreographer.doFrame(Choreographer.java:729)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:981)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:237)
at android.app.ActivityThread.main(ActivityThread.java:7860)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1075)

How change languaje programatically

How can the language of the items be changed programmatically, since it does not allow me to do it only does it with an element.

I hope you can help me, Thanks!

Tapping on tabs does nothing

Hey,

Great looking bottom bar you got here. I took a look by adding it to an empty template app from Android Studio 4 and it doesn't seem to work. The bar appears but it stays on the first tab.

  1. I added the Gradle lines.
  2. I created the menu.xml (FYI the readme says menu.xml but the SmoothBottomBar looks for menu_bottom )
  3. I added the SmoothBottomBar View
  4. Added the listeners in the mainActivity.

I stopped here to test it to see how it feels but as I say nothing happens when you touch any part of the bar. Pity.

Best of luck with it

I want onItemSelected function for Java

Hello i tried this library for my project, but I am unable to use onItemSelected function. Instead i get setOnItemSelected function but couldn't understand it as to how to use it. Please help. How do i switch fragment when bottombar item changes, in Java. Please help.

setOnItemSelectedListener not working in version 1.7.6

setOnItemSelectedListener or onItemSelectedListener not working in fragment
i'm getting unresolved reference.

i'm using it as
userType.setOnItemSelectedListener(object : OnItemSelectedListener{ override fun onItemSelect(pos: Int): Boolean { TODO("Not yet implemented") } })

deselect

hi
how i can deselect all items

Please help with this?

ERROR: Failed to resolve: com.github.ibrahimsn98:SmoothBottomBar:1.2
Show in Project Structure dialog
Affected Modules: app

Java Version of the Library

Can we also please have a java version if the library. This library is awesome but java developers like me can't take it in use.

setting app:activeItem="#" anything other than 0 via XML causes view to change active item with noticeable delay from 0 to that desired position at startup

video_2021-02-24_21-46-28.mp4

When setting activeItem from XML I expect it to set that item active at startup, I can clearly see that at first startup, item at position 0 is set then item at position which I set in XML will be set as active.
Don't let quality and low frame rate of GIF fool you I already tested this situation in several devices and android versions also in an Emulator in a decent computer.
BTW I took the liberty of inspecting your library source and as I guessed initial value for activeItem is 0 which explains the situation where at first initial active item is 0, investing further there's a setter method for another variable coupled with that which shows applyItemActiveIndex() method which I guess is responsible for changing active item index and animations for that matter. further trace shows that itemActiveIndex is set to attribute from XML and in setter method of itemActiveIndex, as explained recently applyItemActiveIndex() is called so I don't see why first item at position 0 is set as active then item at position where developer set from XML so it seems to me code is OK except that maybe onSizeChanged method is called in initial view creation and in that method this line (applyItemActiveIndex) is called so maybe this is causing the issue. I'm not sure about view lifecycle so how can that method being called before object consternation is beyond me, I should investigate more.

Menu with no icons causes application to crash

I was populating the bottom navigation with the menu, all my items did not have an icon as I planned to add them later on. The bottom navigation kept on crashing with the main error as follows:

Error inflating class me.ibrahimsn.lib.SmoothBottomBar

After a closer look into the logcat revealed the following error:

Caused by: kotlin.KotlinNullPointerException at me.ibrahimsn.lib.BottomBarParser.getTabConfig(BottomBarParser.kt:48) at me.ibrahimsn.lib.BottomBarParser.parse(BottomBarParser.kt:23)

After a few hours of debugging and looking through your code, I figured out that the library is trying to load icon and not finding any. Please put a note in the library description or handle it with a try-catch.
PS: Very Cool Library, great work.
Happy Coding.

Disable text shortening

Hi,
Thank you for the great work you've done with this library!
I use it and it almost fits with the designer's expectations.

The only problem I'm facing is I need to show the full text without shortening it.
Is it currently possible?

If not, I think it could be a nice feature!

How to change background shape?

How to change background shape from drawable resource file, maybe we want to use custom background that rounded in topLeftCorner and topRightCorner.

getActiveItem

Can you create a function for get active item like setActiveItem. Thanks

Issue with NoActionbar theme

very cool !! lib.
i am using NoActionBar theme(i.e Theme.AppCompat.Light.NoActionBar / Theme.MaterialComponents.Light.NoActionBar) in this case fragment is not changing according to menu item. In DarkActionBar it works fine.

How to hook up with navController?

I am a newbie and am currently working with a single activity and multiple fragments pattern. I want to integrate this smooth bar with the navController.

I tried doing this:

bottomBar.onItemSelected = {
            when (it) {
                0 -> navController.navigate(R.id.someFragment)
                1 -> navController.navigate(R.id.someOtherFragment)
                else -> navController.navigate(R.id.someFragment)
            }
        }

But this would create a new fragment every time instead of using the existing fragment in the navigation stack. I looked up the documentation and it only teaches how to integrate it with the bottom navigation view they provided.

Is it possible to somehow setup the nav controller? And if not, are there any workarounds?

MVVM Support

Can we integrate this in MVVM architecture using data binding?

Java version

Hy, It is a great library, but i can not code in kotlin. So my question is: Is there perhaps a java version of this library? If so, than could you please link it for me?
Thank you for your answer!

Handling for title value in menu.xml

When you hardcode title value in bottom_menu.xml, it crashes the app because of resourse not found exception.
Please add the handling for reading hardcoded value in addition of reading from strings.xml.

set Badge

how can i set badge for every item? (with navigation component)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.