Code Monkey home page Code Monkey logo

animatedbottombar's People

Contributors

am3n avatar droppers avatar mbobiosio avatar pelmenstar1 avatar rosuh avatar sinadalvand avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

animatedbottombar's Issues

Min height

It is not a truble, but ... Maybe 64dp too large?

method setOnTabSelectListener() error

Hi. I,m new on android and i want to use this library and i got these errors when use 1.0.5+ version of this library.

Code that got error:

animatedBottomBar.setOnTabSelectListener(new AnimatedBottomBar.OnTabSelectListener() {
@OverRide
public void onTabSelected(int lastIndex, @nullable AnimatedBottomBar.Tab lastTab, int newIndex, @NotNull AnimatedBottomBar.Tab newTab) {
Fragment fragment = null;
switch (newTab.getId()) {
case R.id.home:
fragment = new HomeFragment();
break;
case R.id.dashboard:
fragment = new DashboardFragment();
break;
case R.id.settings:
fragment = new SettingsFragment();
break;
}
if (fragment != null) {
fragmentManager = getSupportFragmentManager();
fragmentManager.beginTransaction().replace(R.id.fragment_container, fragment)
.commit();
} else {
Log.e(TAG, "Error in creating Fragment");
}

Build error:

C:\Users\mohammadreza22\AndroidStudioProjects\EnergX\app\src\main\java\com\madeit\energx\MainActivity.java:34: error: <anonymous com.madeit.energx.MainActivity$1> is not abstract and does not override abstract method onTabReselected(int,Tab) in OnTabSelectListener
animatedBottomBar.setOnTabSelectListener(new AnimatedBottomBar.OnTabSelectListener() {

Logcat:

2020-04-22 01:34:14.855 7369-7369/com.madeit.energx E/m.madeit.energ: Invalid ID 0x00000975.
2020-04-22 01:34:14.874 7369-7369/com.madeit.energx E/m.madeit.energ: Invalid ID 0x00000974.
2020-04-22 01:34:14.875 7369-7369/com.madeit.energx E/m.madeit.energ: No package ID ff found for ID 0xff2196f3.
2020-04-22 01:34:14.876 7369-7369/com.madeit.energx D/AndroidRuntime: Shutting down VM
2020-04-22 01:34:14.945 7369-7369/com.madeit.energx E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.madeit.energx, PID: 7369
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.madeit.energx/com.madeit.energx.MainActivity}: android.view.InflateException: Binary XML file line #8 in com.madeit.energx:layout/activity_main: Binary XML file line #8 in com.madeit.energx:layout/activity_main: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3333)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7464)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: android.view.InflateException: Binary XML file line #8 in com.madeit.energx:layout/activity_main: Binary XML file line #8 in com.madeit.energx:layout/activity_main: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
Caused by: android.view.InflateException: Binary XML file line #8 in com.madeit.energx:layout/activity_main: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
at android.view.LayoutInflater.createView(LayoutInflater.java:852)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:1121)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:1082)
at android.view.LayoutInflater.inflate(LayoutInflater.java:680)
at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.madeit.energx.MainActivity.onCreate(MainActivity.java:12)
at android.app.Activity.performCreate(Activity.java:7990)
at android.app.Activity.performCreate(Activity.java:7979)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1309)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3308)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3477)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2043)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:216)
at android.app.ActivityThread.main(ActivityThread.java:7464)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:955)
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0xff2196f3
at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:239)
at android.content.res.Resources.getColor(Resources.java:1016)
2020-04-22 01:34:14.945 7369-7369/com.madeit.energx E/AndroidRuntime: at android.content.Context.getColor(Context.java:676)
at androidx.core.content.ContextCompat.getColor(ContextCompat.java:514)
at nl.joery.animatedbottombar.ExtensionsKt.getColorResCompat(Extensions.kt:14)
at nl.joery.animatedbottombar.AnimatedBottomBar.initAttributes(AnimatedBottomBar.kt:61)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:50)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:27)
at nl.joery.animatedbottombar.AnimatedBottomBar.(Unknown Source:6)
... 28 more

Can't use it with a Navigation component

I tried to use this bottom bar with Navigation component, tried to tie the items with fraagments using a NavController but i can't set up this bottom bar with it!

What is the role of the setEnabled() method in the Badge Class?

What is the role of the setEnabled() method in the Badge Class?

