Skip to content
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

090620_0415PM_addingChangesFromCn1 #36

Merged
merged 243 commits into from
Jun 19, 2020
Merged
Changes from 1 commit
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
c074708
added anchors for percent anchors
Jan 7, 2020
2521c8a
Fixed RoundRectBorder.equals() so that it correctly reports borders w…
shannah Jan 22, 2020
22aa590
Improved sizing and padding for Sheet.
shannah Jan 22, 2020
90f13dd
Added titlebar padding/margin to Sheet so that it doesn't get obscure…
shannah Jan 22, 2020
866314d
Fixed RoundBorder opacity not being loaded from XML in themes. Also …
shannah Jan 23, 2020
0f78ba5
Updated hashCode and equals() of RoundBorder to take into account mor…
shannah Jan 23, 2020
babc49c
Fix for RoundRectBorder.equals() to take into account cornerRadius.
shannah Jan 23, 2020
795eed5
Fixed naming of files so it won't change when sharing
shai-athena Jan 24, 2020
8c90a81
Fixed animation artifacts that occur if adding or removing components…
shannah Jan 24, 2020
8fcfbde
Override setPreferredW and getPreferredW on SpanLabel so that these m…
shannah Jan 24, 2020
6f5927b
Added allowClose property on Sheet which causes a Sheet *not* to clos…
shannah Jan 24, 2020
46e9be8
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Jan 24, 2020
c5308b9
Fixed NPE in component inspector when there are elements with null ui…
shannah Jan 27, 2020
fd06dc1
Added copyibs classpath to properties to fix build issue.
shannah Jan 27, 2020
2c0f9b4
Added API to find out the safe display areas - mainly for iPhone X. …
shannah Jan 29, 2020
e3f4720
Removed caching for safe area because it caused problems with the sim…
shannah Jan 29, 2020
514bcb5
Fixed regression in text editing in simulator. Regressions fixed:
shannah Jan 29, 2020
b7bc749
Small change to Executor so that start(), stop(), init(), and destroy…
shannah Jan 29, 2020
31071a6
Added javadocs for BrowserComponent.ready() method. https://github.c…
shannah Jan 30, 2020
894851f
Merge branch 'pull2986'
shannah Jan 30, 2020
e47917f
Added unit tests for LayeredLayout including new percentInsetAnchors …
shannah Jan 30, 2020
d7cf011
Fixed ready() method of BrowserComponent, as it wasn't being added to…
shannah Jan 31, 2020
0e16caa
Added "see also" link in the javadoc
jsfan3 Feb 1, 2020
39e1716
Add "see also" link to blog article
jsfan3 Feb 1, 2020
6473d88
Override get/setPreferredW/H in ScaleImageLabel to make preferred siz…
shannah Feb 7, 2020
3b98daa
Fixed TextArea.stopEditing(Runnable) so that the onFinished callback …
shannah Feb 7, 2020
3caf93a
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Feb 7, 2020
e7b6435
Added ActionSource interface which is implemented by all components t…
shannah Feb 7, 2020
e075059
Changed ComponentSelector implementation of add/removeActionListener …
shannah Feb 7, 2020
6e62fb8
Adjusted LoadingTextAnimation to use font size of the label that it i…
shannah Feb 10, 2020
9fc2b4b
Fixed regression related to safe areas support. https://github.com/c…
shannah Feb 12, 2020
94d8708
Fix https://github.com/codenameone/CodenameOne/issues/3025, fetchAsPr…
jsfan3 Feb 13, 2020
03245c6
Removed debugging text for safe area (https://github.com/codenameone/…
shannah Feb 14, 2020
804795b
Fixed issue with round rect border tracking arrow being rendered dist…
shannah Feb 14, 2020
c4cb1a1
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Feb 14, 2020
5321828
Completed done listener support on multiline text areas in Android port.
shannah Feb 15, 2020
2745f88
Added support for setting different Material icons for different stat…
shannah Feb 16, 2020
b5863f6
SpanMultiButton implementation
jsfan3 Feb 15, 2020
f4630c7
Added removeText methods
jsfan3 Feb 15, 2020
0c958e7
Small fix
jsfan3 Feb 15, 2020
d4adcba
Replaced `SpanLabel` with `TextArea`
jsfan3 Feb 16, 2020
d5d1dee
Fixed issue with millimeter stroke thickness not being set in round r…
shannah Feb 20, 2020
144b427
Set long event flag for events of type LONG_POINTER_PRESS.
shannah Feb 20, 2020
e3be3db
Added action listener support for images to notify interested parties…
shannah Feb 20, 2020
fb3c586
Fixed issues with lead components inside the toolbar. Previously eve…
shannah Feb 20, 2020
60625ce
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Feb 20, 2020
55c6e86
Fixed positioning of text in text areas.
shannah Feb 21, 2020
a7a180c
Fixed NPE when using slow connection mode in simulator.
shannah Feb 21, 2020
25d1763
Fixed positioning of interaction dialog to work properly for both lay…
shannah Feb 23, 2020
f2cceae
Fixed setting multiple font icons on labels for different states.
shannah Feb 23, 2020
34e06af
Made sheet commands a safe area so the close/back button doesn't get …
shannah Feb 23, 2020
9df82fd
Added support for file and storage URLs in URLImage so that images ca…
shannah Feb 23, 2020
9e8a643
Placed upper bound on the size of temporary bitmaps generated for and…
shannah Feb 24, 2020
5d31f6b
Added getOwner() method to Component.
shannah Feb 27, 2020
fe3f94c
Added ProfileAvatarView sample.
shannah Feb 27, 2020
fbf9939
Fixed issue with screen rotation on iOS - a regression related to saf…
shannah Feb 27, 2020
d846639
Removed extra margin and padding in internal containers of SpanLabel.…
shannah Feb 29, 2020
cdfc198
Fixed lead component behaviour to allow a container with a lead compo…
shannah Feb 29, 2020
a05bf40
Changed long press interval from 800ms to 500ms to match Apple UI ges…
shannah Feb 29, 2020
42921d0
Added animation safety to some revalidate() calls.
shannah Feb 29, 2020
972aadf
Added accessors to isOnlyLeftRouned and isOnlyRightRounded properties…
shannah Feb 29, 2020
abe6389
Fixed issue with jar: URLs on iOS. https://github.com/codenameone/Co…
shannah Mar 2, 2020
a0ea09d
Added sample test case for https://github.com/codenameone/CodenameOne…
shannah Mar 3, 2020
eab2bad
Created interfaces IconHolder and SelectableIconHolder to be implemen…
shannah Mar 4, 2020
cc422d5
Added javadocs for state change listeners in Buttons.
shannah Mar 4, 2020
ad7e9aa
Added publich blockSideSwipe() method to Component.
shannah Mar 4, 2020
5898b4a
Improved support for safe areas. It is now possible to mark a compon…
shannah Mar 4, 2020
2ad65d4
Added Style.stripMarginAndPadding() method which does what it sounds …
shannah Mar 4, 2020
08e89ac
Removed debug output
shannah Mar 4, 2020
c1a555e
Added support for BASELINE vertical alignment in Label. The primary …
shannah Mar 5, 2020
0514036
Exposed getDisplaySafeArea() in Display class as it might be useful t…
shannah Mar 5, 2020
4875e5f
Added support for badges on labels.
shannah Mar 6, 2020
07217ca
Fixed issue with phantom action events being emitted from lead compon…
shannah Mar 6, 2020
6d5450e
Added methods for setting individual margins more easily.
shannah Mar 6, 2020
9d9bf85
Refactored handling of pointer events with lead components to make th…
shannah Mar 6, 2020
400c356
Fixed regression with iOS push device tokens on iOS 13. Behaviour of…
shannah Mar 9, 2020
080b05a
Fixed issue with push callback called twice on iOS10+ when push messa…
shannah Mar 10, 2020
d7fe9b8
Updated local path
shai-almog Mar 12, 2020
4d0d73e
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shai-almog Mar 12, 2020
d43c67a
Fixed regression with button action events. Fixes https://github.com…
shannah Mar 13, 2020
ee6b317
Fixed container layout width and height to take into account if the c…
shannah Mar 13, 2020
ac8986a
Added filter(String) method to ComponentSelector to filter a found se…
shannah Mar 13, 2020
07a086b
Fixed background painting of InterFormContainer.
shannah Mar 13, 2020
e144b59
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Mar 13, 2020
8fe95b3
Removed debugging code.
shannah Mar 13, 2020
b646353
Fixed drag-and-drop regression. https://github.com/codenameone/Coden…
shannah Mar 17, 2020
f1e9b5e
Added missing repaints when state of lead component changes between s…
shannah Mar 17, 2020
7c60d76
Added test case for https://github.com/codenameone/CodenameOne/issues…
shannah Mar 18, 2020
da6896e
Fixed issue with Switch not toggling on tap on iOS. The problem was …
shannah Mar 18, 2020
251fc80
Refactoring to fix issues with lead components. Added a LeadUtil pac…
shannah Mar 18, 2020
96720ed
Fixed regression in InteractionDialog that could cause incorrect sizi…
shannah Mar 20, 2020
e6960d1
Added CSSBorder class to try to fill some of the gaps in our CSS supp…
shannah Mar 20, 2020
21b2b44
Better implementation of fillLinearGradient for JavaSE port.
shannah Mar 21, 2020
3570611
Fixed sizing of InteractionDialogs whose preferred height depends on …
shannah Mar 21, 2020
235e58b
Added test case for #3051
shannah Mar 23, 2020
edb8a59
Added test case for #3056
shannah Mar 23, 2020
f3a0f50
Fixed issue with toolbar not showing up in popovers on iPad with iOS …
shannah Mar 23, 2020
42be84b
Added sample of adding component to right bar.
shannah Mar 23, 2020
a1d3f1f
Events received outside of bounds when InteractionDialog is set to di…
shannah Mar 23, 2020
d5fcc51
Selection events now only fired when selection is changed.
shannah Mar 23, 2020
2610845
Updated Container.calcPreferredSize() to take into account safe areas.
shannah Mar 23, 2020
8df38b1
Added sample with addDropListener to help with #3059
shannah Mar 24, 2020
d96642c
Added sample to demonstrate drop listener with lead component to help…
shannah Mar 24, 2020
d2ff07a
Added image to contributing page
shannah Mar 25, 2020
00dc1af
Fixed issue with padding units and margin units bleeding between styl…
shannah Mar 26, 2020
4be450a
Slight optimization to setPaddingUnits and setMarginUnits so it only …
shannah Mar 26, 2020
bc4e04a
Better support for 9-piece borders in CSS by adding support for image…
shannah Mar 27, 2020
12ac334
Updated CSSBorder sample to include 9-piece image border.
shannah Mar 27, 2020
1cd6668
Fixed some issues with 9-piece borders. Made some changes to image h…
shannah Mar 27, 2020
1d8ea6d
Added easy thread error handling
shai-almog Mar 29, 2020
ce9ef56
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shai-almog Mar 29, 2020
cb757b5
Fixed bug with monospace system fonts not being used when font-family…
shannah Mar 30, 2020
4d885ea
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Mar 30, 2020
211a41b
Fixed issue with facebook login on iOS 13. These changes are update…
shannah Apr 1, 2020
274adae
Added test case for ScaleImageLabel
shannah Apr 2, 2020
38f8993
Fixed issue with safe areas not getting updated on rotation. https:/…
shannah Apr 2, 2020
bd7188d
Added support for connect timeout in sockets. Added SocketSample tha…
shannah Apr 2, 2020
5bc9660
Set failonerror=true for building netbeans plugin in CodenameOne rele…
shannah Apr 3, 2020
61e9bd8
Added fade transition sample.
shannah Apr 3, 2020
1629344
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Apr 3, 2020
52406dc
Added native controls sample.
shannah Apr 3, 2020
bfcb8fa
Better documentation and a new code example
jsfan3 Apr 5, 2020
359c481
Better documentation and a new code example
jsfan3 Apr 5, 2020
7792877
Better documentation
jsfan3 Apr 5, 2020
9495869
Update Media.java
jsfan3 Apr 5, 2020
7ea5185
Update MediaManager.java
jsfan3 Apr 5, 2020
2614913
Fixed issue with preferred sizing of ScaleImageLabel when preferredW …
shannah Apr 6, 2020
922f946
Updated GoogleSignIn to use 5.0.x version of the GoogleSignIn SDK bas…
shannah Apr 6, 2020
bf19e85
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Apr 6, 2020
a8da0d8
SafeAreas are now respected even when rendering while not initialized…
shannah Apr 6, 2020
cf921d6
Fixed issue with swipe containers not opening/closing properly. The …
shannah Apr 6, 2020
8fbc9da
Fixed issue with date being off by one day with DatePicker https://gi…
shannah Apr 6, 2020
a53605f
Updated FingerprintScannerSample with examples of storing passwords p…
shannah Apr 9, 2020
4a4d964
Fix a NPE
jsfan3 Apr 9, 2020
ab75a55
Fixed regression in CSS compiler that caused the new CSSBorder to be …
shannah Apr 13, 2020
140945b
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Apr 13, 2020
f68b69b
Fixed issue with CSSBorder that occurs when the border-radius is defi…
shannah Apr 14, 2020
6ee1a5c
Fixed another CSS regression related to CSSBorder. https://github.com…
shannah Apr 15, 2020
5c74e7c
Fixed regression in Google SignIn that affected some older versions o…
shannah Apr 15, 2020
5c6a516
Better fix for issues with CSSBorder. Since Border implements equals…
shannah Apr 15, 2020
8de1f11
Added test case for https://github.com/codenameone/CodenameOne/issues…
shannah Apr 15, 2020
3ca10c5
Added test case for https://github.com/codenameone/CodenameOne/issues…
shannah Apr 15, 2020
8d23aff
Changed RoundRectBorderTest to reflect changes to RoundRectBorderEquals.
shannah Apr 15, 2020
6ff6176
Added components in swipe containers to demonstrate that lead compone…
shannah Apr 16, 2020
1cd349e
Fixed border-image-slice to work with more than one inset value.
shannah Apr 16, 2020
b5b41eb
Small fix to restore box shadow caching.
shannah Apr 16, 2020
2c6b38d
Image metadata is now stored inside theme constants so that we can tr…
shannah Apr 16, 2020
ed4fd6b
Another fix for CSSBorder regression. This identified that the CSSBo…
shannah Apr 16, 2020
604b75f
Fixed userdatadir path for webviews in JavaSE. This fixes errors lik…
shannah Apr 17, 2020
16b4bb5
Fixed NPE in css compiler with border-top-left-radius directive. http…
shannah Apr 18, 2020
6d83ae1
Added getShortMonthName() and getLongMonthName() methods to L10NManag…
shannah Apr 20, 2020
6dbeca2
Added test case for executeAndReturnString.
shannah Apr 21, 2020
8777948
Updated FingerprintScannerSample with new isTouchIDAvailable() and is…
shannah Apr 21, 2020
07146ca
Added minimal sample using ChatRoomView as a test case for https://gi…
shannah Apr 21, 2020
144f278
Added sample for zooming images in and out.
shannah Apr 22, 2020
f02f73d
Modified zoom sample to be able to zoom past max screen width.
shannah Apr 22, 2020
3209bff
Added participants to chat view to test https://github.com/shannah/RA…
shannah Apr 22, 2020
a2bff90
Added Jailbreak detection sample using CN1JailbreakDetect cn1lib
shannah Apr 27, 2020
a197c6b
Changed some repaint() calls to revalidate() in AutocompleteTextField…
shannah Apr 27, 2020
86f4ce0
Added support for the ios.blockScreenshotsOnEnterBackground build hin…
shannah Apr 27, 2020
cc5186d
Added improved logging for error conditions while processing images i…
shannah Apr 28, 2020
9761ba3
Added sample using ChatBubbleView.USE_OVERFLOW_CONTAINER view propert…
shannah Apr 29, 2020
da984f4
Fixed issue with CSS compiler failing when it has to create image bor…
shannah Apr 30, 2020
06bb25b
Added usage of ChatView.scrollToMessage() in RADChatRoomSample. http…
shannah Apr 30, 2020
9de1327
Fixed issue with popup in wrong place when autocomplete text field in…
shannah May 1, 2020
b914b29
Deprecated MediaManager.deleteAudioBuffer() and added new method Medi…
shannah May 1, 2020
17d2b2f
Fixed issue with sidebar menu button not showing up. https://github.…
shannah May 4, 2020
c7834b8
Fixed issue with layout of safe areas when combined with pull-to-refr…
shannah May 5, 2020
746f16b
Added test case for https://github.com/codenameone/CodenameOne/issues…
shannah May 5, 2020
5218beb
Fixed issue with 9-piece border generation when style has both rounde…
shannah May 5, 2020
cda0ab1
Fixed issue with freezing when moving cursor in iOS text fields. Thi…
shannah May 5, 2020
bb421ae
Added support for alpha in linear gradients on ios. Added test case.
shannah May 5, 2020
dd9b9ed
Added alpha support for linear gradients in Android port. https://gi…
shannah May 5, 2020
422b4dd
Fixed issue with datepicker on iOS cancel and done buttons not workin…
shannah May 6, 2020
0dfddc4
Added support for setting timeout on google analytics service. Also …
shannah May 6, 2020
8511ef9
Definitive solution for image orientation issues
jsfan3 May 6, 2020
4e59e38
Implemented equals for Style
shai-almog May 7, 2020
c8d3d1e
Guarded autocomplete text field from infinite recursion when using as…
shannah May 8, 2020
b755114
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah May 8, 2020
6884a42
Fixed strange iOS memory heap corruption errors in client app. Not s…
shannah May 8, 2020
82f9e3d
Fixed issue with crashing on iOS due when rendering paths with zero w…
shannah May 13, 2020
c64f731
Improvement to iOS networking code to reduce amount of allocations re…
shannah May 13, 2020
726eda3
Improvement to reduce amount of allocation required during string par…
shannah May 13, 2020
5a7201f
Fixed buffer overflow in Double.toString(). This was caught while de…
shannah May 13, 2020
86c53e1
- Updates based on Shai's comment
ThomasH99 May 5, 2020
c0f74dc
Updated based on Shai's comments
ThomasH99 May 12, 2020
2ec249b
Added sample for websocket auto reconnection as test case for https:/…
shannah May 20, 2020
33a8ac8
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah May 20, 2020
de5c6cb
Added CN.postMessage() and CN.addMessageListener()/removeMessageListe…
shannah May 20, 2020
7a747f8
Added support for custom permissions prompts for playing and recordin…
shannah May 21, 2020
ac4f7d2
Fixed invalid character in unused field
shai-athena May 22, 2020
47320a1
Added test case for https://github.com/codenameone/CodenameOne/issues…
shannah May 22, 2020
f3ba81e
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah May 22, 2020
d9e061f
Explicitly set platforms.JDK_1.8.home ant property when running ant i…
shannah May 22, 2020
78ce7d6
Fixed issue with isBlockLead() capturing events that should go to the…
shannah May 22, 2020
bae0d75
Fixed wrong information in the Javadoc
jsfan3 May 24, 2020
8d2d65e
Update NetworkManager.java
jsfan3 May 24, 2020
981812e
Fixed wrong information in the javadoc
jsfan3 May 24, 2020
87024ed
Added call to super.deinitialize() in TextField to fix memory leak
shannah May 27, 2020
39692a7
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah May 27, 2020
8e47e90
Added support for CSS media queries. https://github.com/codenameone/C…
shannah May 28, 2020
d793515
Forgot to commit for media query support. https://github.com/codenam…
shannah May 28, 2020
e46eadc
Fixed error in boolean returned value
jsfan3 May 28, 2020
14cd2c1
Added an undocumented info to the javadoc
jsfan3 May 29, 2020
5eac612
Added testrunner component.
shannah Jun 2, 2020
5c58b80
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Jun 2, 2020
cc6ba70
Added sample for AudioRecorderComponent
shannah Jun 2, 2020
6ff0c7a
Fixed issue with AutoCompleteTextField that caused it to not update p…
shannah Jun 2, 2020
6080939
Generic object wrapper, as workaround for the issue
Jun 2, 2020
16dbd82
Added getFileSizeWithoutDownload methods
Jun 2, 2020
20dd950
Added downloadUrlToStorageSafely method very similar to the
Jun 2, 2020
0bc9c13
Improvements:
Jun 2, 2020
b96e557
Fixed an important error in the measurement of the downloaded data,
Jun 2, 2020
04efd94
Correct unintentional mistake in replacing a word in the javadocs.
Jun 2, 2020
b718fa7
Small javadocs fix
Jun 2, 2020
3cc6fb9
Added code example.
Jun 2, 2020
3c1982c
Made synchronization of AudioBuffer more fine-grained to avoid some m…
shannah Jun 3, 2020
8e0c21c
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Jun 3, 2020
10f242c
Added Display.getSharedJavascriptContext() method which will return a…
shannah Jun 3, 2020
97a3107
Added sample for getSharedJavascriptContext.
shannah Jun 3, 2020
71f739b
Added new ready() methods that return AsyncResource to make it easier…
shannah Jun 3, 2020
8bc0675
Fixed a couple of regressions in getComponentAt(x,y). Added tests ca…
shannah Jun 4, 2020
a064e37
Fixed a nullPointer issue in TextField.initComponent where getCompone…
ThomasH99 Jun 2, 2020
7b59959
Initial work to support dark mode
shai-almog Jun 6, 2020
93e680c
Fixed issue with fillShape() threshing the GC on iOS. This commit is…
shannah Jun 8, 2020
8f17e0d
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Jun 8, 2020
990bd84
Fixed regression in getComponentAt(x,y) that caused layered pane to o…
shannah Jun 8, 2020
b9c2c77
Added shell wrapper for running ant that sets some system properties …
shannah Jun 9, 2020
1933347
Fixed compilation issue (typo on darkmode function) on iOS.
shannah Jun 9, 2020
e1c1efe
Small fix for dark mode on iOS.
shannah Jun 9, 2020
243446d
Guard against NPE, and prevent possible memory leak with connection i…
shannah Jun 10, 2020
d94f35c
Added ability to operate just on a subtree of an XML document with Re…
shannah Jun 10, 2020
2a39ee0
Added toString() implementation for Stroke
shannah Jun 10, 2020
a94720d
Fixed Element so that getChildrenByTagName() and getDescendantsByTagN…
shannah Jun 10, 2020
151d034
Fixed race condition with display property BrowserComponent.useWKWebV…
shannah Jun 11, 2020
17d8d8c
Fixed dark mode static methods in CN
shai-almog Jun 13, 2020
6211a8b
When animation is disabled and the default text is empty the label go…
shai-almog Jun 16, 2020
1fe035b
Improved styling of custom switch components
shai-almog Jun 17, 2020
9461031
Added support for tooltips
shai-almog Jun 18, 2020
93e422a
Workaround build issue in the JavaScript port
shai-athena Jun 19, 2020
14ebfdf
Added method to Sheet to get the current Sheet.
shannah Jun 19, 2020
03e3a03
Merge branch 'master' of https://github.com/codenameone/CodenameOne
shannah Jun 19, 2020
3d0b947
Removed stub getCurrentSheet() method that was just added as a workar…
shannah Jun 19, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed RoundRectBorder.equals() so that it correctly reports borders w…
…ith differnt topLeft,topRight,bottomLeft,bottomRight modes as being unequal. This fixes issues where you change the border of a style but it has no effect, because the style does an equality test inside setBorder() to only change the border if it isn't the same as the existing border.
shannah committed Jan 22, 2020
commit 2521c8a4c3eedea8c412a9ccdd85123758ae898b
22 changes: 20 additions & 2 deletions CodenameOne/src/com/codename1/ui/Sheet.java
Original file line number Diff line number Diff line change
@@ -405,7 +405,23 @@ private void updateBorderForPosition() {
Border border = getStyle().getBorder();
if (border instanceof RoundRectBorder) {
RoundRectBorder b = (RoundRectBorder)border;

RoundRectBorder nb = RoundRectBorder.create();
nb.bezierCorners(b.isBezierCorners());
nb.bottomLeftMode(b.isBottomLeft());
nb.bottomRightMode(b.isBottomRight());
nb.topRightMode(b.isTopRight());
nb.topLeftMode(b.isTopLeft());
nb.cornerRadius(b.getCornerRadius());
nb.shadowBlur(b.getShadowBlur());
nb.shadowColor(b.getShadowColor());
nb.shadowOpacity(b.getShadowOpacity());
nb.shadowSpread(b.getShadowSpread());
nb.shadowX(b.getShadowX());
nb.shadowY(b.getShadowY());
nb.strokeColor(b.getStrokeColor());
nb.strokeOpacity(b.getStrokeOpacity());
nb.stroke(b.getStrokeThickness(), b.isStrokeMM());
b = nb;
switch (getPositionInt()) {
case C:
b.bottomRightMode(true);
@@ -436,10 +452,12 @@ private void updateBorderForPosition() {
b.topLeftMode(false);
b.topRightMode(false);
b.bottomLeftMode(true);
b.bottomLeftMode(false);
b.bottomRightMode(true);
break;

}
getStyle().setBorder(b);

}

}
41 changes: 35 additions & 6 deletions CodenameOne/src/com/codename1/ui/plaf/RoundRectBorder.java
Original file line number Diff line number Diff line change
@@ -874,12 +874,7 @@ public boolean isBottomOnlyMode() {
return (!topLeft) && (!topRight) && bottomLeft && bottomRight;
}

@Override
public int hashCode() {
int hash = 5;
hash = 43 * hash + strokeColor;
return hash;
}


@Override
public boolean equals(Object obj) {
@@ -923,9 +918,43 @@ public boolean equals(Object obj) {
if (this.bezierCorners != other.bezierCorners) {
return false;
}
if (this.topLeft != other.topLeft) {
return false;
}
if (this.topRight != other.topRight) {
return false;
}
if (this.bottomLeft != other.bottomLeft) {
return false;
}
if (this.bottomRight != other.bottomRight) {
return false;
}
return true;
}

@Override
public int hashCode() {
int hash = 5;
hash = 79 * hash + this.strokeColor;
hash = 79 * hash + this.strokeOpacity;
hash = 79 * hash + Float.floatToIntBits(this.strokeThickness);
hash = 79 * hash + (this.strokeMM ? 1 : 0);
hash = 79 * hash + Float.floatToIntBits(this.shadowSpread);
hash = 79 * hash + this.shadowOpacity;
hash = 79 * hash + this.shadowColor;
hash = 79 * hash + Float.floatToIntBits(this.shadowX);
hash = 79 * hash + Float.floatToIntBits(this.shadowY);
hash = 79 * hash + Float.floatToIntBits(this.shadowBlur);
hash = 79 * hash + Float.floatToIntBits(this.cornerRadius);
hash = 79 * hash + (this.bezierCorners ? 1 : 0);
hash = 79 * hash + (this.topLeft ? 1 : 0);
hash = 79 * hash + (this.topRight ? 1 : 0);
hash = 79 * hash + (this.bottomLeft ? 1 : 0);
hash = 79 * hash + (this.bottomRight ? 1 : 0);
return hash;
}

/**
* Returns true if this border corner is round and false if it's square
* @return the topLeft value
6 changes: 5 additions & 1 deletion Samples/samples/RoundRectBorderTest/RoundRectBorderTest.java
Original file line number Diff line number Diff line change
@@ -89,9 +89,13 @@ public void start() {

l = l("Border Radius 10");
l.getStyle().setBorder(b().cornerRadius(10f));
hi.add(l);


hi.add(l);

l = l("Bottom left and right");
l.getStyle().setBorder(b().bottomLeftMode(true).bottomRightMode(true).topLeftMode(false).topRightMode(false));
hi.add(l);

hi.show();
}
22 changes: 22 additions & 0 deletions tests/core/test/com/codename1/ui/RoundRectBorderTest.java
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@

import com.codename1.testing.AbstractTest;
import com.codename1.ui.plaf.RoundRectBorder;
import com.codename1.ui.plaf.Style;

/**
*
@@ -29,6 +30,27 @@ public boolean runTest() throws Exception {
assertTrue(!border.isBezierCorners(), "Setting bezier corners to false failed.");
border.bezierCorners(true);
assertTrue(border.isBezierCorners(), "Setting bezier corners to true failed.");

assertEqual(RoundRectBorder.create(), RoundRectBorder.create(), "Default roundRect borders should be equal");
assertNotEqual(RoundRectBorder.create().topLeftMode(true), RoundRectBorder.create().topLeftMode(false), "RoundRectBorder should be unequal if topLeftMode not equal");
assertNotEqual(RoundRectBorder.create().topRightMode(true), RoundRectBorder.create().topRightMode(false), "RoundRectBorder should be unequal if topRightMode not equal");
assertNotEqual(RoundRectBorder.create().bottomRightMode(true), RoundRectBorder.create().bottomRightMode(false), "RoundRectBorder should be unequal if bottomRightMode not equal");
assertNotEqual(RoundRectBorder.create().bottomLeftMode(true), RoundRectBorder.create().bottomLeftMode(false), "RoundRectBorder should be unequal if bottomLeftMode not equal");
assertNotEqual(RoundRectBorder.create().cornerRadius(2), RoundRectBorder.create().cornerRadius(3), "RoundRectBorder should be unequal if cornerRadius not equal");

Style s = new Style();
RoundRectBorder b1 = RoundRectBorder.create();
s.setBorder(b1);
assertTrue(b1 == s.getBorder(), "Failed to set RoundRectBorder on style");

RoundRectBorder b2 = RoundRectBorder.create();
s.setBorder(b2);
// This shouldn't actually change the border because b1.equals(b2)
assertTrue(b1 == s.getBorder(), "Shouldn't have overwritten RoundRectBorder on style because it is equal to old style");
b2.cornerRadius(b2.getCornerRadius()+1);
s.setBorder(b2);
assertTrue(b2 == s.getBorder(), "Border should have been changed to new RoundRectBorder because the border was changed.");

return true;

}