GithubHelp home page GithubHelp logo

ittianyu / bottomnavigationviewex Goto Github PK

View Code? Open in Web Editor NEW
3.4K 82.0 556.0 1.73 MB

An android lib for enhancing BottomNavigationView. 一个增强BottomNavigationView的安卓库。

License: MIT License

Java 100.00%
bottomnavigationview

bottomnavigationviewex's Introduction

BottomNavigationViewEx

An android lib for enhancing BottomNavigationView.

MIT License api 9+

Info Amount
Linsong Wang 100$

Features

Method Description
enableAnimation Enable or disable click item animation(text scale and icon move animation in no item shifting mode). Default true.
enableItemShiftingMode Enable the shifting mode for each item. It will have a shifting animation for item if true. Otherwise the item text is always shown. Default true when item count > 3.
enableShiftingMode Enable the shifting mode for navigation. It will has a shift animation if true. Otherwise all items are the same width. Default true when item count > 3.
getBottomNavigationItemView Get private mButton in mMenuView at position
getBottomNavigationItemViews Get private mButtons in mMenuView
getCurrentItem Get the current checked item position.
getIconAt Get icon at position.
getItemCount Get item count.
getItemHeight Get item height.
getLargeLabelAt Get large label at position. Each item has two labels, one is large, the other is small.
getSmallLabelAt Get small label at position. Each item has two labels, one is large, the other is small.
getMenuItemPosition Get menu item position in menu. Return position if success, -1 otherwise.
getOnNavigationItemSelectedListener Get OnNavigationItemSelectedListener.
setCurrentItem Set the currently checked item.
setIconMarginTop set margin top for icon.
setIconSize Set all item ImageView size.
setIconSizeAt Set all item ImageView size which is at position.
setIconsMarginTop set margin top for all icons.
setIconTintList Set item icon tint list.
setIconVisibility Change the visibility of an icon.
setItemBackground Set background of item.
setItemHeight Set menu item height.
setLargeTextSize Set all item large TextView size. Each item has two labels, one small and one large. The small one will be shown when item state is normal. The large one will be shown when item is checked.
setSmallTextSize Set all item small TextView size. Each item has two labels, one small and one large. The small one will be shown when item state is normal. The large one will be shown when item is checked.
setTextSize Set all item large and small TextView size.
setTextTintList Set item TextView color.
setTextVisibility Change the visibility of text.
setTypeface set Typeface for all item TextView.
setupWithViewPager This method will link the given ViewPager and this BottomNavigationViewEx together so that changes in one are automatically reflected in the other. This includes scroll state changes and clicks.

Example

Style

Attention: Something wrong on Android 4.x

With ViewPager

Add ViewBadger

Center Floating Action Button

Adding to project

Sdk Version

compileSdkVersion >= 25

Importing to project(choose one)

Example for Gradle:

Step 1. Add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url "https://jitpack.io" }
		maven { url "https://maven.google.com" }
	}
}

Step 2. Add the dependency

  1. old version support lib is 25 or 26
compile 'com.github.ittianyu:BottomNavigationViewEx:1.2.4'
compile "com.android.support:design:26.+"
  1. new version support lib = 28
implementation 'com.github.ittianyu:BottomNavigationViewEx:2.0.4'
implementation "com.android.support:design:28.0.0"
  1. AndroidX use new version,and add config into gradle.properties
android.useAndroidX=true
android.enableJetifier=true

Manual:

Downloading BottomNavigationViewEx.java and copying it to you project.

Getting started

Adding a custom widget in xml :

<com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
    android:id="@+id/bnve"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@color/colorPrimary"
    app:itemIconTint="@color/selector_item_color"
    app:itemTextColor="@color/selector_item_color"
    app:menu="@menu/menu_navigation_with_view_pager" />

Binding view in Activity:

BottomNavigationViewEx bnve = (BottomNavigationViewEx) findViewById(R.id.bnve);

Disable all animations

bnve.enableAnimation(false);
bnve.enableShiftingMode(false);
bnve.enableItemShiftingMode(false);

Custom text and icon size

