Closed baoxin closed 8 years ago
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.
Yeah, I'm trying to do that.
And what?
Hello, i have the same issue with french language title and badge do not show
<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"/>
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
<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"/>
Do you set titles in models? And what color of your titles?
Maybe your fonttype doesnt provide any symbols for your languages?
How do you set the color of the titles please?
Can you send me yout strings?
<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>
Its so interesting.
I dont know what is the problem is. I`ve tested on many langs and there was ok.
Its seems like your method of getString(R.string.tab_bar_histoires) returns to you "". Try to log this.
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'
will try to log it
No. This is problem on your side.
A yes, it's our problem, the sample code can run normally
Mhhh the logs are correct, its really strange because the demo are ok
Well, it is very strange
Maybe your strings placed in not default folder of /values or /string.xml. Maybe there are some flag for this path like lang etc.
i am trying this
final String[] colors = getResources().getStringArray(R.array.default_preview);
final ArrayList
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) {
}
});
What's the reason why I found. Cannot use relativelayout parent layout
mhhh i use parent relativelayout
will try with linearlayout
linearlayout is ok
no it does not work with linearlayout too :/
ok it works with linearlayout like that <?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" xmlns:tools="http://schemas.android.com/tools" android:background="#423752" android:orientation="vertical">
<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" />
i have the titles finally :)
Thank you very much for your help
:)
You welcome.
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?