Coder Social home page Coder Social logo

Comments (27)

notjedi avatar notjedi commented on May 30, 2024 1

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.

st235 avatar st235 commented on May 30, 2024 1

Cool, I am glad that you problem is resolved πŸ˜ƒ

from expandablebottombar.

st235 avatar st235 commented on May 30, 2024

Will be fixed at 1.2.3

from expandablebottombar.

st235 avatar st235 commented on May 30, 2024

1.2.3 is live now

from expandablebottombar.

st235 avatar st235 commented on May 30, 2024

@jedi2610 Can you please confirm that problem really solved?

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

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.

st235 avatar st235 commented on May 30, 2024

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.

notjedi avatar notjedi commented on May 30, 2024

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.

st235 avatar st235 commented on May 30, 2024

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.

notjedi avatar notjedi commented on May 30, 2024

anroid

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.

st235 avatar st235 commented on May 30, 2024

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

alr @st235

from expandablebottombar.

st235 avatar st235 commented on May 30, 2024

@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.

notjedi avatar notjedi commented on May 30, 2024

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.

st235 avatar st235 commented on May 30, 2024

Yeah, if you remove your coordinator from home fragment it should work

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

untitled

now it works but it's just sooo broke πŸ˜†

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

@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.

st235 avatar st235 commented on May 30, 2024

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

@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.

st235 avatar st235 commented on May 30, 2024

yeah, probably, it will not work)

from expandablebottombar.

notjedi avatar notjedi commented on May 30, 2024

@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.

st235 avatar st235 commented on May 30, 2024

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.

st235 avatar st235 commented on May 30, 2024

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.

notjedi avatar notjedi commented on May 30, 2024

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.

st235 avatar st235 commented on May 30, 2024

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.

notjedi avatar notjedi commented on May 30, 2024

that's great to hear. looking out for the new version then. thanks

from expandablebottombar.

st235 avatar st235 commented on May 30, 2024

@jedi2610 hi πŸ‘‹,

1.2.4 is in live now. Currently, there were implemented hide and show methods.

from expandablebottombar.

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.