bnve.setIconSize(widthDp, heightDp);
bnve.setTextSize(sp);

Binding with ViewPager

// set adapter
adapter = new VpAdapter(getSupportFragmentManager(), fragments);
bind.vp.setAdapter(adapter);

// binding with ViewPager
bind.bnve.setupWithViewPager(bind.vp);

Add badge view

  1. Add badge lib
    compile 'q.rorbin:badgeview:1.1.0'
    
  2. Bind bottom view
    // add badge
    addBadgeAt(2, 1);
    
    private Badge addBadgeAt(int position, int number) {
        // add badge
        return new QBadgeView(this)
                .setBadgeNumber(number)
                .setGravityOffset(12, 2, true)
                .bindTarget(bind.bnve.getBottomNavigationItemView(position))
                .setOnDragStateChangedListener(new Badge.OnDragStateChangedListener() {
                    @Override
                    public void onDragStateChanged(int dragState, Badge badge, View targetView) {
                        if (Badge.OnDragStateChangedListener.STATE_SUCCEED == dragState)
                            Toast.makeText(BadgeViewActivity.this, R.string.tips_badge_removed, Toast.LENGTH_SHORT).show();
                    }
                });
    }
    

Other usage in BottomNavigationViewEx

You can see the demo.

Usage in BottomNavigationView

Other usage is the same as official BottomNavigationView. You can click here for detail.

ProGuard

If you are using ProGuard you might need to add the following option:

None Android X

-keep public class android.support.design.widget.BottomNavigationView { *; }
-keep public class android.support.design.internal.BottomNavigationMenuView { *; }
-keep public class android.support.design.internal.BottomNavigationPresenter { *; }
-keep public class android.support.design.internal.BottomNavigationItemView { *; }

Android X

-keep public class com.google.android.material.bottomnavigation.BottomNavigationView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationMenuView { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationPresenter { *; }
-keep public class com.google.android.material.bottomnavigation.BottomNavigationItemView { *; }

References

The lib is based on BottomNavigationView in Support Library 25 design.

I found it was inflexible when I tried the demo. For example, I couldn't change the currently checked item through code. So I wrote a class to extend it to provide some useful methods.

You have no need to worry about stability, because I minimised the modifications through reflection.

Thanks

Thanks to Adrián Mouly | liaolintao | Luong Vo.

License

MIT License

Copyright (c) 2017 ittianyu

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Donate

paypal: [email protected]

bottomnavigationviewex's People

Contributors

anky21 avatar ittianyu avatar liaolintao avatar limuyang2 avatar luongvo 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  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

bottomnavigationviewex's Issues

6666666666666666

厉害咧大神。就是搞不懂Google为什么不把这些方法暴露出来,因为还是有不需要位移的需要的。以后要是Google开发了api你就是功臣了。

Failed to inflate ColorStateList

I'm getting a crash after updating to android studio 3.0 preview 5
gradle url: gradle-4.1-milestone-1-all.zip
gradle tools: com.android.tools.build:gradle:3.0.0-alpha5
support libs: 26.0.0-beta2

E/AppCompatResources: Failed to inflate ColorStateList, leaving it to the framework
                                                                         java.lang.IllegalArgumentException: alpha must be between 0 and 255.
                                                                             at android.support.v4.graphics.ColorUtils.setAlphaComponent(ColorUtils.java:298)
                                                                             at android.support.v7.content.res.AppCompatColorStateListInflater.modulateColorAlpha(AppCompatColorStateListInflater.java:169)
                                                                             at android.support.v7.content.res.AppCompatColorStateListInflater.inflate(AppCompatColorStateListInflater.java:144)
                                                                             at android.support.v7.content.res.AppCompatColorStateListInflater.createFromXmlInner(AppCompatColorStateListInflater.java:88)
                                                                             at android.support.v7.content.res.AppCompatColorStateListInflater.createFromXml(AppCompatColorStateListInflater.java:67)
                                                                             at android.support.v7.content.res.AppCompatResources.inflateColorStateList(AppCompatResources.java:116)
                                                                             at android.support.v7.content.res.AppCompatResources.getColorStateList(AppCompatResources.java:74)
                                                                             at android.support.design.widget.BottomNavigationView.createDefaultColorStateList(BottomNavigationView.java:399)
                                                                             at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:147)
                                                                             at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:114)
                                                                             at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.<init>(BottomNavigationViewEx.java:55)
                                                                             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.rInflate(LayoutInflater.java:809)
                                                                             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 android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                                                                             at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                             at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
                                                                             at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
                                                                             at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
                                                                             at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                             at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
                                                                             at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                             at android.os.Looper.loop(Looper.java:155)
                                                                             at android.app.ActivityThread.main(ActivityThread.java:5696)
                                                                             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:1028)
                                                                             at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
