Xamarin Forms Customized Camera for iOS and Android - visual-studio

I'm pretty new to Xamarin Forms and C# in general, and need som hints on the best way to create an app for iOS and Android. I want to use the Camera to take pictures / videos and later on send them with email or something else, since I want customized controls on the camera, I'm guessing the stock camera won't be an option? Which gets us to Renderers, which is the best approach to this? Preferably in a MVVM way. I just want the camera and a few customized buttons on it.
Do I make on renderer for the different buttons objects and one for the camera, the buttons I'll do as extensions of the Button class, but what about the camera?
/Oliver

You have two options:
Create a page renderer and put your camera/buttons native in each platform.
Create a view renderer for the camera and add your view in any page of Forms, so you can put your buttons or anything you like in forms.

Related

Xamarin - support inserting GIF and images using Android keyboard

Has anyone gotten the android keyboard to support GIF and image insertion in an Xamarin app? Let's say I want to build a chat application, have a custom EditText view to capture user input, and want to have it behave similar to the Android built-in chat application. Currently the keyboard shows a popup . Is it possible to make this work? I prefer to not create a custom keyboard renderer, though was hoping this could be done within a custom EditText renderer. Along the lines of:
UPDATE: For anyone looking for a similar solution, I have been making progress using the https://github.com/xamarin/monodroid-samples/tree/main/android-n/CommitContentSample. Essentially set the content mime types and wrap the IOnCommitContentListener, then process OnCommitContent().

Xamarin.forms open camera inside popup

Is there any way we can open camera in a custom popup in xamarin.forms? Currently I am using Xam.Plugin.Media which will open camera in an entire screen. what I am trying to mimic is open the camera inside a circular frame to show inside Rg.Plugin.Popup . How can I achieve it? Does it require platform level implementation? Any help is appreciated
First, I find a feature-request - Cropping interface of Xam.Plugin.Media and the author refused it as it should be done in a different app since it is not available out of the box on all platforms.
You can have a try with Take Photo Overlay (iOS Only) function of this plugin to add a layer in iOS camera.
I also find a useful OverlaySample of Xamarin.forms which can add overlayer to camera in Xamarin.forms.
Refer: overlayview-in-xamarin-forms
how-capture-image-using-camera-circle

How to create same UI as given UX in xamarin forms?

I am working in xamarin forms. I have some UX given by the designer. Now I want to create exactly same UI(same height of control, width of control, colors etc) in xamarin forms. My xaml view should be exactly xame like given UX.
Is there any tool that can guide me to create same UI like UX. I mean through that tool I can get the height, widths and colors of controls of screens and then can use it.
it's not good idea to use exact length of UI since the app will run on different screen and different devices. Xamarin forms uses native views for each platform which will also change the look of basic views.
What you need to do is to use grids or other layouts for sizing and control the height and the width of your views.
I also suggested that you always use scroll view incase if a mobile has a small screen size.
Finally, regarding the actual UI components and UX interactions, there are many ready components like calendars, custom checkboxes, sliders,... . If you can't find a component that cover what you need, you have 2 options:
combine different components and try to customize them with absolute
and Relative layouts.
Create the components yourself which will require some knowledge
on each platform to create the view component by drawing it and do
all the handling for each platform.
Regarding the UX, there are many libraries for animations and most components allow customizability.
Your question was very general so this answer is general. Please try to be more specific next time.

Xamarin Forms Custom Page Renderer Data Bindings

I'm developing a Xamarin Forms application and I have implemented an IOS custom renderer for a content page.
I generate the page from laying out the native controls programmatically where ListEntry is a subclass of UITextField.
ListEntry entry = new ListEntry(control, new CGRect(x, y, width, height));
entry.BackgroundColor = UIColor.Blue;
view.AddSubview(entry);
I have been using two way data binding to hook up my Xamarin Form content pages to view models but I'm not sure how I go about doing this with custom renderers and native controls. I'm looking for a little guidance on the best way to approach this?
Thanks

Xamarin Forms animation limitation?

In Xamarin Forms if you want to create animations quickly you can call any of the animation extension methods such as TranslateTo(x, y), etc according to:
https://developer.xamarin.com/guides/xamarin-forms/user-interface/animation/simple/
But they don't seem to cover everything. For example on the above link, I don't see:
A method to animate the background color?
A parameter to specify the easing factor?
What are the other animation limitations in Xamarin Forms API, compared to the full iOS and Android animation capabilities?
The "simple" ones are just the easy extension methods to do basic things. If you want the full control you need to use the animation class. There is even a background colour example a few pages below yours:
https://developer.xamarin.com/guides/xamarin-forms/user-interface/animation/custom/

Resources