Hide BottomNavigationMenu in a scrollview - android

I need to create a bottomnavigationmenu that hides like in that one link:
https://github.com/NikolaDespotoski/ahbottomnavigation
But instead of make it fade by scroll, fade with timer, like, 2 seconds of inactivity
Any hints? I don't know how to access the behavior of the scroll through my main activity

Related

How to reset MotionLayout to first ConstraintSet

I use a ViewPager have 3 pages. How to reset MotionLayout and re-run animation when a page is re-selected?
Currently, I call method transitionToStart() when a page replaced by another. But if user swipe back too quickly, animation transitionToStart() won't finish.
Is there a better method?
You can do the following:
motionLayout.setTransition(R.id.transition);
motionLayout.transitionToEnd();
if (instant)
motionLayout.setProgress(1);
You can manually set the progress by calling .setProgress(0) or .setProgress(1)
Based on .setTransition(R.id.transition) you can define start and end constraint (in case you have more than two constraintSets).

Tab layout transition delay is very fast

Am using custom animations in view pager and these animations works perfectly when swiping left or right,but when pressing on the tabs itself without swiping, the animations is done very fast causing damage to the eye, so is there any function to change the delay when pressing on the tabs ?
The first thing comes to my mind is making delay with a handler but delaying the transition between pages may cause unexpected result because of user behavior like clicking buttons very fast. I recommend making the view pager's transition animation a little slower. You can achieve such a behavior by using the Slowing speed of Viewpager controller in android

Scrolling a ViewPager programmatically, by a small amount

I have the requirement for what is effectively two activities side by side, allowing the user to scroll from one to the other, and back. I've decided that ViewPager is probably the best way to handle this, but am open to suggestions.
When the activity loads, the left hand view is displayed. I want to indicate to the user that the other view exists, by just scrolling it a small amount to the left and back again (similar to the way it's now common to show that a sliding drawer menu exists).
I've tried a number of things but have yet failed to find a method where both the views scroll smoothly together. Another way of interpretting the requirement is saying I want to programmatically fake a user flicking the page briefly.
Try calling the method fakeDragBy(float)! According to the documentation you need to first call beginFakeDrag() to initiate it and then call endFakeDrag(). This will mantain the ViewPagers default snapping behavior, so once you've revealed the other screen is there you don't have to animate the transition back, simply call endFakeDrag and the ViewPager will correctly snap back to the last screen (As long as you haven't dragged it past the half-way mark).

How to create a transition like this one?

http://1.bp.blogspot.com/-Vv4SxVSI2DY/VEqQxAf3PWI/AAAAAAAAA7c/mfq7XBrIGgo/s400/activity_transitions%2B%281%29.gif
This is a material animation I want to implement, but I can't achieve a similar effect. First of all, the shared element transition moves the image into the second activity. This is quite simple, but then the root layout of the activity starts expanding and during the animation the user can see the first activity until the second activity's view doesn't hide it totally.

How can i only apply animation for activity but not for toolbar?

I have several activities which have the same toolbar at bottom of each activity. The problem that i'm encountering is when i apply animation slide in/out for all activities, the whole of activity will be applied this animation. But i don't want toolbar do this animation. I mean that when i move from an activity to another activity ,all other views of activity will be move but the toolbar don't move.
How can i achieve this?
Thanks you a lot.
/****Edit********/
I intend to use TabWidget with activity tabs, but i don't know how to use overridePendingTransition() to make a transition animation between them when i change tabs. I also tried to put overridePendingTransition() in pause event of TabActivity and Activities for tabs, but not work.
Please help me.
if activities are not to complex you can do animation on layouts with change content view (or change view to invisible). Another option it to create tabwidget and just change tabs with animation between them. Third option is to turn off animation between activities changing, that create illusion that toolbar is staying. Just add animation to main layouts.

Categories

Resources