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

[pull] master from halilb:master #1

Open
wants to merge 64 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
8cf0959
feat: add long press feature
XadillaX Apr 10, 2017
73cdb85
Handle case where the event width evaluates to zero which causes the …
Apr 13, 2017
b31d7c5
Update GridContainer.js (#21)
AlessandroAnnini Apr 13, 2017
e2891dd
Add displayTopBar property (#30)
aksonov Apr 13, 2017
a6e4ccb
Custom back button, allow to customise top/bottom bar (#31)
aksonov Apr 13, 2017
29fb7a5
Updated depreciated ProgressBarAndroid component (#38)
Apr 13, 2017
36e31a7
updated ProgressBarAndroid line in README
halilb Apr 13, 2017
ce4343a
feat: use default props to instead of if
XadillaX Apr 14, 2017
f5bbf0a
upgraded example project to RN 0.43.3
halilb Apr 18, 2017
1e7a9e1
applying parent style to the container component
halilb Apr 18, 2017
396ee9a
merged #40
halilb Apr 18, 2017
53a5264
Merge branch 'XadillaX-feature/longpress'
halilb Apr 18, 2017
5030c2a
bumped version
halilb Apr 18, 2017
6409f1e
#33 hide back button if onBack is undefined
halilb Apr 18, 2017
717047f
bumped version
halilb Apr 18, 2017
738c8b4
Added sqaure prop, so thumbnails can be square
iRoachie Jul 20, 2017
d633001
Add gridOffset prop
iRoachie Jul 20, 2017
dc31db2
added alwaysDisplayStatusBar prop
thiagoghisi May 21, 2017
df70324
Merge branch 'imagesize' of git://github.com/iRoachie/react-native-ph…
halilb Jul 22, 2017
7c58757
Merge branch 'iRoachie-imagesize'
halilb Jul 22, 2017
eefcd44
merged #51 into master
halilb Jul 22, 2017
3695cd1
Merge branch 'iRoachie-offset'
halilb Jul 22, 2017
f6e03ff
Use prop-types library (#52)
developer239 Jul 22, 2017
bf7c346
added prop-types dependency
halilb Jul 22, 2017
7d81c9b
Only show TopBar if displayTopBar is true (#55)
lucasbento Jul 24, 2017
2bca458
reverting paddingTop change
halilb Jul 24, 2017
802eef5
Fix prop. names & default values in README (#56)
kashav Jul 25, 2017
a124750
fix(example): Navigator component has been deprecated
timothystewart6 Oct 21, 2017
297abb8
fix(package): Added react-native-deprecated-custom-components
timothystewart6 Oct 21, 2017
9a5d387
upgraded the example project to RN 0.50
halilb Nov 6, 2017
ff32068
merged #68
halilb Nov 6, 2017
3216fe4
Merge branch 'timothystewart6-master'
halilb Nov 6, 2017
a1c33f6
Using ViewPropTypes.styles (#69)
windwang Nov 6, 2017
3544c10
Long press params (#62)
spacegraym3 Nov 6, 2017
2e01297
replaced navigator with react-navigation
halilb Nov 6, 2017
3e74d75
bumped version
halilb Nov 6, 2017
d499317
add the custom title in full-screen mode
dendakhongduong Nov 8, 2017
a6ea8a3
add the custom title in full-screen mode
dendakhongduong Nov 8, 2017
f7bb90f
Merge branch 'lynkxyz-master'
halilb Nov 19, 2017
52d3034
Switch from ListView -> FlatList (#76). Fixes #75
ngandhy Oct 29, 2018
5bce377
upgrading the example project to RN 0.57 (#83)
halilb Oct 29, 2018
6415fe6
fix readme maintenance section
halilb Oct 29, 2018
d14003f
Merge pull request #84 from halilb/fix-readme
halilb Oct 29, 2018
29dcef5
migrated grid listview to flatlist (#85) Fixes #78
halilb Oct 29, 2018
bdfc4a3
fix photos not updated when mediaList prop changes
riwu Dec 27, 2018
6c6ef2e
add photo deletion to grid example
riwu Dec 27, 2018
338b605
Merge pull request #86 from riwu/master
halilb Dec 27, 2018
9b45904
Bumped version to 0.5.0
halilb Oct 22, 2019
07d6a45
Bump js-yaml from 3.12.0 to 3.13.1 in /Example
dependabot[bot] Oct 22, 2019
b890113
Bump mixin-deep from 1.3.1 to 1.3.2 in /Example
dependabot[bot] Oct 22, 2019
057171b
Bump merge from 1.2.0 to 1.2.1 in /Example
dependabot[bot] Oct 22, 2019
fdcda5d
Merge pull request #93 from halilb/dependabot/npm_and_yarn/Example/js…
halilb Oct 22, 2019
1a13c6d
Merge pull request #94 from halilb/dependabot/npm_and_yarn/Example/mi…
halilb Oct 22, 2019
6d2bc2e
Merge pull request #95 from halilb/dependabot/npm_and_yarn/Example/me…
halilb Oct 22, 2019
e24930e
Add 'react-native-iphone-x-helper' dependency
WilsonGramer Oct 26, 2019
b34bdfd
Fix padding for iPhone X
WilsonGramer Oct 26, 2019
097f8ea
Merge pull request #98 from Wilsonator5000/iphone-x-padding
halilb Oct 28, 2019
328184f
Add support for custom BottomBar buttons (#97)
WilsonGramer Nov 4, 2019
903c167
Replacing ViewPager with FlatList
makedirectory Nov 12, 2019
071ae30
Better IphoneX support (#101)
novseje Jan 2, 2020
566d87f
0.6.0
halilb Jan 14, 2020
6e8a594
fixed version issue (#105)
RNTop Jun 4, 2020
852289b
Bump ini from 1.3.4 to 1.3.7 in /Example
dependabot[bot] Dec 11, 2020
568e306
Add backTitle & backIcon to PhotoBrowser's properties. (#109)
mokabyls May 17, 2021
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
3 changes: 3 additions & 0 deletions Example/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"presets": ["module:metro-react-native-babel-preset"]
}
6 changes: 6 additions & 0 deletions Example/.buckconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

[android]
target = Google Inc.:Google APIs:23

[maven_repositories]
central = https://repo1.maven.org/maven2
89 changes: 24 additions & 65 deletions Example/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,89 +1,48 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

# We fork some components by platform.
.*/*.web.js
.*/*.android.js
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

# Some modules have their own node_modules with overlap
.*/node_modules/node-haste/.*
; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

# Ugh
.*/node_modules/babel.*
.*/node_modules/babylon.*
.*/node_modules/invariant.*
; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js

# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/fetch.js
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
.*/node_modules/fbjs/lib/ErrorUtils.js

# Flow has a built-in definition for the 'react' module which we prefer to use
# over the currently-untyped source
.*/node_modules/react/react.js
.*/node_modules/react/lib/React.js
.*/node_modules/react/lib/ReactDOM.js

.*/__mocks__/.*
.*/__tests__/.*

.*/commoner/test/source/widget/share.js

# Ignore commoner tests
.*/node_modules/commoner/test/.*

# See https://github.com/facebook/flow/issues/442
.*/react-tools/node_modules/commoner/lib/reader.js

# Ignore jest
.*/node_modules/jest-cli/.*

# Ignore Website
.*/website/.*

.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json
; Ignore polyfills
.*/Libraries/polyfills/.*

[include]

[libs]
node_modules/react-native/Libraries/react-native/react-native-interface.js
node_modules/react-native/flow
flow/
node_modules/react-native/flow/

[options]
module.system=haste
emoji=true

esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable
module.system=haste

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-2]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true

[version]
0.22.0
^0.56.0
1 change: 1 addition & 0 deletions Example/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.pbxproj -text
21 changes: 20 additions & 1 deletion Example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,32 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Android/IJ
# Android/IntelliJ
#
build/
.idea
.gradle
local.properties
*.iml

# node.js
#
node_modules/
npm-debug.log
yarn-error.log

# BUCK
buck-out/
\.buckd/
*.keystore

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/

*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots
89 changes: 89 additions & 0 deletions Example/DetailScreen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import React, { Component } from 'react';
import { ActionSheetIOS, Platform, Button } from 'react-native';

import PhotoBrowser from 'react-native-photo-browser';

export default class HomeScreen extends Component {
static navigationOptions = {
header: null,
};

state = {
mediaList: this.props.navigation.state.params.example.media,
selected: new Set(),
}

onSelectionChanged = (media, index, selected) => {
this.setState(prevState => {
const copy = new Set(prevState.selected);
if (selected) {
copy.add(index);
} else {
copy.delete(index);
}
return {
selected: copy,
};
});
};

onActionButton = (media, index) => {
if (Platform.OS === 'ios') {
ActionSheetIOS.showShareActionSheetWithOptions(
{
url: media.photo,
message: media.caption,
},
() => {},
() => {},
);
} else {
alert(`handle sharing on android for ${media.photo}, index: ${index}`);
}
};

render() {
const {
initialIndex,
displayNavArrows,
displayActionButton,
displaySelectionButtons,
startOnGrid,
enableGrid,
alwaysDisplayStatusBar,
} = this.props.navigation.state.params.example;

const { mediaList, selected } = this.state;

return (
<>
<PhotoBrowser
onBack={navigator.pop}
mediaList={mediaList}
initialIndex={initialIndex}
displayNavArrows={displayNavArrows}
displaySelectionButtons={displaySelectionButtons}
displayActionButton={displayActionButton}
startOnGrid={startOnGrid}
enableGrid={enableGrid}
useCircleProgress
onSelectionChanged={this.onSelectionChanged}
onActionButton={this.onActionButton}
alwaysDisplayStatusBar={alwaysDisplayStatusBar}
customTitle={(index, rowCount) => `${index} sur ${rowCount}`}
/>
{selected.size > 0 && (
<Button
title="Delete"
onPress={() =>
this.setState(prevState => ({
mediaList: prevState.mediaList.filter((_, i) => !prevState.selected.has(i)),
selected: new Set(),
}))
}
/>
)}
</>
);
}
}
Loading