I'm using TransitionsEverywhere library https://github.com/andkulikov/Transitions-Everywhere and I'm wondering if is it possible to use methods setSharedElementEnterTransition or setEnterTransition using TransitionInflater from this library? Or is there another solution to use smooth and pretty transition between two fragments on Android 4?
It is not possible in Transitions-Everywhere library. You can check this issue on github account :
https://github.com/andkulikov/transitions-everywhere/issues/11
I didn't try but this library seems like doing fragment transitions on pre-lollipop devices :
https://github.com/takahirom/PreLollipopTransition
Related
I am building a Android TV application using the Leanback Support library using PageRows.
I am following pretty much what the leanback-showcase same app is doing here, but I am wondering if it is possible to animate the fragments exiting and entering when the row changes?
It is pretty jolting when the fragments are changed for each row.
As stated in the official documentation, android.support.v17.leanback has R.animator class. Then you may use the lb_playback_rows_fade_in and lb_playback_rows_fade_out methods.
I've seen the android developers blog that the new design support library 23.2 supports animated vector. When i searched i came across this link to implement animated vector drawable. Is it the same way to implement animated vector drawables in design support library 23.2? Can someone help me out with the new implementation?
Here's a link to an example project on Github implementing the Support Library to make this Floating Action Button.
Using the Support Library is very similar to the non-Support Library method in that the xml files for AnimatedVectorDrawables are the same, as are the objectAnimators and static VectorDrawables.
The differences come when setting up your project to use the Support Library and when referring to the AnimatedVectorDrawables in your code.
Make sure you are using at least version 23.2.0 of AppCompat in your build.gradle, the VectorDrawable and AnimatedVectorDrawable libraries do not need to be added separately:
dependencies {
...
...
compile 'com.android.support:appcompat-v7:23.2.0'
}
The official anouncement blog you linked to gives a couple of different ways to ensure Android Studio does not convert your Vector Drawables into pngs. There are two different methods depending on what version of the Gradle plugin you are using, so you should follow the appropriate one.
To call up an Animated Vector from resources in your code:
AnimatedVectorDrawableCompat animatedVector = AnimatedVectorDrawableCompat.create(this, R.drawable.animated_vector_name);
You can display this on ImageViews, Buttons etc. with their .setImageDrawable(animatedVector); method, and start the animation using animatedVector.start();
Important note: as mentioned in Chris Banes' post, there are some limitations to what will work in the support library. The sqisland.com post you linked to includes examples of Path Morphing, which won't work with the current support library(version 23.2.0)
I created an application with a navigation drawer navigating following the android documentation tutorial. Now the main parts of my application are Fragment but the problem is I have to use dynamic fragments in one of them.
I saw the nested fragments were supported since android 4.2, but I need to use my app on older version.
What can I do ?
I'm thinking of using a FrameLayout of fixed fragments and to set them visible or gone depending of what I need, but it seems a little ugly...
What do you think ?
Thanks for your answers
Edit :
my question is not clear but what I want to know is :
can I use the navigationdrawer with activities instead of fragments ?
is the solution I'm thinking about realy ugly ?
how can I use the nested fragment system for older version ?
In the end I used the nested fragment system using the Android Support Library (thanks Nobu Games)
Thanks for your comments
I want to use property animation on my app instead of using tween animation on fragment
Right now, I use NineOldAndroids for normal property animation in my app and it works perfectly.
However, I cannot find the way to integrate this NineOldAndroid with support fragment.
Are there any way to animate fragment with property animation on pre-3.0?
Thanks.
I found this library.
It integrates support library from Google with NineOldAndroid.
If I do not need to grant support for older versions of android and can just use API 17, is there an alternative way to implement the much advertised horizontal swipe (like in gmail) and not use viewpager, fragmentsactivities (new APIs already have fragments...) etc. to get rid of the support library?
All the tutorials I've found for horizontal swipe show how to do it using the support library and FragmentActivities. Otherwise what is the advantage of the new APIs if I cannot use their native classes and methods?
to get rid of the support library
ViewPager only exists in the Android Support Library. The Android Support Library is not just for backports.
new APIs already have fragments
ViewPager can use native API Level 11 fragments, though you may need to create your own PagerAdapter. Or, you can use ViewPager without any fragments, using just ordinary View or ViewGroup objects for the pages.
is there an alternative way to implement the much advertised horizontal swipe
You are welcome to write your own replacement for ViewPager. Most developers prefer to reuse ViewPager, for reduced development and maintenance costs.
There is also HorizontalScrollView, an open source HorizontalListView floating around, and so on.
You can write your own FragmentPagerAdapter which works with android.app.Fragment instead of android.support.v4.app.Fragment to minimize dependency on the support library. You only need to create your own class for the adapter (based on FragmentPagerAdapter from support library which source can be found in folder <android-sdks>/extras/android/support/v4/src/java/android/support/v4/app/). Only modification is in the import section - you should reference Fragment, FragmentManager and FragmentTransaction from android.app instead of android.support.v4.app.