maui-linux/Stubs/Xamarin.Forms.Platform.cs

167 строки
4.2 KiB
C#
Исходник Обычный вид История

2016-03-22 23:02:25 +03:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xamarin.Forms;
#if __ANDROID__
using Xamarin.Forms.Platform.Android;
#elif TIZEN4_0
using Xamarin.Forms.Platform.Tizen;
2016-03-22 23:02:25 +03:00
#elif __IOS__
using Xamarin.Forms.Platform.iOS;
#endif
namespace Xamarin.Forms.Platform
{
internal static class Loader
{
internal static void Load ()
{
}
}
#if !WINDOWS_PHONE && !WINDOWS_PHONE_APP && !TIZEN4_0
2016-03-22 23:02:25 +03:00
[RenderWith(typeof(BoxRenderer))]
#else
[RenderWith (typeof(BoxViewRenderer))]
#endif
internal class _BoxViewRenderer { }
[RenderWith(typeof(EntryRenderer))]
internal class _EntryRenderer { }
[RenderWith (typeof (EditorRenderer))]
internal class _EditorRenderer { }
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#if __ANDROID__
[RenderWith(typeof(Xamarin.Forms.Platform.Android.LabelRenderer))]
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#else
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (LabelRenderer))]
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#endif
2016-03-22 23:02:25 +03:00
internal class _LabelRenderer { }
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#if __ANDROID__
[RenderWith(typeof(Xamarin.Forms.Platform.Android.ImageRenderer))]
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#else
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (ImageRenderer))]
Android fastrenderers (#845) * Obsolete IVisualElementRenderer.ViewGroup in favor of .View * Fix NRE * Changing TContainer in PlatformEffect to View * Fix "View" type * new VisualElementRenderer * First attempt at a fast(er) button renderer * Fast Label Renderer * Let's try that again. Behold: Label Fast Renderer * Move FrameRenderer into Fast Renderers * Fix Disposable on VisualElementRenderer * Simplify touch and click handlers * Drop empty if clause * [Android] Add initial Image fast renderer * Split accessibility out to a separate helper class; fix tapgesture bug with label * [Android] Small fixes to VisualElementRenderer * Move accessiblity stuff to a separate class (which needs a good name) * Prevent query from looking to parent for fast renderers * [Android] ImageRenderer refactoring * Fix elevation/z-index bugs with Button (e.g., 40173) * Move SetLabeledBy to Accessibilitizer * Un-break automation IDs for Labels * Move gesture handling to its own class * Split gesture and effect management into separate classes * Remove unneeded packager from LabelRenderer * LabelRenderer inherits from FormsTextView * Batch updates to View * Fix isOnParentRenderer check for non-Android platforms * [Controls] Update Xamarin.Forms.ControlGallery.iOS.csproj * [Android,IOS] Small fixes to rebase and use of Internals * [Android] Ignroe warning for now * Fast renderers now passing InputTransparent and IsEnabled tests * Fast and legacy renderers now pass the Enabled and InputTransparent tests * Change PlatformEffect back, default container to null * Fix mangled using directives
2017-04-06 16:19:52 +03:00
#endif
2016-03-22 23:02:25 +03:00
internal class _ImageRenderer { }
[RenderWith (typeof (ButtonRenderer))]
internal class _ButtonRenderer { }
#if __ANDROID__
[RenderWith(typeof(ImageButtonRenderer))]
#elif !TIZEN4_0
[RenderWith(typeof(ImageButtonRenderer))]
#endif
internal class _ImageButtonRenderer { }
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (TableViewRenderer))]
internal class _TableViewRenderer { }
[RenderWith (typeof (ListViewRenderer))]
internal class _ListViewRenderer { }
[Enhancement] Add CollectionView progress behind feature flag (#4265) * The barest beginnings of starting a spike for LV2 * Very basic RecyclerView * Very, very basic UICollectionView * Start setting up galleries * De-duplicate some gallery code * Android horizontal layout * Very basic horizontal/vertical text lists for iOS * Vertical list views working in iOS, stashing while trying to figure out what the deal is with horizontal views and frames with heights of 1 * Working on rotation issues in iOS * Fix name of renderer in UWP; make horizontal scrolling work for horizontal lists on UWP * Set up gallery to generate different sizes of lists for testing * Respond to items source updates on UWP * Add gallery for GridLayout; Add GridLayout; begin GridLayout implementation UWP * Basic UWP gridness * Add demo page for grid layouts with text; Handle grid layout spans on UWP; handle grid layout span changes on UWP; * Implement span updates on Android grid layouts; * Ironed out most of the iOS text cell layout issues * iOS vertical/horizontal text lists now working reliably; * In progress on UWP DataTemplate stuff * Dumping the data template into the itemsource * Vertical list basically working with DataTemplate; horizontal list having image size issues * Clean up names and move classes to their own files * Adding some notes for FormsContentControl * Rolling back platform test on UWP * Fix Tizen build * Fix typo and roll back old test code * Remove old testing comments * Make basic data templates work on Android * Update measure to work horizontally * Remove old testing code * Terser rectangles * Use nameof() * Rename FormsContentControl to ItemContentControl * Use CreateRenderer instead of GetOrCreateRenderer * Clean up TemplateCodeCollectionViewGallery * Add grid galleries for templates * Nicer example templates * Create gallery to test removing items from collections * Smooth single item removal on Android * Smooth item insertion on Android * Observable collection item adds working on UWP * UWP Remove * Split files * Add gallery for snap points; start implementation of snap points on Android; * Move snap handling to separate class; implement Start snapping (horizontally) * Debugging vertical overlap issues on Android * Temporarily add IsClippedToBounds to generators to force clipping on Android * Start and End SnapHelpers are working horizontally and vertically * Consolidate some snap code on Android * Mandatory Single Snapping working for Center/Start horizontally * Throwing together scrollto gallery * Super basic "ScrollTo" implementation for Android, plus test page * Expand ScrollTo test harness; * Move ScrollToRequestEventArgs to its own file * Mostly working Carousel renderer; needs some cleanup and its own gallery pages * Carousel gallery * Naming cleanup * Make parameter name consistent * Finally some basic data template functionality for lists * Checkpoint; sort of working * Working out estimate size hacks * Working out cell optimizations * Checkpoint before some serious refactoring * Collapsing closer to a solution; text lists and grids working; template lists and grids working; uniform size hint mostly implemented; * Remove awkward Update method * No longer hard-coding list item heights estimates * Consolidate more code * Get rid of event on ItemsViewLayout * Remove public NeedsEstimate stuff * Get rid of IConstrainedCell * Watch for Span changes on iOS * Indexed ScrollTo on iOS * Implement removal/insertion of items on iOS * Handle Move, Reset, Replace on Android * Add screens to test ScrollTo Item; implement ScrollTo Item for iOS * ScrollTo Item working on Android, but only works for MakeVisible * Implement Android ScrollTo Animated ScrollToPosition * Ugly but functional non-animated scroll with ScrollToPosition * Move Scroll logic into helper class for clarity and maintenance * Fix Start snapping with grids (hard-coded span of 1) * Fix next/previous row/col snapping bug for EndSnapHelper * Remove some debug statements * Clean up example code * Fix missing delegate setting on CollectionView * Add filtering example * Watching the adapter and handling empty view from the renderer * Add debugging for all the FindViewHolder methods * Suuuuper basic but functional EmptyView * Allow EmptyView to be turned on and off * Building tests for all the EmptyView scenarios * Set Platform on EmptyView (for now) * Templated EmptyView on Android * Clean up merge errors * Require flag to use CollectionView on Android * Require flag to use CollectionView on UWP * Restore Label functionality commented out during testing * Adding a note for myself * Add flags for iOS; flags for Android CarouselView; * Remove Calabash out-commenting * Undo changes to DotSettings; remove outdated TODOs * Fix formatting * Remove debugging code; remove outdated todos; remove unnecessary comments * Undo randon VS changes * Include CollectionView in experimental renderer testing * Use correct property in nameof() call * Rename ScrollToRequestEventArgs Animate -> IsAnimated * Rename Constrain -> ConstrainTo for consistency * Add Core flags feature; add flag verification for CollectionView features * Make sure no one is subclassing native CollectionView stuff without flag * Set CollectionView flags for unit tests * Make flags depend on Application.Current * Fix iOS 9.3 exception when laying out CollectionView * Use Device.Flags * Move CV flag check to CollectionView; use Device.Flags on native platforms; * Move classes into their own files * Make CollectionView flag check method non-browseable * Remove old TODO * Remove Element.Platform sets * stubbed toolbox entries and snippets for Carousel and Collection * updated CV snippet to include layout * Remove Linq using statement * Remove unused using statement * Turn off CollectionView in Control Gallery * Move PropertyChangedEventArgsExtensions to internal on each platform * Clean up debugging code * Fix broken test setup * Remove ToString overrides * Fix broken test screen Fix broken test screen * Fix rebase errors * Update submodule * Fix rebase error
2018-11-13 15:49:08 +03:00
#if !TIZEN4_0
[RenderWith (typeof (CollectionViewRenderer))]
internal class _CollectionViewRenderer { }
[RenderWith (typeof (CarouselViewRenderer))]
internal class _CarouselViewRenderer { }
#endif
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (SliderRenderer))]
internal class _SliderRenderer { }
[RenderWith (typeof (WebViewRenderer))]
internal class _WebViewRenderer { }
[RenderWith (typeof (SearchBarRenderer))]
internal class _SearchBarRenderer { }
[RenderWith (typeof (SwitchRenderer))]
internal class _SwitchRenderer { }
[RenderWith (typeof (DatePickerRenderer))]
internal class _DatePickerRenderer { }
[RenderWith (typeof (TimePickerRenderer))]
internal class _TimePickerRenderer { }
[RenderWith (typeof (PickerRenderer))]
internal class _PickerRenderer { }
[RenderWith (typeof (StepperRenderer))]
internal class _StepperRenderer { }
[RenderWith (typeof (ProgressBarRenderer))]
internal class _ProgressBarRenderer { }
[RenderWith (typeof (ScrollViewRenderer))]
internal class _ScrollViewRenderer { }
[RenderWith (typeof (ActivityIndicatorRenderer))]
internal class _ActivityIndicatorRenderer { }
[RenderWith (typeof (FrameRenderer))]
internal class _FrameRenderer { }
Checkbox (#6232) * Add CheckBox class and Renderer * Add CheckBoxCell class * Add Control Gallery for CheckBox and CheckBoxCell. Add stubs only for Android for now. * Update to fast renderer for Android, Implement Checked and Unchecked Colors! * Initial UWP implementation, no colors yet. * Add iOS implementation for checkbox. It's not pretty, but it is a start! * Updates from Frank * Code cleanup with frank * Finalize iOS checkbox!!! it is a circle! * Fix WPF build and Add a checkbox!!! * Cell Renderers and macOS * UWP switchcell * Update CheckBox Cell on ios/android with colors * Remove all instances of CheckBoxCell per demand * Added UITests and UnitTests * Changed colors to TintColor which makes sense. Added a IsChecked visual state property and a sample! * checkbox cleanup, tint color fixes, and material * uwp fix when changing TintBrush * add checkbox to visual controls page * formatting fix * formatting fix * formatting fix * convert to tabs * formatting * checkbox tabs * roll back formatting changes to WPFResources * android renderer overrides * uwp fix and sizing fix ios * mask checkbox * use a single image for ios inatead of always drawing new ones * wpf fix * rename to color and add css interfaces * missing wpf file * designer hack * fix wpf for ios builds * assembly info * fix default tint color and infinite crash * [iOS] fixes change checked state from control simplification added to dynamic galery * [iOS material] fix crash when dispose * [UWP, WPF] fix vertical alignment * [Android] fixes does not change size when the reduction HeightRequest * Update Xamarin.Forms.Material.iOS/MaterialCheckboxRenderer.cs Co-Authored-By: Samantha Houts <samhouts@users.noreply.github.com> * [Android] TabStop support * alphabetize gallery, fix color update when disabled, unsubscribe from event in dispose * cleanup assembly info * fix assembly attributes * remove assembly info * pr comments * couple of more dispose fixes * One Last Dispose * fix api 19 call to ClipToOutline
2019-05-30 19:32:28 +03:00
#if __ANDROID__
// current previewer doesn't work with appcompat so this renderer is here for the previewer only
// once previewer switches to appcompat then we can remove this
[RenderWith(typeof(CheckBoxDesignerRenderer))]
internal class _CheckBoxRenderer { }
#endif
#if __IOS__
// current previewer doesn't work with appcompat so this renderer is here for the previewer only
// once previewer switches to appcompat then we can remove this
[RenderWith(typeof(CheckBoxRenderer))]
internal class _CheckBoxRenderer { }
#endif
2016-03-22 23:02:25 +03:00
#if !WINDOWS_PHONE && !WINDOWS_PHONE_APP && !TIZEN4_0
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (OpenGLViewRenderer))]
#else
[RenderWith (null)]
#endif
internal class _OpenGLViewRenderer { }
#if !WINDOWS_PHONE && !WINDOWS_PHONE_APP && !TIZEN4_0
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (TabbedRenderer))]
#else
[RenderWith (typeof (TabbedPageRenderer))]
#endif
internal class _TabbedPageRenderer { }
#if !WINDOWS_PHONE && !WINDOWS_PHONE_APP && !TIZEN4_0
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (NavigationRenderer))]
#else
[RenderWith (typeof (NavigationPageRenderer))]
#endif
internal class _NavigationPageRenderer { }
[RenderWith (typeof (CarouselPageRenderer))]
internal class _CarouselPageRenderer { }
[RenderWith (typeof (PageRenderer))]
internal class _PageRenderer { }
#if !__IOS__ && !TIZEN4_0
2016-03-22 23:02:25 +03:00
[RenderWith (typeof (MasterDetailRenderer))]
#elif TIZEN4_0
[RenderWith (typeof(MasterDetailPageRenderer))]
2016-03-22 23:02:25 +03:00
#else
[RenderWith (typeof (PhoneMasterDetailRenderer))]
#endif
internal class _MasterDetailPageRenderer { }
[Android/iOS] RefreshView (#7214) * Swipe To Refresh * pull in pull to refresh * api changes * Added RefreshView CoreGallery and Gallery Samples (using ScrollView, ListView, CollectionView, etc.) * Code refactoring in RefreshViewRenderer (iOS) * Updated RefreshView Android Renderer * Fixed RefreshView Android samples in Core Gallery * Added initial RefreshView UWP implementation * Added another UWP RefreshView renderer using WinUI NuGet controls (RefreshContainer) * - additional linker settings * - uwp fixes * - disable SkipMicrosoftUIXamlCheckTargetPlatformVersion check * Update .nuspec/Xamarin.Forms.targets * Limited RefreshView in Android to support only content using scroll. Small changes in RefreshView iOS renderer. Updated Core Gallery RefreshView samples. * Fixed Visualizer colors in UWP RefreshView * Added UWP RefreshPullDirection Platform Specific * Small changes in code syntax in iOS renderer. * Removed some unnecessary curly braces . * Register effect provider in iOS RefreshView * Changes in RefreshView UWP Dispose * Added conditional code to manage the refresh control differently if it is iOS 10 or higher. * Fixed error in Android Core Gallery (Linker) Code refactoring and small changes (PR Feedback) * Changes disposing the Android renderer * - fix SkipMicrosoftUIXamlCheckTargetPlatformVersion so it can be turned off * Removed UWP RefreshView renderer and Platform Specific * - remove winui from nuspec * - remove skip checks from targets * - remove XamlControlsResources * - remove skip check on UAP platform * Revert changes in Android Core Gallery manifiest * Revert unnecessary space in UAP Platform csproj * Removed unnecessary new line in UWP Resources * Simplified RefreshView iOS Renderer. fixes #5882
2019-08-30 00:09:34 +03:00
#if !TIZEN4_0
[RenderWith(typeof(RefreshViewRenderer))]
#endif
internal class _RefreshViewRenderer { }
2016-03-22 23:02:25 +03:00
}