0

Hey i want to hide my toolbar when i click inside an editText Therefore i added these lines

mORMetWeight.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            if (!enterWeightClicked) {
                enterWeightClicked = true;
                Toolbar mToolbar = (Toolbar) getActivity().findViewById(R.id.toolbar);
                mToolbar.setVisibility(View.GONE);
                mContainer.removeView(cv1);
                mContainer.removeView(cv2);
                mContainer.getChildAt(0);
                header.getLayoutParams().height = (int) getResources().getDimension(R.dimen.smallEnterWeightHeight);

In my onCreateView method i added the transition effect but the animation now of the Toolbar looks horrible..

LayoutTransition transition = mContainer.getLayoutTransition();
        transition.enableTransitionType(LayoutTransition.CHANGING);

I simply like to let the Toolbar scroll out and the view to the top? Is this possible with the "simple" animation style?

Sebastian
  • 408
  • 1
  • 6
  • 11
  • What's cv1 & cv2's relation to the ToolBar, what's the current animation effect, and how is it different from what your wish? – Kai Nov 22 '15 at 14:21
  • Hey, cv stands for CardView, at the moment my animation is that first the toolbar slides up - then after animation ends visible is gone --> blank field appears and then my whole layout slides up.. what i wish is an "effect" like the layout simply slides over the toolbar :) not those animation with two parts if you wish i edit my question with my actual code :) greetings – Sebastian Nov 22 '15 at 14:43
  • @ additional the problem with the code above was that the layout had the bug that it jumped for some milliseconds up and then back and then the layout animation to slide up starts.. :/ – Sebastian Nov 22 '15 at 14:46
  • That sounds a bit tricky, since ToolBar is normally on top of the other layout, but now you want other layout to draw on top of it, is my understanding correct? – Kai Nov 22 '15 at 14:48
  • yep it is :) already tried to implement an own toolbar for this fragment -> this is easy to scroll over but toolbar hadnt the toolbar functions it was just a blank space with the color of my toolbar.. :) but maybe this is n first step :D idk – Sebastian Nov 22 '15 at 14:55
  • I'd suggest extending ToolBar and apply progressive y-axis [clipping](http://stackoverflow.com/questions/5574212/android-view-clipping) in an animation to it. – Kai Nov 22 '15 at 15:14
  • okey but what do you mean with extending Toolbar? I'll try the animation clipping later - i hope i can return to you when i got questions with the coding :) greetings – Sebastian Nov 22 '15 at 15:29
  • ToolBar is a ViewGroup that you can extend and override its onDraw() method to implement clipping. – Kai Nov 22 '15 at 15:48

0 Answers0