Skip to content

Fix 0.25 deprecations (and 0.26 errors). Fix the iOS warning. Fix logic bugs due properties being set in nondeterminstic orders.#8

Open
mikelambert wants to merge 5 commits intozzyyppqq:masterfrom
mikelambert:master
Open

Fix 0.25 deprecations (and 0.26 errors). Fix the iOS warning. Fix logic bugs due properties being set in nondeterminstic orders.#8
mikelambert wants to merge 5 commits intozzyyppqq:masterfrom
mikelambert:master

Conversation

@mikelambert
Copy link

No description provided.

…n warning due to the missing native module. This separates it out into a separate per-platform files to avoid the warning.
…rty in any order. But most properties only make sense to set *after* setting childText. This ensures that the views get updated and reflected, no matter what order they are set in.
@mikelambert mikelambert changed the title Fix 0.25 deprecations (and 0.26 errors). And fix the iOS warning. Fix 0.25 deprecations (and 0.26 errors). Fix the iOS warning. Fix logic bugs due properties being set in nondeterminstic orders. May 27, 2016
@mikelambert
Copy link
Author

Added another change to this, and updating the title to reflect it. Bugs were:

  • If RN calls setSelectedChild before setChildText, it will trigger an array-out-of-bounds index since no children exist.
  • If RN calls setTintColor before setChildText, it will updated the colors of zero views, and then the constructed views won't have the correct color.
  • If RN calls orientation before setChildText, the objects will be set up with incorrect layout constraints
  • If RN detects a change to childText and calls setChildText multiple times, it will result in too many children.

This third changelist fixes all of those issues.

@mikelambert
Copy link
Author

Ping?

@nakaruna
Copy link

@mikelambert When running your fork, I've got

/Users/user/verb/node_modules/react-native-segmented-android/src/main/java/com/higo/zhangyp/segmented/AndroidSegmentedEvent.java:19: error: no suitable constructor found for Event(int)
        super(viewId);
        ^
    constructor Event.Event() is not applicable
      (actual and formal argument lists differ in length)
    constructor Event.Event(int,long) is not applicable
      (actual and formal argument lists differ in length)
1 error
:react-native-segmented-android:compileReleaseJavaWithJavac FAILED

@mikelambert
Copy link
Author

mikelambert commented Oct 14, 2016

What version of RN are you using? RN changed their API for Event constructors as of 0.32 (due to the breaking change for android listed in https://github.com/facebook/react-native/releases/tag/v0.32.0), and this pull request now (with 1a8c1ef) fixes that for react-native-segmented-android as well. So this change is only compatible with 0.32 and up.

@nakaruna
Copy link

Hi @mikelambert

You right. I'll update my project and let you know

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants