-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: better example and synthetic checkbox controllering example
- Loading branch information
1 parent
6b7f71a
commit 97633e5
Showing
9 changed files
with
325 additions
and
243 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { | ||
ImageSourcePropType, | ||
ImageStyle, | ||
PressableProps, | ||
StyleProp, | ||
TextStyle, | ||
ViewStyle, | ||
} from 'react-native'; | ||
import React from 'react'; | ||
|
||
export const AnimationValues = { | ||
BounceIn: 0.9, | ||
BounceOut: 1, | ||
VelocityIn: 0.1, | ||
VelocityOut: 0.4, | ||
BouncinessIn: 20, | ||
BouncinessOut: 20, | ||
}; | ||
|
||
export type BasePressableProps = Pick< | ||
PressableProps, | ||
Exclude<keyof PressableProps, 'onPress' | 'onLongPress'> | ||
>; | ||
|
||
export interface BouncyCheckboxProps extends BasePressableProps { | ||
size?: number; | ||
text?: string; | ||
testID?: string; | ||
fillColor?: string; | ||
isChecked?: boolean; | ||
unFillColor?: string; | ||
disableText?: boolean; | ||
bounceEffect?: number; | ||
bounceFriction?: number; | ||
useNativeDriver?: boolean; | ||
bounceEffectIn?: number; | ||
bounceEffectOut?: number; | ||
bounceVelocityIn?: number; | ||
bounceVelocityOut?: number; | ||
bouncinessIn?: number; | ||
bouncinessOut?: number; | ||
ImageComponent?: any; | ||
TouchableComponent?: any; | ||
iconComponent?: React.ReactNode; | ||
textComponent?: React.ReactNode; | ||
iconStyle?: StyleProp<ViewStyle>; | ||
innerIconStyle?: StyleProp<ViewStyle>; | ||
style?: StyleProp<ViewStyle>; | ||
textStyle?: StyleProp<TextStyle>; | ||
iconImageStyle?: StyleProp<ImageStyle>; | ||
textContainerStyle?: StyleProp<ViewStyle>; | ||
checkIconImageSource?: ImageSourcePropType; | ||
onPress?: (checked: boolean) => void; | ||
onLongPress?: (checked: boolean) => void; | ||
} | ||
|
||
export interface BouncyCheckboxHandle { | ||
onCheckboxPress: () => void; | ||
onCheckboxLongPress: () => void; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export {default} from './BouncyCheckbox'; | ||
export * from './BouncyCheckbox'; | ||
export * from './BouncyCheckbox.type'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters