Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

menu without a title #33

Closed
baoxin opened this issue Jul 5, 2016 · 33 comments
Closed

menu without a title #33

baoxin opened this issue Jul 5, 2016 · 33 comments

Comments

@baoxin
Copy link

baoxin commented Jul 5, 2016

I am a Chinese but English is not very good, I use your library, but the menu does not have a title, I try to use your demo,it dose not have a title too. I don't know what's wrong?

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Hello. Thanks for question. There are a list of examples activities in sample app. You can look there and also check source code to resolve your issue.

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

Yeah, I'm trying to do that.

@baoxin baoxin closed this as completed Jul 5, 2016
@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

And what?

@darcheville06
Copy link

Hello, i have the same issue with french language title and badge do not show

@darcheville06
Copy link

    <com.gigamole.navigationtabbar.ntb.NavigationTabBar
        android:id="@+id/navigationTabBar"
                android:layout_alignParentBottom="true"
    android:layout_width="match_parent"
                android:layout_height="60dp"
                app:ntb_badge_gravity="top"
                app:ntb_badge_position="right"
                app:ntb_badged="true"
                app:ntb_scaled="true"
                app:ntb_tinted="true"
                app:ntb_title_mode="all"
                app:ntb_titled="true"
                app:ntb_swiped="true"/>

@darcheville06
Copy link

        final ArrayList<NavigationTabBar.Model> models = new ArrayList<NavigationTabBar.Model>()
        {
            {
                add(new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.icone_profile_tab),
                        Color.parseColor("#000000")
                ).title(getString(R.string.tab_bar_profil))
                        .build());

                add(new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.tab_bar_icone_missions),
                        Color.parseColor("#000000")
                ).title(getString(R.string.tab_bar_missions))
                        .build());

                add(new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.icone_push_tab),
                        Color.parseColor("#000000")
                ).build());

                add(new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.icone_activites_tab),
                        Color.parseColor("#000000")
                )
                        .title(getString(R.string.tab_bar_histoires))
                        .build());

                add(new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.icone_circuit_tab),
                        Color.parseColor("#000000") // fond du linearlayout quand actif
                ).title(getString(R.string.tab_bar_circuits))
                        .build());

            }
        };
        navigationTabBar.setModels(models);

        //setBackgroundColor ne marche pas
        navigationTabBar.setActiveColor(getResources().getColor(R.color.white)); //couleur de l'icone quand actif
        navigationTabBar.setInactiveColor(getResources().getColor(R.color.white)); //couleur de l'icone quand pas actif

        navigationTabBar.setBgColor(getResources().getColor(R.color.tab_bar_non_selectionne));//fond de couleur quand pas actif

        navigationTabBar.setViewPager(mViewPager, Prefs.getInt(GlobalConfig.SHARED_PREFERENCES_CURRENT_TAB, 2));

no error but they dont show

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

<com.gigamole.navigationtabbar.ntb.NavigationTabBar
android:id="@+id/navTabBar"
android:layout_width="match_parent"
android:layout_height="50dp"
android:layout_alignParentBottom="true"
app:ntb_badge_gravity="top"
app:ntb_badge_position="right"
app:ntb_badged="true"
app:ntb_scaled="true"
app:ntb_tinted="true"
app:ntb_title_mode="all"
app:ntb_bg_color="@color/white"
app:ntb_titled="true"
app:ntb_swiped="true"/>

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Do you set titles in models? And what color of your titles?

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Maybe your fonttype doesnt provide any symbols for your languages?

@darcheville06
Copy link

How do you set the color of the titles please?

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Can you send me yout strings?

@darcheville06
Copy link

<string name = "tab_bar_profil">Profile</string>
<string name = "tab_bar_missions">Quizz</string>
<string name = "tab_bar_histoires">Activities</string>
<string name = "tab_bar_circuits">Circuits</string>

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Its so interesting.

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

