{"action":"created","issue":{"url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/17","repository_url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider","labels_url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/17/comments","events_url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/17/events","html_url":"https://github.com/JackDanielsAndCode/react-native-multi-slider/issues/17","id":121849906,"number":17,"title":"Does this module support Android?","user":{"login":"oney","id":4091190,"avatar_url":"https://avatars.githubusercontent.com/u/4091190?v=3","gravatar_id":"","url":"https://api.github.com/users/oney","html_url":"https://github.com/oney","followers_url":"https://api.github.com/users/oney/followers","following_url":"https://api.github.com/users/oney/following{/other_user}","gists_url":"https://api.github.com/users/oney/gists{/gist_id}","starred_url":"https://api.github.com/users/oney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oney/subscriptions","organizations_url":"https://api.github.com/users/oney/orgs","repos_url":"https://api.github.com/users/oney/repos","events_url":"https://api.github.com/users/oney/events{/privacy}","received_events_url":"https://api.github.com/users/oney/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2015-12-12T11:44:51Z","updated_at":"2016-08-18T16:01:05Z","closed_at":null,"body":"It seems that it doesn't work great in Android."},"comment":{"url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/comments/240770766","html_url":"https://github.com/JackDanielsAndCode/react-native-multi-slider/issues/17#issuecomment-240770766","issue_url":"https://api.github.com/repos/JackDanielsAndCode/react-native-multi-slider/issues/17","id":240770766,"user":{"login":"chung-nguyen","id":14791553,"avatar_url":"https://avatars.githubusercontent.com/u/14791553?v=3","gravatar_id":"","url":"https://api.github.com/users/chung-nguyen","html_url":"https://github.com/chung-nguyen","followers_url":"https://api.github.com/users/chung-nguyen/followers","following_url":"https://api.github.com/users/chung-nguyen/following{/other_user}","gists_url":"https://api.github.com/users/chung-nguyen/gists{/gist_id}","starred_url":"https://api.github.com/users/chung-nguyen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chung-nguyen/subscriptions","organizations_url":"https://api.github.com/users/chung-nguyen/orgs","repos_url":"https://api.github.com/users/chung-nguyen/repos","events_url":"https://api.github.com/users/chung-nguyen/events{/privacy}","received_events_url":"https://api.github.com/users/chung-nguyen/received_events","type":"User","site_admin":false},"created_at":"2016-08-18T16:01:05Z","updated_at":"2016-08-18T16:01:05Z","body":"I managed to get this to work with Android by changing the render method of Slider like this.\r\n\r\nrender() {\r\n    var {positionOne, positionTwo} = this.state;\r\n    var {selectedStyle, unselectedStyle, sliderLength} = this.props;\r\n    var twoMarkers = positionTwo;\r\n\r\n    var fixedPositionOne = Math.floor(positionOne / this.stepLength) * this.stepLength;\r\n    var fixedPositionTwo = Math.floor(positionTwo / this.stepLength) * this.stepLength;\r\n\r\n    var trackOneLength = fixedPositionOne;\r\n    var trackOneStyle = twoMarkers ? unselectedStyle : selectedStyle;\r\n    var trackThreeLength = twoMarkers ? sliderLength - (fixedPositionTwo) : 0;\r\n    var trackThreeStyle = unselectedStyle;\r\n    var trackTwoLength = sliderLength - trackOneLength - trackThreeLength;\r\n    var trackTwoStyle = twoMarkers ? selectedStyle : unselectedStyle;\r\n    var Marker = this.props.customMarker;\r\n    var {slipDisplacement, height, width, borderRadius} = this.props.touchDimensions;\r\n    var touchStyle = {\r\n      height: height,\r\n      width: width,\r\n      borderRadius: borderRadius || 0\r\n    };\r\n\r\n    return (\r\n      <View style={[styles.container, this.props.containerStyle]}>\r\n        <View style={[styles.fullTrack, { width: sliderLength }]}>\r\n          <View style={[this.props.trackStyle, styles.track, trackOneStyle, { width: trackOneLength }]} />\r\n          <View style={[this.props.trackStyle, styles.track, trackTwoStyle, { width: trackTwoLength }]} />\r\n          { twoMarkers && (\r\n            <View style={[this.props.trackStyle, styles.track, trackThreeStyle, { width: trackThreeLength }]} />\r\n          ) }\r\n\r\n\r\n          <View\r\n            style={[styles.touch, touchStyle, {left: -(trackTwoLength + trackThreeLength + width / 2)}]}\r\n            ref={component => this._markerOne = component}\r\n            {...this._panResponderOne.panHandlers}\r\n            >\r\n            <Marker\r\n              pressed={this.state.onePressed}\r\n              value={this.state.valueOne}\r\n              markerStyle={this.props.markerStyle}\r\n              pressedMarkerStyle={this.props.pressedMarkerStyle}\r\n              />\r\n          </View>\r\n\r\n          { twoMarkers && (positionOne !== this.props.sliderLength) && (\r\n            <View\r\n              style={[styles.touch, touchStyle, {left: -(trackThreeLength + width * 1.5)}]}\r\n              ref={component => this._markerTwo = component}\r\n              {...this._panResponderTwo.panHandlers}\r\n              >\r\n              <Marker\r\n                pressed={this.state.twoPressed}\r\n                value={this.state.valueOne}\r\n                markerStyle={this.props.markerStyle}\r\n                pressedMarkerStyle={this.props.pressedMarkerStyle}\r\n                />\r\n            </View>\r\n          ) }\r\n\r\n        </View>\r\n      </View>\r\n    );\r\n  }"}}
{"actor":{"display_login":"chung-nguyen"}}