Xamarin Forms application with half of screen size - xamarin.forms

I need to create a xamarin forms application that will work on half of the screen. As default, layouts fill the screen. How could i do this by layout or contentView or ContentPage?

Xamarin forms don't have this kind of function(half screen)
Although there a thing called widget on android,Android Floating Widget is nothing but overlay views drawn over applications. To allow drawing views over other applications.you can refer to here to know more https://www.journaldev.com/14673/android-floating-widget
and here is a related queston with the working solution:How can I do this floating action button where can run even in background mode in Xamarin forms

Related

Ability to drag a window using an element in WebView (Cocoa, Swift)

I build a web-based Cocoa app that has a WebView stretched to the whole window. The top bar of the app has tabs, controls and some unused area which I would like to use for giving user an ability to drag the window (like many apps do). Chrome apps and Electron have -webkit-app-region: drag CSS property for doing this. What about WKWebView in Cocoa?
Make sure that -[NSWindow isMovableByWindowBackground] is set. Then, assuming nothing on WKWebView consumed mouse events, the drag should work.

Xamarin TextCell on UWP moves when tapped

In my Xamarin Forms app, I have numerous TextCells displayed in a TableView.
When run the app on UWP, I see that the text moves slightly (slightly indented) when the cell is tapped on. I suspect this is done as a form of highlighting the cell when it is tapped.
I find this very distracting and is different from what happens on iOS or Android.
Is there a way to disable this behavior?

How to achieve Tinder Style or stack based card swipe animation using xamarin forms across all platforms

After doing enough research, i could able to achieve it using Xamarin forms.
Android it was little tricky as it was not triggering "GestureStatus.Completed" in OnPanUpdated event when user does a swipe to certain area, but android triggers the Tap gesture event at this instance instead of Pan gesture event. So need to handle code separately for Android by collecting the coordinates of the card till where it was swiped.
Also to note for android, i have used a additional extra layout with opacity 0.0 upon the top card in the existing stack, with this we can get a smooth transition when user does the panning or swiping. Practically user swipes a extra layout with visible==true but with opacity 0.0, based on this extra transparent layout movements we will receive events in Tap or Pan gesture methods and we can move the actual top card in the existing stack which is under the transparent layout.
In iPhone and Windows Phone it triggers GestureStatus.Running and GestureStatus.Completed perfectly, so no need to create a hack extra layer. Code snippet is pasted below.
Android sample code to achieve panning or swiping smoothly:
'
private AbsoluteLayout createGestureSupportlayout()
{
AbsoluteLayout gestureSupportlayout = new AbsoluteLayout();
gestureSupportlayout.WidthRequest = frameWidth;
gestureSupportlayout.HeightRequest = frameHeight;
gestureSupportlayout.VerticalOptions = LayoutOptions.Center;
gestureSupportlayout.HorizontalOptions = LayoutOptions.Center;
gestureSupportlayout.Opacity = 0.0;
//In andriod, make Gesture support layout visible if invoices are present
gestureSupportlayout.SetBinding(IsVisibleProperty, "GestureSupportLayoutVisible");
return gestureSupportlayout;
}
'
You can use this plugin: SwipeCardView is a lightweight MVVM friendly user control that brings Tinder-style swipe card view into Xamarin.Forms applications.
In your view xaml:
<swipeCardView:SwipeCardView
ItemsSource="{Binding ViewModelItems}"
SwipedLeftCommand="{Binding SwipedLeftCommand}"
SwipedRightCommand="{Binding SwipedRightCommand}"
TopItem="{Binding TopItem}">
<swipeCardView:SwipeCardView.ItemTemplate>
<DataTemplate x:Name="SomeTemplate">
<!-- Template -->
</DataTemplate>
</swipeCardView:SwipeCardView.ItemTemplate>
</swipeCardView:SwipeCardView>
For a detailed explanation of design, implementation and usage of this library, check my blog post: Create Tinder-like UI in Xamarin Forms using SwipeCardView.
Another framework for this is https://github.com/robinmanuelthiel/swipecards

Respond to split-screen changes in Xamarin.Forms

In my Xamarin.Forms app, I have a MasterDetailPage with MasterBehavior set to Split when the device Idiom is Tablet. That is, I always want master page to be displayed.
The exception is during multitasking. For example, on iOS, if the user enters Split View, then I want the app to behave like it's on a phone, with no split view, but instead just a master or detail page displayed, and the proper navigation controls to move between them.
It seems like MasterDetailPage wants to help me with this. When I drag up another app to enter Split View on iOS, my app no longer shows the master page. However, the detail page that remains has no navigation control to return to the master.
What is the proper way to detect the mode change and dynamically adjust the navigation in Xamarin.Forms when your app enters and leaves Split View on iOS or split-screen mode on Android?

Howto make xamarin forms relayout if the size of my native control changes

I am working on a control deriving from Entry in xamarin forms with a native renderer for iOS and Android.
Depending on some options, the size of the control can change (there is a text line added or removed from the control).
This basically works as long as I do not do the size change of the control when it is already displayed.
When I do the size change when it is already displayed, the outer layout (in my test case a StackLayout) does not move the widgets accordingly. When the size is reduced, the free space is not taken by the next controls. When the size is expanded, the control is drawn below the next controls.
Can I somehow tell my custom control that its size has changed and that it has to be re-layouted on the page?

Resources