Skip to content
This repository has been archived by the owner on Oct 18, 2023. It is now read-only.

Commit

Permalink
adding docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel committed Nov 28, 2019
1 parent 3105c8f commit faaf23e
Show file tree
Hide file tree
Showing 13 changed files with 237 additions and 1 deletion.
42 changes: 42 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: github pages

on:
push:
branches:
- master

jobs:
build-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- name: Setup Python
uses: actions/setup-python@v1
with:
python-version: '3.6'
architecture: 'x64'

- name: Cache dependencies
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install -r ./.github/workflows/requirements.txt
- run: mkdocs build

- name: Deploy
uses: peaceiris/actions-gh-pages@v2.5.0
env:
ACTIONS_DEPLOY_KEY: ${{ secrets.ACTIONS_DEPLOY_KEY }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: ./site
with:
emptyCommits: false
2 changes: 2 additions & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
mkdocs>=1.0.4
mkdocs-material>=4.5.0
2 changes: 1 addition & 1 deletion ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prism.Plugin.Popups

The Popups plugin provides an extremely lightweight framework for implementing Popup Pages using the [Rg.Plugin.Popup][1] package with [Prism.Forms][2]. To do this we simply provide you with some friendly extensions for the INavigationService so that you can navigate in a Prism friendly manner. Note that this does not currently support deep linking.
The Popups plugin provides an extremely lightweight framework for implementing Popup Pages using the [Rg.Plugin.Popup][1] package with [Prism.Forms][2]. To do this we simply provide you with some new implementations of both Prism's Navigation & Dialog Services.

| Platform | Build Status |
| -------- | ------ |
Expand Down
Empty file added docs/.nojekyll
Empty file.
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
popups.prismplugins.com
Binary file added docs/assets/favicon.ico
Binary file not shown.
Binary file added docs/assets/prism-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions docs/dialogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Popup Dialog Service

The Dialog Service in Prism is simply fantastic, however it has one major limitation. Because Dialogs are pushed as content within the currently active ContentPage this results in a limitation in which the NavigationPage within a TabbedPage or NavigationPage will remain visible and accessible. Also if called from a MasterDetailPage's Master, it will be update the Detail but may not close the Master resulting in a situation where you can still access menu items within the Master page.

The Popup Plugin is perfectly situated to solve this problem by swapping out the implementation for the Dialog Service with one which uses a PopupPage to push. This solves the issues mentioned above because a PopupPage will overlay any Navigation Bar and will display even if a MasterDetailPage's Master is currently presented.

```c#
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterPopupDialogService();

containerRegistry.RegisterDialog<SampleDialog, SampleDialogViewModel>();
}
```

!!! note "Note"
Besides needing to register the Popup Dialog Service there are ZERO differences at this time for using the Dialog Service.

!!! warning "Warning"
Popup Pages from Rg.Plugins.Popup are simply a Xamarin.Forms.ContentPage. If you fail to properly initialize Rg.Plugins.Poup or you fail to register the Popup Plugin, Prism will simply push the Popup Page as if it were a Content Page. This may result in the Popup Page being treated as a Modal page or it may be pushed into a Navigation Page. Be sure to see the [Initializing Rg.Plugin.Popup](rgplugins.md) topic for more information.
29 changes: 29 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Popups

The Popups plugin provides an extremely lightweight framework for implementing Popup Pages using the [Rg.Plugin.Popup][1] package with [Prism.Forms][2]. To do this we simply provide you with some new implementations of both Prism's Navigation & Dialog Services.

!!! note "Note"
Install the [Prism.Plugin.Popups][PluginNuGet] NuGet to your project. This has no dependency on a specific DI Container thus allowing your code to work with any container of your choice.

!!! danger "Critical Note"
This plugin does not remove any platform initialization requirements that [Rg.Plugins.Popup][1] has. Be sure that you have followed all of the [Rg.Plugins.Popup][1] guidelines for initializing each Platform (iOS/Android,etc).

## Support

This project is maintained by Dan Siegel. If this project or others maintained by Dan have helped you please help support the project by [sponsoring Dan](https://xam.dev/sponsor-prism-popups) on GitHub!

[![GitHub Sponsors](https://github.blog/wp-content/uploads/2019/05/mona-heart-featured.png?fit=600%2C315)](https://xam.dev/sponsor-prism-popups)

## NuGet

| Package | NuGet | MyGet |
|-------|:-----:|:------:|
| [Prism.Plugin.Popups][PluginNuGet] | [![Latest NuGet][PluginNuGetShield]][PluginNuGet] | [![Latest CI Build][PluginMyGetShield]][PluginMyGet] |

[1]: https://github.com/rotorgames/Rg.Plugins.Popup
[2]: https://github.com/PrismLibrary/Prism

[PluginNuGet]: https://www.nuget.org/packages/Prism.Plugin.Popups
[PluginNuGetShield]: https://img.shields.io/nuget/vpre/Prism.Plugin.Popups.svg
[PluginMyGet]: https://www.myget.org/feed/prism-plugins/package/nuget/Prism.Plugin.Popups
[PluginMyGetShield]: https://img.shields.io/myget/prism-plugins/vpre/Prism.Plugin.Popups.svg
16 changes: 16 additions & 0 deletions docs/navigaton.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The original purpose of the Popup Plugin was to provide support for Popup Pages within a Prism Application. This cannot be natively supported since Xamarin.Forms has no concept of a PopupPage, and Rg.Plugins.Popup uses it's own service for push and popping PopupPages. While the original implemenation largely consisted of extension methods, the current version of the Popup Plugin now replaces the NavigationService that is registered by Prism with it's own implementation that understands Popup Pages.

## Initializing the Popup Plugin

!!! warning "Warning"
Popup Pages from Rg.Plugins.Popup are simply a Xamarin.Forms.ContentPage. If you fail to properly initialize Rg.Plugins.Poup or you fail to register the Popup Plugin, Prism will simply push the Popup Page as if it were a Content Page. This may result in the Popup Page being treated as a Modal page or it may be pushed into a Navigation Page. Be sure to see the [Initializing Rg.Plugin.Popup](rgplugins.md) topic for more information.

In your Prism Application you will need to be sure to specify that you want to register the Popup Plugin's Navigation Service from your RegisterTypes method. Failure to call this method will result in the Popup Navigation Service not being registered.

```c#
protected override void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterPopupNavigationService();
}
```

40 changes: 40 additions & 0 deletions docs/rgplugins.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Initializing Rg.Plugin.Popup

Rg.Plugin.Popup must be initialized on each platform.

## Android

```c#
public class MainActivity : FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;

base.OnCreate(savedInstanceState);

global::Rg.Plugins.Popup.Popup.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

LoadApplication(new App());
}
}
```

## iOS

```c#
public partial class AppDelegate : FormsApplicationDelegate
{
public override bool FinishedLaunching(UIApplication uiApplication, NSDictionary launchOptions)
{
global::Rg.Plugins.Popup.Popup.Init();
global::Xamarin.Forms.Forms.Init();

LoadApplication(new App());

return base.FinishedLaunching(uiApplication, launchOptions);
}
}
```
67 changes: 67 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Project Information
site_name: Prism.Plugin.Popups
site_description: Documentation for the Prism Popups Plugin
site_author: Dan Siegel
site_url: http://popups.prismplugins.com

# Repository
repo_name: dansiegel/Prism.Plugin.Popups
repo_url: https://github.com/dansiegel/Prism.Plugin.Popups
edit_uri: ''

# Copyright
copyright: 'Copyright &copy; 2016 - 2019 Dan Siegel'

# Configuration
theme:
name: 'material'
custom_dir: 'theme'
logo: assets/prism-logo.png
favicon: assets/favicon.ico
language: en
feature:
tabs: true
palette:
primary: 'white'
accent: 'cyan'

# Social
extra:
social:
- type: globe
link: https://dansiegel.net
- type: github
link: https://github.com/dansiegel
- type: twitch
link: https://twitch.tv/dansiegel
- type: twitter
link: https://twitter.com/DanJSiegel
- type: youtube
link: https://www.youtube.com/channel/UC0kcuQoK6odp-4UAlI8FeqA
- type: linkedin
link: https://linkedin.com/in/DanSiegel

# Extensions
markdown_extensions:
- admonition:
- codehilite:
linenums: false
- toc:
permalink: true

nav:
- Prism:
- Prism Library: http://prismlibrary.github.io/docs
- Logging:
- Logging: http://logging.prismplugins.com
- Popups:
- Home: index.md
- Initializing Rg.Plugin.Popup: rgplugins.md
- Navigation Service: navigaton.md
- Dialog Service: dialogs.md
- Container Extensions:
- Container Extensions: http://prismplugins.com
- Mobile.BuildTools:
- Mobile.BuildTools: http://mobilebuildtools.com

google_analytics: ['UA-153405647-3', 'Prism.Plugin.Popups']
19 changes: 19 additions & 0 deletions theme/partials/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{% import "partials/language.html" as lang with context %}

<footer class="md-footer">
<div class="md-footer-meta md-typeset">
<div class="md-footer-meta__inner md-grid">
<!-- Copyright and theme information -->
<div class="md-footer-copyright">
{% if config.copyright %}
<div class="md-footer-copyright__highlight">
{{ config.copyright }}
</div>
{% endif %}
</div>

<!-- Social links -->
{% include "partials/social.html" %}
</div>
</div>
</footer>

0 comments on commit faaf23e

Please sign in to comment.