How to create transition animation between BrowseFragment and headers? - java

I'll try to create transition animation between headers list and BrowseFragment like in this video on 44 second:
google developers video.
Maybe a must use BrowseTransitionListener, but i don't understand how.
Thanks.

This animation is built in, but does not work on API level 17.
Unfortunately it's not in the documentation.

Related

Adding animation to android

I'm not even sure if it is called animation but I couldn't find it anywhere.
In my application, I want to give a star to the users once they finish some activity.
I want to make some animation that will look like this:
https://dribbble.com/shots/2795344-Jump-jump
How can I do something like this on android?
I see different applications in my device that have cool animations and cant figure out how it is done.
Of course, it doesn't have to be that star but anything that will give the same feeling.
Thank you
You can use Lottie to have sucn an amazing animation ,with just few lines of code.
For example have a look here -> https://lottiefiles.com/search?q=star&category=animations
Let me make you understand how to get started with it....
(1) Add dependency for Lottie
implementation 'com.airbnb.android:lottie:$lottieVersion'
(2) Add lottie view in layout
(3) Download animation and use it...
Reference Blog
Feel free to ask if something is unclear.
You can achieve this by using the Motion Layout
For more information you can check the official Motion Layout documentation

Media Controls in Picture in Picture ExoPlayer

I am using ExoPlayer to play my streams. I have implemented Picture in Picture which works pretty good but i haven't been able to implement play, pause controls on PiP window until now. I know that by defaul Exoplayer + Picture in Picture does not give us the Picture in Picture media controls we see in the Youtube player for instance.
Anyway i searched a lot about this issue, and found out a code that may help me but the problem is that the code is in Kotlin and i am using Java, as a beginner i wasn't able to find the alternative code for Java to make it work.
This is the recommendation i got:
val mediaSession = MediaSessionCompat(this, packageName)
val mediaSessionConnector = MediaSessionConnector(mediaSession)
mediaSessionConnector.setPlayer(player, null)
mediaSession.isActive = true
I know that i should implement it onStart() after handling Exoplayer. I thinked about converting my project in Kotlin but as a beginner i would like to focus in Java and instead find a way to fix this.
Android will show media controls in Picture-in-picture mode automatically if there is an active media session for the app.
https://developer.android.com/guide/topics/ui/picture-in-picture
Also, the code you posted belongs to the media session extension library for exoplayer, so you need to add it to your build.gradle
https://github.com/google/ExoPlayer/tree/release-v2/extensions/mediasession

Android: Yahoo Weather App Horizontal Scroll-view Effect?

I would like to know what the Android implementation is of this type of scrolling that you see in the Yahoo Weather App. Here is a video example:
http://www.youtube.com/watch?v=a-q_yetkpik
Any examples or ideas on how to implement this would sincerely help this poor lost soul!
Thank you
use that library https://github.com/xgc1986/ParallaxPagerLibrary, it's very easy to use, and it worked for me
demo
You should separate two different things here:
The horizontal scrolling
As you swipe your way through the viewpager, the background moves slower than the content does.
This effect can be achieved with the ParallaxPagerLibrary
The vertical scrolling
As you swipe up, the background image blurs away, making the "swiped up" content more visible to the user. This post explains it all and also provides a library.
But if you want it even better, someone wrote a simple "clone" of this weather app https://github.com/MoshDev/LikeYahooWeather
They customized ViewPager, the widget is called WeatherViewPager that it's unfortunately unavailable, looks like a ViewPager with a sort of parallax
You may take a look at https://play.google.com/store/apps/details?id=com.desarrollodroide.repos
it's a collection of usable opensource libraries
e.g. Utils->Paralloid or Utils->ParallaxScroll

Vertical Drawer on Android

It's there a way to make a vertical slider on Android?, for example, I want the action bar to be dragged all the way from top to bottom, to show a fragment, pretty much like the notification bar on Android.
Thank you very much
There is always a way ;), but it would take some custom code to do it. I don't really have to much time to write something out for you, but I did find something that may be useful to you. These guys open sourced a slide from bottom to top view like is used in Google Play Music. You can take a look and maybe modify it to slide from top to bottom.
https://github.com/umano/AndroidSlidingUpPanel
Good Luck
There used to be a slidingdrawer view as part of the framework but it's now deprecated. There is however a nice implementation of something similar on github that you can take a look at here:
https://github.com/umano/AndroidSlidingUpPanel
Umano's Drawer is dated and limited. You should use a more up-to-date library like https://github.com/drxeno02/androidprojects-book2-slidingdrawer.
This library has no limitations such as only having two children. You can have as many children as you want, and you can set offsets and design your drawer to look anyway you want.

Google Maps in a Webview for Android

I have a pair of questions about google maps for android. I decided to use a webview to display google maps due to the compatibility for the google maps api, so i'm having problems with really simple things (at least i think the are simple).
1) At the start of the application, my webview shows the map with a very low zoom. How can i set a higher zoom from the beginning? There are +/- buttons, but they are pretty uncomfortable.
2) How can i put a mark on the map? With the api, i have just to use the
google.maps.Marker
, but i don't know ho to use it with a webview.
I think that both the problems can be solved using javascript, but i'm new and i really don't know how to solve them. Thank you very much.
For the marker, you could create a javascript function to add a marker, and then on the WebView load a url like javascript:addAMarker("AddItHere");. I don't get what you mean the buttons are uncomfortable for the +/-.

Categories