Git Product home page Git Product logo

bottombar's People

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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bottombar's Issues

Three icons BottomBar background color

Hi, that's mentioned earlier in other issues, but i open a new one just to discuss it.

Material design specs doesn't cover the light with light problem:

It will be great if we can set a color for the BottomBar at anytime, and also will be cool to have a custom attribute to set it via theme.

If you want i can open a PR for it

NoSuchMethodError

java.lang.NoSuchMethodError: android.widget.FrameLayout.
at com.roughike.bottombar.BottomBar.(BottomBar.java:86)
at com.roughike.bottombar.BottomBar.(BottomBar.java:72)
at com.roughike.bottombar.BottomBar.attach(BottomBar.java:131)
at com.example.bottombar.sample.MainActivity.onCreate(MainActivity.java:17)
at android.app.Activity.performCreate(Activity.java:4470)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1053)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1934)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4517)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:993)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:760)
at dalvik.system.NativeStart.main(Native Method)

Licenses inside the project

Why the licenses are inside of the folders of the library? It would be better to use one file in the root of the library.

Bottom Bar overlays part of the layout

After the latest update, the bottom bar is taking up part of the bottom layout (see how the FAB is overlapped), I guess because it isn't pushing it up?

screenshot_20160320-233349

RecyclerView inside FrameLayout doesen't work

Hello, I used the code below, the frame layout have recyclerview, but it doesn't show with BottomBar, only recyclerview or bottombar not both..

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">

    <com.roughike.bottombar.BottomBar
        android:id="@+id/bb_bottom_bar"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@color/white" />
    <FrameLayout
        android:id="@+id/fragmentContainer"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />
</LinearLayout>

will you release a gradle?

will you release a gradle?
and is this library have been finished for stable use? do you still have some import feature to add or modify?

Thank you for your great job~
Best Wishes~

Dark mode doesn't seem to work

After enabling dark mode with useDarkTheme(true), the bottom bar looks exactly the same as before. Selecting a tab causes it to disappear (I'm guessing because the text is now white):

screenshot_20160319-202740

Not detecting software navbar on CM11

I'm running Cyanogenmod 12 (Android 5.1.1) on my OnePlus One and I when I went for a trial run I noticed that the library always detects the software navbar as being active. It's possible to enable it and use it instead of the hardware buttons on the device, but by default it's not active.

It might be worth noting that I have configured my hardware menu button as recent apps but as far as I've noticed no changes when I configure it as menu button.

screenshot_2016-03-20-15-51-48
screenshot_2016-03-20-15-52-00

Library structure

Hi,

First nice job doing this library, but there are few things I would change.

  1. Make it more flexible, I do not see the reason why to create the bar dynamically in java. This is a ui library, thus should be provided as xml widget. Why? well, it makes it dynamic, flexible and visually to have it on the xml, the dev will be able to decide if wants to have some other view on top, for example coordinator layout? what happen here with the scroll behavior? etc...
  2. I would keep it simple! I don't see the reason why the BottomBar should be handling fragments. It should only be responsible of creating the tabs and the proper animations for each item as well as notifying on event. That's the problem of some UI libraries, they try to do too much.
  3. Related to the first point. Create and style_attribute so the dev can set a menu from xml.
  4. Add ability to set the full color of the BottomBar by tab, so a tab should define, icon, text, color

If I have so time this weekend I maybe fork it and make some pull request.

Br,
Marcel

can not understand the README

In Can it handle my Fragments and replace them automagically when a different tab is selected?, codes are:

mBottomBar.setFragmentItems(getSupportFragmentManager(), R.id.fragmentContainer,
    new BottomBarFragment(SampleFragment.newInstance("Content for recents."), R.drawable.ic_recents, "Recents"),
    new BottomBarFragment(SampleFragment.newInstance("Content for favorites."), R.drawable.ic_favorites, "Favorites"),
    new BottomBarFragment(SampleFragment.newInstance("Content for nearby stuff."), R.drawable.ic_nearby, "Nearby")
);

But in Separate BottomBars for individual Fragments, they are:

@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)     {
    View view = inflater.inflate(R.layout.my_fragment_layout, container, false);
    // initialize your views here

    BottomBar bottomBar = BottomBar.attach(view, savedInstanceState);
    bottomBar.setItems(
        new BottomBarTab(R.drawable.ic_recents, "Recents"),
        new BottomBarTab(R.drawable.ic_favorites, "Favorites"),
        new BottomBarTab(R.drawable.ic_nearby, "Nearby")
    );

    // Important! Don't return the view here. Instead, return the bottomBar, as it already contains your view.
    return bottomBar;
}

So if I wanna use Bottom bars connected with 4 different fragments, what should I use?

BTW, you guys are really fast for this repository.

Weird navigation behavior

Not sure if it's just me.. but I have 5 menu items.. I can't seem to get back to home (0).

I can click and go through all the others fine but clicking home doesn't work. except on the one activity which I have: mBottomBar.selectTabAtPosition(2, false); set in the onResume.. and that ONLY works if I go to menu item 2 then 3, hit return, and then click on 0.

If I click on item 2, then back to home it doesn't work.

Snackbars should go above the bottom bar.

I don't know if it was already reported, but when I implement this library and try to attach a snack bar like so:

Snackbar.make(bottomBar, "Some text", Snackbar.LENGTH_LONG).show();

I get this result (The snackbar overlays the bottom bar).

According to the guidelines it should look like this.

And once again, thank you for this great and quick implementation.

Does not detect whether device have soft navigation bar or not

