New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix border on android buttons #941

Merged
merged 3 commits into from Jun 1, 2017

Conversation

Projects
None yet
6 participants
@rmarinho
Member

rmarinho commented May 29, 2017

Description of Change

Don't allow negative border width .
Refactoring and add support for border properties to appcompact and fast renderer button

Bugs Fixed

https://bugzilla.xamarin.com/show_bug.cgi?id=36031

PR Checklist

  • Has tests (if omitted, state reason in description)
  • Rebased on top of master at time of PR
  • Changes adhere to coding standard
  • Consolidate commits as makes sense

rmarinho added some commits May 29, 2017

[Android] Add a button background tracker to handle background and bo…
…rder properties and be shared between button renderers

@rmarinho rmarinho changed the title from Fix bugzilla36031 to Fix border on android buttons May 29, 2017

@StephaneDelcroix

This comment has been minimized.

Show comment
Hide comment
@StephaneDelcroix

StephaneDelcroix May 30, 2017

Member

you comment says

Don't allow negative border width

but the code only checks for negative cornerRadius

Member

StephaneDelcroix commented May 30, 2017

you comment says

Don't allow negative border width

but the code only checks for negative cornerRadius

@@ -27,6 +23,7 @@ public class ButtonRenderer : ViewRenderer<Button, AppCompatButton>, AView.IOnAt
public ButtonRenderer()
{
System.Diagnostics.Debug.WriteLine("Slow Button!");

This comment has been minimized.

@StephaneDelcroix

This comment has been minimized.

@rmarinho

rmarinho May 30, 2017

Member

This is something we also added on non app compact button so users select fast renderers, should we remove it @ez ?

@rmarinho

rmarinho May 30, 2017

Member

This is something we also added on non app compact button so users select fast renderers, should we remove it @ez ?

This comment has been minimized.

@hartez

hartez May 30, 2017

Member

Yeah, that should have been removed a while ago.

@hartez

hartez May 30, 2017

Member

Yeah, that should have been removed a while ago.

@rmarinho

This comment has been minimized.

Show comment
Hide comment
@rmarinho

rmarinho May 30, 2017

Member

@StephaneDelcroix my comment referes to border width (inset) calculation inside the renderer where if border radius was 0 it will have a negative value for the border width (inset) when drawing

Member

rmarinho commented May 30, 2017

@StephaneDelcroix my comment referes to border width (inset) calculation inside the renderer where if border radius was 0 it will have a negative value for the border width (inset) when drawing

@hartez

hartez approved these changes May 30, 2017

@rmarinho rmarinho merged commit 20d33c6 into master Jun 1, 2017

5 checks passed

Android-UITests-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 : Running
Details
Android-UITests-Stable-LegacyRenderers Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: UI Tests :: OSX Test Cloud Package - Run Android 6.0.1 (Legacy Rende…
Details
OSX-Debug-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: OSX Debug : Running
Details
Windows-Debug-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Debug : Tests passed: 3791, ignored: 10
Details
Windows-Release-Stable Finished TeamCity Build Xamarin.Forms :: Debug :: Stable - Cycle 9 :: Windows Release Unit Tests : Tests passed: 3791, ignored: 10
Details

@StephaneDelcroix StephaneDelcroix deleted the fix-bugzilla36031 branch Jun 1, 2017

rmarinho added a commit that referenced this pull request Jun 26, 2017

Fix border on android buttons (#941)
* [Android] Add a button background tracker to handle background and border properties and be shared between button renderers

* [Android]Fix border radius dependency

* [Android] Make sure we always create or updated the background button tracker

samhouts added a commit that referenced this pull request Jul 25, 2017

Fix border on android buttons (#941)
* [Android] Add a button background tracker to handle background and border properties and be shared between button renderers

* [Android]Fix border radius dependency

* [Android] Make sure we always create or updated the background button tracker

assemhakmeh added a commit to assemhakmeh/Xamarin.Forms that referenced this pull request Jul 28, 2017

Merge branch '2.3.5' into ios-fastrenderers
* 2.3.5:
  [UWP] Fixes for usage of XF with .net native toolchain (#1024)
  [UWP] Make sure to update HitTestVisible when IsEnable changes (#1015)
  [Android] Dispose check before setting properties on Button (#1013)
  Add missing member variable to FormsApplicationActivity
  Fix NRE when background color of button set in FormsApplicationActivity (#1010)
  Fix border on android buttons  (#941)
  [iOS] ListView with UnevenRows and Cell Heights will no longer be slow to load (#994)
  Set the Id field for Android Views created by Forms #1004
  Fix build
  Fix possible crash on API 21+ at launch when using Holo theme and FormsApplicationActivity (#961)
  [Android] Remove the ". " on empty labels (Accessibility) on Fastrenderers (#915)
  Remove debug outputs (#1008)
  Add check for instance of UITableView (#885)
  [XamlC] fix release builds of Xaml Unit Tests
  Dispose check on ButtonRenderer (#975)
  [previewer] make sure we do not crash even if the previewer doesn't s… (#946)
  [XamlC] fix build
  Remove VisualElement finalizer (#918)
  [XamlC] process symbols if DebugType is set (#925)

samhouts added a commit that referenced this pull request Oct 4, 2017

@samhouts samhouts referenced this pull request Oct 4, 2017

Merged

Revert "Fix border on android buttons (#941)" #1178

3 of 4 tasks complete

samhouts added a commit that referenced this pull request Oct 9, 2017

samhouts added a commit that referenced this pull request Oct 10, 2017

samhouts added a commit that referenced this pull request Oct 10, 2017

jassmith added a commit that referenced this pull request Oct 10, 2017

rmarinho added a commit that referenced this pull request Oct 16, 2017

Revert "Fix border on android buttons (#941)" (#1178)
* Revert "Fix border on android buttons  (#941)"

This reverts commit aa9bca1.

* Fix merge conflicts

rmarinho added a commit that referenced this pull request Oct 16, 2017

Revert "Fix border on android buttons (#941)" (#1178)
* Revert "Fix border on android buttons  (#941)"

This reverts commit aa9bca1.

* Fix merge conflicts

jassmith added a commit that referenced this pull request Oct 26, 2017

Merge 2.4.0 into 15-5 branch (#1230)
* [Android] Fix bugzilla58868 (#1106)

* [Android] Only set elevation in Lolipop or newer

* Update submodule

* [Android] Restore and obsolete EditorEditText and EntryEditText controls (#1114)

* Restore and obsolete EditorEditText and EntryEditText controls

* Don't need to use the obsolete classes in the renderers

* Update obsolete messages

* [Internal] Fix loading props file on older MSBuild versions (#1112)

* Fix loading props file on older MSBuild versions

* Fix applying metadata to default items

* Fix build error caused be errant '

* Fix ' issue better this time

* One more missing '

* Fix NRE when removing multiple pages in NavigationPageRenderer (#1108)

* Update 53179 test to remove 2 pages; fix for NRE when removing two pages with Android Support 25+

* Add missing step to UI test

* [UWP] ListView ItemSelected event will fire only once on selection changed (#1005)

* Add repro for 44886

* [UWP] Fire ListItemClicked when Selection changes

This will automatically set the value on the renderer and prevent the double event from firing.

* Clean up repro

* Update test case for delection scenario

* [Core] Allow ListView item deselection

* [UWP] Send events when item is deselected, too

* Test works better when you DO something.

* [Android] Fix NRE when page is being disposed (#1118)

* [ControlGallery] Add test case for bugzilla 59097

* [Android] Fix NRE

* [iOS] Make sure to include query path on generated url (#1119)

* Fix default items (#1123)

There were some issues in the MSBuild evaluation order
that caused the default items files to never get used.

* Revert PR #762 (#1134)

* [UITests] Update packages, fix failing test (#1140)

* [Nuget] Update UITest packages

* [UITest] Fix failing tests by scrolling to results first

* [PagesGallery] Remove iOS7 storyboard

* Revert "[UITest] Fix failing tests by scrolling to results first"

This reverts commit 54eba70.

* [Controls] Move results labels on 51773 to the top

* [iOS] launch image for iPhoneX

* [Build] Move to XCode 9 support

* Fix failing UI tests for Android FormsApplicationActivity (#1141)

* Fix broken test for 57910 when using FormsApplicationActivity

* Fix NRE when removing a page during OnAppearing using FormsApplicationActivity

* Update 45926 test to work correctly with FormsApplicationActivity

* Update 32830 test so it doesn't crash on FormsApplicationActivity

* Longer wait before refreshing appearing messages (to work with FormsApplicationActivity)

* Fix input transparency issue with old FrameRenderer

* Remove extraneous using directive

* Just ignore test 32830 on FormsApplicationActivity

* [Controls] Add missing directive

* Update submodule

* [UWP] Use ItemClick to re-enable use of enter key for selection on ListView (#1133)

* [Android] Restore pinch gestures and fix listview item selection (#1135)

* Repro

* Fail test if tap command is executed more than once.

* Update error message

* Handle context actions and taps without breaking selection

* Fix 58833 test

* Prevent InnerGestureListener from swallowing clicks and preventing selection

* Repro for 57515

* Add gestures category to appropriate tests

* Test notes

* Restore the tap gesture handling

* Better test name

* Simplify InnerGestureListener constructor; handle OnDown only if listening

* OnInterceptTouchEvent for IsEnabled handling

* Fix incorrect class filter in TapGestureHandler

* Restore MotionEventHelper

* Add IsEnabled check on OnTouchEvent

* Reinstate pinch gestures

* Checkpoint (trying to figure out how to handle button elevation)

* Rip out elevation ordering in DefaultRenderer

* Working version of pinch-to-zoom test

* Clean up lazy initializers, remove unnecessary members

* One fewer Java.Lang.Object

* Fix issue number; clean up notes and issue number changes

* Remove conditional

* Restore correct issue number

* Automate all the options for 58833 test

* Remove unnecessary automation ID

* Formatting cleanup; reinstate gesture detector dispose checks

* Updating Xamarin UI test version to avoid iOS crashes; update test to open iOS context actions

* Attempting to get 58833 test running on all iOS versions

* [Android] Hide actionbar when MDP with NavigationPage with hidden NavigationBar (#1120)

* [ControlGallery] Add repo and test for Bugzilla27731

* [Android] Hide ActionBar if MDP with NavigationPage that hides the NavigationBar

* [iOS] Can activate ContextActions on ListViews reliably again (#1144)

* Add ContextActions test category

* Add repro for 58875

* [iOS] Null check for the Delegate; clear the static WeakRef on dispose

* Add iOS prototypical cell cache for LV RowHeight calcs (#1143)

* Fix UI test for 58875 on Android

* [Nuget]Fix condition to import DefaultItems.targes (#1146)

* Use bitwise ops on caching strategy in ListViewAdapter.cs (#1149)

* Revert "[UWP] Use ItemClick to re-enable use of enter key for selection on ListView (#1133)"

This reverts commit d1bf93b.

* Revert "[Nuget]Fix condition to import DefaultItems.targes (#1146)"

This reverts commit 0092456.

* Fix nuspec file to install DefaultItems.targets in PCL projects (#1163)

* [Android]Ignore warning

* Add ProjectCapability to targets file (#1164)

* Prevent Flags/IsInitialized check from crashing Android app on restart (#1151)

* Prevent Android app crashes on configuration restarts when flags are set

* Update UI test

* Fix typos

* Don't prevent FastRenderers flag from being set

* Revert PR #882 (#1190)

* Revert "Fix border on android buttons  (#941)" (#1192)

This reverts commit 20d33c6.

* [Build] Update submodule

* Checking IsDestroyed before using FragmentManager in Dispose() (#1194)

* [UITest] Fix uitest for elevation

* [UITest] Add preserve (#1105)

* [Android] Handle rapid taps when only single-tap recognizer is present (#1188)

* Handle rapid tapping correctly

* Remove failed optimization attempt for 2-pointer gestures

* [UWP]  Fix for UWP crashing on load when compiled with .NET Native for the store. (#1186)

* [Xaml] Chain op_implicit for OnPlatform (if needed) (#1176)

* [Xaml] Chain op_implicit for OnPlatform (if needed)

For OnPlatform<T>, if a conversion for T to the destination type exists,
first convert OnPlatform<T> to T, the T to the dest type

Also unify the way we look for op_implicit operators

* [Xaml] only apply the double opImplicit if a flag is set

* [C] allow conversion on parameter

* Clear MainPage renderer if exists after reload (#1200)

* [UWP] Inherit from Panel on WrapperControl (#1204)

* [UWP] Inherit from Panel on WrapperControl

* Fix typo

* [Controls] Fix cherry-pick

* fix-cp

* [*] Expose the Flags to the Core (#1181)

* [*] Expose the Flags to the Core

* docs

* [C] Hide Device.Flags

* Allow duplicate issue numbers per tracker (#1127)

* fix-cp

* Do not attempt to clear data on app start (crashes on iOS 11)

* [Packages] Update UITest and consolidate packages (#1201)

* [Packages] Update UITest and consolidate packages

* [Controls] Remove old packages

* [UITest] Try fix UITests iOS11

* [UITests] Use back instead of custom class

* [Android] Prevent ObjectDisposedExceptions in ListViews with Header/FooterTemplates (#1155)

* Update repro to include header/footers with bound props

* [Android] Clear renderers of ListView header/footers

And don't call `RemoveAllViews`, because that causes the ObjectDisposedExceptions.

* Undo changes meant for 2.5.0

* [UITest] Fix build

* Stop forcing FormsTextBox content to ForegroundFocusBrush on UWP (#1206)

* Proper revert of PR #882 (#1220)

* [Android] Use non-deprecated constructor for GestureDetector (#1227)

* Use non-deprecated constructor for GestureDetector

* Only grab Context once

* Only get Context once

samhouts added a commit that referenced this pull request Jan 12, 2018

samhouts added a commit that referenced this pull request Feb 2, 2018

rmarinho added a commit that referenced this pull request Feb 8, 2018

[Android] Button Border can be set independent of other properties an…
…d will not change the size of the Button. fixes #1436 **behavior change** (#1570)

* Revert "Revert "Fix border on android buttons  (#941)""

This reverts commit a4c7f31.

* Add repro for 1436

Fix typo

* [Core] Use 2dp for Android default Button BorderRadius

* [Android] Add shadow & padding to ButtonDrawable

* [Android] Set BackgroundDrawable on Button when BorderWidth, BorderRadius, and BorderColor are changed

Also add RippleDrawable when supported for the nice ripple effect on press, and set the PaddingTop for the ButtonDrawable. fixes #1436

* [Android] Default Color for Button is specified for AppCompat and AppAct

* [Android] Check BorderRadius value against proper default

* Fix test case number

* grumble grumble this branch is still vs2015 grumble

* [Android] Get button color from resources

* [Core] Obsolete Button.BorderRadius in favor of CornerRadius

* [Core] Added VisualElement.DefaultBackgroundColor

* Update tests to ignore obsolete prop warning

* [Android] Use Button.CornerRadius instead of BorderRadius

* [iOS] Use Button.CornerRadius instead of BorderRadius

* [macOS] Use Button.CornerRadius instead of BorderRadius

* [UWP] Use Button.CornerRadius instead of BorderRadius

* Update docs

* Fix more cases of BorderRadius obsolete warnings

* [UWP] Use BP.DefaultValue instead of abstracted const

* [Android] Use BP.DefaultValue instead of abstracted const

* [Core] Remove unnecessary abstracted consts from Button

* [Android] Fix default corner radius on ButtonDrawable

* Unit tests for Button.CornerRadius/BorderRadius

* [iOS] Restore default Button.CornerRadius

* [UWP] Add todo

@samhouts samhouts added this to the 2.5.0 milestone May 5, 2018

@samhouts samhouts modified the milestones: 2.5.0, 2.3.0, 2.3.5 Jun 27, 2018

@samhouts samhouts referenced this pull request Aug 1, 2018

Merged

[Android] check if bitmaps have been GC'd #3459

3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment