Xamarin - A floating button outside of the application - c#

Im using Xamarin.Forms for a little project, and im looking for a way to add a floating action button that appears all the time everywhere (something like Facebook Messenger's chat head) , even when the app is closed, to receive notifications and show them to the user.
I did a lot of google searches but managed only to find the solution for native android in java and nothing about Xamarin.
Is this possible in anyway ? (My project is simple, no MVVM, nothing fancy)
UPDATE:
I found a native view for Android that does the same thing:
https://github.com/recruit-lifestyle/FloatingView
Thank you

Related

How do I programmatically minimize/restore the current windows on MAUI (maccatalyst)

I am new to MAUI, and I am trying to port my WPF application so that it runs on Mac Catalyst, and I am blocked trying to port the code that programmatically minimize/restore the current window.
In WPF, it is easy, it is just this.WindowState = WindowState.Minimized.
I understand that MAUI needs to work on all platform, and minimizing might not make sense for iOS or Android. As far as I can lookup in the dotnet/maui repo, there is no API for minimizing windows.
Talking to the MAUI team, they suggested that I can access the underlying native objects and do that natively. Here below is my attempts:
Given the MainPage as a ContentPage. I have found this:
this.GetParentWindow().Handler.PlatformView is an instance of UIKit.UIWindow living in Xamarin.iOS.dll.
The documentation of UIKit.UIWindow also has no way to minimize it.
The closest thing that I could find is NSWindow.PerformMiniaturize, that requires a NSWindow, not a UIWindow. That NSWindows seems to be in a thing called AppKit, not UIKit.
This branch contains my attempt to port the application, the WPF application that I am trying to port is right next to it. This is not a huge application, but still quite some amount of code that is unnecessary for this question. If the community provides a tiny sample with a button that when it is clicked the window will minimize, that is good enough I can take it from there.
Thanks a lot in advance.

is it possible to organize the display of all the notifications on the smartphone using a button without leaving the application?

first of all I want to apologize for the lack of code, since I have never come across this at all, and I almost did not find material on this topic ... I use C # + Unity 2020, and I had the task of reproducing all notifications that are on the phone by clicking on a button in the application - it should look something like this: you press the button, and you are shown all the notifications that are on the smartphone (while you are still in the application), you can look at them and then do something else .. ...
Please, who knows, I will be very grateful: is this even possible? and how best to organize it? If it's not difficult, you would help me a lot ...
Because you are looking at an OS-specific feature you would have to write your own native plugin(s) to get the notification data.
See: Building and using plug-ins for Android / Building plug-ins for iOS
At least on Android the feature to get the Notification information does exist, I'm not sure about iOS:
NotificationListenerService.getActiveNotifications()

Why does the Xamarin.Forms designer not show windows layouts?

I tried searching for this everywhere, but I cannot find any solution.
I also tried looking at solution properties, project properties, visual studio preferences, Visual Studio extensions, change XAML xmlns definitions but I have no clue why this is not possible, and I think it should be standard simple functionality.
When you create a new Xamarin.Forms project that includes
, you would suspect that there is not only a way to see your XAML design on Android and iOS but also for any Windows platform you are targeting, such as W10 Desktop but also other Windows platforms that UWP supports and that supposedly Xamarin. Forms do support according to the website from Microsoft. You can easily build your project for these platforms, no problem. But I want to see what I am doing before I compile my work.
When opening your XAML design, instead of a simple Android / iOS and Windows tab in the design panel, Windows is nowhere to be found.
How am I supposed to see how my Windows screen is going to look without an option to see this? In WPF and plain UWP, this works fine, but somehow for Xamarin it only shows Android/IOS, but apparently, Xamarin has full support for Windows (desktop).
I am looking for multi-platform support to create a windows desktop application that is easily portable to iOS and Android. I thought Xamarin could do that, but if I am not able to see what I am doing on Windows in terms of layout, how am I supposed to develop a solid UI for the platform?
I am probably missing some kind of checkbox somewhere (I am hoping), but I cannot find any information about this. Yes, I tried to google. And Stack overflow. And Xamarin documentation from Microsoft. And watch YouTube videos about Xamarin for 20 minutes that supposed to explain the Xamarin multi-platform support. And after 20 minutes I find they only specifically explain iOS/Android but nothing about Windows. So yeah, getting pretty tired of searching and hope someone can be kind enough to help me out.
This is a limitation of Xamarin.Forms. Although it uses XAML, it has a custom XAML dialect which is not compatible with WPF/UWP, so the built-in UWP designer cannot handle it directly and it will require a custom designer implementation.
But if you want a first-class Windows development experience compatible with Android, iOS and even WebAssembly, try looking into the Uno Platform. This is a UWP bridge with full XAML compatibility with UWP XAML, so your app will look exactly the same on all platforms and provides full templating and styling support. In addition, Uno Platform provides bridge for many non-UI APIs as well, including things like Clipboard, Accelerometer and so on. In the end you will be able to just write a Windows app which will work everywhere with minimal changes.
You can use XAML adaptive triggers to make sure the app works well on each screen size and scales great from desktop to mobile.
If you want desktop version of you app just add UWP or WPF blank project to your solution.
For UWP it goes like this:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/windows/installation/
For WPF it goes like this:
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/platform/other/wpf
Right click on your "Project.UWP" or "Project.WPF" project and pick "Set as Startup Project"
and building your solution.

Windows 8 RT online Flash Movie

I'm programming a Windows 8 RT app that uses the API of Rotten Tomatoes. It gives me access to trailers/clips of the selected movie. I checked out the link and it appears all of the links are online Flash movies.
I tried playing around with the 'WebView' control and the 'MediaElement', but none seem to satisify my needs.
Is it even possible to play Flash movies. If not what are my options?
If you code like this <WebView Source="http://www.rottentomatoes.com/m/last_vegas_2013/trailers/11178829" />, you can see it's opening whole page. Good thing is that video gets play. So you need to remove the non-relevant portion using InvokeScript method & JavaScript. I don't know too much JS otherwise I would have give you proper solution.
I am confident JS will help you, the reason is this app itself. It's basically a Facebook website with RELEVANT portion.
Disclaimer: I am not the owner of that app.
Also check out this feature request.

SilverSprite runs as White Page

I've been attempting to bring some of my XNA games to the web with Silversprite. However, whenever I run these apps they appear as a white screen.
I am wondering if anyone has any idea on how this might be fixed.
I have followed the tutorials exactly (except replacing the XNA apps they used with my own). Nothing is working.
Has anyone figured a way around this?
Use ExEn instead of Silversprite.
http://exen.codeplex.com
ExEn is a high-performance implementation of a subset of the XNA API that runs on Silverlight, iOS and Android.
It's production ready.
Here are some samples:
My samples (if you want, I can upload you the source code):
Pacman: http://vackup.blogspot.com.ar/2011/09/xna-3-pacman-ported-to-silverlight.html
Pong: http://www.mylittlebets.com/Pong/TestPage.html
From ExEn creator:
http://andrewrussell.net/2011/02/exen-home-stretch-y-arms/
http://andrewrussell.net/lightblocks/

Categories

Resources