All Projects → michaeled → Formspopup

michaeled / Formspopup

Licence: mit
Xamarin.Forms Popup View

Projects that are alternatives of or similar to Formspopup

Android Lint Plugin
Android Lint parser plugin for Jenkins
Stars: ✭ 52 (-30.67%)
Mutual labels:  deprecated
System
A full-stack framework built from Aura library packages.
Stars: ✭ 61 (-18.67%)
Mutual labels:  deprecated
Django Cache Url
DEPRECATED | Use Cache URLs in your Django Application
Stars: ✭ 68 (-9.33%)
Mutual labels:  deprecated
Dataarrays.jl
DEPRECATED: Data structures that allow missing values
Stars: ✭ 54 (-28%)
Mutual labels:  deprecated
Notifier For Github Firefox
[DEPRECATED] Firefox extension - Displays your GitHub notifications unread count
Stars: ✭ 58 (-22.67%)
Mutual labels:  deprecated
Dashboard Extension Webpage Item
⛔ DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
Stars: ✭ 62 (-17.33%)
Mutual labels:  deprecated
Zoho Crm Client Php
[DEPRECATED] Provides a clean readable PHP API to the Zoho Rest API.
Stars: ✭ 52 (-30.67%)
Mutual labels:  deprecated
Sphero Mac Sdk
🚫 DEPRECATED: Sphero SDK for the Mac platform.
Stars: ✭ 70 (-6.67%)
Mutual labels:  deprecated
Anatine
[DEPRECATED] 🐦 Pristine Twitter app
Stars: ✭ 1,102 (+1369.33%)
Mutual labels:  deprecated
Onedrive Fuse Fs
Script to mount Microsoft OneDrive (formerly known as SkyDrive) folder as a FUSE filesystem
Stars: ✭ 68 (-9.33%)
Mutual labels:  deprecated
Face Recognition
Deprecated. Face recognition Android application. Using Android SDK, OpenCV and Facebook SDK. Loading the user's Facebook pictures, scanning pictures for facial features and comparing faces to image repository for matches. PLEASE NOTE: This project is relatively old and uses obsolete versions of both the Facebook SDK and the Android SDK.
Stars: ✭ 54 (-28%)
Mutual labels:  deprecated
Heroku Buildpack Datadog
Heroku Buildpack to run Datadog DogStatsD in a Dyno
Stars: ✭ 55 (-26.67%)
Mutual labels:  deprecated
Conductor
Conductor makes it easy to mange multiple composer packages within a single source repository
Stars: ✭ 64 (-14.67%)
Mutual labels:  deprecated
Graphql Modules
⚠️ [DEPRECATED] GraphQL module library for Apollo.
Stars: ✭ 53 (-29.33%)
Mutual labels:  deprecated
Entware Ng
Entware-ng
Stars: ✭ 1,157 (+1442.67%)
Mutual labels:  deprecated
Terminal Ide
💀 A full command line based Java / Android develpment kit, that runs on Android devices.
Stars: ✭ 52 (-30.67%)
Mutual labels:  deprecated
Twoot
An open source light-weight OS X twitter client based on jQuery and Fluid (deprecated!)
Stars: ✭ 61 (-18.67%)
Mutual labels:  deprecated
Kirby Twig
Twig templating support for Kirby CMS 2. For Kirby 3, use https://github.com/amteich/kirby-twig
Stars: ✭ 73 (-2.67%)
Mutual labels:  deprecated
Grunt Myth
Myth - Postprocessor that polyfills CSS
Stars: ✭ 70 (-6.67%)
Mutual labels:  deprecated
Dashboard Extension Online Map Item
⛔ DEPRECATED. This project was moved to a new repository. Visit https://github.com/DevExpress/dashboard-extensions to find an updated version.
Stars: ✭ 65 (-13.33%)
Mutual labels:  deprecated

Xamarin.Forms Popup View

This repository houses an example of using the Xamarin.Forms API to create a popup view. I chose not to use any platform APIs (Xamarin.Android or Xamarin.iOS) while implementing the view, as I wished to experiment with the framework. That said, it's still a fairly featureful implementation.

Projects

  • FormsPopup (The Popup implementation)
  • FormsPopup.Examples
  • FormsPopup.Droid
  • FormsPopup.iOS

A short note

This project has a few documented issues. They are mostly related to iOS9.

Initializing

The current implementation requires either one of two conditions be met before you can use a popup view within a Page:

  1. The visible page must extend from the PopupPage class.
  2. Any visible page that does not extend from PopupPage must instantiate an object of type PopupPageInitializer after the page's content has been set. This is easier than it seems:

Example

public class CodedSimpleExample : ContentPage
{
	public CodedSimpleExample()
	{
		var popup = new Popup
		{
			XPositionRequest = 0.5,
			YPositionRequest = 0.2,
			ContentHeightRequest = 0.1,
			ContentWidthRequest = 0.4,
			Padding = 10,
	
			Body = new ContentView
			{
				BackgroundColor = Color.White,
				Content = new Label
				{
					XAlign = TextAlignment.Center,
					YAlign = TextAlignment.Center,
					TextColor = Color.Black,
					Text = "Hello, World!"
				}
			}
		};

		var button = new Button {Text = "Show Popup"};
		button.Clicked += (s, e) => popup.Show();
		
		Content = new StackLayout
		{
			Children = 
			{
				button
			}
		};
		
		// Required for the popup to work. It must come after the Content has been set.
		new PopupPageInitializer(this) {popup};
	}
}

Two examples have been added to the FormsPopup.Examples project to demonstrate this point. Reference either CodedPopupExample.cs or XamlPopupExample.xaml/XamlPopupExample.cs.

Sizing and Placement

The current implementation relies heavily on proportional sizes. For any Popup properties that require a location or size, you should pass in a value between 0 and 1.

Example

var popup = new Popup
{
	XPositionRequest = 0.5,
	YPositionRequest = 0.5,
	ContentWidthRequest = 0.8,
	ContentHeightRequest = 0.8
};

Events

The following events are invoked during various moments in a popup's life cycle. They're availble to all Popup views.

  • Initializing (happens once, during the hosting page's Appearing event)
  • Tapped
  • Showing
  • Shown
  • Hiding
  • Hidden

The Tapped, Showing, and Hiding events can be cancelled by using the event argument property:

Example

private void Popup1_Showing(object sender, PopupShowingEventArgs e)
{
	if (_preventShowing.On)
	{
		e.Cancel = true;
	}
}

Animations

The Popup.ShowAsync() and Popup.HideAsync() methods can be used to add animations. If you do not wish to include animations, you can use either Popup.Show() or Popup.Hide().

Example

double original;

await popup.ShowAsync(async p =>
{
	original = p.Scale;

	await Task.WhenAll
	(
		/** 
		 *  Since p is the Popup object, scaling it would also affect the overlay
		 *  behind the popup's body. Although it wouldn't be noticeable in this simple example,
		 *  it would be if the overlay's color was set.
		**/
		
		p.SectionContainer.RelScaleTo(0.05, 100, Easing.CubicOut),
		p.SectionContainer.RelScaleTo(-0.05, 105, Easing.CubicOut)
	).ContinueWith(c =>
	{	// reset popup to original size
		p.SectionContainer.Scale = original;
	});
});

Styling

At this moment, there are no default styles for the popup. Your views will inherit whatever styles you have attached to your resource dictionaries.

Miscellaneous Features

  • The left, top, right, and bottom border colors can be individually set
  • During the Tapped event, you can determine if the user tapped within the header, body, or footer sections.

Screenshots

alt text alt text

More screenshots are available in the repository.

FAQ

Q. Can I use XAML to create popup views?
A. Of course!
Q. Can I add control XX in the popup?
A. I don't see why not. Let me know if you have any problems.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].