Item explode() transition in older devices - android

I want a transition for a list item that opens detailsActivity. I think in 5.0 we can use
getWindow().setExitTransition(new Explode());
Is there any way we can implement same effect in older devices?

There are few community backports for transitions:
https://github.com/guerwan/TransitionsBackport
https://github.com/andkulikov/transitions-everywhere
which offer you to use backported transitions. From my perspective I can recommend you Transitions Everywhere library - I applied it successfully in production code.
Unfortunatelly those backports don't support transitions between activities and fragments - you can use it only by using Scenes. They represents different layouts and you replace one by another in layout container.
Due to you scenario, probably viewgroup, where your list is placed, will be you container.

Related

what is the main difference between android.animation and android.transition package?

We can create animations using both android.animation package and android.transition package but I would like to know what is the main difference between these packages since even custom transitions also use animator's from android animation package.
From the documentation of android.animation:
These classes provide functionality for the property animation system,
which allows you to animate object properties of any type.
From the documentation of android.transition:
The classes in this package enable "scenes & transitions" functionality for view hiearchies.
From there a conclusion could be made that android.animation mostly handles individual View animation (a FAB moving left upon click, etc) while android.transition cares mostly about view hierarchy/layout transition animation (Material Design shared elements, etc).
do read about fundamental difference at http://developer.android.com/about/versions/android-4.4.html in 'Animation & Graphics' section. Basically, you can transition between different states of UI by defining Scene objects.
I don't have any code to support as i haven't used this till now, but above link should get you started.

Material Transitions in pre lollipop apps

I am trying to use the transitions which introduced in material design in pre - lollipop apps(Min API19). I was going through http://www.google.com/design/spec/animation/meaningful-transitions.html#meaningful-transitions-visual-continuity transitions. But couldn't find how to do these transition mainly the second one on click of list item it expands the details. Can anybody help me to do this.
Thanks
You cannot use the "Material transitions" (or shared content animations) in pre-Lollipop versions, whether you're using Appcompat or not.
Check this link Custom animations

Swipe between ListView items (like with ViewPager) in Android 4.0+

I have an app which supports Android 4.0+ (i.e. android:minSdkVersion="14"). I've created a ListView and when clicking on its item the app moves to an Activity with single Fragment in it. I want to implement swiping between this items (like in Gmail app between conversations), but the only approach I see is using the ViewPager, which is a part of Compatibility library. So maybe there is some way to implement this behavior without using support libraries (which also means changing Activities to FragmentActivities, FragmentManagers to SupportFragmentManagers, android.app.Fragment to Fragment from support library and so on).
Can I avoid this somehow or should I use ViewPager and support library even if minsdkversion="22"?
i don't think using viewpager will cause you any problem because viewpager doesn't require minsdkversion = 22.

What should be used instead of "setListNavigationCallbacks"?

Background
setListNavigationCallbacks is used to allow the user to switch between different views of the current screen easily via the ActionBar, as shown here and here.
The problem
I've noticed it got deprecated as of API21 (Lollipop), and that all the documentation says is to look for other navigation solutions, but it doesn't say what's the best one that fits the same point:
This method is deprecated. Action bar navigation modes are deprecated
and not supported by inline toolbar action bars. Consider using other
common navigation patterns instead.
All other functions/classes that are related to this function are also deprecated, such as setNavigationMode, OnNavigationListener, ActionBar.NAVIGATION_MODE_LIST .
What I've tried
The navigation drawer is for navigation of different screens, and not different views of the same screen.
adding an action item that will provide a way to switch between the modes, but that's a bit weird...
using a ViewPager, but that's also weird as it doesn't really switch views, plus it takes more space.
Using tabs, but I think that's also deprecated in some way, plus it takes more space this way.
The question
What should be the best alternative to this way of navigation?
This post explains why not only list-, but ALL navigation modes have been deprecated. It became too difficult to make it able to customize Actionbar's navigations. Toolbar is the new Actionbar (also available in the appcompat-v7 support library). However, you won't find these methods there either. Instead, you need to supply your own optional (navigation) view(s). Then you can use it like a normal view in your layout.

NavigationDrawer(SlidingMenu): which one is best?

I need to incorporate a youtube like drawer navigation drawer for both(left,right) sides. AFAIK android apis don't provide means for the right-to-left drawer functionality. There're quite a lot of implementations out there(sliding menu) which do.
This sliding menu feature seems to present a performance issue. Should I try to rewrite original NavigationDrawer, which I expect to be the least performance-impact solution, or there is another performance-optimal library?
Thanks.
I would choose NavigationDrawer. I used both and I find NavigationDrawer smoother. If you try to mimic google UX then with NavigationDrawer should be enought for your needs.
I recently made a project/demo to implement NavigationDrawer with ActionBarSherlock for pre Honeycomb devices because I need for an app.
SherlockNavigationDrawer impl
Another thing to take in mind is that if you use NavigationDrawer try to avoid Tabs because all the tabs items could fit perfectly as a listview in NavigationDrawer.
Actually NavigationDrawer supports drawers on both edges.
You have to supply the two drawer views inside your layout xml; one with gravity:left and one with gravity:right.
Then, in your Activity you call setDrawerLockMode(DrawerLayout.LOCK_MODE_UNLOCKED) on your DrawerLayout object.
This will enable swiping either from left or right edge.
#MichaƂ The question is actually implementation of both left as well as the right drawer.
#midnight NavigationDrawer right now only implements one-sided menu which you can place either on the left or the right. If you want to implement the other pane also you can make your content layout as SlidingPaneLayout.
This was also added to the latest support library along with the NavgationDrawer. For an implemented example you can look at the newest Hangouts app on how they are using it. This layout will probably suit your purposes better rather than rewriting the NavigationDrawer. In any case i'd hold off on re-writing it since it is the first release of the Layout and may undergo changes fairly quickly.
Since the last version of SupportLibrary there is a NavigationDrawer in Android.

Categories

Resources