I dont know what is the problem is. I`ve tested on many langs and there was ok.

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Its seems like your method of getString(R.string.tab_bar_histoires) returns to you "". Try to log this.

@darcheville06
Copy link

maybe a conflict with an other library

compile 'com.github.MKergall:osmbonuspack:v5.8.1'
compile 'org.osmdroid:osmdroid-android:5.2@aar'
compile 'com.orhanobut:dialogplus:1.11@aar'
compile 'com.github.frank-zhu:pullzoomview:1.0.0'
compile 'com.facebook.android:facebook-android-sdk:+'
compile 'com.github.dmytrodanylyk.android-process-button:library:1.0.4'
compile 'com.github.bumptech.glide:glide:3.7.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'com.squareup.okhttp3:okhttp:3.2.0'
compile 'com.github.2359media:EasyAndroidAnimations:0.8'
compile 'com.squareup.retrofit2:retrofit:2.0.2'
compile 'com.google.android.gms:play-services-analytics:+'
compile 'com.mobsandgeeks:android-saripaar:+'
compile 'com.google.android.gms:play-services-location:+'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.jaredrummler:android-device-names:1.0.9'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:design:24.0.0'
compile 'info.hoang8f:fbutton:1.0.5'
compile 'uk.co.chrisjenx:calligraphy:2.2.0'
compile 'com.android.support:recyclerview-v7:24.0.0'
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.github.johnkil.android-progressfragment:progressfragment:1.4.+'
compile 'de.hdodenhof:circleimageview:+'
compile 'com.google.android.gms:play-services-panorama:+'
compile 'com.github.halysongoncalves:pugnotification:1.8.1'
compile 'com.commonsware.cwac:cam2:0.6.2'
compile 'com.infstory:recyclerlist:1.0.0'
compile 'com.kogitune:pre-lollipop-activity-transition:+'
compile 'com.github.pwittchen:reactivenetwork:0.2.0'
compile('net.i2p.android.ext:floatingactionbutton:1.10.0') {
    exclude module: "library"
}
compile 'com.makeramen:roundedimageview:2.2.1'
compile 'com.github.dmytrodanylyk.shadow-layout:library:1.0.1'
compile 'com.squareup.leakcanary:leakcanary-android:+'
compile 'org.zeroturnaround:zt-zip:1.9'
compile 'com.pixplicity.easyprefs:library:+'
compile 'com.github.jd-alexander:library:1.1.0'
compile 'com.github.viethoa:fastscroller:1.1.0'
compile 'com.github.fenjuly:ArrowDownloadButton:9e15b85e8a'
compile 'com.github.vlonjatg:progress-activity:v1.0.3'
compile('com.github.gabrielemariotti.recyclerview:recyclerview-animators:0.3.0-SNAPSHOT@aar') {
    exclude module: "okhttp"
}
compile('com.twitter.sdk.android:twitter:+') {
    transitive = true;
}
compile 'com.karumi:dexter:2.2.2'
compile 'com.hedgehog.ratingbar:app:1.0.4'
compile 'com.google.android.gms:play-services:+'
compile 'com.jonathanfinerty.expandabletextview:expandabletextview:0.0.2'
compile 'io.reactivex:rxandroid:1.2.0'
compile 'com.sangcomz:FishBun:0.4.4@aar'
//compile 'cn.finalteam:galleryfinal:1.4.8.7'
compile 'com.github.NightWhistler:HtmlSpanner:+'
//compile 'com.jakewharton:butterknife:8.0.1'

//apt 'com.jakewharton:butterknife-compiler:8.0.1'
compile 'com.anjlab.android.iab.v3:library:1.0.+'
compile 'com.joanzapata.iconify:android-iconify:+'
compile 'com.joanzapata.iconify:android-iconify-fontawesome:+'
compile 'com.github.thorbenprimke:realm-searchview:+'
compile 'com.jakewharton:butterknife:7.0.1'
compile 'com.pacioianu.david:ink-page-indicator:1.2.0'
compile 'com.github.johnpersano:supertoasts:1.3.4@aar'
compile 'com.estimote:sdk:0.10.5@aar'
compile 'com.github.medyo:fancybuttons:1.8.1'
compile 'com.rengwuxian.materialedittext:library:2.1.4'
compile 'com.github.dmytrodanylyk.shadow-layout:library:1.0.3'
compile 'com.github.devlight.navigationtabbar:navigationtabbar:1.2.3'

@darcheville06
Copy link

will try to log it

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

No. This is problem on your side.

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

A yes, it's our problem, the sample code can run normally

@darcheville06
Copy link

Mhhh the logs are correct, its really strange because the demo are ok

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

Well, it is very strange

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

Maybe your strings placed in not default folder of /values or /string.xml. Maybe there are some flag for this path like lang etc.

@darcheville06
Copy link

i am trying this

final String[] colors = getResources().getStringArray(R.array.default_preview);
final ArrayList<NavigationTabBar.Model> models = new ArrayList<NavigationTabBar.Model>();

        models.add(
                new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.ic_third),
                        Color.parseColor(colors[0]))
                        .selectedIcon(getResources().getDrawable(R.drawable.ic_third))
                        .title("Heart")
                        .badgeTitle("NTB")
                        .build()
        );
        models.add(
                new NavigationTabBar.Model.Builder(
                        getResources().getDrawable(R.drawable.ic_third),
                        Color.parseColor(colors[1]))

// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
.title("Cup")
.badgeTitle("with")
.build()
);
models.add(
new NavigationTabBar.Model.Builder(
getResources().getDrawable(R.drawable.ic_third),
Color.parseColor(colors[2]))
.selectedIcon(getResources().getDrawable(R.drawable.ic_third))
.title("Diploma")
.badgeTitle("state")
.build()
);
models.add(
new NavigationTabBar.Model.Builder(
getResources().getDrawable(R.drawable.ic_third),
Color.parseColor(colors[3]))
// .selectedIcon(getResources().getDrawable(R.drawable.ic_eighth))
.title("Flag")
.badgeTitle("icon")
.build()
);
models.add(
new NavigationTabBar.Model.Builder(
getResources().getDrawable(R.drawable.ic_third),
Color.parseColor(colors[4]))
.selectedIcon(getResources().getDrawable(R.drawable.ic_third))
.title("Medal")
.badgeTitle("777")
.build()
);

        navigationTabBar.setModels(models);

        //setBackgroundColor ne marche pas
        navigationTabBar.setActiveColor(getResources().getColor(R.color.white)); //couleur de l'icone quand actif
        navigationTabBar.setInactiveColor(getResources().getColor(R.color.white)); //couleur de l'icone quand pas actif

        navigationTabBar.setBgColor(getResources().getColor(R.color.tab_bar_non_selectionne));//fond de couleur quand pas actif

        DebugUtilities.displayInConsole("TOTO : " + getString(R.string.tab_bar_profil));

        navigationTabBar.setViewPager(mViewPager, Prefs.getInt(GlobalConfig.SHARED_PREFERENCES_CURRENT_TAB, 2));

        navigationTabBar.setOnTabBarSelectedIndexListener(new NavigationTabBar.OnTabBarSelectedIndexListener() {
            @Override
            public void onStartTabSelected(NavigationTabBar.Model model, int index) {
                try {
                    Prefs.putInt(GlobalConfig.SHARED_PREFERENCES_CURRENT_TAB, index);
                } catch (Exception e) {
                    new ExceptionManager(e, MonumentTrackerApplication.context);
                }
            }

            @Override
            public void onEndTabSelected(NavigationTabBar.Model model, int index) {

            }
        });

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

What's the reason why I found. Cannot use relativelayout parent layout

@darcheville06
Copy link

mhhh i use parent relativelayout

@darcheville06
Copy link

will try with linearlayout

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

linearlayout is ok

@darcheville06
Copy link

no it does not work with linearlayout too :/

@darcheville06
Copy link

ok it works with linearlayout like that

<com.monumentTrackerAddictive.Coeur.Fragments.NonScrollingViewPager
    android:id="@+id/viewpager"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1"/>

<com.gigamole.navigationtabbar.ntb.NavigationTabBar
    android:id="@+id/navigationTabBar"
    android:layout_width="match_parent"
    android:layout_height="60dp"
    app:ntb_badge_gravity="top"
    app:ntb_badge_position="right"
    app:ntb_badged="true"
    app:ntb_scaled="true"
    app:ntb_tinted="true"
    app:ntb_title_mode="all"
    app:ntb_titled="true"
    app:ntb_swiped="true"/>

<include
    android:layout_alignParentTop="true"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    layout="@layout/navigation_action_bar_progression" />

@darcheville06
Copy link

i have the titles finally :)

@darcheville06
Copy link

Thank you very much for your help

@baoxin
Copy link
Author

baoxin commented Jul 5, 2016

:)

@GIGAMOLE
Copy link
Member

GIGAMOLE commented Jul 5, 2016

You welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants