Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Regenerate example app #303

Merged
merged 1 commit into from
Mar 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
examples
example

# Assets
docs
12 changes: 3 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ A component for UIVisualEffectView's blur and vibrancy effect on iOS, and [500px

### Installation

**NOTE:** Latest version of the package is available in npm as `react-native-blur@3.0.0-alpha`

1. Install package via npm:

```
Expand All @@ -34,7 +32,7 @@ react-native link react-native-blur

```
android {
// make sure to use 23.0.3 instead of 23.0.1
// make sure to use 23.0.3 or greater
buildToolsVersion '23.0.3'

// ...
Expand All @@ -50,10 +48,6 @@ android {

```javascript
import { BlurView, VibrancyView } from "react-native-blur";

// OR

const { BlurView, VibrancyView } = require("react-native-blur");
```

5. Compile and have fun!
Expand Down Expand Up @@ -186,10 +180,10 @@ cd ~
git clone https://github.com/react-native-community/react-native-blur.git
```

2. cd to `examples/Basic`
2. cd to `example`

```
cd react-native-blur/examples/Basic
cd react-native-blur/example
```

3. Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ repositories {
}

dependencies {
compile 'com.facebook.react:react-native:[0.32,)'
implementation 'com.facebook.react:react-native:+'
}
File renamed without changes.
69 changes: 69 additions & 0 deletions example/.flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
[ignore]
; We fork some components by platform
.*/*[.]android.js

; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*

; 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 polyfills
.*/Libraries/polyfills/.*

; Ignore metro
.*/node_modules/metro/.*

[include]

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

[options]
emoji=true

esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.system=haste
module.system.haste.use_name_reducers=true
# get basename
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
# strip .js or .js.flow suffix
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
# strip .ios suffix
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
module.system.haste.paths.blacklist=.*/__tests__/.*
module.system.haste.paths.blacklist=.*/__mocks__/.*
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*

munge_underscores=true

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'

module.file_ext=.js
module.file_ext=.jsx
module.file_ext=.json
module.file_ext=.native.js

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

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

[version]
^0.92.0
File renamed without changes.
11 changes: 7 additions & 4 deletions examples/Basic/.gitignore → example/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,11 @@ buck-out/
# 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://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
# https://docs.fastlane.tools/best-practices/source-control/

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
*/fastlane/report.xml
*/fastlane/Preview.html
*/fastlane/screenshots

# Bundle artifact
*.jsbundle
File renamed without changes.
24 changes: 10 additions & 14 deletions examples/Basic/index.android.js → example/App.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,24 @@
* Basic [Android] Example for react-native-blur
* https://github.com/react-native-community/react-native-blur
*/
'use strict';
import React, { Component } from 'react';
import {
AppRegistry,
Dimensions,
Image,
findNodeHandle,
InteractionManager,
StyleSheet,
Switch,
Text,
View,
Dimensions,
Switch,
InteractionManager,
findNodeHandle,
} from 'react-native';
import AndroidSegmented from 'react-native-segmented-android';
import SegmentedControlTab from 'react-native-segmented-control-tab';

import { BlurView } from 'react-native-blur';

const BLUR_TYPES = ['xlight', 'light', 'dark'];

class Basic extends Component {
export default class Basic extends Component {
constructor() {
super();
this.state = {
Expand Down Expand Up @@ -72,18 +70,18 @@ class Basic extends Component {
Blur component (Android)
</Text>

<AndroidSegmented
<SegmentedControlTab
tintColor={tintColor}
style={{
width: Dimensions.get('window').width,
height: 28,
justifyContent: 'center',
alignItems: 'center',
}}
childText={BLUR_TYPES}
values={BLUR_TYPES}
orientation="horizontal"
selectedPosition={this.state.activeSegment}
onChange={this._onChange.bind(this)} />
selectedIndex={this.state.activeSegment}
onTabPress={this._onChange.bind(this)} />

</View>
);
Expand Down Expand Up @@ -148,5 +146,3 @@ const styles = StyleSheet.create({
alignItems: 'flex-end',
},
});

AppRegistry.registerComponent('Basic', () => Basic);
11 changes: 4 additions & 7 deletions examples/Basic/index.ios.js → example/App.ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,17 @@
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
Image,
View,
SegmentedControlIOS,
StyleSheet,
Switch,
Text,
View,
} from 'react-native';

import { BlurView, VibrancyView } from 'react-native-blur';

class Basic extends Component {
export default class Basic extends Component {
constructor(props) {
super(props);

Expand Down Expand Up @@ -165,5 +164,3 @@ const styles = StyleSheet.create({
alignItems: 'flex-end',
},
});

AppRegistry.registerComponent('Basic', () => Basic);
22 changes: 6 additions & 16 deletions examples/Basic/android/app/BUCK → example/android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
create_aar_targets(glob(["libs/*.aar"]))

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
Expand All @@ -45,12 +35,12 @@ android_library(

android_build_config(
name = "build_config",
package = "com.basic",
package = "com.example",
)

android_resource(
name = "res",
package = "com.basic",
package = "com.example",
res = "src/main/res",
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ import com.android.build.OutputFile
* // bundleInPaidRelease: true,
* // bundleInBeta: true,
*
* // whether to disable dev mode in custom build variants (by default only disabled in release)
* // for example: to disable dev mode in the staging build type (if configured)
* devDisabledInStaging: true,
* // The configuration property can be in the following formats
* // 'devDisabledIn${productFlavor}${buildType}'
* // 'devDisabledIn${buildType}'
*
* // the root of your project, i.e. where "package.json" lives
* root: "../../",
*
Expand All @@ -58,13 +65,17 @@ import com.android.build.OutputFile
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
* nodeExecutableAndArgs: ["node"],
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/

project.ext.react = [
entryFile: "index.js"
]

apply from: "../../node_modules/react-native/react.gradle"

/**
Expand All @@ -83,18 +94,19 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.basic"
minSdkVersion 16
targetSdkVersion 22
applicationId "com.example"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
renderscriptTargetApi 23
renderscriptSupportModeEnabled true
}
Expand All @@ -103,7 +115,7 @@ android {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
}
}
buildTypes {
Expand All @@ -117,7 +129,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Expand All @@ -128,11 +140,10 @@ android {
}

dependencies {
compile project(':react-native-blur')
compile project(':react-native-segmented-android')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:23.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
implementation project(':react-native-blur')
}

// Run this once to be able to run the application with BUCK
Expand Down
19 changes: 19 additions & 0 deletions example/android/app/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""

def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
Loading