I am using android slider.jar for animation. while opening left/right side menu using this mNav.toggleLeftDrawer(); and mNav.toggleRightDrawer(); with help of slide_left_in and slide_left_out , slide_right_in and slide_right_out for transition xml animations..
here animation are working fine.
my problem. when i click menu from left or right side, drawer is opening, when i click items from left or right side, its going to start a new activity like this both activities items.
while clicking item from left side menu that time, first time new activity are opening. that time, my previous animated drawer is opened state. its does not hiding.
before starting new activity, the previous drawer is closing first, and then only new activity is starting.
I want directly go to the new activity without showing previous animated state..
I have my sample code link
http://www.mediafire.com/download/475tpnob648u6vc/SimpleSideDrawerExample.zip
Related
I simply want to implement an animation to a listview opening.
My listview just goes to visible to unvisible when I press the button but without animation.
I have a button on right center of the screen and when I press this I want to open a small listview from sliding right to left and pushing button to the center too.
I already have one drawer but this one is not exactly like drawer.
Is there any other way without using navigation drawer again?
Thank you for all.
I am trying to close my navigation drawer after I finish certain activities immediately, without the sliding animation. I don't close it on activity start because I would like it to stay open if the user backs out of the activity. However, I cannot get it to close without a brief flickering animation as it closes itself. I have tried variations of the following code:
protected void closeDrawerImmediate() {
mDrawerLayout.setVisibility(View.GONE);
mDrawerLayout.closeDrawers();
mDrawerLayout.setX(0);
mDrawerLayout.setVisibility(View.VISIBLE);
}
You can use the new DrawerLayout.closeDrawer(int/View, bool) methods in v24 of the support library to instantly close a drawer:
drawerLayout.closeDrawer(Gravity.LEFT, false);
If you just want to close a drawer immediately, such as when you're launching an activity from tapping on a drawer item, that is probably enough.
If you want to close the drawer on coming back to the activity, I'd set a stateful boolean like closeDrawerOnResume = true wherever is appropriate (eg. starting a new activity), and then in onResume check this boolean and close the drawer without animating if it is true.
You can consider setting animation time to 0. But it seems it's not as easy as setting one property. Here is tutorial and the code but it requires importing sources for DrawerLayout and ViewDragHelper into project and small modifications there.
I am using ActionBar Sherlock with a number of fragments.
The app I am building is a basic RSS reader much like the one shown here (http://www.youtube.com/watch?v=R_qR2glTTAs), except that there are multiple tabs for several different RSS feeds. When a tab is clicked, I replace the active fragment with the appropriate new fragment.
I am trying to get ActionBar animated refresh button functionality much like it is depicted in the YouTube video above. Basically, when the user clicks the refresh button, I expect the refresh button to rotate until the refresh is complete. If the user switches tabs while the current tab is refreshing, I want to show a refresh button that is NOT rotating.
The problem is: after I click on the refresh button and the button starts rotating, if I switch to another tab, I simply get a non-rotating refresh button on top of the rotating refresh button! This happens despite my calling menu.clear() and recreating the menu each time a tab is clicked. Interestingly, rotating the device causes the extra rotating refresh buttons to disappear.
Nothing I've tried seems to be able to stop the refresh animation when I change tabs! Any ideas why? I can post more of my code here if necessary.
I think the problem could be that you are animating and / or creating the menu inside your fragements... if this is the case do the things you want to do with your menu in the FragmentActivity
By the way, the effect you experience while rotating the screen is caused by the android architecture. Android always recreates the view if you are switching from portrait to landscape mode or the other way around.
I am trying to create a YouTube style UI for my app.
I have two Fragment.. lets say A(left) and B(right). On clicking the app icon in the Action bar, B should slides to the right. On clicking again, it should slides back to the left.
I have a Listview on B and A is empty. Also, I am using ActionBarSherlock.
The following behaviour is experienced:
1. When App icon clicked,
B slides to the right normally
When App icon is clicked again
B slides to the left normally
When App icon is clicked again
B doesnt slide unless the fragment is touched manually.
On subsequent clicks, B slides to left normally. But it slides to the right only when touched after clicking the button.
what could be the issue and how can i solve it? Thank you.
Friend's
I need to get slider pop up window,when i click a tab control available at bottom.when i click the tab,i need to show the slider pop up from bottom to top animated to show the login button,after login i have to move my actual tab Activity.How can i get the view for slider pop up.
lets refer the screenshots,i attached here what i need exactly..
.
From these when user to choose login at the time second screen appears looks like it.
How can i get the view like this above.
Thanks in advance..
Get the sliding drawer view by id, cast it to a SlidingDrawer and then there is a function the SlidingDrawer object to pop it up. You might have some weird issues though with screen state if users do stuff like hit back or close the slider.
To do what you need in the screenshot, do a sliding drawer with an empty handle and slide that up from the bottom as needed. The sliding drawer is just another layout that can contain buttons, etc.
Here is an example: http://www.androidpeople.com/android-sliding-drawer-example-tutorial/