` override fun setEnabled(enabled: Boolean) {
val lastEnabled = isEnabled
super.setEnabled(enabled)

    if (lastEnabled == enabled) {
        return
    }

    if (animationType == AnimatedBottomBar.BadgeAnimation.NONE) {
        visibility = if (enabled) VISIBLE else GONE
        return
    }

    animator.run {
        duration = _animationDuration.toLong()

        if(isEnabled) {
            start()
        } else {
            reverse()
        }
    }
}`

TABS/MENU NOT SHOWING

The tabs and menu is not showing, i even tried to just copy the default code in README but its not working, I also tried the version 1.0.4 to 1.0.8 but not working

Bottom Navigation does not work with Navigation Components

Issues

  • Bottom Navigation is not working correctly with Navigation Components
  • Fragment is not changing when bottom nav item is pressed
  • Sample code shown in the NavControllerActivity is wrong
  • No Documentation regarding configuration with Navigation Components in README.md

Add Support for NavController

Hello, I really like the design of your library, and I was wondering if you could add the ability to easily set it up with a NavController, as the library I was previously using, ibrahimsn98/SmoothBottomBar, has this functionality. I found how they implemented it, and was able to modify their code to work with your library. I have included the file I modified instead of trying to create a fork of your library, as I am not familiar with how your library works internally.
I don't know if this helps, but I belive this is how they used the NavigationComponentHelper in their main class:

    fun setupWithNavController(menu: Menu, navController: NavController){
        NavigationComponentHelper.setupWithNavController(menu,this,navController)
    }

Thank you for considering this!
NavigationComponentHelper.txt

Feature Request

You have 2 Options for Text and Icon, What can you add 2 more:

Text and Text
Icon and Icon

So people can choose if I just want icon.

Also maybe add a new variation,
Icon with Text On Top or Bottom.

Options can be TextIcon

app:abb_selectedTabType="text/icon/both/icononly/textonly/both"
app:abb_TextLocation="top/bottom"

How to use fragment with whis AnimatedBottomBar

How do we use fragment with this library? Let say i want to change FrameLayout with fragmentLayout base on position. Let say when we on Home, so my FrameLayout change to fragment_home. Is it possible to use switch case programatically?

Configuration change resets bottom bar position

Selecting a different tab from the default and then changing the theme will reset the current tab selection. This means that it will be out of sync with the ViewPager. The tab selection should be maintained even after configuration changes - I have attached a video to show this.

21-08-18-17-48-56.mp4

android.view.InflateException

My app is crashing when i applied this library, i tried to create a new project following the readME.md settings but keeps showing me this error:

2020-06-08 06:39:44.178 9236-9236/com.example.myapplication E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.myapplication, PID: 9236
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
Caused by: android.view.InflateException: Binary XML file line #9: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance0(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
at android.view.LayoutInflater.createView(LayoutInflater.java:651)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)
at com.example.myapplication.MainActivity.onCreate(MainActivity.java:12)
at android.app.Activity.performCreate(Activity.java:7088)
at android.app.Activity.performCreate(Activity.java:7079)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)
at android.app.ActivityThread.-wrap11(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)
Caused by: java.lang.Exception: Menu item attribute 'icon' for tab named 'Home' is missing
at nl.joery.animatedbottombar.MenuParser.parse(MenuParser.kt:22)
at nl.joery.animatedbottombar.AnimatedBottomBar.initInitialTabs(AnimatedBottomBar.kt:240)
at nl.joery.animatedbottombar.AnimatedBottomBar.initAttributes(AnimatedBottomBar.kt:190)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:50)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:27)
at nl.joery.animatedbottombar.AnimatedBottomBar.(Unknown Source:6)
at java.lang.reflect.Constructor.newInstance0(Native Method)聽
at java.lang.reflect.Constructor.newInstance(Constructor.java:334)聽
at android.view.LayoutInflater.createView(LayoutInflater.java:651)聽
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:794)聽
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)聽
at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)聽
at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:519)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:427)聽
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)聽
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:555)聽
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:161)聽
at com.example.myapplication.MainActivity.onCreate(MainActivity.java:12)聽
at android.app.Activity.performCreate(Activity.java:7088)聽
at android.app.Activity.performCreate(Activity.java:7079)聽
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)聽
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)聽
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2895)聽
at android.app.ActivityThread.-wrap11(Unknown Source:0)聽
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1616)聽
at android.os.Handler.dispatchMessage(Handler.java:106)聽
at android.os.Looper.loop(Looper.java:176)聽
at android.app.ActivityThread.main(ActivityThread.java:6651)聽
at java.lang.reflect.Method.invoke(Native Method)聽
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)聽
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)聽

This problem occurs when migrating to a project

The following classes could not be instantiated:
- nl.joery.animatedbottombar.AnimatedBottomBar (Open Class, Show Exception, Clear Cache)
Tip: Use View.isInEditMode() in your custom views to skip code or show sample data when shown in the IDE. If this is an unexpected error you can also try to build the project, then manually refresh the layout. Exception Details java.lang.IllegalArgumentException: Unknown color   at android.graphics.Color.parseColor(Color.java:1391)   at com.android.layoutlib.bridge.android.BridgeContext.resolveThemeAttribute(BridgeContext.java:412)   at android.content.res.Resources_Theme_Delegate.resolveAttribute(Resources_Theme_Delegate.java:97)   at android.content.res.Resources$Theme.resolveAttribute(Resources.java:1578)   at nl.joery.animatedbottombar.ExtensionsKt.getTextColor(Extensions.kt:20)   at nl.joery.animatedbottombar.AnimatedBottomBar.initAttributes(AnimatedBottomBar.kt:57)   at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:50)   at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:27)   at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:-1)   at java.lang.reflect.Constructor.newInstance(Constructor.java:423)   at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)   at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:863)   at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:72)   at android.view.LayoutInflater.rInflate(LayoutInflater.java:837)   at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)   at android.view.LayoutInflater.inflate(LayoutInflater.java:515)

does not have a NavController set

hi, how can use setupWithNavController? i want use your lib but also share data between fragments, I will be glad you help

this my mainacitivity

1

this error

2

What is the latest version?

The version I download and look at is different if I look at the source on the Github

For example, the version downloaded to the Library has a layout folder, but if you look at the source in the Github Webstore, there is no layout folder.

Which version is the latest?

duplicate class error

Duplicate class androidx.navigation.ActivityKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ActivityNavArgsLazyKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ActivityNavArgsLazyKt$navArgs$1 found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ActivityNavigatorDestinationBuilder found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ActivityNavigatorDestinationBuilderKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ActivityNavigatorExtrasKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.AnimBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavActionBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavArgsLazy found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavArgsLazyKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavArgumentBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavControllerKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.NavDeepLinkDsl found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavDeepLinkDslBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavDeepLinkDslBuilderKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavDestinationBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavDestinationDsl found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavGraphBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavGraphBuilderKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavGraphKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavHostKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.NavOptionsBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavOptionsBuilderKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavOptionsDsl found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.NavigatorProviderKt found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.PopUpToBuilder found in modules navigation-common-2.5.2-runtime (androidx.navigation:navigation-common:2.5.2) and navigation-common-ktx-2.3.5-runtime (androidx.navigation:navigation-common-ktx:2.3.5)
Duplicate class androidx.navigation.ViewKt found in modules navigation-runtime-2.5.2-runtime (androidx.navigation:navigation-runtime:2.5.2) and navigation-runtime-ktx-2.3.5-runtime (androidx.navigation:navigation-runtime-ktx:2.3.5)
Duplicate class androidx.navigation.ui.ActivityKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.AppBarConfigurationKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.AppBarConfigurationKt$AppBarConfiguration$1 found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.AppBarConfigurationKt$AppBarConfiguration$2 found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.AppBarConfigurationKt$AppBarConfiguration$3 found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.AppBarConfigurationKt$sam$i$androidx_navigation_ui_AppBarConfiguration_OnNavigateUpListener$0 found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.BottomNavigationViewKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.CollapsingToolbarLayoutKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.MenuItemKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.NavControllerKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.NavigationViewKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)
Duplicate class androidx.navigation.ui.ToolbarKt found in modules navigation-ui-2.5.2-runtime (androidx.navigation:navigation-ui:2.5.2) and navigation-ui-ktx-2.3.5-runtime (androidx.navigation:navigation-ui-ktx:2.3.5)

Go to the documentation to learn how to Fix dependency resolution errors.

How to use Fragment with this library

How do we use fragment with this library? Let say i want to change FrameLayout with fragmentLayout base on position. Let say when we on Home, so my FrameLayout change to fragment_home. Is it possible to use switch case programatically?

Resource not found exception when an attirube doesn't refer to a color that is in colors.xml

Hi, firstly thank you so much for this great library!

I wanna mention about an important problem. I got the following error when I use AnimatedBottomBar:

109045175-51af5c00-76e4-11eb-836c-3f79fafb3205

App is stoping in the following lines when we track the code:
tabColorSelected = context.getColorResCompat(android.R.attr.colorPrimary)

After hours of investigation, I understood the reason of the problem. I changed color attribute in my theme as below:

image

And it worked! We must use color attribute instead of writing the color like #526fa4.

Did you do that intentionally? If yes, could you pleasee write a note about it in the readme. So that other people don't waste time like me to fix this problem :(

Add function to set icons programatically

It would be great to have the feature to set icons for the bottom bar programmatically as it would mean that any third party libraries such as Android Iconics can be utilised so that drawable resources do not have to be used in XML and can be created programmatically instead.

bottomBar.tabs[i].icon = customIcon currently says Val cannot be reassigned.

Download Error

Could not find constraintlayout-solver-2.0.2.jar (androidx.constraintlayout:constraintlayout-solver:2.0.2).

setNestedScrollingEnabled is not respected

It currently intercepts all touch events in a nested scrollview. This is difficult to configure since setNestedScrollingEnabled is ignored, when calling this method the value should also be set for the inner RecyclerView.

Temporary workaround using reflection:

val field = bottom_bar.javaClass.getDeclaredField("recycler")
field.isAccessible = true

val recycler = field.get(bottom_bar) as RecyclerView
recycler.isNestedScrollingEnabled = false

Allow to reset selection

I have a use case where when the user selects a tab, a certain view would show. then if the user reselects that tab that view would disappear, but I can't find a way to deselect the tab or reset the selection.

I managed to handle this using this useful callback:

mainBar.onTabReselected = { tab ->
                when (tab?.id) {
                    R.id.fontSize -> {
                        seekBarView.reverseVisibility()
                         //  mainBar.resetSelection()   or   tab.deselect()
                    }
                   // other code
                }
            }

I try to run DEMO, but there is an error in the execution.

I downloaded the source file.
I try to run DEMO, but there is an error in the execution.

Please see the error message below and give us some advice to carry out the demonstration.

Thank you.

error message ------------------------------------------------

E/AndroidRuntime: FATAL EXCEPTION: main
Process: nl.joery.demo.animatedbottombar, PID: 2834
java.lang.RuntimeException: Unable to start activity ComponentInfo{nl.joery.demo.animatedbottombar/nl.joery.demo.animatedbottombar.playground.PlaygroundActivity}: android.view.InflateException: Binary XML file line #8: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2378)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2440)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Caused by: android.view.InflateException: Binary XML file line #8: Error inflating class nl.joery.animatedbottombar.AnimatedBottomBar
at android.view.LayoutInflater.createView(LayoutInflater.java:633)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
at nl.joery.demo.animatedbottombar.playground.PlaygroundActivity.onCreate(PlaygroundActivity.kt:34)
at android.app.Activity.performCreate(Activity.java:6057)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2440) 
at android.app.ActivityThread.access$800(ActivityThread.java:162) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5422) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707) 
Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.newInstance(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:288)
at android.view.LayoutInflater.createView(LayoutInflater.java:607)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170) 
at nl.joery.demo.animatedbottombar.playground.PlaygroundActivity.onCreate(PlaygroundActivity.kt:34) 
at android.app.Activity.performCreate(Activity.java:6057) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2440) 
at android.app.ActivityThread.access$800(ActivityThread.java:162) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5422) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707) 
Caused by: android.content.res.Resources$NotFoundException: Resource ID #0x7f07005f
at android.content.res.Resources.getValue(Resources.java:1316)
at android.content.res.Resources.getDrawable(Resources.java:812)
at android.content.Context.getDrawable(Context.java:403)
at com.android.internal.view.menu.MenuItemImpl.getIcon(MenuItemImpl.java:388)
at nl.joery.animatedbottombar.utils.MenuParser.parse(MenuParser.kt:22)
at nl.joery.animatedbottombar.AnimatedBottomBar.initInitialTabs(AnimatedBottomBar.kt:272)
at nl.joery.animatedbottombar.AnimatedBottomBar.initAttributes(AnimatedBottomBar.kt:221)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:54)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt:31)
at nl.joery.animatedbottombar.AnimatedBottomBar.(AnimatedBottomBar.kt)
at java.lang.reflect.Constructor.newInstance(Native Method) 
at java.lang.reflect.Constructor.newInstance(Constructor.java:288) 
at android.view.LayoutInflater.createView(LayoutInflater.java:607) 
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:743) 
at android.view.LayoutInflater.rInflate(LayoutInflater.java:806) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:504) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:414) 
at android.view.LayoutInflater.inflate(LayoutInflater.java:365) 
at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696) 
at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170) 
at nl.joery.demo.animatedbottombar.playground.PlaygroundActivity.onCreate(PlaygroundActivity.kt:34) 
at android.app.Activity.performCreate(Activity.java:6057) 
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106) 
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331) 
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2440) 
at android.app.ActivityThread.access$800(ActivityThread.java:162) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348) 
at android.os.Handler.dispatchMessage(Handler.java:102) 
at android.os.Looper.loop(Looper.java:135) 
at android.app.ActivityThread.main(ActivityThread.java:5422) 
at java.lang.reflect.Method.invoke(Native Method) 
at java.lang.reflect.Method.invoke(Method.java:372) 
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707) 

