Shared element from activity to fragment like snapchat - android

I am exploring share element transition from one activity to other.
I have a list of video thumbnail in one activity and in second activity i have two fragments, FragmentA and FragmentB. In FragmentB i am showing videos like snap chat. If user click on right next video will play. Now if user swipes from top and drag video to bottom, I want to make animation like snap chat where video view will shrink according to drag distance.
Please give me some hint/suggestions how can i achieve transition of element like snapchat.

You can check this project in Github: https://github.com/pedrovgs/DraggablePanel
Draggable Panel is an Android library created to build a draggable user interface similar to the new YouTube draggable video component based on Fragments or Views.
It has the drag functionality you mentioned as seen from this image
screenshot

Related

How to create close animation like instagram stories?

what i need to do:
fragment opens expanding from recyclerView item (shared element maybe)
fragment closes by dragging it down and after release folds back to recyclerView item
i didn't found any native solutions from google to implement this logic

BottomNavigationView that opens detail in full screen

I'd like to build an app that has what I understand top be a three top level screen hierarchy like this:
That is, Master screen displays different sections with different content, comprised of items that can be articles (green) or videos (blue).
Clicking on an article (in any of the sections) would take you to a detail screen (top right, in yellow) that should maximize reading area, with a topbar with a back/close button, and covering the bottomnavigationview. Going back (or up) takes you again to the screen with bottomnavigationview.
Clicking on a video would launch a different detail page in which the video can be dragged to the bottom as shown in bottom left screen, so you can still operate with the master list of items (or whatever lies beneath).
Either clicking on an article item (green), or clicking on a video item on top right (detail of an article), would take you to what is shown on bottom right; that is, video detail over article detail. Video then can be dragged to reveal underlying article and still be operable.
Now I already have a fragment that implements the dragging behavior of a video detail, that is not an issue.
My problem comes with understanding how to architect this with Navigation Component. My naivest approach would be ditching the nav component and have on my activity three fragment holders, one for the bottomnav content, one for the article detail, one for the video detail (which has to be above everything else), but getting rid of the nav component means i have to implement such things as backstack and deep linking myself.
Is this kind of navigation flow possible with navigation component? If anything, I'd like at least to get the master-article detail implemented with NavComponent, and separate the video implementation in a differnet fragment holder.

How to change images when navigate into next fragment?

I'm trying to design a guide section in my app using fragments. I'm using 6 fragments in my GuidActivity.java which related to its activity activity_guid.xml , the activity contains coordenator layout which contains an image of dotsat the bottom, I want when I navigate into next fragment the image get changed to another image (the next image has yellow second dot ) and so on , any help or more simple idea to preview the progress of fragments ??
Use a ViewPager instead, you will have gesture support and onPageChanged triggered when you scroll to next page.
A simple Onboarding screen doesn't need to use fragments

How to Overlay Fragment over another with swipe-in/out

In Android (22+), I'm looking for a library or a 'tried & tested approach' to give the setup that allows an app to overlay 1 fragment on top of another that and would also provide gesture drag in/out along with peeking behind(see animation below)?
Criteria;
library to animate the swipe-in/out
handles the darkening the background fragment the further you drag in
the overlay fragment is there to provide context information to the user)
Further to #Rainmakers suggestions, I have a 'nearly working' approach were that I have an overlay fragment that is added to the top of the fragment stack; were then I have applied a touch gesture on the overlay fragment to dismiss on a left->right swipe capture. This Works and looks ok and 'will do' but would like the peek behind the feature that is shown in the animated GIF.
This animation was taken from the google drive android app;
If you're eager to use a library then check this out FragmentTransactionExtended. It has different slides.
Then you just override the onTouchEvent() method (check how to do it link) and do fragment transactions when swipe is caught. If you use add in the transaction you won't dispose the fragment underneath.
And the part with darkening you should also manage it in onTouchEvent(). See this to make your fragment grey out.

How to go about building an expanding fragment in Android?

So, I'm working on a media player application.
I would like to make something similar to Google Play Music's or SoundCloud's slide up mini-player to full-player UX.
I'm not really sure how to tackle that, though. Is it simply two fragments/views? I can understand how to transition onClick with animations, but how would I go about the fluid dragging?
Yes, it can be done with a fragment, OnTouchListener, and dragging the fragment up. I've done it with a click event and animation with no dragging.
The activity is on the bottom and the container with the fragment placed on top via the xml.
I wouldn't call it expanding though. Its just not fully revealed on screen (i.e. the location is on and off the screen and the fragment isn't actually changing).

Categories

Resources