armcha / luseenbottomnavigation Goto Github PK
View Code? Open in Web Editor NEWBottomNavigationView Designed according Google guideLine
BottomNavigationView Designed according Google guideLine
Hello all,
i have a weird problem with your library which is really great one and ease my work; i would like to know if its possible to put a png with colors and preserve these color on an item of your navigation bar ? if so how to attempt it ;is there a size requirement ?
Thanks
What about add badge to navigation bottom item?
it would be great to set a badge number on each tab
The shadow has too much height.
it works well on Android 5.0 but failed on Android 4.2(un show)。i don't know why,could anyone give me a hand ,thanks very much!
Hello,
tank you.
i import your lib. and gradle is ready.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 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">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="58dp"
android:background="@android:color/holo_green_dark"
android:minHeight="?attr/actionBarSize"
android:titleTextColor="#ffffff">
</android.support.v7.widget.Toolbar>
<Button
android:id="@+id/btnPayment"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Payment"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"/>
<com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView
android:id="@+id/bottomNavigation"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true" />
</LinearLayout>
Error show in Android Studio :
java.lang.IndexOutOfBoundsException: Position must be less or equivalent than items size, items size is -1 current is 0 at com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView.onSizeChanged(BottomNavigationView.java:156) at android.view.View.sizeChange(View.java:17641) at android.view.View.setFrame(View.java:17603) at android.view.View.layout(View.java:17520) at android.view.ViewGroup.layout(ViewGroup.java:5612) at android.widget.LinearLayout.setChildFrame(LinearLayout.java:1741) at android.widget.LinearLayout.layoutHorizontal(LinearLayout.java:1730) at android.widget.LinearLayout.onLayout(LinearLayout.java:1496) at android.view.View.layout(View.java:17523) at android.view.ViewGroup.layout(ViewGroup.java:5612) at android.widget.FrameLayout.layoutChildren(FrameLayout.java:323) at android.widget.FrameLayout.onLayout(FrameLayout.java:261) at android.view.View.layout(View.java:17523) at android.view.ViewGroup.layout(ViewGroup.java:5612) at android.widget.RelativeLayout.onLayout(RelativeLayout.java:1079) at android.view.View.layout(View.java:17523) at android.view.ViewGroup.layout(ViewGroup.java:5612) Copy stack to clipboard Tip: Try to refresh the layout.
How can I change background of the selected item in order to make it look like this:
I tried to do i this way:
bottomNavigation.getItem(index).setColor(ContextCompat.getColor(DashboardActivity.this, R.color.colorPurpleButtonPressed));
inside of the OnBottomNavigationItemClickListener,
but it causes StackOverFlow
Is it possible for you to reproduce this issue on your side? I'm not quite sure if its an issue on my side. I tried to set the bottomNavigationView to null before creating the tabs etc. but I still get this issue.
Hi, i am using this bottom navigation at my MainActivity (with ViewPager), which has a FAB, but it stays behind the bottom navigation, and the snackbar event´s goes over the bottom navigation.
What is the best approach to resolve that?
Thanks.
using 'app:bnv_colored_background' changes the background color of the toolbar to white. How can I change that to the color I want? I tried with android:background but it didn't work.
thanks
Hi,
When I set the drawable via setImageResourceActive() method, the initial drawable resource not shown for first time opened app. after select /unselect the drawable changing working. did i miss anything? can you help for this.
|Thanks.
final BottomNavigationView bottomNavigationView =(BottomNavigationView)findViewById(R.id.bottomNavigation);
BottomNavigationItem homeNavigationItem = new BottomNavigationItem
("Feed", ContextCompat.getColor(this, R.color.colorAccent), R.drawable.ic_home_icon);
BottomNavigationItem recentsNavigationItem = new BottomNavigationItem
("Recents", Color.parseColor("#553e52"), R.drawable.ic_wall_clock);
BottomNavigationItem vaskNavigationItem = new BottomNavigationItem
("Vask", Color.parseColor("#7B1FA2"), R.drawable.vask_icon);
final BottomNavigationItem favoritesNavigationItem = new BottomNavigationItem
("Favorites",Color.parseColor("#FF5252"), R.drawable.heart_shape);
favoritesNavigationItem.setImageResource(R.drawable.heart_shape);
favoritesNavigationItem.setImageResourceActive(R.drawable.vask_icon);
BottomNavigationItem profileNavigationItem = new BottomNavigationItem
("Profile", Color.parseColor("#FF9800"), R.drawable.ic_user_silhouette);
bottomNavigationView.addTab(homeNavigationItem);
bottomNavigationView.addTab(recentsNavigationItem);
bottomNavigationView.addTab(vaskNavigationItem);
bottomNavigationView.addTab(favoritesNavigationItem);
bottomNavigationView.addTab(profileNavigationItem);
onSizeChange()
if (bottomNavigationItems.get(i).getImageResourceActive() != 0) {
if (i == currentItem)
icon.setImageResource(bottomNavigationItems.get(i).getImageResourceActive());
else
bottomNavigationItems.get(i).getImageResource();
}
Hello,
How to make this navigation bar compatible with API level 17
AS MENTIONED IN the title i've set up the view pager, the color resources, and the images.
The pager is assigned to an adapter, simply i keep getting a null pointer exception somehow
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mcubetechnologies.landolsi.cherni.onabupourvous/com.mcubetechnologies.landolsi.cherni.onabupourvous.MainActivity}: java.lang.NullPointerException
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2389)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
at android.app.ActivityThread.access$900(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5345)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method)
Caused by: java.lang.NullPointerException
at com.luseen.luseenbottomnavigation.BottomNavigation.BottomNavigationView.setUpWithViewPager(BottomNavigationView.java:366)
at com.mcubetechnologies.landolsi.cherni.onabupourvous.MainActivity.onCreate(MainActivity.java:57)
at android.app.Activity.performCreate(Activity.java:5343)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1088)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2343)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2441)
at android.app.ActivityThread.access$900(ActivityThread.java:151)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1354)
at android.os.Handler.dispatchMessage(Handler.java:110)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:5345)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:515)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:824)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:640)
at dalvik.system.NativeStart.main(Native Method) `
Hello,
I currently have a tab with the user location, and would like to dynamically change the text of the BottomNavigationItem.
Do you plan to add something like:
bottomNavigationView.getItem(0).setTitle("NewTitle")?
Thank a lot for the awesome lib!
It seems that the view you are creating with the gradient as a background it is actually cutting the content. In your examples the shadow looks good because you do not have any content and the background is white. I would expect to see something like the attached image where the shadow it is on top of the content.
Code of this line should be changed as below:
icon.setImageResource(bottomNavigationItems.get(i).getImageResource());
Hello All,
i hope you all good; i have a question
can we set up the size of an item in the bottomnavigationview ?
if yes how can we do so please ?
Thanks
The library is very awesome, but you mentioned that I can use it with view pager using a method setViewPager(). and this was not found
Can i select none of items on bottom bar ? or how can i provide multiple click on same item ?
Thanks for thew library and help.
@armcha
Thank for your great library and great work
Is it possible to add a method which can get or set the Typeface of Bottom Navigation Items?
It would be greater than normal Typeface
Thank you again
I'm waiting for your response
According to my need ..... i want to divide bottom tab into two parts 1st contain 3 tab and 2nd also 3 and between them, i want to add Floating action button ..is it possible ?..plzz elaborate ...
When I use the simplified Chinese, the text font is so big, I want to customize the size of the text, what should I do
Hi,
is it possible to select the tab manually?
(Using 5 tabs which have activities/fragments behind, I need to set the selected tab manually after I switch to an activity.)
Cheers,
Chris
Hi Bro , great work and really like your library , only one request to you is it possible to update library for more than 5 items and if more than 5 then arrow key appear and we can press arrow key or swipe RTL to view other options
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.