All icons disappears when i set badge twice

In the activity's onResume function I added code to check badge every time activity rersumes:

if (badgeNumber > 0) bn_menu.setBadgeAtTabIndex(1, AnimatedBottomBar.Badge("$badgeNumber")) else bn_menu.clearBadgeAtTabIndex(1)

So this code caused an issue to the users.
i improved it to be like this and the issue was solved:

val notifTab = bn_menu.tabs[1] if (badgeNumber > 0) { if (notifTab.badge == null) { bn_menu.setBadgeAtTab(notifTab, AnimatedBottomBar.Badge("$badgeNumber")) } } else { if(notifTab.badge != null) { bn_menu.clearBadgeAtTab(notifTab) } }

But the issue here that the badge is not updated once it is added. Only cleared if badge is 0.

I think those checks must be done inside the library, like if I call clearBadgeAtTab or setBadgeAtTab(notifTab, AnimatedBottomBar.Badge("$badgeNumber")) twice It must not hide all icons.

Icon padding?

Hi, thinking about using this library for my app, but supplying a bottom bar with png drawables makes the icons look big and distasteful. Is there an option to add padding or margin for icons in xml? Thanks

add scroll feature

nice if can add a scroll feature when there are more than 4 tabs,this can make the tab flexible for tab names with long character

This library does NOT work with androidx.appcompat:appcompat:1.5.0

by upgrading to androidx.appcompat:appcompat:1.5.0
it cause this error:
org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction

it works by androidx.appcompat:appcompat:1.4.2 fine but NOT 1.5.0

Fatal Exception: java.lang.IllegalStateException

`Fatal Exception: java.lang.IllegalStateException
newView must not be null

nl.joery.animatedbottombar.TabIndicator.setSelectedIndex (TabIndicator.kt:161)
nl.joery.animatedbottombar.AnimatedBottomBar$initAdapter$1.invoke (AnimatedBottomBar.kt:184)
nl.joery.animatedbottombar.AnimatedBottomBar$initAdapter$1.invoke (AnimatedBottomBar.kt:23)
nl.joery.animatedbottombar.TabAdapter.selectTab (TabAdapter.kt:104)
nl.joery.animatedbottombar.AnimatedBottomBar.selectTab (AnimatedBottomBar.kt:373)
nl.joery.animatedbottombar.AnimatedBottomBar.selectTabAt (AnimatedBottomBar.kt:353)
nl.joery.animatedbottombar.AnimatedBottomBar.selectTabAt$default (AnimatedBottomBar.kt:347)
nl.joery.animatedbottombar.AnimatedBottomBar$setupWithViewPager2$1.onPageSelected (AnimatedBottomBar.kt:426)`

I use AnimatedBottomBar with ViewPager2. I have only 2 tabs. Select second and rotate device.

ps by the way, demo.apk is not exist and your demo is not compiling. please, take a look.

Feature request

I have n number of tab which are not fit in screen so I need to make horizontal scrallable tabs.
But in current version we can't make horizontal scrallable tabs.

Please add this kind of feature.

WhatsApp Image 2022-07-31 at 7 34 30 PM

unexpected resource type : 'menu' expected string

there is a red error message when using AnimatedBottomBar

in android studio, in Design tab, app_tabs field gets red with this error message: "unexpected resource type : 'menu' expected string"

but it works fine anyway...

Disable tabs

Hi! I have just tried your lib in an application and, although I know we can intercept some tabs with the OnTabInterceptedListener, I would love to have the possibility to completely disable some tabs, preventing the user to click on them and displaying the icon with another color (i.e, in my application the icons are shown in blue and the disabled ones in grey).

In my application, the users need to complete some data to advance to the next section, so it would be great to only enable those tabs when the data is completed.

Could it be possible to implement this feature?

Thanks a lot!!!

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.