android.view.InflateException: Binary XML file line #22: Error inflating class com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2411)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474)
                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:144)
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359)
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102)
                                                                         at android.os.Looper.loop(Looper.java:155)
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5696)
                                                                         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:1028)
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
                                                                      Caused by: android.view.InflateException: Binary XML file line #22: Error inflating class com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
                                                                         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.rInflate(LayoutInflater.java:809)
                                                                         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 android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
                                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140)
                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129)
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474) 
                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359) 
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                         at android.os.Looper.loop(Looper.java:155) 
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5696) 
                                                                         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:1028) 
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
                                                                      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.rInflate(LayoutInflater.java:809) 
                                                                         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 android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
                                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129) 
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474) 
                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359) 
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                         at android.os.Looper.loop(Looper.java:155) 
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5696) 
                                                                         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:1028) 
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823) 
                                                                      Caused by: java.lang.RuntimeException: Expecting menu, got ripple
                                                                         at android.support.v7.view.SupportMenuInflater.parseMenu(SupportMenuInflater.java:159)
                                                                         at android.support.v7.view.SupportMenuInflater.inflate(SupportMenuInflater.java:126)
                                                                         at android.support.design.widget.BottomNavigationView.inflateMenu(BottomNavigationView.java:234)
                                                                         at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:165)
                                                                         at android.support.design.widget.BottomNavigationView.<init>(BottomNavigationView.java:114)
                                                                         at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.<init>(BottomNavigationViewEx.java:55)
                                                                         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.rInflate(LayoutInflater.java:809) 
                                                                         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 android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287) 
                                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:140) 
                                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1129) 
                                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364) 
                                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2474) 
                                                                         at android.app.ActivityThread.access$800(ActivityThread.java:144) 
                                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1359) 
                                                                         at android.os.Handler.dispatchMessage(Handler.java:102) 
                                                                         at android.os.Looper.loop(Looper.java:155) 
                                                                         at android.app.ActivityThread.main(ActivityThread.java:5696) 
                                                                         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:1028) 
                                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)

Custom typeface only works for the selected item

Really cool extensions for BottomNavigationView. I'm having an issue with setting a custom font.

I'm using the following code:

Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/SourceSansPro/SourceSansPro-Bold.ttf");
bnve.setTypeface(typeface);

The font SourceSansPro-Bold is only applied to the selected item. All other items remain in the default font.

Vertical center

Vertical center normalization is fucked up. If the navgiation is e.g. 48dp, your icons are 20+dp, they get aligned a bit to the bottom rather than shifted to the top so it can be vertically aligned. Can we have the option to shift the offset of the menu items? OR even better: to let BottomNavigationViewEx do that behind the scenes automatically for us?

Bottom Navigation View padding

How can i set the View padding top and bottom using setTextVisibility(false);? The bar height is so small. Thank you.

在NestedScrollView中能不能固定在屏幕底部

我的Root View是NestedScrollView,使用BottomNavigationView或Ex都会排到内容底部,不是屏幕底部。layout_gravity 或者 alignParentBottom 都无效~
有什么方法固定在屏幕底部么?谢谢。

android:allowBackup conflict

The manifest of this library sets allowBackup to true. This value may conflict with the manifest of app. I think this line can be deleted from the manifest of the library because it is not required.

