Comments (27)
hey alr thanks. i have a question tho. does the library try to instantiate the fragments anywhere?
EDIT1:
i already had it implemented using
view.clearAnimation();
view.animate().translationY(0).setDuration(200).start();
but the methods animation is really smooth, thanks
EDIT2: no need thanks i solved the problem
from expandablebottombar.
Cool, I am glad that you problem is resolved π
from expandablebottombar.
Will be fixed at 1.2.3
from expandablebottombar.
1.2.3
is live now
from expandablebottombar.
@jedi2610 Can you please confirm that problem really solved?
from expandablebottombar.
alr cool thanks. sorry for the late reply i had some other work today. okay i'll check if it really works.
EDIT: works like a charm. btw, do you mind telling me what caused the problem?
from expandablebottombar.
Yeah, cool!
This commit contains all the changes: 427b87c
But the main problem was getMaxScrollDistance
method. It didn't take into account the margin of the view
from expandablebottombar.
hey it's me again, this is not exactly an issue nut i need some help.
i actually have three fragments setup with the bottom bar and the bottom bar itself in my main activity which has a coordinator layout. the home fragment has a recycler view, but when i scroll the recycler view the bottom bar is not scrolling along with it. the layout_behaviour
for the bottom bar is set to github.com.st235.lib_expandablebottombar.behavior.ExpandableBottomBarScrollableBehavior
, but even then it is not working. can you help me with it?
from expandablebottombar.
Hi @jedi2610,
can you record a video, please? Also, attach the layout file o the schema of your views on it.
Best wishes,
Alexander Dadukin
from expandablebottombar.
HomeFragment file: https://termbin.com/30og
Acitvity main file: https://termbin.com/1ijnr
I want the bottom bar to scroll but i don't know how to implement it. thanks in advance
from expandablebottombar.
from expandablebottombar.
alr @st235
from expandablebottombar.
@jedi2610 hi π
unfortunately, it's not an issue. Your layout is too complex: nested coordinator layout consumes all the events, so, that's why top-level coordinator layout cannot detect scroll and proceed it to the behaviour.
I will investigate this further, but there is no solution at the time, except reduce the complexity of the layout. I am really sorry, that I dont have any better news for you.
Kind regards,
Alexander Dadukin
from expandablebottombar.
so what you're saying is that since i have 2 coordinator layouts (one in main activity and an other one in the home fragment),
the scroll events are not passed to the top-level coordinator layout(main activity) and instead they are being passed to the local coordinator layout (home fragment), right? so maybe if i remove the coordinator layout in my home fragment it would work?
from expandablebottombar.
Yeah, if you remove your coordinator from home fragment it should work
from expandablebottombar.
now it works but it's just sooo broke π
from expandablebottombar.
@st235 i'm actually trying to pass scroll events to the parent coordinator layout but still it doesn't work. have any idea to implement this?
coordinatorLayout.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_UP || motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
Log.i(TAG, "onTouch: Passed");
getActivity().findViewById(R.id.coordinator_layout).onTouchEvent(motionEvent);
return true;
}
return false;
}
});
mRecyclerView.setOnTouchListener(new View.OnTouchListener() {
@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
if (motionEvent.getAction() == MotionEvent.ACTION_UP || motionEvent.getAction() == MotionEvent.ACTION_DOWN) {
Log.i(TAG, "onTouch: Passed");
getActivity().findViewById(R.id.coordinator_layout).onTouchEvent(motionEvent);
return true;
}
return false;
}
});
mRecyclerView
and coordinatorLayout
are custom classes extending RecyclerView
and CoordinatorLayout
respectively where i override only the performClick
method. (it throws an error if i don't implement it)
from expandablebottombar.
from expandablebottombar.
@st235 i'm passing it to the parent CoordinatorLayout
so that it can make the bottom nav bar hide. is there anything wrong in that?
from expandablebottombar.
yeah, probably, it will not work)
from expandablebottombar.
@st235 yeah it's not working. i searched the internet an entire day but still no luck, couldn't find any answers. although it's clear that the local CoordinatorLayout
is receiving all events, i don't know how to pass it on to the parent CoordinatorLayout
.
do you know how to pass those events? can you please help me out on this one?
like you said replacing the child CoordinatorLayout
helps but it breaks the AppBarLayout
so replacing the child CoordinatorLayout
will not be enough because i want it for the AppBarLayout
to hide on scroll event.
from expandablebottombar.
The problem requires a lot of investigation here.
So, not all the events are consumed by the coordinator layout, but only that events, which can be classified as a nested scroll. When coordinator layout finds a scroll pattern it will consume the events. Unfortunately, in your example nested scroll consumed by the inner coordinator as long as you have AppBarLayout
- if you remove AppBarLayout
nested coordinator will work like a charm inside of outer one as it will not consume nested scroll events.
So, currently, I don't know what the fix is the best one for your problem - I will investigate the problem further and maybe find some fixes from the library side, but my current answer stays still the same - you need to reduce the complexity of your layout π
from expandablebottombar.
Maybe a better solution, for now, will be:
- Listen to the scroll inside of a fragment
- Hide bottom bar from fragment, for example
from expandablebottombar.
alr cool thanks. is there a method from the library side that i could invoke to hide the bottom bar?
i tried that but i was not able to animate the hiding. it was just instantly hiding. how do i animate that?
PS: sorry for all the dumb questions, i'm still a novice dev.
from expandablebottombar.
Yeah, as I said before - you are welcomed here, so, no need to apologize if you don't understand something.
Yeah, I don't have such methods (ie show/hide) in a view yet, but I have plans to release it soon.
from expandablebottombar.
that's great to hear. looking out for the new version then. thanks
from expandablebottombar.
@jedi2610 hi π,
1.2.4
is in live now. Currently, there were implemented hide
and show
methods.
from expandablebottombar.
Related Issues (20)
- Add the ability to vary the activeColor in an existing menu HOT 2
- Is there a way to use this in a java project? HOT 32
- How add badge for menu items? HOT 5
- custom font support for text in bottom bar HOT 4
- ExpandableBottomBarNavigationUI navigation not working when onItemSelectedListener added HOT 9
- Hacktoberfest 2020 HOT 1
- how can i use onItemSelectedListener?
- dynamic item control HOT 3
- Default Item selection HOT 3
- setting Font or typeface to title's HOT 1
- There was a problem when importing version 1.4.0 HOT 3
- Back Stack maintain Without Recreating Fragment HOT 6
- Back Stack maintain Without Recreating Fragment HOT 1
- Bottom Bar not showing properly HOT 4
- ExpandableBottomBarScrollableBehavior isn't working for me. HOT 9
- Failed to resolve: HOT 1
- how to select menu item via position HOT 1
- Class referenced in the layout file, github.com.st235.lib_expandablebottombar.ExpandableBottomBar, was not found in the project or the libraries HOT 6
- White background under icon and title of item selected in a fragment layout HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from expandablebottombar.