diff options
author | Rui Marinho <me@ruimarinho.net> | 2017-04-06 14:19:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-06 14:19:52 +0100 |
commit | 425fafb05723a299a5eaa0f6d801f87bdf7141fa (patch) | |
tree | a9e38aa0a0252e6a6d2da6990303d82f2163a5a9 /Xamarin.Forms.ControlGallery.Android | |
parent | 829a4bda76166ddffce5a0e84538183b9527a1bd (diff) | |
download | xamarin-forms-425fafb05723a299a5eaa0f6d801f87bdf7141fa.tar.gz xamarin-forms-425fafb05723a299a5eaa0f6d801f87bdf7141fa.tar.bz2 xamarin-forms-425fafb05723a299a5eaa0f6d801f87bdf7141fa.zip |
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
Diffstat (limited to 'Xamarin.Forms.ControlGallery.Android')
4 files changed, 38 insertions, 38 deletions
diff --git a/Xamarin.Forms.ControlGallery.Android/Activity1.cs b/Xamarin.Forms.ControlGallery.Android/Activity1.cs index b0491b0f..320c6e37 100644 --- a/Xamarin.Forms.ControlGallery.Android/Activity1.cs +++ b/Xamarin.Forms.ControlGallery.Android/Activity1.cs @@ -1,28 +1,20 @@ using System; -using System.ComponentModel; using System.Diagnostics; -using System.Reflection; - +using System.Globalization; +using System.IO; +using System.IO.IsolatedStorage; using Android.App; -using Android.Content; using Android.Content.PM; -using Android.Runtime; -using Android.Views; -using Android.Widget; using Android.OS; +using Android.Widget; +using Java.Interop; using Xamarin.Forms; using Xamarin.Forms.ControlGallery.Android; using Xamarin.Forms.Controls; -using Xamarin.Forms.Maps.Android; +using Xamarin.Forms.Controls.Issues; using Xamarin.Forms.Platform.Android; using Xamarin.Forms.Platform.Android.AppLinks; -using System.IO; -using System.IO.IsolatedStorage; - -using Droid = Android; -using System.Globalization; -using Java.Interop; -using Xamarin.Forms.Controls.Issues; +using Android.Content; [assembly: Dependency (typeof (CacheService))] [assembly: Dependency (typeof (TestCloudService))] @@ -34,29 +26,7 @@ using Xamarin.Forms.Controls.Issues; namespace Xamarin.Forms.ControlGallery.Android { - public class BorderEffect : PlatformEffect - { - protected override void OnAttached () - { - Control.SetBackgroundColor (global::Android.Graphics.Color.Aqua); - - var childLabel = (Element as ScrollView)?.Content as Label; - if (childLabel != null) - childLabel.Text = "Success"; - } - - protected override void OnDetached () - { - Control.SetBackgroundColor(global::Android.Graphics.Color.Beige); - } - - protected override void OnElementPropertyChanged (PropertyChangedEventArgs args) - { - base.OnElementPropertyChanged (args); - } - } - - public class CacheService : ICacheService + public class CacheService : ICacheService { public void ClearImageCache () { diff --git a/Xamarin.Forms.ControlGallery.Android/BorderEffect.cs b/Xamarin.Forms.ControlGallery.Android/BorderEffect.cs new file mode 100644 index 00000000..9eb73ab1 --- /dev/null +++ b/Xamarin.Forms.ControlGallery.Android/BorderEffect.cs @@ -0,0 +1,21 @@ +using Xamarin.Forms.Platform.Android; + +namespace Xamarin.Forms.ControlGallery.Android +{ + public class BorderEffect : PlatformEffect + { + protected override void OnAttached () + { + Control.SetBackgroundColor (global::Android.Graphics.Color.Aqua); + + var childLabel = (Element as ScrollView)?.Content as Label; + if (childLabel != null) + childLabel.Text = "Success"; + } + + protected override void OnDetached () + { + Control.SetBackgroundColor(global::Android.Graphics.Color.Beige); + } + } +}
\ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.Android/Properties/AssemblyInfo.cs b/Xamarin.Forms.ControlGallery.Android/Properties/AssemblyInfo.cs index 61a74f21..dc197baf 100644 --- a/Xamarin.Forms.ControlGallery.Android/Properties/AssemblyInfo.cs +++ b/Xamarin.Forms.ControlGallery.Android/Properties/AssemblyInfo.cs @@ -2,6 +2,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using Android.App; +using Xamarin.Forms; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information @@ -35,3 +36,10 @@ using Android.App; [assembly: Android.App.MetaData("com.google.android.maps.v2.API_KEY", Value = "AIzaSyAdstcJQswxEjzX5YjLaMcu2aRVEBJw39Y")] [assembly: Xamarin.Forms.ResolutionGroupName ("XamControl")] + +#if TEST_LEGACY_RENDERERS +[assembly: ExportRenderer(typeof(Button), typeof(Xamarin.Forms.Platform.Android.AppCompat.ButtonRenderer))] +[assembly: ExportRenderer(typeof(Image), typeof(Xamarin.Forms.Platform.Android.ImageRenderer))] +[assembly: ExportRenderer(typeof(Label), typeof(Xamarin.Forms.Platform.Android.LabelRenderer))] +[assembly: ExportRenderer(typeof(Frame), typeof(Xamarin.Forms.Platform.Android.AppCompat.FrameRenderer))] +#endif
\ No newline at end of file diff --git a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj index 75a5a7b8..b606e109 100644 --- a/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj +++ b/Xamarin.Forms.ControlGallery.Android/Xamarin.Forms.ControlGallery.Android.csproj @@ -168,6 +168,7 @@ </ItemGroup> <ItemGroup> <Compile Include="Activity1.cs" /> + <Compile Include="BorderEffect.cs" /> <Compile Include="BrokenNativeControl.cs" /> <Compile Include="Properties\MapsKey.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> |