If no detect whether android device have soft navigation bar or not then the height of bottom bar will abnormal.
Modification:
BottomBar.java
navBarMagic() {
...
boolean hasMenuKey = ViewConfiguration.get(activity).hasPermanentMenuKey();
boolean hasBackKey = KeyCharacterMap.deviceHasKey(KeyEvent.KEYCODE_BACK);
final int navBarHeight;

        if(!hasMenuKey && !hasBackKey) {
          if (navBarIdentifier > 0) {
            navBarHeight = res.getDimensionPixelSize(navBarIdentifier);
          } else {
            navBarHeight = MiscUtils.dpToPixel(activity, 48);
          }
        } else {
          navBarHeight = 0;
        }

...
}

Android Iconics

I'm using your BottomBar with another good lib to generate icons : Android Iconics. Its implementation is so easy, you can maybe refer a link into the readme for people who want ? Or don't knoa about that lib ?
https://github.com/mikepenz/Android-Iconics
quick showcase :

bottomBar = BottomBar.attach(view, savedInstanceState);
        bottomBar.setFragmentItems(getActivity().getSupportFragmentManager(), R.id.container,
                        new BottomBarFragment(new LatestKitFragment(), new IconicsDrawable(getActivity(), CommunityMaterial.Icon.cmd_trending_up).sizeDp(18), "Trending"),
                        new BottomBarFragment(new LatestKitFragment(), new IconicsDrawable(getActivity(), CommunityMaterial.Icon.cmd_newspaper).sizeDp(18), "Latest"),
                        new BottomBarFragment(new LatestKitFragment(), new IconicsDrawable(getActivity(), CommunityMaterial.Icon.cmd_tag_faces).sizeDp(18), "All")
        );

Change typeface

Is it possible to change the typeface of the labels by a function like bottomBar.setTypeface(Typeface tf) ?

How to set color of bottom bar and its items?

Hello, just started checking this out and it seems really cool. However I can't seem to find out how to set the background color or item selected color? Thanks and continue the great work!

NullPointerException occurred when i did not set mapColor.

ver1.0.5

i did not set "mapColorForTab()" method.

(mColorMap is null)

java.lang.NullPointerException
at com.roughike.bottombar.BottomBar.handleBackgroundColorChange(BottomBar.java:545)
at com.roughike.bottombar.BottomBar.selectTab(BottomBar.java:530)
at com.roughike.bottombar.BottomBar.onClick(BottomBar.java:366)
at android.view.View.performClick(View.java:4492)
at android.view.View$PerformClick.run(View.java:18647)
at android.os.Handler.handleCallback(Handler.java:733)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:136)

thank you.

Remove attributes from manifest's Application

A library shouldn't declare unnecessary attributes on the Application as doing so will automatically merge them into app's manifest. For example, an app that doesn't declare supportsRtl will now have it set to true after importing this library, even though the default value should be false.

BottomBar/bottom-bar/src/main/AndroidManifest.xml

<application
        android:allowBackup="true"
        android:label="@string/app_name"
        android:supportsRtl="true">

</application>

How to show all titles visible and set custom position ?

Hi. Thank you for your amazing lib!
I have a few questions, answer on which I didn't find at documentation.

  1. how can I make title always visible for all tabs? As on your first example animation on the readme.
  2. How can I create my activity with BottomBar wich will stay by default on the second position, for example?

error when switch from 1.0.1 to 1.0.3

using 1.0.1, my app runs well, except the ugly top border.
after switch to 1.0.3, and add the statement:mBottomBar.hideShadow(), just like below:
mBottomBar = BottomBar.attach(this, savedInstanceState); mBottomBar.hideShadow(); mBottomBar.setItemsFromMenu(R.menu.menu_bottombar, new OnMenuTabSelectedListener() { @Override public void onMenuItemSelected(int resId) { switch (resId) { case R.id.bottomBarHome: displayView(0); break;
the ugly top border appear above the toolbar:
before:
2016-03-18 12 23 49
after:
2016-03-18 12 22 33

next, when click the bottom icon, error occurs:
2016-03-18 12 31 33

the code have been posted in the issue:
How to style top border? #3

How to implement the navigation bar goodness?

I want to get this result.

Here is my current code:


       bottomBar = BottomBar.attach(this, savedInstanceState);

        bottomBar.setItemsFromMenu(R.menu.bar, new OnMenuTabSelectedListener() {
            @Override
            public void onMenuItemSelected(int resId) {

            }
        });
        bottomBar.mapColorForTab(0, ContextCompat.getColor(this, R.color.primary_dark));
        bottomBar.mapColorForTab(1, ContextCompat.getColor(this, R.color.md_teal_600));
        bottomBar.mapColorForTab(2, ContextCompat.getColor(this, R.color.md_red_500));
        bottomBar.mapColorForTab(3, ContextCompat.getColor(this, R.color.md_blue_grey_500));

But the result of this code is a black navbar.

What am I missing?

Does not follow Material design specs

Hi, this was a fast release! I was just reading about this a couple of days ago.

I noticed that the second gif you posted does not follow the material design specs. The active & inactive items don't shrink or expand.

Crashed when fast switch item

17:58:20.335 8390-8390/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.example.bottombar.sample, PID: 8390
java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.Context android.view.ViewGroup.getContext()' on a null object reference
at com.example.bottombar.sample.SampleFragment.onCreateView(SampleFragment.java:50)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1974)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1067)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1252)
at android.support.v4.app.BackStackRecord.run(BackStackRecord.java:738)
at android.support.v4.app.FragmentManagerImpl.execPendingActions(FragmentManager.java:1617)
at android.support.v4.app.FragmentManagerImpl$1.run(FragmentManager.java:517)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5477)
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:947)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:742)
03-18 17:58:20.335 2825-3406/? W/ActivityManager: Force finishing activity 1 com.example.bottombar.sample/.MainActivity

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.