GithubHelp home page GithubHelp logo

Comments (11)

ittianyu avatar ittianyu commented on June 27, 2024

Please show me your code.

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

Menu:

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item
        android:id="@+id/navigation_engagement"
        android:checked="true"
        android:icon="@drawable/folder_con"
        android:title="@string/title_engagement" />

    <item
        android:id="@+id/navigation_mytodos"
        android:icon="@drawable/check_ico"
        android:title="@string/title_dashboard" />
    <!--must set the item title to empty-->
    <item
        android:id="@+id/menu_add"
        android:icon="@drawable/icon_add"
        android:title="" />
    <item
        android:id="@+id/navigation_activity"
        android:icon="@drawable/active_ico"
        android:title="@string/title_notifications" />
    <item
        android:id="@+id/navigation_file"
        android:icon="@drawable/file_ico"
        android:title="@string/title_files" />
</menu>

XMl :

<com.auvenir.ui.BottomNavigationViewEx
        android:id="@+id/navigation"
        style="@style/bnve_primary_bg"
        android:layout_gravity="bottom"
        app:itemIconTint="@color/selector_item_gray_color"
        app:itemTextColor="@color/selector_item_gray_color"
        app:menu="@menu/menu_navigation_center_icon_only" />

Java code:

navigation = (BottomNavigationViewEx) findViewById(R.id.navigation);
        navigation.setOnNavigationItemSelectedListener(this);
        navigation.enableAnimation(false);
        navigation.enableShiftingMode(false);
        navigation.enableItemShiftingMode(false);
        int centerPosition = 2;
        navigation.setIconSizeAt(centerPosition, 48, 48);
        navigation.setTextSize(10);
        navigation.setIconMarginTop(centerPosition, BottomNavigationViewEx.dp2px(this, 4));
        navigation.setItemBackground(centerPosition, R.color.white);

        navigation.setIconTintList(centerPosition,
                getResources().getColorStateList(R.color.selector_item_center));

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

Can you help me? Thanks

from bottomnavigationviewex.

ittianyu avatar ittianyu commented on June 27, 2024

Can't find the problem. Can you share me the project ?
Or you can try another method to show center icon only.

  1. clear center menu icon
  2. add FloatingActionButton at bottom center..
  3. Control the tab click click listener.

from bottomnavigationviewex.

ittianyu avatar ittianyu commented on June 27, 2024

Sorry, not have time today. I will reply at tomorrow.

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

I use app of you https://github.com/ittianyu/BottomNavigationViewEx/tree/master/app change menu_navigation_center_icon_only.xml of you. I add icon
<item android:id="@+id/menu_add" android:icon="@drawable/ic_add_48dp" android:title="" />

to
<item android:id="@+id/menu_add" android:icon="@drawable/icon_add" android:title="" />
then not show.

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

You can help me when I have free time!

from bottomnavigationviewex.

ittianyu avatar ittianyu commented on June 27, 2024

I just try your image. It not works. May be you need a svg instead of png.
You can find some images here: http://www.iconfont.cn/search/index?searchType=icon&q=add
I think png is ok. But may be can't mix with svg. I means all item use png.

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

So My icon not works?

from bottomnavigationviewex.

ittianyu avatar ittianyu commented on June 27, 2024

Try to use svg or use five png.

from bottomnavigationviewex.

loidoantitan avatar loidoantitan commented on June 27, 2024

I use file png and svg not work with my icon. I think Some other color icons (not black color, color white) then not works.

from bottomnavigationviewex.

Related Issues (20)

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.