push / slide transition with react navigation - react-navigation

I'm trying to work out the best way to create a horizontal slide transition using react navigation.
I'm using the stackNavigator and the default IOS transition appears like it is "stacking over the top" of each previous view
like this example where as I'm trying to have the transition Push the previous view and slide out like this push slide example.
Is there a simple config setting I'm missing? Or does this effect require a custom transition to be created?

Related

How to make a drag and drop in Grid Layout in Xamarin forms?

What I want to achieve is to drag red box view and drop in on the aqua boxview. The aqua box view should then take the place of the redbox view. How can I achieve this in Xamarin Forms ? I have added the following XAML code below. Please someone help me with this.
AFAIK Xamarin.Forms does not support drag-n-drop out of the box, hence you'll have to implement it yourself. It won't be easy, since there are certainly some edge cases to consider, but it's achievable. Basically the steps could be (maybe there are other options)
Add an AbsoluteLayout that wraps your Grid
Add an PanGestureRecognizer
When the pan gesture starts, check if it's on the red BoxView
If so, move the red BoxView to the AbsoluteLayout and remove it from the Grid
Move the red BoxView if the pan is updated
When the users stops the pan, check whether the red BoxView where you'd expect it to be dropped
If so, drop it (whatever that means in the context of your app)
If not, animate it back to its original position, remove it from the AbsoluteLayout and add it to the Grid
If you have tried to implement it and are stuck with a more concrete issue, feel free to ask another question about it.

Xamarin.Forms MasterDetailPage with part of master visible on detail

I want to push (make visible) little part of master page to detail page like on pictures in links below. Is it possible in Xamarin.Forms?
Before swipe
After swipe
I'll be grateful for help.
Set
<ContentPage NavigationPage.HasNavigationBar="False">
Place a StackLayout or Grid that looks like the side menu shown in your image. Add a tap gesture recognizer to it.
slMenu.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() => ShowSideMenu(masterPage)),
});
private void ShowSideMenu(MasterDetailPage masterPage)
{
masterPage.IsPresented = !masterPage.IsPresented;
}
This is possible, but requires quite some work, since you can't access the width of the MasterDetailView directly.
In another post (see How to set width for MasterDetailPage in xamarin forms ) I have described how to change the width of the MasterDetail view.
While implementing that, I came across a behaviour like you want to have, though for me it was an error.
Basically the steps would be
Implement a custom version of the MasterDetail view where you can set up a custom width
Change the width of the master view so it is a bit wider than it should be
Adapt the calculations when collapsing and expanding the view so that they don't collapse the entire width
For instance if your Master View gets a width of 340 and you want the last 40 to show, make sure that when being collapsed it "only" moves by 300

NativeScript animated Modal Page

I need Modal Page appears with "slide from bottom and cover (NOT push) current page" transition.
I set parameter animated of showModal method, but nothing changed.
How implement such transition for Modal Page? Android platform.
it's bug github.com/NativeScript/NativeScript/issues/5989
I have kinda hacky stuff, wrapping my elements with AbsoluteLayout and give it a high top value like '800',
and in navigatedTo function make transition animation with the negative value of the top attribute. In your case you would use left attribute and make transition over x.
Another solution that looks better in the UI, adding a custom component that would act as your modal, wrap your page elements with AbsoluteLayout, add your custom component when you need to show your modal, and apply the previous animation hack to it.
Tip: You can set the actionBarHiddin = true if you want to your custom component to overlay the full screen.
Tip: async/await and then would be very useful for the smoothing matters.

Xamarin Forms label animation at bottom of screen

I'm essentially making a 'shopping cart' UI and I want it so that when the user hits the 'Add' button, a little tiny box-label appears at the bottom of the screen that says 'Added Item' or something like that.
My question is how to do that with my current set up. I am currently using a nested Grid inside of a Scroll view for the main content of the page. I want the box-label to fade in at the bottom of the screen and stay located at the bottom of the screen ontop of everything else even if you scroll, until the animation fades.
Now i figure it doesn't make sense to add it into the grid since the grid's end will be out of view in the scrolling part of the scroll view, and same for the Scroll View. I am considering nesting the entire scroll view inside of a stack layout but i fear the button will just be located at the end of the stack layout under the scroll view instead of on TOP of the scroll view. How do you recommend I achieve this effect?
I prefer not to use a custom renderer if possible due to my lack of experience in the three separate platforms.
Thanks
Make vertically oriented stack layout. When you need to add you animation add it programmatically to the stack. When it finishes remove it from stack. Your scroll view will not affect animation

Android Wear Horizontal ListView

I'm trying to realize this layout in android wear: Timer Custom App. I think this is like a listview with horizontal orientation, but WearableListView doesn't have this attribute.
Try using a GridViewPager and setting negative page margins :
pager = (GridViewPager) stub.findViewById(R.id.fragment_container);
pager.setPageMargins(0, -30);
You can then implement onClick listeners on the fragments to change the current page by just clicking at the right or left of the page like the native alarm app.

Resources