Error log:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute application@allowBackup value=(false) from AndroidManifest.xml:10:9-36
	is also present at [com.github.ittianyu:BottomNavigationViewEx:1.1.3] AndroidManifest.xml:12:9-35 value=(true).
	Suggestion: add 'tools:replace="android:allowBackup"' to <application> element at AndroidManifest.xml:8:5-28:19 to override.

Code location:
https://github.com/ittianyu/BottomNavigationViewEx/blob/master/widget/src/main/AndroidManifest.xml#L4

com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getFontHeight (Unknown Source:4)

GREAT LIBRARY 👍,
but I have an issue...
I'm testing the library in emulator works fine but on device i get this error:
com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getFontHeight (Unknown Source:4)

or full stack trace:

Fatal Exception: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.primoz.fluidwallpaper/com.primoz.fluidwallpaper.activities.MainActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2817)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
Caused by java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getFontHeight(Unknown Source:4)
at com.primoz.fluidwallpaper.activities.MainActivity.onCreate(Unknown Source:49)
at android.app.Activity.performCreate(Activity.java:6975)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
at android.app.ActivityThread.-wrap11(Unknown Source)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6541)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

I'm using it like in onCreate:


ButterKnife.bind(this);

navigation.enableShiftingMode(false);
navigation.enableItemShiftingMode(false);
navigation.setTextVisibility(false); navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);

text is not visible along with icon

I have done following coding

bottomNavigationView.enableAnimation(false);
bottomNavigationView.enableShiftingMode(false);
bottomNavigationView.enableItemShiftingMode(false);

but text is only visible on selected icon. how to show text for all icons.

My android version is 6.0.1 (Mi Note3)

切换存在BUG

从0切到3然后切回第0个第2个的文字直接就消失了。

Drop min SDK to 9

Hi there,

I was wondering if you could elaborate on the reason for having a minSdk of 11. It seems to have been so since your initial commit, but it seems to compile/lint fine when I drop the minSdk to 9. Given the support library supports down to 9, would you consider dropping the minSdk to 9 for this library too?

Cheers.

Badger example

Due that the BadgerView used in the example is deprecated, I started looking for an alternative. I found this one:

https://github.com/AlexLiuSheng/BadgeView

I changed a little your example code and apparently it works just fine. Could you give it a try?

Thank you!

Exclude android:label attr from Android Manifest

Cannot use library since it uses the label attr in its own Android Manifest.

Error:Execution failed for task ':mobile:processDebugManifest'.

Manifest merger failed : Attribute application@label value=(@string/title_app) from AndroidManifest.xml:18:13-46
is also present at [com.github.ittianyu:BottomNavigationViewEx:1.1.2] AndroidManifest.xml:13:9-41 value=(@string/app_name).
Suggestion: add 'tools:replace="android:label"' to element at AndroidManifest.xml:7:5-58:19 to override.

底部item的icon如何设置2张渐变的png图

需求是底部导航栏的icon默认是灰色,选中是橙色渐变的效果,用这个框架后,图片被强制渲染成主题色,怎么解决?或者说,我想两张图片png的来切换选中未选中的icon,不要把我的icon强制再渲染上一层色,该怎么做?

Badge not working

I am trying to add support for badging in bottom navigation view. As per your examples you used "ActivityBadgeViewBinding" , but this class does not exisit anywhere in library. Pleas help to resolve this.

建议增加单独Item的setIconVisibility的方法

目前的setIconVisibility针对所有BottomNavigationItemView设置。希望能增加类似setIconVisibility(int position ,boolean visibility)的方法控制Item的显示与隐藏.
ps:虽然也可以自己在代码里面获取到BottomNavigationItemView后设置visibility,但是会出现Item宽度间隔不一的问题。

请教,怎么会出现java.lang.NoSuchFieldException: No field mAnimationHelper in class这样的错误?

09-12 15:06:19.888 20291-20291/? I/zygote: Not late-enabling -Xcheck:jni (already on)
09-12 15:06:19.894 20291-20291/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
09-12 15:06:19.982 20291-20291/com.exectt.app I/InstantRun: starting instant run server: is main process
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: java.lang.NoSuchFieldException: No field mAnimationHelper in class Landroid/support/design/internal/BottomNavigationMenuView; (declaration of 'android.support.design.internal.BottomNavigationMenuView' appears in /data/app/com.exectt.app-vrO_uep479VkChTuwsv4Lg==/split_lib_dependencies_apk.apk:classes6.dex)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at java.lang.Class.getDeclaredField(Native Method)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.getField(BottomNavigationViewEx.java:781)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.addAnimationListener(BottomNavigationViewEx.java:109)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.init(BottomNavigationViewEx.java:96)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.(BottomNavigationViewEx.java:61)
09-12 15:06:20.068 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:647)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:418)
09-12 15:06:20.069 20291-20291/com.exectt.app W/System.err: at android.app.Activity.setContentView(Activity.java:2654)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at com.exectt.app.MainActivity.onCreate(MainActivity.java:41)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.Activity.performCreate(Activity.java:6975)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.os.Handler.dispatchMessage(Handler.java:105)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.os.Looper.loop(Looper.java:164)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6541)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Method.invoke(Native Method)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-12 15:06:20.070 20291-20291/com.exectt.app W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.addAnimationListener(BottomNavigationViewEx.java:110)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.init(BottomNavigationViewEx.java:96)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at com.exectt.app.widgets.BottomNavigationViewEx.(BottomNavigationViewEx.java:61)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Constructor.newInstance0(Native Method)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Constructor.newInstance(Constructor.java:334)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createView(LayoutInflater.java:647)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:790)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:730)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.rInflate(LayoutInflater.java:863)
09-12 15:06:20.071 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:824)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:515)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:418)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.app.Activity.setContentView(Activity.java:2654)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at com.exectt.app.MainActivity.onCreate(MainActivity.java:41)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.app.Activity.performCreate(Activity.java:6975)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1213)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2770)
09-12 15:06:20.072 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2892)
09-12 15:06:20.073 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.-wrap11(Unknown Source:0)
09-12 15:06:20.073 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1593)
09-12 15:06:20.073 20291-20291/com.exectt.app W/System.err: at android.os.Handler.dispatchMessage(Handler.java:105)
09-12 15:06:20.074 20291-20291/com.exectt.app W/System.err: at android.os.Looper.loop(Looper.java:164)
09-12 15:06:20.074 20291-20291/com.exectt.app W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6541)
09-12 15:06:20.074 20291-20291/com.exectt.app W/System.err: at java.lang.reflect.Method.invoke(Native Method)
09-12 15:06:20.074 20291-20291/com.exectt.app W/System.err: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
09-12 15:06:20.074 20291-20291/com.exectt.app W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:767)

当ViewPager里添加了多于bottomNavigationView的items数量时,会报index our of bound

您好,当我用自带的BottomNavigationView的时候,我的底部菜单里只有3个items(buttons), 但是我可以在ViewPager里设置多于3个fragments。例如,我在adapter里添加了五个fragments,而BNV里只有3个items。
但是,当我用BottomNavigationViewEx的时候,会报出index out of bound错误。
请问是否可以添加setItems数量的方法?
抑或您有什么好的解决方案?
多谢

After adding BadgeView icon goes down

I tried to use BadgeView with BottomNavigationViewEx.
I used code like this:

bottomNavigationView.enableAnimation(false);
bottomNavigationView.enableItemShiftingMode(false);
bottomNavigationView.enableShiftingMode(false);

private BadgeView addBadgeViewAt(int position, String text, int shape) {
        // get position
        ImageView icon = bottomNavigationView.getIconAt(position);
        int[] pos = new int[2];
        icon.getLocationInWindow(pos);
        // action bar height
        ActionBar actionBar = getSupportActionBar();
        int actionBarHeight = 0;
        if (null != actionBar) {
            actionBarHeight = actionBar.getHeight();
        }
        int x = (int) (pos[0] + icon.getMeasuredWidth() * 0.7f);
        int y = (int) (pos[1] - actionBarHeight - icon.getMeasuredHeight() * 1.25f);
        // calculate width
        int width = 16 + 4 * (text.length() - 1);
        int height = 16;

        BadgeView badgeView = BadgeFactory.create(this)
                .setTextColor(Color.WHITE)
                .setWidthAndHeight(width, height)
                .setBadgeBackground(Color.RED)
                .setTextSize(10)
                .setBadgeGravity(Gravity.RIGHT | Gravity.TOP)
                .setBadgeCount(text)
                .setShape(shape)
                .setSpace(1, 1)
                .bind(icon);
//        badgeView.setX(x);
//        badgeView.setY(y);
        return badgeView;
    }

At first badge looks good.
1

But when I start to click on BottomNavigationView icon goes down, and stays there.
2

app:itemIconTint only works for item in state_checked=true for APIs above KitKat

Having an issue with app:itemIconTint: colors from the xml selector are only applied to items that are in state_checked=true. The ones that are not are not colored. This only happens for APIs ABOVE KitKat.

Here's how I define my BottomNavigationView:

<com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx
    android:id="@+id/bottomNavView"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignParentBottom="true"
    android:background="@android:color/white"
    android:paddingBottom="@dimen/bottom_nav_menu_margin"
    app:elevation="@dimen/bottomview_elevation"
    app:itemIconTint="@@color/bottom_nav_button"
    app:itemTextColor="@color/bottom_nav_button"
    app:layout_constraintBottom_toBottomOf="parent"
    app:menu="@menu/bottombar_menu" />

My selector, that resides in res/color:

<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:color="@color/colorPrimaryDark" android:state_checked="true"/>
    <item android:color="@color/colorPrimaryLight"/>
</selector>

I also tried with other possible states, but I learned that for BottomNavigationView it's indeed state_checked that we should work with.
I also tried using @drawable instead of @color, and also with
<item android:color="@color/colorPrimaryLight" android:state_checked="false"/> explicitly, but still no luck.

Any help appreciated and thank you for your work on this time-saving library!

Ripple effect

There is a way to maintain the Ripple Effect after removing the shifting mode?

I'm using this configuration:

bottomNavigationView.enableAnimation(false);
bottomNavigationView.enableShiftingMode(false);
bottomNavigationView.enableItemShiftingMode(false);
bottomNavigationView.setTextVisibility(true);
bottomNavigationView.setIconVisibility(true);

I don't want any kind of Shifting but I want to continue having the ripple effect.

Thank you and amazing job!

Badge not showing up properly

Hello,

Thanks for making an excellent library public. I tried using the nugget package and everything (animation, shifting) works fine but I am having issue with the Badge functionality.

I implemented exactly as per the code sample but in my case badge is not appearing and also the respective icon is getting reduced in size. Attached please find a screen shot for the same.

Kindly advise.
screenshot

Hidden menu item (visibility gone) still takes space in the Bottom Navigation

image
I have 4 menu items in the bottom navigation but I have set first item's visibility gone. But this is not allowing the remaining 3 icons to take full remaining space.
Can you suggest a solution for this issue?
How to set effect for the hidden icon like there are only three icons?
My use case is:
having 4 views in view pager, 1st view is not related to the bottom navigation, remaining 3 are selected with the bottom navigation.
But setting 3 items in navigation, will show the first item as selected but view pager will show the view not related to the selected item.
Thank you.

Set icons top and bottom margin (center icons vertically)

First of all, a big THANK YOU for your work on this library ❤️ ! The framework API is just too much to handle and I saved a lot of time thanks to BottomNavigationViewEx.

I have a question regarding centering of the menu items in the menu.
Is there a way to give them the same top and bottom margin/center them vertically? I am using setIconsMarginTop(int x) to style top margin, but I couldn't find anything similar for styling the bottom margin.

Appreciate your help.

"No field mAnimationHelper" error is thrown in the console in version 26.0.0 of the design support lib

When running an app with design support 26.0.0, the following lengthy stacktrace shows up in the logcat:

