Tweak FIGListItem layout

Reviewed By: yungsters

Differential Revision: D6586846

fbshipit-source-id: cf57c4e042868a053da2dfa959cd47c7b9241a24
This commit is contained in:
Spencer Ahrens
2017-12-18 18:19:22 -08:00
committed by Facebook Github Bot
parent 632f1202ab
commit 350377f57c
3 changed files with 12 additions and 10 deletions

View File

@@ -26,7 +26,7 @@ const ViewPropTypes = require('ViewPropTypes');
const createReactClass = require('create-react-class');
const ensurePositiveDelayProps = require('ensurePositiveDelayProps');
import type {Event} from 'TouchableWithoutFeedback';
import type {PressEvent} from 'CoreEventTypes';
const DEFAULT_PROPS = {
activeOpacity: 0.85,
@@ -216,21 +216,21 @@ const TouchableHighlight = createReactClass({
* `Touchable.Mixin` self callbacks. The mixin will invoke these if they are
* defined on your component.
*/
touchableHandleActivePressIn: function(e: Event) {
touchableHandleActivePressIn: function(e: PressEvent) {
clearTimeout(this._hideTimeout);
this._hideTimeout = null;
this._showUnderlay();
this.props.onPressIn && this.props.onPressIn(e);
},
touchableHandleActivePressOut: function(e: Event) {
touchableHandleActivePressOut: function(e: PressEvent) {
if (!this._hideTimeout) {
this._hideUnderlay();
}
this.props.onPressOut && this.props.onPressOut(e);
},
touchableHandlePress: function(e: Event) {
touchableHandlePress: function(e: PressEvent) {
clearTimeout(this._hideTimeout);
this._showUnderlay();
this._hideTimeout = setTimeout(
@@ -240,7 +240,7 @@ const TouchableHighlight = createReactClass({
this.props.onPress && this.props.onPress(e);
},
touchableHandleLongPress: function(e: Event) {
touchableHandleLongPress: function(e: PressEvent) {
this.props.onLongPress && this.props.onLongPress(e);
},

View File

@@ -32,7 +32,7 @@ const {
AccessibilityTraits,
} = require('ViewAccessibility');
export type Event = Object;
import type {PressEvent} from 'CoreEventTypes';
const PRESS_RETENTION_OFFSET = {top: 20, left: 20, right: 20, bottom: 30};
@@ -130,19 +130,19 @@ const TouchableWithoutFeedback = createReactClass({
* `Touchable.Mixin` self callbacks. The mixin will invoke these if they are
* defined on your component.
*/
touchableHandlePress: function(e: Event) {
touchableHandlePress: function(e: PressEvent) {
this.props.onPress && this.props.onPress(e);
},
touchableHandleActivePressIn: function(e: Event) {
touchableHandleActivePressIn: function(e: PressEvent) {
this.props.onPressIn && this.props.onPressIn(e);
},
touchableHandleActivePressOut: function(e: Event) {
touchableHandleActivePressOut: function(e: PressEvent) {
this.props.onPressOut && this.props.onPressOut(e);
},
touchableHandleLongPress: function(e: Event) {
touchableHandleLongPress: function(e: PressEvent) {
this.props.onLongPress && this.props.onLongPress(e);
},

View File

@@ -25,3 +25,5 @@ export type LayoutEvent = {|
|},
+persist: () => void,
|};
export type PressEvent = Object;