W/System.err: java.lang.NoSuchFieldException: No field mAnimationHelper in class Landroid/support/design/internal/BottomNavigationMenuView; 
W/System.err:     at java.lang.Class.getDeclaredField(Native Method)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.getField(BottomNavigationViewEx.java:799)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.addAnimationListener(BottomNavigationViewEx.java:84)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.init(BottomNavigationViewEx.java:70)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.<init>(BottomNavigationViewEx.java:60)
W/System.err:     at java.lang.reflect.Constructor.newInstance0(Native Method)
W/System.err:     at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
W/System.err:     at android.view.LayoutInflater.createView(LayoutInflater.java:645)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
W/System.err:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
W/System.err:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:777)
W/System.err:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
W/System.err:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
W/System.err:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
W/System.err:     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
W/System.err:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
W/System.err:     at no.rorbuer.eliassen.activities.BottomNavActivity_.setContentView(BottomNavActivity_.java:49)
W/System.err:     at no.rorbuer.eliassen.activities.BottomNavActivity_.onCreate(BottomNavActivity_.java:35)
W/System.err:     at android.app.Activity.performCreate(Activity.java:6679)
W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
W/System.err:     at android.app.ActivityThread.-wrap12(ActivityThread.java)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:154)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6119)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Class java.lang.Object.getClass()' on a null object reference
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.addAnimationListener(BottomNavigationViewEx.java:85)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.init(BottomNavigationViewEx.java:70)
W/System.err:     at com.ittianyu.bottomnavigationviewex.BottomNavigationViewEx.<init>(BottomNavigationViewEx.java:60)
W/System.err:     at java.lang.reflect.Constructor.newInstance0(Native Method)
W/System.err:     at java.lang.reflect.Constructor.newInstance(Constructor.java:430)
W/System.err:     at android.view.LayoutInflater.createView(LayoutInflater.java:645)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.createCustomViewInternal(CalligraphyLayoutInflater.java:211)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.access$000(CalligraphyLayoutInflater.java:20)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater$PrivateWrapperFactory2.onCreateView(CalligraphyLayoutInflater.java:302)
W/System.err:     at android.view.LayoutInflater$FactoryMerger.onCreateView(LayoutInflater.java:189)
W/System.err:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:777)
W/System.err:     at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:727)
W/System.err:     at android.view.LayoutInflater.rInflate(LayoutInflater.java:858)
W/System.err:     at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:821)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:518)
W/System.err:     at uk.co.chrisjenx.calligraphy.CalligraphyLayoutInflater.inflate(CalligraphyLayoutInflater.java:60)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:426)
W/System.err:     at android.view.LayoutInflater.inflate(LayoutInflater.java:377)
W/System.err:     at android.support.v7.app.AppCompatDelegateImplV9.setContentView(AppCompatDelegateImplV9.java:287)
W/System.err:     at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:139)
W/System.err:     at no.rorbuer.eliassen.activities.BottomNavActivity_.setContentView(BottomNavActivity_.java:49)
W/System.err:     at no.rorbuer.eliassen.activities.BottomNavActivity_.onCreate(BottomNavActivity_.java:35)
W/System.err:     at android.app.Activity.performCreate(Activity.java:6679)
W/System.err:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
W/System.err:     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2618)
W/System.err:     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2726)
W/System.err:     at android.app.ActivityThread.-wrap12(ActivityThread.java)
W/System.err:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1477)
W/System.err:     at android.os.Handler.dispatchMessage(Handler.java:102)
W/System.err:     at android.os.Looper.loop(Looper.java:154)
W/System.err:     at android.app.ActivityThread.main(ActivityThread.java:6119)
W/System.err:     at java.lang.reflect.Method.invoke(Native Method)
W/System.err:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
W/System.err:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)

Update dependencies

com.android.support:appcompat-v7:26.0.1 is out, so you should update the dependencies on your supportSDK26 branch to avoid this kind of AndroidManifest merging conflicts:

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : Attribute meta-data#android.support.VERSION@value value=(26.0.0) from [com.android.support:design:26.0.0] AndroidManifest.xml:28:13-35
  	is also present at [com.android.support:appcompat-v7:26.0.1] AndroidManifest.xml:28:13-35 value=(26.0.1).
  	Suggestion: add 'tools:replace="android:value"' to <meta-data> element at AndroidManifest.xml:26:9-28:38 to override.

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.