├── Images ├── Posture.gif ├── Redux.gif ├── Teleoperation.gif ├── Trajectory.gif └── connectionRos.gif ├── NativePrueba ├── .buckconfig ├── .eslintrc.js ├── .flowconfig ├── .gitattributes ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── App.js ├── __tests__ │ └── App-test.js ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── nativeprueba │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── assets │ │ │ └── fonts │ │ │ │ ├── AntDesign.ttf │ │ │ │ ├── Entypo.ttf │ │ │ │ ├── EvilIcons.ttf │ │ │ │ ├── Feather.ttf │ │ │ │ ├── FontAwesome.ttf │ │ │ │ ├── FontAwesome5_Brands.ttf │ │ │ │ ├── FontAwesome5_Regular.ttf │ │ │ │ ├── FontAwesome5_Solid.ttf │ │ │ │ ├── Fontisto.ttf │ │ │ │ ├── Foundation.ttf │ │ │ │ ├── Ionicons.ttf │ │ │ │ ├── MaterialCommunityIcons.ttf │ │ │ │ ├── MaterialIcons.ttf │ │ │ │ ├── Octicons.ttf │ │ │ │ ├── Roboto.ttf │ │ │ │ ├── Roboto_medium.ttf │ │ │ │ ├── SimpleLineIcons.ttf │ │ │ │ ├── Zocial.ttf │ │ │ │ └── rubicon-icon-font.ttf │ │ │ ├── java │ │ │ └── com │ │ │ │ └── nativeprueba │ │ │ │ ├── MainActivity.java │ │ │ │ └── MainApplication.java │ │ │ └── res │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── NativePrueba-tvOS │ │ └── Info.plist │ ├── NativePrueba-tvOSTests │ │ └── Info.plist │ ├── NativePrueba.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ ├── NativePrueba-tvOS.xcscheme │ │ │ └── NativePrueba.xcscheme │ ├── NativePrueba │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj │ │ │ └── LaunchScreen.xib │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ └── main.m │ ├── NativePruebaTests │ │ ├── Info.plist │ │ └── NativePruebaTests.m │ └── Podfile ├── metro.config.js ├── package.json └── src │ ├── actions │ └── index.js │ ├── app.js │ ├── boot │ └── setup.js │ ├── images │ └── robot.png │ ├── modules │ └── Login │ │ ├── components │ │ ├── HomeNavigation.js │ │ ├── PostureNavigation.js │ │ ├── TeleNavigation.js │ │ └── TrayNavigation.js │ │ └── containers │ │ ├── home.js │ │ ├── pc_srceen.js │ │ ├── settings_home.js │ │ ├── settings_pc.js │ │ ├── settings_tc.js │ │ ├── settings_tele.js │ │ ├── tc_screen.js │ │ └── tele_screen.js │ ├── reducers │ ├── connectionReducer.js │ ├── index.js │ ├── ipReducer.js │ ├── portReducer.js │ ├── rosReducer.js │ ├── topic_odomReducer.js │ ├── topic_velReducer.js │ ├── vReducer.js │ └── wReducers.js │ ├── store │ └── index.js │ └── theme │ ├── components │ ├── Badge.js │ ├── Body.js │ ├── Button.js │ ├── Card.js │ ├── CardItem.js │ ├── CheckBox.js │ ├── Container.js │ ├── Content.js │ ├── Fab.js │ ├── Footer.js │ ├── FooterTab.js │ ├── Form.js │ ├── H1.js │ ├── H2.js │ ├── H3.js │ ├── Header.js │ ├── Icon.js │ ├── Input.js │ ├── InputGroup.js │ ├── Item.js │ ├── Label.js │ ├── Left.js │ ├── ListItem.js │ ├── Picker.android.js │ ├── Picker.ios.js │ ├── Picker.js │ ├── Radio.js │ ├── Right.js │ ├── Segment.js │ ├── Separator.js │ ├── Spinner.js │ ├── Subtitle.js │ ├── SwipeRow.js │ ├── Switch.js │ ├── Tab.js │ ├── TabBar.js │ ├── TabContainer.js │ ├── TabHeading.js │ ├── Text.js │ ├── Textarea.js │ ├── Thumbnail.js │ ├── Title.js │ ├── Toast.js │ ├── View.js │ └── index.js │ └── variables │ ├── commonColor.js │ ├── material.js │ └── platform.js ├── README.md └── ReactNativeControl ├── CMakeLists.txt ├── package.xml └── src └── ControlReactNative.py /Images/Posture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/Images/Posture.gif -------------------------------------------------------------------------------- /Images/Redux.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/Images/Redux.gif -------------------------------------------------------------------------------- /Images/Teleoperation.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/Images/Teleoperation.gif -------------------------------------------------------------------------------- /Images/Trajectory.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/Images/Trajectory.gif -------------------------------------------------------------------------------- /Images/connectionRos.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/Images/connectionRos.gif -------------------------------------------------------------------------------- /NativePrueba/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /NativePrueba/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /NativePrueba/.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; These should not be required directly 12 | ; require from fbjs/lib instead: require('fbjs/lib/warning') 13 | node_modules/warning/.* 14 | 15 | ; Flow doesn't support platforms 16 | .*/Libraries/Utilities/LoadingView.js 17 | 18 | [untyped] 19 | .*/node_modules/@react-native-community/cli/.*/.* 20 | 21 | [include] 22 | 23 | [libs] 24 | node_modules/react-native/interface.js 25 | node_modules/react-native/flow/ 26 | 27 | [options] 28 | emoji=true 29 | 30 | esproposal.optional_chaining=enable 31 | esproposal.nullish_coalescing=enable 32 | 33 | module.file_ext=.js 34 | module.file_ext=.json 35 | module.file_ext=.ios.js 36 | 37 | munge_underscores=true 38 | 39 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 40 | 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\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 41 | 42 | suppress_type=$FlowIssue 43 | suppress_type=$FlowFixMe 44 | suppress_type=$FlowFixMeProps 45 | suppress_type=$FlowFixMeState 46 | 47 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\) 48 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+ 49 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError 50 | 51 | [lints] 52 | sketchy-null-number=warn 53 | sketchy-null-mixed=warn 54 | sketchy-number=warn 55 | untyped-type-import=warn 56 | nonstrict-import=warn 57 | deprecated-type=warn 58 | unsafe-getters-setters=warn 59 | inexact-spread=warn 60 | unnecessary-invariant=warn 61 | signature-verification-failure=warn 62 | deprecated-utility=error 63 | 64 | [strict] 65 | deprecated-type 66 | nonstrict-import 67 | sketchy-null 68 | unclear-type 69 | unsafe-getters-setters 70 | untyped-import 71 | untyped-type-import 72 | 73 | [version] 74 | ^0.113.0 75 | -------------------------------------------------------------------------------- /NativePrueba/.gitattributes: -------------------------------------------------------------------------------- 1 | *.pbxproj -text 2 | -------------------------------------------------------------------------------- /NativePrueba/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log 37 | 38 | # BUCK 39 | buck-out/ 40 | \.buckd/ 41 | *.keystore 42 | !debug.keystore 43 | 44 | # fastlane 45 | # 46 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 47 | # screenshots whenever they are needed. 48 | # For more information about the recommended setup visit: 49 | # https://docs.fastlane.tools/best-practices/source-control/ 50 | 51 | */fastlane/report.xml 52 | */fastlane/Preview.html 53 | */fastlane/screenshots 54 | 55 | # Bundle artifact 56 | *.jsbundle 57 | 58 | # CocoaPods 59 | /ios/Pods/ 60 | -------------------------------------------------------------------------------- /NativePrueba/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: false, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | }; 7 | -------------------------------------------------------------------------------- /NativePrueba/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /NativePrueba/App.js: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | import Setup from "./src/boot/setup"; 3 | import { Provider } from 'react-redux' 4 | import { store, persistor } from './src/store'; 5 | import {PersistGate} from 'redux-persist/es/integration/react' 6 | 7 | export default class App extends React.Component { 8 | 9 | render() { 10 | return( 11 | 12 | 13 | 14 | 15 | 16 | ) 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /NativePrueba/__tests__/App-test.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from '../App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /NativePrueba/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.nativeprueba", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.nativeprueba", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /NativePrueba/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /NativePrueba/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/debug.keystore -------------------------------------------------------------------------------- /NativePrueba/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/debug/java/com/nativeprueba/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.nativeprueba; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/AntDesign.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/AntDesign.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Entypo.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Entypo.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/EvilIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/EvilIcons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Feather.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Feather.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/FontAwesome.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/FontAwesome.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Brands.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Regular.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/FontAwesome5_Solid.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Fontisto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Fontisto.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Foundation.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Foundation.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Ionicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Ionicons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/MaterialIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/MaterialIcons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Octicons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Octicons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Roboto.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Roboto.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Roboto_medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Roboto_medium.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/SimpleLineIcons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/SimpleLineIcons.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/Zocial.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/Zocial.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/assets/fonts/rubicon-icon-font.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/assets/fonts/rubicon-icon-font.ttf -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/java/com/nativeprueba/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.nativeprueba; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "NativePrueba"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/java/com/nativeprueba/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.nativeprueba; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.soloader.SoLoader; 11 | import java.lang.reflect.InvocationTargetException; 12 | import java.util.List; 13 | 14 | public class MainApplication extends Application implements ReactApplication { 15 | 16 | private final ReactNativeHost mReactNativeHost = 17 | new ReactNativeHost(this) { 18 | @Override 19 | public boolean getUseDeveloperSupport() { 20 | return BuildConfig.DEBUG; 21 | } 22 | 23 | @Override 24 | protected List getPackages() { 25 | @SuppressWarnings("UnnecessaryLocalVariable") 26 | List packages = new PackageList(this).getPackages(); 27 | // Packages that cannot be autolinked yet can be added manually here, for example: 28 | // packages.add(new MyReactNativePackage()); 29 | return packages; 30 | } 31 | 32 | @Override 33 | protected String getJSMainModuleName() { 34 | return "index"; 35 | } 36 | }; 37 | 38 | @Override 39 | public ReactNativeHost getReactNativeHost() { 40 | return mReactNativeHost; 41 | } 42 | 43 | @Override 44 | public void onCreate() { 45 | super.onCreate(); 46 | SoLoader.init(this, /* native exopackage */ false); 47 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 48 | } 49 | 50 | /** 51 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 52 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 53 | * 54 | * @param context 55 | * @param reactInstanceManager 56 | */ 57 | private static void initializeFlipper( 58 | Context context, ReactInstanceManager reactInstanceManager) { 59 | if (BuildConfig.DEBUG) { 60 | try { 61 | /* 62 | We use reflection here to pick up the class that initializes Flipper, 63 | since Flipper library is not available in release mode 64 | */ 65 | Class aClass = Class.forName("com.nativeprueba.ReactNativeFlipper"); 66 | aClass 67 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 68 | .invoke(null, context, reactInstanceManager); 69 | } catch (ClassNotFoundException e) { 70 | e.printStackTrace(); 71 | } catch (NoSuchMethodException e) { 72 | e.printStackTrace(); 73 | } catch (IllegalAccessException e) { 74 | e.printStackTrace(); 75 | } catch (InvocationTargetException e) { 76 | e.printStackTrace(); 77 | } 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | NativePrueba 3 | 4 | -------------------------------------------------------------------------------- /NativePrueba/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /NativePrueba/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "28.0.3" 6 | minSdkVersion = 16 7 | compileSdkVersion = 28 8 | targetSdkVersion = 28 9 | } 10 | repositories { 11 | google() 12 | jcenter() 13 | } 14 | dependencies { 15 | classpath("com.android.tools.build:gradle:3.5.2") 16 | 17 | // NOTE: Do not place your application dependencies here; they belong 18 | // in the individual module build.gradle files 19 | } 20 | } 21 | 22 | allprojects { 23 | repositories { 24 | mavenLocal() 25 | maven { 26 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 27 | url("$rootDir/../node_modules/react-native/android") 28 | } 29 | maven { 30 | // Android JSC is installed from npm 31 | url("$rootDir/../node_modules/jsc-android/dist") 32 | } 33 | 34 | google() 35 | jcenter() 36 | maven { url 'https://www.jitpack.io' } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /NativePrueba/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.33.1 29 | -------------------------------------------------------------------------------- /NativePrueba/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /NativePrueba/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /NativePrueba/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | # Determine the Java command to use to start the JVM. 86 | if [ -n "$JAVA_HOME" ] ; then 87 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 88 | # IBM's JDK on AIX uses strange locations for the executables 89 | JAVACMD="$JAVA_HOME/jre/sh/java" 90 | else 91 | JAVACMD="$JAVA_HOME/bin/java" 92 | fi 93 | if [ ! -x "$JAVACMD" ] ; then 94 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 95 | 96 | Please set the JAVA_HOME variable in your environment to match the 97 | location of your Java installation." 98 | fi 99 | else 100 | JAVACMD="java" 101 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 102 | 103 | Please set the JAVA_HOME variable in your environment to match the 104 | location of your Java installation." 105 | fi 106 | 107 | # Increase the maximum file descriptors if we can. 108 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 109 | MAX_FD_LIMIT=`ulimit -H -n` 110 | if [ $? -eq 0 ] ; then 111 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 112 | MAX_FD="$MAX_FD_LIMIT" 113 | fi 114 | ulimit -n $MAX_FD 115 | if [ $? -ne 0 ] ; then 116 | warn "Could not set maximum file descriptor limit: $MAX_FD" 117 | fi 118 | else 119 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 120 | fi 121 | fi 122 | 123 | # For Darwin, add options to specify how the application appears in the dock 124 | if $darwin; then 125 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 126 | fi 127 | 128 | # For Cygwin or MSYS, switch paths to Windows format before running java 129 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 130 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 131 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 132 | JAVACMD=`cygpath --unix "$JAVACMD"` 133 | 134 | # We build the pattern for arguments to be converted via cygpath 135 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 136 | SEP="" 137 | for dir in $ROOTDIRSRAW ; do 138 | ROOTDIRS="$ROOTDIRS$SEP$dir" 139 | SEP="|" 140 | done 141 | OURCYGPATTERN="(^($ROOTDIRS))" 142 | # Add a user-defined pattern to the cygpath arguments 143 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 144 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 145 | fi 146 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 147 | i=0 148 | for arg in "$@" ; do 149 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 150 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 151 | 152 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 153 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 154 | else 155 | eval `echo args$i`="\"$arg\"" 156 | fi 157 | i=$((i+1)) 158 | done 159 | case $i in 160 | (0) set -- ;; 161 | (1) set -- "$args0" ;; 162 | (2) set -- "$args0" "$args1" ;; 163 | (3) set -- "$args0" "$args1" "$args2" ;; 164 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 165 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 166 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 167 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 168 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 169 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 170 | esac 171 | fi 172 | 173 | # Escape application args 174 | save () { 175 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 176 | echo " " 177 | } 178 | APP_ARGS=$(save "$@") 179 | 180 | # Collect all arguments for the java command, following the shell quoting and substitution rules 181 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 182 | 183 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 184 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 185 | cd "$(dirname "$0")" 186 | fi 187 | 188 | exec "$JAVACMD" "$@" 189 | -------------------------------------------------------------------------------- /NativePrueba/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 33 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 34 | 35 | @rem Find java.exe 36 | if defined JAVA_HOME goto findJavaFromJavaHome 37 | 38 | set JAVA_EXE=java.exe 39 | %JAVA_EXE% -version >NUL 2>&1 40 | if "%ERRORLEVEL%" == "0" goto init 41 | 42 | echo. 43 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 44 | echo. 45 | echo Please set the JAVA_HOME variable in your environment to match the 46 | echo location of your Java installation. 47 | 48 | goto fail 49 | 50 | :findJavaFromJavaHome 51 | set JAVA_HOME=%JAVA_HOME:"=% 52 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 53 | 54 | if exist "%JAVA_EXE%" goto init 55 | 56 | echo. 57 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 58 | echo. 59 | echo Please set the JAVA_HOME variable in your environment to match the 60 | echo location of your Java installation. 61 | 62 | goto fail 63 | 64 | :init 65 | @rem Get command-line arguments, handling Windows variants 66 | 67 | if not "%OS%" == "Windows_NT" goto win9xME_args 68 | 69 | :win9xME_args 70 | @rem Slurp the command line arguments. 71 | set CMD_LINE_ARGS= 72 | set _SKIP=2 73 | 74 | :win9xME_args_slurp 75 | if "x%~1" == "x" goto execute 76 | 77 | set CMD_LINE_ARGS=%* 78 | 79 | :execute 80 | @rem Setup the command line 81 | 82 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 83 | 84 | @rem Execute Gradle 85 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 86 | 87 | :end 88 | @rem End local scope for the variables with windows NT shell 89 | if "%ERRORLEVEL%"=="0" goto mainEnd 90 | 91 | :fail 92 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 93 | rem the _cmd.exe /c_ return code! 94 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 95 | exit /b 1 96 | 97 | :mainEnd 98 | if "%OS%"=="Windows_NT" endlocal 99 | 100 | :omega 101 | -------------------------------------------------------------------------------- /NativePrueba/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'NativePrueba' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | -------------------------------------------------------------------------------- /NativePrueba/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NativePrueba", 3 | "displayName": "NativePrueba" 4 | } -------------------------------------------------------------------------------- /NativePrueba/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | }; 4 | -------------------------------------------------------------------------------- /NativePrueba/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import {AppRegistry} from 'react-native'; 6 | import App from './App'; 7 | import {name as appName} from './app.json'; 8 | 9 | AppRegistry.registerComponent(appName, () => App); 10 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba-tvOS/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | NSAppTransportSecurity 26 | 27 | NSExceptionDomains 28 | 29 | localhost 30 | 31 | NSExceptionAllowsInsecureHTTPLoads 32 | 33 | 34 | 35 | 36 | NSLocationWhenInUseUsageDescription 37 | 38 | UILaunchStoryboardName 39 | LaunchScreen 40 | UIRequiredDeviceCapabilities 41 | 42 | armv7 43 | 44 | UISupportedInterfaceOrientations 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationLandscapeLeft 48 | UIInterfaceOrientationLandscapeRight 49 | 50 | UIViewControllerBasedStatusBarAppearance 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba-tvOSTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba.xcodeproj/xcshareddata/xcschemes/NativePrueba-tvOS.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba.xcodeproj/xcshareddata/xcschemes/NativePrueba.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #if DEBUG 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #if DEBUG 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"NativePrueba" 37 | initialProperties:nil]; 38 | 39 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1]; 40 | 41 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 42 | UIViewController *rootViewController = [UIViewController new]; 43 | rootViewController.view = rootView; 44 | self.window.rootViewController = rootViewController; 45 | [self.window makeKeyAndVisible]; 46 | return YES; 47 | } 48 | 49 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 50 | { 51 | #if DEBUG 52 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 53 | #else 54 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 55 | #endif 56 | } 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 21 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | NativePrueba 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSAllowsArbitraryLoads 30 | 31 | NSExceptionDomains 32 | 33 | localhost 34 | 35 | NSExceptionAllowsInsecureHTTPLoads 36 | 37 | 38 | 39 | 40 | NSLocationWhenInUseUsageDescription 41 | 42 | UILaunchStoryboardName 43 | LaunchScreen 44 | UIRequiredDeviceCapabilities 45 | 46 | armv7 47 | 48 | UISupportedInterfaceOrientations 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationLandscapeLeft 52 | UIInterfaceOrientationLandscapeRight 53 | 54 | UIViewControllerBasedStatusBarAppearance 55 | 56 | UIAppFonts 57 | 58 | AntDesign.ttf 59 | Entypo.ttf 60 | EvilIcons.ttf 61 | Feather.ttf 62 | FontAwesome.ttf 63 | FontAwesome5_Brands.ttf 64 | FontAwesome5_Regular.ttf 65 | FontAwesome5_Solid.ttf 66 | Fontisto.ttf 67 | Foundation.ttf 68 | Ionicons.ttf 69 | MaterialCommunityIcons.ttf 70 | MaterialIcons.ttf 71 | Octicons.ttf 72 | Roboto_medium.ttf 73 | Roboto.ttf 74 | rubicon-icon-font.ttf 75 | SimpleLineIcons.ttf 76 | Zocial.ttf 77 | 78 | 79 | 80 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePrueba/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePruebaTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /NativePrueba/ios/NativePruebaTests/NativePruebaTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface NativePruebaTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation NativePruebaTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /NativePrueba/ios/Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '9.0' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | def add_flipper_pods!(versions = {}) 5 | versions['Flipper'] ||= '~> 0.33.1' 6 | versions['DoubleConversion'] ||= '1.1.7' 7 | versions['Flipper-Folly'] ||= '~> 2.1' 8 | versions['Flipper-Glog'] ||= '0.3.6' 9 | versions['Flipper-PeerTalk'] ||= '~> 0.0.4' 10 | versions['Flipper-RSocket'] ||= '~> 1.0' 11 | 12 | pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug' 13 | pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug' 14 | pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug' 15 | pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug' 16 | pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug' 17 | 18 | # List all transitive dependencies for FlipperKit pods 19 | # to avoid them being linked in Release builds 20 | pod 'Flipper', versions['Flipper'], :configuration => 'Debug' 21 | pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug' 22 | pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug' 23 | pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug' 24 | pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug' 25 | pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug' 26 | pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug' 27 | pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug' 28 | pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug' 29 | pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug' 30 | pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug' 31 | pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug' 32 | pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug' 33 | pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug' 34 | end 35 | 36 | # Post Install processing for Flipper 37 | def flipper_post_install(installer) 38 | installer.pods_project.targets.each do |target| 39 | if target.name == 'YogaKit' 40 | target.build_configurations.each do |config| 41 | config.build_settings['SWIFT_VERSION'] = '4.1' 42 | end 43 | end 44 | end 45 | end 46 | 47 | target 'NativePrueba' do 48 | # Pods for NativePrueba 49 | pod 'FBLazyVector', :path => "../node_modules/react-native/Libraries/FBLazyVector" 50 | pod 'FBReactNativeSpec', :path => "../node_modules/react-native/Libraries/FBReactNativeSpec" 51 | pod 'RCTRequired', :path => "../node_modules/react-native/Libraries/RCTRequired" 52 | pod 'RCTTypeSafety', :path => "../node_modules/react-native/Libraries/TypeSafety" 53 | pod 'React', :path => '../node_modules/react-native/' 54 | pod 'React-Core', :path => '../node_modules/react-native/' 55 | pod 'React-CoreModules', :path => '../node_modules/react-native/React/CoreModules' 56 | pod 'React-Core/DevSupport', :path => '../node_modules/react-native/' 57 | pod 'React-RCTActionSheet', :path => '../node_modules/react-native/Libraries/ActionSheetIOS' 58 | pod 'React-RCTAnimation', :path => '../node_modules/react-native/Libraries/NativeAnimation' 59 | pod 'React-RCTBlob', :path => '../node_modules/react-native/Libraries/Blob' 60 | pod 'React-RCTImage', :path => '../node_modules/react-native/Libraries/Image' 61 | pod 'React-RCTLinking', :path => '../node_modules/react-native/Libraries/LinkingIOS' 62 | pod 'React-RCTNetwork', :path => '../node_modules/react-native/Libraries/Network' 63 | pod 'React-RCTSettings', :path => '../node_modules/react-native/Libraries/Settings' 64 | pod 'React-RCTText', :path => '../node_modules/react-native/Libraries/Text' 65 | pod 'React-RCTVibration', :path => '../node_modules/react-native/Libraries/Vibration' 66 | pod 'React-Core/RCTWebSocket', :path => '../node_modules/react-native/' 67 | 68 | pod 'React-cxxreact', :path => '../node_modules/react-native/ReactCommon/cxxreact' 69 | pod 'React-jsi', :path => '../node_modules/react-native/ReactCommon/jsi' 70 | pod 'React-jsiexecutor', :path => '../node_modules/react-native/ReactCommon/jsiexecutor' 71 | pod 'React-jsinspector', :path => '../node_modules/react-native/ReactCommon/jsinspector' 72 | pod 'ReactCommon/callinvoker', :path => "../node_modules/react-native/ReactCommon" 73 | pod 'ReactCommon/turbomodule/core', :path => "../node_modules/react-native/ReactCommon" 74 | pod 'Yoga', :path => '../node_modules/react-native/ReactCommon/yoga', :modular_headers => true 75 | 76 | pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec' 77 | pod 'glog', :podspec => '../node_modules/react-native/third-party-podspecs/glog.podspec' 78 | pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec' 79 | 80 | target 'NativePruebaTests' do 81 | inherit! :complete 82 | # Pods for testing 83 | end 84 | 85 | use_native_modules! 86 | 87 | # Enables Flipper. 88 | # 89 | # Note that if you have use_frameworks! enabled, Flipper will not work and 90 | # you should disable these next few lines. 91 | add_flipper_pods! 92 | post_install do |installer| 93 | flipper_post_install(installer) 94 | end 95 | end 96 | 97 | target 'NativePrueba-tvOS' do 98 | # Pods for NativePrueba-tvOS 99 | 100 | target 'NativePrueba-tvOSTests' do 101 | inherit! :search_paths 102 | # Pods for testing 103 | end 104 | end 105 | -------------------------------------------------------------------------------- /NativePrueba/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | 8 | module.exports = { 9 | transformer: { 10 | getTransformOptions: async () => ({ 11 | transform: { 12 | experimentalImportSupport: false, 13 | inlineRequires: false, 14 | }, 15 | }), 16 | }, 17 | }; 18 | -------------------------------------------------------------------------------- /NativePrueba/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "NativePrueba", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint ." 11 | }, 12 | "dependencies": { 13 | "@react-native-community/masked-view": "^0.1.9", 14 | "native-base": "^2.13.12", 15 | "react": "16.11.0", 16 | "react-native": "0.62.2", 17 | "react-native-gesture-handler": "^1.6.1", 18 | "react-native-reanimated": "^1.8.0", 19 | "react-native-safe-area-context": "^0.7.3", 20 | "react-native-screens": "^2.5.0", 21 | "react-native-vector-icons": "^6.6.0", 22 | "react-navigation": "^4.3.7", 23 | "react-navigation-drawer": "^2.4.11", 24 | "react-navigation-stack": "^2.3.12", 25 | "react-redux": "^7.2.0", 26 | "redux": "^4.0.5", 27 | "redux-persist": "^6.0.0", 28 | "roslib": "^1.1.0" 29 | }, 30 | "devDependencies": { 31 | "@babel/core": "^7.6.2", 32 | "@babel/runtime": "^7.6.2", 33 | "@react-native-community/eslint-config": "^0.0.5", 34 | "babel-jest": "^24.9.0", 35 | "eslint": "^6.5.1", 36 | "jest": "^24.9.0", 37 | "metro-react-native-babel-preset": "^0.58.0", 38 | "react-test-renderer": "16.11.0" 39 | }, 40 | "jest": { 41 | "preset": "react-native" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /NativePrueba/src/actions/index.js: -------------------------------------------------------------------------------- 1 | export const ip_master = (ipID) => { 2 | return { 3 | type: 'ip_master', 4 | payload: ipID 5 | } 6 | } 7 | 8 | export const port_master = (portID) => { 9 | return { 10 | type: 'port_master', 11 | payload: portID 12 | } 13 | } 14 | 15 | export const topic_vel = (top_velID) => { 16 | return { 17 | type: 'topic_vel', 18 | payload: top_velID 19 | } 20 | } 21 | 22 | export const vref = (vrefID) => { 23 | return { 24 | type: 'vref', 25 | payload: vrefID 26 | } 27 | } 28 | 29 | export const wref = (wrefID) => { 30 | return { 31 | type: 'wref', 32 | payload: wrefID 33 | } 34 | } 35 | 36 | export const topic_odom = (top_odomID) => { 37 | return { 38 | type: 'topic_odom', 39 | payload: top_odomID 40 | } 41 | } 42 | 43 | export const ros_node = (rosID) => { 44 | return { 45 | type: 'ros_node', 46 | payload: rosID 47 | } 48 | } 49 | 50 | export const ros_connection = (rosconID) => { 51 | return { 52 | type: 'ros_connection', 53 | payload: rosconID 54 | } 55 | } -------------------------------------------------------------------------------- /NativePrueba/src/app.js: -------------------------------------------------------------------------------- 1 | import React from 'react' 2 | import {Image} from 'react-native' 3 | import {createAppContainer} from 'react-navigation' 4 | import {createDrawerNavigator, DrawerNavigatorItems, DrawerItems} from 'react-navigation-drawer' 5 | import HomeNavigator from './modules/Login/components/HomeNavigation' 6 | import TeleNavigator from './modules/Login/components/TeleNavigation' 7 | import PostureNavigator from './modules/Login/components/PostureNavigation' 8 | import TrayNavigation from './modules/Login/components/TrayNavigation' 9 | import Entypo from 'react-native-vector-icons/Entypo' 10 | import MaterialIcons from 'react-native-vector-icons/MaterialIcons' 11 | import MaterialCommunityIcons from 'react-native-vector-icons/MaterialCommunityIcons' 12 | import { Container, Body, Header, Footer } from 'native-base' 13 | 14 | const DrawerContent = (props) => { 15 | return( 16 | 17 |

18 | 19 | 20 | 21 |
22 | 23 | 24 | ) 25 | } 26 | 27 | const LoginNavigator = createDrawerNavigator({ 28 | HomeNavigator:{ 29 | screen : HomeNavigator, 30 | navigationOptions:{ 31 | title: 'Home', 32 | drawerIcon: ({item}) => ( 33 | 34 | ) 35 | } 36 | }, 37 | TeleNavigator:{ 38 | screen : TeleNavigator, 39 | navigationOptions:{ 40 | title: 'Teleoperation', 41 | drawerIcon: ({item}) => ( 42 | 43 | ) 44 | } 45 | }, 46 | PostureNavigator:{ 47 | screen : PostureNavigator, 48 | navigationOptions:{ 49 | title: 'Posture Control', 50 | drawerIcon: ({item}) => ( 51 | 52 | ) 53 | } 54 | }, 55 | TrayNavigation:{ 56 | screen : TrayNavigation, 57 | navigationOptions:{ 58 | title: 'Trajectory Control', 59 | drawerIcon: ({item}) => ( 60 | 61 | ) 62 | } 63 | } 64 | },{ 65 | drawerPosition: 'left', 66 | contentComponent: DrawerContent 67 | }); 68 | 69 | export default createAppContainer(LoginNavigator) -------------------------------------------------------------------------------- /NativePrueba/src/boot/setup.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from "react"; 2 | import { StyleProvider } from "native-base"; 3 | 4 | import App from "../app"; 5 | import getTheme from "../theme/components"; 6 | import variables from "../theme/variables/commonColor"; 7 | 8 | export default class Setup extends Component { 9 | render() { 10 | return ( 11 | 12 | 13 | 14 | ); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /NativePrueba/src/images/robot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Juanesb230/ReactNative_ROS_App/3b1bfc457fe66af49dc6eccf2bc0907629792c8a/NativePrueba/src/images/robot.png -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/components/HomeNavigation.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from 'react-navigation-stack' 2 | import Home from '../containers/home'; 3 | import HomeSettings from '../containers/settings_home'; 4 | 5 | 6 | const HomeNavigator = createStackNavigator({ 7 | 8 | Home:{ 9 | screen : Home, 10 | navigationOptions:{ 11 | headerShown: false 12 | } 13 | 14 | }, 15 | HomeSettings:{ 16 | screen : HomeSettings, 17 | navigationOptions:{ 18 | headerShown: false 19 | } 20 | 21 | } 22 | }); 23 | 24 | export default HomeNavigator -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/components/PostureNavigation.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from 'react-navigation-stack' 2 | import Posture from '../containers/pc_srceen'; 3 | import PostureSettings from '../containers/settings_pc' 4 | 5 | const HomeNavigator = createStackNavigator({ 6 | 7 | Posture:{ 8 | screen : Posture, 9 | navigationOptions:{ 10 | headerShown: false 11 | } 12 | 13 | }, 14 | PostureSettings:{ 15 | screen : PostureSettings, 16 | navigationOptions:{ 17 | headerShown: false 18 | } 19 | 20 | } 21 | }); 22 | 23 | export default HomeNavigator -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/components/TeleNavigation.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from 'react-navigation-stack' 2 | import Teleop from '../containers/tele_screen'; 3 | import TeleSettings from '../containers/settings_tele' 4 | 5 | 6 | const HomeNavigator = createStackNavigator({ 7 | 8 | Teleop:{ 9 | screen : Teleop, 10 | navigationOptions:{ 11 | headerShown: false 12 | } 13 | 14 | }, 15 | TeleSettings:{ 16 | screen : TeleSettings, 17 | navigationOptions:{ 18 | headerShown: false 19 | } 20 | 21 | } 22 | }); 23 | 24 | export default HomeNavigator -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/components/TrayNavigation.js: -------------------------------------------------------------------------------- 1 | import {createStackNavigator} from 'react-navigation-stack' 2 | import Tray from '../containers/tc_screen'; 3 | import TraySettings from '../containers/settings_tc' 4 | 5 | const HomeNavigator = createStackNavigator({ 6 | 7 | Tray:{ 8 | screen : Tray, 9 | navigationOptions:{ 10 | headerShown: false 11 | } 12 | 13 | }, 14 | TraySettings:{ 15 | screen : TraySettings, 16 | navigationOptions:{ 17 | headerShown: false 18 | } 19 | 20 | } 21 | }); 22 | 23 | export default HomeNavigator -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react' 2 | import {StyleSheet, ScrollView, Alert} from 'react-native' 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Item,Input, Text } from 'native-base'; 4 | import AntDesign from 'react-native-vector-icons/AntDesign'; 5 | import * as actions from '../../../actions' 6 | import {connect} from 'react-redux' 7 | import * as ROSLIB from 'roslib' 8 | 9 | class AnatomyExample extends Component { 10 | 11 | componentDidMount() { 12 | this.didFocusListener = this.props.navigation.addListener('didFocus', () => { 13 | this.someAction(); 14 | }) 15 | } 16 | 17 | someAction() { 18 | if (this.props.rosconID){ 19 | this.string = new ROSLIB.Message({ 20 | data: 'Teleoperation' 21 | }) 22 | this.Topic_mode() 23 | this.topic2.publish(this.string) 24 | } 25 | } 26 | 27 | componentWillUnmount() { 28 | this.didFocusListener.remove(); 29 | } 30 | 31 | 32 | Topic_mode = () =>{ 33 | this.topic2 = new ROSLIB.Topic({ 34 | ros: this.props.rosID, 35 | name: '/mode', 36 | messageType: 'std_msgs/String' 37 | }) 38 | } 39 | 40 | constructor(props){ 41 | super(props) 42 | this.state = { 43 | connected: false, 44 | error: undefined, 45 | } 46 | } 47 | 48 | registrer = () => { 49 | this.props.navigation.openDrawer() 50 | } 51 | 52 | registrer2 = () => { 53 | this.props.navigation.navigate('HomeSettings') 54 | } 55 | 56 | save_ip = () => { 57 | this.ros = new ROSLIB.Ros({url: "ws://" + this.props.ipID + ":" + this.props.portID}) 58 | this.props.ros_node(this.ros) 59 | this.ros.on ('connection', () => { 60 | Alert.alert("Success","Connected to server: ws://" + this.props.ipID + ":" + this.props.portID) 61 | this.state.connected = true 62 | this.props.ros_connection(this.state.connected) 63 | }) 64 | this.ros.on ('error', (error) => { 65 | Alert.alert("Error","Type error: " + error) 66 | this.state.connected = false 67 | this.props.ros_connection(this.state.connected) 68 | }) 69 | this.ros.on ('close', () => { 70 | Alert.alert("Closed connection","The server: "+ this.props.ipID + ":" + this.props.portID + " was close") 71 | this.state.connected = false 72 | this.props.ros_connection(this.state.connected) 73 | }) 74 | 75 | } 76 | 77 | 78 | render() { 79 | 80 | return ( 81 | 82 |
83 | 84 | 87 | 88 | 89 | Home 90 | 91 | 92 | 95 | 96 |
97 | 98 | Remote ROS 99 | Mobile Robot Control 100 | IP Adress: 101 | 102 | this.props.ip_master(ip)} style={{textAlign:'center'}}/> 103 | 104 | Port: 105 | 106 | this.props.port_master(port)} style={{textAlign:'center'}}/> 107 | 108 | 111 | 112 |
113 | ); 114 | } 115 | } 116 | 117 | const styles = StyleSheet.create({ 118 | IP:{ 119 | flexGrow: 1, 120 | flexDirection: 'column', 121 | alignItems: 'center', 122 | justifyContent: 'center', 123 | } 124 | }) 125 | 126 | const mapStateToProps = state => { 127 | return { 128 | ipID: state.ipID, 129 | portID: state.portID, 130 | rosID: state.rosID, 131 | rosconID: state.rosconID 132 | } 133 | } 134 | 135 | export default connect(mapStateToProps,actions)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/pc_srceen.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import {View, ScrollView, Alert} from 'react-native' 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Text, Form, Item, Label, Input } from 'native-base'; 4 | import AntDesign from 'react-native-vector-icons/AntDesign' 5 | import {connect} from 'react-redux' 6 | import * as ROSLIB from 'roslib' 7 | 8 | class AnatomyExample extends Component { 9 | 10 | componentDidMount() { 11 | this.didFocusListener = this.props.navigation.addListener('didFocus', () => { 12 | this.someAction(); 13 | }) 14 | } 15 | 16 | someAction() { 17 | if (this.props.rosconID){ 18 | this.string = new ROSLIB.Message({ 19 | data: 'Posture Control' 20 | }) 21 | this.stop() 22 | this.Topic_mode() 23 | this.topic2.publish(this.string) 24 | } 25 | } 26 | 27 | componentWillUnmount() { 28 | this.didFocusListener.remove(); 29 | } 30 | 31 | Topic_mode = () =>{ 32 | this.topic2 = new ROSLIB.Topic({ 33 | ros: this.props.rosID, 34 | name: '/mode', 35 | messageType: 'std_msgs/String' 36 | }) 37 | } 38 | 39 | constructor(props){ 40 | super(props) 41 | this.state = { 42 | xref:'0.0', 43 | yref:'0.0' 44 | } 45 | } 46 | 47 | Topic_vel =() => { 48 | this.topic = new ROSLIB.Topic({ 49 | ros: this.props.rosID, 50 | name:this.props.top_velID, 51 | messageType: 'geometry_msgs/Twist' 52 | })} 53 | 54 | stop =() => { 55 | if (this.props.rosconID){ 56 | this.message = new ROSLIB.Message({ 57 | linear: {x: 0.0, y: 0.0, z: 0.0}, 58 | angular: {x: 0.0, y: 0.0, z: 0.0 } 59 | }) 60 | this.Topic_vel() 61 | this.topic.publish(this.message) 62 | } 63 | } 64 | 65 | registrer = () => { 66 | this.props.navigation.openDrawer() 67 | } 68 | 69 | registrer2 = () => { 70 | this.props.navigation.navigate('PostureSettings') 71 | } 72 | 73 | posRef = () => { 74 | if (this.props.rosconID){ 75 | this.Xref = new ROSLIB.Param({ 76 | ros : this.props.rosID, 77 | name : 'x_position' 78 | }) 79 | this.Xref.set(parseFloat(this.state.xref)) 80 | this.Yref = new ROSLIB.Param({ 81 | ros : this.props.rosID, 82 | name : 'y_position' 83 | }) 84 | this.Yref.set(parseFloat(this.state.yref)) 85 | } 86 | } 87 | 88 | render() { 89 | return ( 90 | 91 |
92 | 93 | 96 | 97 | 98 | Posture Control 99 | 100 | 101 | 104 | 105 |
106 | 107 | 108 | Server connection: {this.props.ipID}:{this.props.portID} 109 | Velocity Topic: {this.props.top_velID} 110 | Odometry Topic: {this.props.top_odomID} 111 | 112 | 113 |
114 | 115 | 116 | this.setState({xref})}/> 117 | 118 | 119 | 120 | this.setState({yref})}/> 121 | 122 |
123 | 126 |
127 |
128 |
129 | ); 130 | } 131 | } 132 | 133 | const mapStateToProps = state => { 134 | return { 135 | ipID: state.ipID, 136 | portID: state.portID, 137 | top_velID: state.top_velID, 138 | top_odomID: state.top_odomID, 139 | rosID: state.rosID, 140 | rosconID: state.rosconID 141 | } 142 | } 143 | 144 | export default connect(mapStateToProps)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/settings_home.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { Container, Header, Left, Body, Right, Button, Icon, Title } from 'native-base'; 3 | 4 | class AnatomyExample extends Component { 5 | 6 | BackHome = () => { 7 | this.props.navigation.navigate('Home')} 8 | 9 | render() { 10 | return ( 11 | 12 |
13 | 14 | 17 | 18 | 19 | Home Settings 20 | 21 | 22 |
23 |
24 | ); 25 | } 26 | } 27 | 28 | 29 | export default AnatomyExample -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/settings_pc.js: -------------------------------------------------------------------------------- 1 | import {Alert} from 'react-native' 2 | import React, { Component } from 'react'; 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Content, Form, Item, Label, Input, Text } from 'native-base'; 4 | import * as actions from '../../../actions' 5 | import {connect} from 'react-redux' 6 | 7 | class AnatomyExample extends Component { 8 | 9 | constructor(props){ 10 | super(props) 11 | this.state = { 12 | topic_vel:this.props.top_velID, 13 | topic_odom:this.props.top_odomID 14 | } 15 | } 16 | 17 | BackPosture = () => { 18 | this.props.navigation.navigate('Posture')} 19 | 20 | save_topic = () => { 21 | this.props.topic_vel(this.state.topic_vel) 22 | this.props.topic_odom(this.state.topic_odom) 23 | Alert.alert("Success","Changed topics") 24 | } 25 | 26 | render() { 27 | return ( 28 | 29 |
30 | 31 | 34 | 35 | 36 | Control Settings 37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 | this.setState({topic_vel})}/> 45 | 46 | 47 | 48 | this.setState({topic_odom})}/> 49 | 50 |
51 | 54 |
55 |
56 | ); 57 | } 58 | } 59 | 60 | const mapStateToProps = state => { 61 | return { 62 | top_velID: state.top_velID, 63 | top_odomID: state.top_odomID 64 | } 65 | } 66 | 67 | export default connect(mapStateToProps,actions)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/settings_tc.js: -------------------------------------------------------------------------------- 1 | import {Alert} from 'react-native' 2 | import React, { Component } from 'react'; 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Content, Form, Item, Label, Input, Text } from 'native-base'; 4 | import * as actions from '../../../actions' 5 | import {connect} from 'react-redux' 6 | 7 | class AnatomyExample extends Component { 8 | 9 | constructor(props){ 10 | super(props) 11 | this.state = { 12 | topic_vel:this.props.top_velID, 13 | topic_odom:this.props.top_odomID 14 | } 15 | } 16 | 17 | BackPosture = () => { 18 | this.props.navigation.navigate('Tray')} 19 | 20 | save_topic = () => { 21 | this.props.topic_vel(this.state.topic_vel) 22 | this.props.topic_odom(this.state.topic_odom) 23 | Alert.alert("Success","Changed topics") 24 | } 25 | 26 | render() { 27 | return ( 28 | 29 |
30 | 31 | 34 | 35 | 36 | Control Settings 37 | 38 | 39 |
40 | 41 |
42 | 43 | 44 | this.setState({topic_vel})}/> 45 | 46 | 47 | 48 | this.setState({topic_odom})}/> 49 | 50 |
51 | 54 |
55 |
56 | ); 57 | } 58 | } 59 | 60 | const mapStateToProps = state => { 61 | return { 62 | top_velID: state.top_velID, 63 | top_odomID: state.top_odomID 64 | } 65 | } 66 | 67 | export default connect(mapStateToProps,actions)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/settings_tele.js: -------------------------------------------------------------------------------- 1 | import {Alert} from 'react-native' 2 | import React, { Component } from 'react'; 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Content, Form, Item, Label, Input, Text } from 'native-base'; 4 | import * as actions from '../../../actions' 5 | import {connect} from 'react-redux' 6 | 7 | class AnatomyExample extends Component { 8 | 9 | constructor(props){ 10 | super(props) 11 | this.state = { 12 | topic_vel: this.props.top_velID, 13 | vref:'0.2', 14 | wref:'0.2' 15 | } 16 | } 17 | 18 | BackTele = () => { 19 | this.props.navigation.navigate('Teleop')} 20 | 21 | save_vel = () => { 22 | this.props.topic_vel(this.state.topic_vel) 23 | this.props.vref(this.state.vref) 24 | this.props.wref(this.state.wref) 25 | Alert.alert("Success","Changed velocities") 26 | } 27 | 28 | render() { 29 | return ( 30 | 31 |
32 | 33 | 36 | 37 | 38 | Teleoperation Settings 39 | 40 | 41 |
42 | 43 |
44 | 45 | 46 | this.setState({topic_vel})}/> 47 | 48 | 49 | 50 | this.setState({vref})}/> 51 | 52 | 53 | 54 | this.setState({wref})}/> 55 | 56 |
57 | 60 |
61 |
62 | ); 63 | } 64 | } 65 | 66 | const mapStateToProps = state => { 67 | return { 68 | top_velID: state.top_velID, 69 | } 70 | } 71 | 72 | export default connect(mapStateToProps,actions)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/tc_screen.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import { ScrollView, View } from 'react-native' 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Text, Content, Radio, ListItem } from 'native-base'; 4 | import AntDesign from 'react-native-vector-icons/AntDesign' 5 | import {connect} from 'react-redux' 6 | import * as ROSLIB from 'roslib' 7 | 8 | class AnatomyExample extends Component { 9 | 10 | componentDidMount() { 11 | this.didFocusListener = this.props.navigation.addListener('didFocus', () => { 12 | this.someAction(); 13 | }) 14 | } 15 | 16 | someAction() { 17 | if (this.props.rosconID){ 18 | this.string = new ROSLIB.Message({ 19 | data: 'Tray Control' 20 | }) 21 | this.Param_tray() 22 | this.Topic_mode() 23 | this.topic2.publish(this.string) 24 | } 25 | } 26 | 27 | componentWillUnmount() { 28 | this.didFocusListener.remove(); 29 | } 30 | 31 | Topic_mode = () =>{ 32 | this.topic2 = new ROSLIB.Topic({ 33 | ros: this.props.rosID, 34 | name: '/mode', 35 | messageType: 'std_msgs/String' 36 | }) 37 | } 38 | 39 | constructor() { 40 | super(); 41 | this.state = { 42 | itemSelected: 'itemOne', 43 | mode: 0 44 | } 45 | } 46 | 47 | Param_tray = () => { 48 | if (this.props.rosconID){ 49 | this.tray = new ROSLIB.Param({ 50 | ros : this.props.rosID, 51 | name : 'TrayMode' 52 | }) 53 | this.tray.set(parseInt(this.state.mode)) 54 | } 55 | } 56 | 57 | registrer = () => { 58 | this.props.navigation.openDrawer() 59 | } 60 | 61 | registrer2 = () => { 62 | this.props.navigation.navigate('TraySettings') 63 | } 64 | 65 | setInit = () => { 66 | this.state.mode= 0 67 | this.setState({itemSelected : 'itemOne'}) 68 | this.Param_tray() 69 | } 70 | 71 | setCircle = () => { 72 | this.state.mode= 1 73 | this.setState({itemSelected : 'itemTwo'}) 74 | this.Param_tray() 75 | } 76 | 77 | setEigth = () => { 78 | this.state.mode= 2 79 | this.setState({itemSelected : 'itemThree'}) 80 | this.Param_tray() 81 | } 82 | 83 | setHeart = () => { 84 | this.state.mode= 3 85 | this.setState({itemSelected : 'itemFour'}) 86 | this.Param_tray() 87 | } 88 | 89 | render() { 90 | return ( 91 | 92 |
93 | 94 | 97 | 98 | 99 | Trajectory Control 100 | 101 | 102 | 105 | 106 |
107 | 108 | 109 | Server connection: {this.props.ipID}:{this.props.portID} 110 | Velocity Topic: {this.props.top_velID} 111 | Odometry Topic: {this.props.top_odomID} 112 | 113 | 114 | Trajectories 115 | 116 | 117 | Initial Position 118 | 119 | 120 | 122 | 123 | 124 | 125 | 126 | Circle 127 | 128 | 129 | 131 | 132 | 133 | 134 | 135 | Eigth 136 | 137 | 138 | 140 | 141 | 142 | 143 | 144 | Heart 145 | 146 | 147 | 149 | 150 | 151 | 152 | 153 |
154 | ); 155 | } 156 | } 157 | 158 | const mapStateToProps = state => { 159 | return { 160 | ipID: state.ipID, 161 | portID: state.portID, 162 | top_velID: state.top_velID, 163 | top_odomID: state.top_odomID, 164 | rosID: state.rosID, 165 | rosconID: state.rosconID 166 | } 167 | } 168 | 169 | export default connect(mapStateToProps)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/modules/Login/containers/tele_screen.js: -------------------------------------------------------------------------------- 1 | import React, { Component } from 'react'; 2 | import {View} from 'react-native' 3 | import { Container, Header, Left, Body, Right, Button, Icon, Title, Text } from 'native-base'; 4 | import AntDesign from 'react-native-vector-icons/AntDesign' 5 | import Feather from 'react-native-vector-icons/Feather' 6 | import FontAwesome from 'react-native-vector-icons/FontAwesome' 7 | import {connect} from 'react-redux' 8 | import * as ROSLIB from 'roslib' 9 | 10 | class AnatomyExample extends Component { 11 | 12 | componentDidMount() { 13 | this.didFocusListener = this.props.navigation.addListener('didFocus', () => { 14 | this.someAction(); 15 | }) 16 | } 17 | 18 | someAction() { 19 | if (this.props.rosconID){ 20 | this.string = new ROSLIB.Message({ 21 | data: 'Teleoperation' 22 | }) 23 | this.stop() 24 | this.Topic_mode() 25 | this.topic2.publish(this.string) 26 | } 27 | } 28 | 29 | componentWillUnmount() { 30 | this.didFocusListener.remove(); 31 | } 32 | 33 | 34 | Topic_mode = () =>{ 35 | this.topic2 = new ROSLIB.Topic({ 36 | ros: this.props.rosID, 37 | name: '/mode', 38 | messageType: 'std_msgs/String' 39 | }) 40 | } 41 | 42 | registrer = () => { 43 | if (this.props.rosconID){ 44 | this.stop() 45 | } 46 | this.props.navigation.openDrawer() 47 | } 48 | 49 | registrer2 = () => { 50 | if (this.props.rosconID){ 51 | this.stop() 52 | } 53 | this.props.navigation.navigate('TeleSettings') 54 | } 55 | 56 | Topic_vel =() => { 57 | this.topic = new ROSLIB.Topic({ 58 | ros: this.props.rosID, 59 | name:this.props.top_velID, 60 | messageType: 'geometry_msgs/Twist' 61 | }) 62 | } 63 | 64 | forward =() => { 65 | if (this.props.rosconID){ 66 | this.message = new ROSLIB.Message({ 67 | linear: {x: parseFloat(this.props.vrefID), y: 0.0, z: 0.0}, 68 | angular: {x: 0.0, y: 0.0, z: 0.0 } 69 | }) 70 | this.Topic_vel() 71 | this.topic.publish(this.message) 72 | } 73 | } 74 | 75 | behind =() => { 76 | if (this.props.rosconID){ 77 | this.message = new ROSLIB.Message({ 78 | linear: {x: -parseFloat(this.props.vrefID), y: 0.0, z: 0.0}, 79 | angular: {x: 0.0, y: 0.0, z: 0.0 } 80 | }) 81 | this.Topic_vel() 82 | this.topic.publish(this.message) 83 | } 84 | } 85 | 86 | left =() => { 87 | if (this.props.rosconID){ 88 | this.message = new ROSLIB.Message({ 89 | linear: {x: 0.0, y: 0.0, z: 0.0}, 90 | angular: {x: 0.0, y: 0.0, z: parseFloat(this.props.wrefID) } 91 | }) 92 | this.Topic_vel() 93 | this.topic.publish(this.message) 94 | } 95 | } 96 | 97 | right =() => { 98 | if (this.props.rosconID){ 99 | this.message = new ROSLIB.Message({ 100 | linear: {x: 0.0, y: 0.0, z: 0.0}, 101 | angular: {x: 0.0, y: 0.0, z: - parseFloat(this.props.wrefID) } 102 | }) 103 | this.Topic_vel() 104 | this.topic.publish(this.message) 105 | } 106 | } 107 | 108 | stop =() => { 109 | if (this.props.rosconID){ 110 | this.message = new ROSLIB.Message({ 111 | linear: {x: 0.0, y: 0.0, z: 0.0}, 112 | angular: {x: 0.0, y: 0.0, z: 0.0 } 113 | }) 114 | this.Topic_vel() 115 | this.topic.publish(this.message) 116 | } 117 | } 118 | 119 | render() { 120 | 121 | return ( 122 | 123 |
124 | 125 | 128 | 129 | 130 | Teleoperation 131 | 132 | 133 | 136 | 137 |
138 | 139 | Server connection: {this.props.ipID}:{this.props.portID} 140 | Velocity Topic: {this.props.top_velID} 141 | Lineal velocity: {this.props.vrefID} (m/s) 142 | Angular velocity: {this.props.wrefID} (rad/s) 143 | 144 | 145 | 146 | 149 | 150 | 151 | 154 | 157 | 160 | 161 | 162 | 165 | 166 | 167 |
168 | ); 169 | } 170 | } 171 | 172 | const mapStateToProps = state => { 173 | return { 174 | ipID: state.ipID, 175 | portID: state.portID, 176 | top_velID: state.top_velID, 177 | vrefID: state.vrefID, 178 | wrefID: state.wrefID, 179 | rosID: state.rosID, 180 | rosconID: state.rosconID 181 | } 182 | } 183 | 184 | export default connect(mapStateToProps)(AnatomyExample) -------------------------------------------------------------------------------- /NativePrueba/src/reducers/connectionReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = false, action) => { 2 | switch(action.type){ 3 | case 'ros_connection': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/index.js: -------------------------------------------------------------------------------- 1 | import {combineReducers} from 'redux' 2 | import ipReducer from './ipReducer' 3 | import portReducer from './portReducer' 4 | import vReducer from './vReducer' 5 | import wReducer from './wReducers' 6 | import top_velReducer from './topic_velReducer' 7 | import top_odomReducer from './topic_odomReducer' 8 | import rosReducer from './rosReducer' 9 | import connectionReducer from './connectionReducer' 10 | 11 | const rootReducer = combineReducers({ 12 | ipID: ipReducer, 13 | portID: portReducer, 14 | vrefID: vReducer, 15 | wrefID: wReducer, 16 | top_velID: top_velReducer, 17 | top_odomID: top_odomReducer, 18 | rosID: rosReducer, 19 | rosconID: connectionReducer 20 | }) 21 | 22 | export default rootReducer -------------------------------------------------------------------------------- /NativePrueba/src/reducers/ipReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = 'localhost', action) => { 2 | switch(action.type){ 3 | case 'ip_master': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/portReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = '9090', action) => { 2 | switch(action.type){ 3 | case 'port_master': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/rosReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = [], action) => { 2 | switch(action.type){ 3 | case 'ros_node': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/topic_odomReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = '/odom', action) => { 2 | switch(action.type){ 3 | case 'topic_odom': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/topic_velReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = '/cmd_vel', action) => { 2 | switch(action.type){ 3 | case 'topic_vel': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/vReducer.js: -------------------------------------------------------------------------------- 1 | export default (state = '0.2', action) => { 2 | switch(action.type){ 3 | case 'vref': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/reducers/wReducers.js: -------------------------------------------------------------------------------- 1 | export default (state = '0.2', action) => { 2 | switch(action.type){ 3 | case 'wref': 4 | return action.payload 5 | default: 6 | return state 7 | } 8 | } -------------------------------------------------------------------------------- /NativePrueba/src/store/index.js: -------------------------------------------------------------------------------- 1 | import { createStore } from "redux"; 2 | import { persistStore, persistReducer } from "redux-persist"; 3 | import { AsyncStorage } from 'react-native' 4 | import rootReducer from '../reducers'; 5 | 6 | 7 | const persistConfig = { 8 | key: "root", 9 | storage: AsyncStorage, 10 | blacklist: ['rosID'] 11 | }; 12 | 13 | const persistedReducer = persistReducer(persistConfig, rootReducer) 14 | 15 | const store = createStore( 16 | persistedReducer, 17 | ); 18 | 19 | let persistor = persistStore(store); 20 | 21 | export { 22 | store, 23 | persistor, 24 | }; -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Badge.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const badgeTheme = { 7 | ".primary": { 8 | backgroundColor: variables.btnPrimaryBg 9 | }, 10 | ".warning": { 11 | backgroundColor: variables.btnWarningBg 12 | }, 13 | ".info": { 14 | backgroundColor: variables.btnInfoBg 15 | }, 16 | ".success": { 17 | backgroundColor: variables.btnSuccessBg 18 | }, 19 | ".danger": { 20 | backgroundColor: variables.btnDangerBg 21 | }, 22 | "NativeBase.Text": { 23 | color: variables.badgeColor, 24 | fontSize: variables.fontSizeBase, 25 | lineHeight: variables.lineHeight - 1, 26 | textAlign: "center", 27 | paddingHorizontal: 3 28 | }, 29 | backgroundColor: variables.badgeBg, 30 | padding: variables.badgePadding, 31 | paddingHorizontal: 6, 32 | alignSelf: "flex-start", 33 | justifyContent: variables.platform === "ios" ? "center" : undefined, 34 | borderRadius: 13.5, 35 | height: 27 36 | }; 37 | return badgeTheme; 38 | }; 39 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Body.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const bodyTheme = { 7 | flex: 1, 8 | alignItems: 'center', 9 | alignSelf: 'center', 10 | }; 11 | 12 | return bodyTheme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Card.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const cardTheme = { 7 | ".transparent": { 8 | shadowColor: null, 9 | shadowOffset: null, 10 | shadowOpacity: null, 11 | shadowRadius: null, 12 | elevation: null, 13 | backgroundColor: "transparent", 14 | borderWidth: 0 15 | }, 16 | ".noShadow": { 17 | shadowColor: null, 18 | shadowOffset: null, 19 | shadowOpacity: null, 20 | elevation: null 21 | }, 22 | marginVertical: 5, 23 | marginHorizontal: 2, 24 | borderWidth: variables.borderWidth, 25 | borderRadius: variables.cardBorderRadius, 26 | borderColor: variables.cardBorderColor, 27 | flexWrap: "nowrap", 28 | backgroundColor: variables.cardDefaultBg, 29 | shadowColor: "#000", 30 | shadowOffset: { width: 0, height: 2 }, 31 | shadowOpacity: 0.1, 32 | shadowRadius: 1.5, 33 | elevation: 3 34 | }; 35 | 36 | return cardTheme; 37 | }; 38 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/CardItem.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { StyleSheet } from "react-native"; 4 | import variable from "./../variables/platform"; 5 | 6 | export default (variables /*: * */ = variable) => { 7 | const platform = variables.platform; 8 | const transparentBtnCommon = { 9 | "NativeBase.Text": { 10 | fontSize: variables.DefaultFontSize - 3, 11 | color: variables.sTabBarActiveTextColor 12 | }, 13 | "NativeBase.Icon": { 14 | fontSize: variables.iconFontSize - 10, 15 | color: variables.sTabBarActiveTextColor, 16 | marginHorizontal: null 17 | }, 18 | "NativeBase.IconNB": { 19 | fontSize: variables.iconFontSize - 10, 20 | color: variables.sTabBarActiveTextColor 21 | }, 22 | paddingVertical: null, 23 | paddingHorizontal: null 24 | }; 25 | 26 | const cardItemTheme = { 27 | "NativeBase.Left": { 28 | "NativeBase.Body": { 29 | "NativeBase.Text": { 30 | ".note": { 31 | color: variables.listNoteColor, 32 | fontWeight: "400", 33 | marginRight: 20 34 | } 35 | }, 36 | flex: 1, 37 | marginLeft: 10, 38 | alignItems: null 39 | }, 40 | "NativeBase.Icon": { 41 | fontSize: variables.iconFontSize 42 | }, 43 | "NativeBase.IconNB": { 44 | fontSize: variables.iconFontSize 45 | }, 46 | "NativeBase.Text": { 47 | marginLeft: 10, 48 | alignSelf: "center" 49 | }, 50 | "NativeBase.Button": { 51 | ".transparent": { 52 | ...transparentBtnCommon, 53 | paddingRight: variables.cardItemPadding + 5 54 | } 55 | }, 56 | flex: 1, 57 | flexDirection: "row", 58 | alignItems: "center" 59 | }, 60 | ".content": { 61 | "NativeBase.Text": { 62 | color: platform === "ios" ? "#555" : "#222", 63 | fontSize: variables.DefaultFontSize - 2 64 | } 65 | }, 66 | ".cardBody": { 67 | padding: -5, 68 | "NativeBase.Text": { 69 | marginTop: 5 70 | } 71 | }, 72 | "NativeBase.Body": { 73 | "NativeBase.Text": { 74 | ".note": { 75 | color: variables.listNoteColor, 76 | fontWeight: "200", 77 | marginRight: 20 78 | } 79 | }, 80 | "NativeBase.Button": { 81 | ".transparent": { 82 | ...transparentBtnCommon, 83 | paddingRight: variables.cardItemPadding + 5, 84 | alignSelf: "stretch" 85 | } 86 | }, 87 | flex: 1, 88 | alignSelf: "stretch", 89 | alignItems: "flex-start" 90 | }, 91 | "NativeBase.Right": { 92 | "NativeBase.Badge": { 93 | alignSelf: null 94 | }, 95 | "NativeBase.Button": { 96 | ".transparent": { 97 | ...transparentBtnCommon 98 | }, 99 | alignSelf: null 100 | }, 101 | "NativeBase.Icon": { 102 | alignSelf: null, 103 | fontSize: variables.iconFontSize - 8, 104 | color: variables.cardBorderColor 105 | }, 106 | "NativeBase.IconNB": { 107 | alignSelf: null, 108 | fontSize: variables.iconFontSize - 8, 109 | color: variables.cardBorderColor 110 | }, 111 | "NativeBase.Text": { 112 | fontSize: variables.DefaultFontSize - 1, 113 | alignSelf: null 114 | }, 115 | "NativeBase.Thumbnail": { 116 | alignSelf: null 117 | }, 118 | "NativeBase.Image": { 119 | alignSelf: null 120 | }, 121 | "NativeBase.Radio": { 122 | alignSelf: null 123 | }, 124 | "NativeBase.Checkbox": { 125 | alignSelf: null 126 | }, 127 | "NativeBase.Switch": { 128 | alignSelf: null 129 | }, 130 | flex: 0.8 131 | }, 132 | ".header": { 133 | "NativeBase.Text": { 134 | fontSize: 16, 135 | fontWeight: platform === "ios" ? "600" : "500" 136 | }, 137 | ".bordered": { 138 | "NativeBase.Text": { 139 | color: variables.brandPrimary, 140 | fontWeight: platform === "ios" ? "600" : "500" 141 | }, 142 | borderBottomWidth: variables.borderWidth 143 | }, 144 | borderBottomWidth: null, 145 | paddingVertical: variables.cardItemPadding + 5 146 | }, 147 | ".footer": { 148 | "NativeBase.Text": { 149 | fontSize: 16, 150 | fontWeight: platform === "ios" ? "600" : "500" 151 | }, 152 | ".bordered": { 153 | "NativeBase.Text": { 154 | color: variables.brandPrimary, 155 | fontWeight: platform === "ios" ? "600" : "500" 156 | }, 157 | borderTopWidth: variables.borderWidth 158 | }, 159 | borderBottomWidth: null 160 | }, 161 | "NativeBase.Text": { 162 | ".note": { 163 | color: variables.listNoteColor, 164 | fontWeight: "200" 165 | } 166 | }, 167 | "NativeBase.Icon": { 168 | width: variables.iconFontSize + 5, 169 | fontSize: variables.iconFontSize - 2 170 | }, 171 | "NativeBase.IconNB": { 172 | width: variables.iconFontSize + 5, 173 | fontSize: variables.iconFontSize - 2 174 | }, 175 | ".bordered": { 176 | borderBottomWidth: StyleSheet.hairlineWidth, 177 | borderColor: variables.cardBorderColor 178 | }, 179 | ".first": { 180 | borderTopLeftRadius: variables.cardBorderRadius, 181 | borderTopRightRadius: variables.cardBorderRadius 182 | }, 183 | ".last": { 184 | borderBottomLeftRadius: variables.cardBorderRadius, 185 | borderBottomRightRadius: variables.cardBorderRadius 186 | }, 187 | flexDirection: "row", 188 | alignItems: "center", 189 | borderRadius: variables.cardBorderRadius, 190 | padding: variables.cardItemPadding + 5, 191 | paddingVertical: variables.cardItemPadding, 192 | backgroundColor: variables.cardDefaultBg 193 | }; 194 | 195 | return cardItemTheme; 196 | }; 197 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/CheckBox.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const checkBoxTheme = { 7 | ".checked": { 8 | "NativeBase.Icon": { 9 | color: variables.checkboxTickColor 10 | }, 11 | "NativeBase.IconNB": { 12 | color: variables.checkboxTickColor 13 | } 14 | }, 15 | "NativeBase.Icon": { 16 | color: "transparent", 17 | lineHeight: variables.CheckboxIconSize, 18 | marginTop: variables.CheckboxIconMarginTop, 19 | fontSize: variables.CheckboxFontSize 20 | }, 21 | "NativeBase.IconNB": { 22 | color: "transparent", 23 | lineHeight: variables.CheckboxIconSize, 24 | marginTop: variables.CheckboxIconMarginTop, 25 | fontSize: variables.CheckboxFontSize 26 | }, 27 | borderRadius: variables.CheckboxRadius, 28 | overflow: "hidden", 29 | width: variables.checkboxSize, 30 | height: variables.checkboxSize, 31 | borderWidth: variables.CheckboxBorderWidth, 32 | paddingLeft: variables.CheckboxPaddingLeft - 1, 33 | paddingBottom: variables.CheckboxPaddingBottom, 34 | left: 10 35 | }; 36 | 37 | return checkBoxTheme; 38 | }; 39 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Container.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform, Dimensions } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | const deviceHeight = Dimensions.get("window").height; 8 | export default (variables /*: * */ = variable) => { 9 | const theme = { 10 | flex: 1, 11 | height: Platform.OS === "ios" ? deviceHeight : deviceHeight - 20, 12 | backgroundColor: variables.containerBgColor 13 | }; 14 | 15 | return theme; 16 | }; 17 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Content.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const contentTheme = { 7 | flex: 1, 8 | backgroundColor: "transparent", 9 | "NativeBase.Segment": { 10 | borderWidth: 0, 11 | backgroundColor: "transparent" 12 | } 13 | }; 14 | 15 | return contentTheme; 16 | }; 17 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Fab.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platform = variables.platform; 7 | 8 | const fabTheme = { 9 | "NativeBase.Button": { 10 | alignItems: "center", 11 | padding: null, 12 | justifyContent: "center", 13 | "NativeBase.Icon": { 14 | alignSelf: "center", 15 | fontSize: 20, 16 | marginLeft: 0, 17 | marginRight: 0, 18 | }, 19 | "NativeBase.IconNB": { 20 | alignSelf: "center", 21 | fontSize: 20, 22 | marginLeft: 0, 23 | marginRight: 0, 24 | }, 25 | }, 26 | }; 27 | 28 | return fabTheme; 29 | }; 30 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Footer.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platformStyle = variables.platformStyle; 7 | const platform = variables.platform; 8 | 9 | const iconCommon = { 10 | "NativeBase.Icon": { 11 | color: variables.tabBarActiveTextColor 12 | } 13 | }; 14 | const iconNBCommon = { 15 | "NativeBase.IconNB": { 16 | color: variables.tabBarActiveTextColor 17 | } 18 | }; 19 | const textCommon = { 20 | "NativeBase.Text": { 21 | color: variables.tabBarActiveTextColor 22 | } 23 | }; 24 | const footerTheme = { 25 | "NativeBase.Left": { 26 | "NativeBase.Button": { 27 | ".transparent": { 28 | backgroundColor: "transparent", 29 | borderColor: null, 30 | elevation: 0, 31 | shadowColor: null, 32 | shadowOffset: null, 33 | shadowRadius: null, 34 | shadowOpacity: null, 35 | ...iconCommon, 36 | ...iconNBCommon, 37 | ...textCommon 38 | }, 39 | alignSelf: null, 40 | ...iconCommon, 41 | ...iconNBCommon, 42 | // ...textCommon 43 | }, 44 | flex: 1, 45 | alignSelf: "center", 46 | alignItems: "flex-start" 47 | }, 48 | "NativeBase.Body": { 49 | flex: 1, 50 | alignItems: "center", 51 | alignSelf: "center", 52 | flexDirection: "row", 53 | "NativeBase.Button": { 54 | alignSelf: "center", 55 | ".transparent": { 56 | backgroundColor: "transparent", 57 | borderColor: null, 58 | elevation: 0, 59 | shadowColor: null, 60 | shadowOffset: null, 61 | shadowRadius: null, 62 | shadowOpacity: null, 63 | ...iconCommon, 64 | ...iconNBCommon, 65 | ...textCommon 66 | }, 67 | ".full": { 68 | height: variables.footerHeight, 69 | paddingBottom: variables.footerPaddingBottom, 70 | flex: 1 71 | }, 72 | ...iconCommon, 73 | ...iconNBCommon, 74 | // ...textCommon 75 | } 76 | }, 77 | "NativeBase.Right": { 78 | "NativeBase.Button": { 79 | ".transparent": { 80 | backgroundColor: "transparent", 81 | borderColor: null, 82 | elevation: 0, 83 | shadowColor: null, 84 | shadowOffset: null, 85 | shadowRadius: null, 86 | shadowOpacity: null, 87 | ...iconCommon, 88 | ...iconNBCommon, 89 | ...textCommon 90 | }, 91 | alignSelf: null, 92 | ...iconCommon, 93 | ...iconNBCommon, 94 | // ...textCommon 95 | }, 96 | flex: 1, 97 | alignSelf: "center", 98 | alignItems: "flex-end" 99 | }, 100 | backgroundColor: variables.footerDefaultBg, 101 | flexDirection: "row", 102 | justifyContent: "center", 103 | borderTopWidth: 104 | platform === "ios" && platformStyle !== "material" 105 | ? variables.borderWidth 106 | : undefined, 107 | borderColor: 108 | platform === "ios" && platformStyle !== "material" 109 | ? "#cbcbcb" 110 | : undefined, 111 | height: variables.footerHeight, 112 | paddingBottom: variables.footerPaddingBottom, 113 | elevation: 3, 114 | left: 0, 115 | right: 0 116 | }; 117 | return footerTheme; 118 | }; 119 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/FooterTab.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | export default (variables /*: * */ = variable) => { 8 | const platform = variables.platform; 9 | 10 | const footerTabTheme = { 11 | "NativeBase.Button": { 12 | ".active": { 13 | "NativeBase.Text": { 14 | color: variables.tabBarActiveTextColor, 15 | fontSize: variables.tabBarTextSize, 16 | lineHeight: 16 17 | }, 18 | "NativeBase.Icon": { 19 | color: variables.tabBarActiveTextColor 20 | }, 21 | "NativeBase.IconNB": { 22 | color: variables.tabBarActiveTextColor 23 | }, 24 | backgroundColor: variables.tabActiveBgColor 25 | }, 26 | flexDirection: null, 27 | backgroundColor: "transparent", 28 | borderColor: null, 29 | elevation: 0, 30 | shadowColor: null, 31 | shadowOffset: null, 32 | shadowRadius: null, 33 | shadowOpacity: null, 34 | alignSelf: "center", 35 | flex: 1, 36 | height: variables.footerHeight, 37 | justifyContent: "center", 38 | ".badge": { 39 | "NativeBase.Badge": { 40 | "NativeBase.Text": { 41 | fontSize: 11, 42 | fontWeight: platform === "ios" ? "600" : undefined, 43 | lineHeight: 14 44 | }, 45 | top: -3, 46 | alignSelf: "center", 47 | left: 10, 48 | zIndex: 99, 49 | height: 18, 50 | padding: 1.7, 51 | paddingHorizontal: 3 52 | }, 53 | "NativeBase.Icon": { 54 | marginTop: -18 55 | } 56 | }, 57 | "NativeBase.Icon": { 58 | color: variables.tabBarTextColor 59 | }, 60 | "NativeBase.IconNB": { 61 | color: variables.tabBarTextColor 62 | }, 63 | "NativeBase.Text": { 64 | color: variables.tabBarTextColor, 65 | fontSize: variables.tabBarTextSize, 66 | lineHeight: 16 67 | } 68 | }, 69 | backgroundColor: Platform.OS === "android" 70 | ? variables.footerDefaultBg 71 | : undefined, 72 | flexDirection: "row", 73 | justifyContent: "space-between", 74 | flex: 1, 75 | alignSelf: "stretch" 76 | }; 77 | 78 | return footerTabTheme; 79 | }; 80 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Form.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platform = variables.platform; 7 | 8 | const theme = { 9 | "NativeBase.Item": { 10 | ".fixedLabel": { 11 | "NativeBase.Label": { 12 | paddingLeft: null 13 | }, 14 | marginLeft: 15 15 | }, 16 | ".inlineLabel": { 17 | "NativeBase.Label": { 18 | paddingLeft: null 19 | }, 20 | marginLeft: 15 21 | }, 22 | ".placeholderLabel": { 23 | "NativeBase.Input": {} 24 | }, 25 | ".stackedLabel": { 26 | "NativeBase.Label": { 27 | top: 5, 28 | paddingLeft: null 29 | }, 30 | "NativeBase.Input": { 31 | paddingLeft: null, 32 | marginLeft: null 33 | }, 34 | "NativeBase.Icon": { 35 | marginTop: 36 36 | }, 37 | marginLeft: 15 38 | }, 39 | ".floatingLabel": { 40 | "NativeBase.Input": { 41 | paddingLeft: null, 42 | top: 10, 43 | marginLeft: null 44 | }, 45 | "NativeBase.Label": { 46 | left: 0, 47 | top: 6 48 | }, 49 | "NativeBase.Icon": { 50 | top: 6 51 | }, 52 | marginTop: 15, 53 | marginLeft: 15 54 | }, 55 | ".regular": { 56 | "NativeBase.Label": { 57 | left: 0 58 | }, 59 | marginLeft: 0 60 | }, 61 | ".rounded": { 62 | "NativeBase.Label": { 63 | left: 0 64 | }, 65 | marginLeft: 0 66 | }, 67 | ".underline": { 68 | "NativeBase.Label": { 69 | left: 0, 70 | top: 0, 71 | position: "relative" 72 | }, 73 | "NativeBase.Input": { 74 | left: -15 75 | }, 76 | marginLeft: 15 77 | }, 78 | ".last": { 79 | marginLeft: 0, 80 | paddingLeft: 15 81 | }, 82 | "NativeBase.Label": { 83 | paddingRight: 5 84 | }, 85 | marginLeft: 15 86 | } 87 | }; 88 | 89 | return theme; 90 | }; 91 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/H1.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const h1Theme = { 7 | color: variables.textColor, 8 | fontSize: variables.fontSizeH1, 9 | lineHeight: variables.lineHeightH1, 10 | }; 11 | 12 | return h1Theme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/H2.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const h2Theme = { 7 | color: variables.textColor, 8 | fontSize: variables.fontSizeH2, 9 | lineHeight: variables.lineHeightH2, 10 | }; 11 | 12 | return h2Theme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/H3.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const h3Theme = { 7 | color: variables.textColor, 8 | fontSize: variables.fontSizeH3, 9 | lineHeight: variables.lineHeightH3 10 | }; 11 | 12 | return h3Theme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Icon.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const iconTheme = { 7 | fontSize: variables.iconFontSize, 8 | color: "#000" 9 | }; 10 | 11 | return iconTheme; 12 | }; 13 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Input.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const inputTheme = { 7 | '.multiline': { 8 | height: null, 9 | }, 10 | height: variables.inputHeightBase, 11 | color: variables.inputColor, 12 | paddingLeft: 5, 13 | paddingRight: 5, 14 | flex: 1, 15 | fontSize: variables.inputFontSize 16 | }; 17 | 18 | return inputTheme; 19 | }; 20 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/InputGroup.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const inputGroupTheme = { 7 | "NativeBase.Icon": { 8 | fontSize: 24, 9 | color: variables.sTabBarActiveTextColor, 10 | paddingHorizontal: 5 11 | }, 12 | "NativeBase.IconNB": { 13 | fontSize: 24, 14 | color: variables.sTabBarActiveTextColor, 15 | paddingHorizontal: 5 16 | }, 17 | "NativeBase.Input": { 18 | height: variables.inputHeightBase, 19 | color: variables.inputColor, 20 | paddingLeft: 5, 21 | paddingRight: 5, 22 | flex: 1, 23 | fontSize: variables.inputFontSize, 24 | lineHeight: variables.inputLineHeight 25 | }, 26 | ".underline": { 27 | ".success": { 28 | borderColor: variables.inputSuccessBorderColor 29 | }, 30 | ".error": { 31 | borderColor: variables.inputErrorBorderColor 32 | }, 33 | paddingLeft: 5, 34 | borderWidth: variables.borderWidth, 35 | borderTopWidth: 0, 36 | borderRightWidth: 0, 37 | borderLeftWidth: 0, 38 | borderColor: variables.inputBorderColor 39 | }, 40 | ".regular": { 41 | ".success": { 42 | borderColor: variables.inputSuccessBorderColor 43 | }, 44 | ".error": { 45 | borderColor: variables.inputErrorBorderColor 46 | }, 47 | paddingLeft: 5, 48 | borderWidth: variables.borderWidth, 49 | borderColor: variables.inputBorderColor 50 | }, 51 | ".rounded": { 52 | ".success": { 53 | borderColor: variables.inputSuccessBorderColor 54 | }, 55 | ".error": { 56 | borderColor: variables.inputErrorBorderColor 57 | }, 58 | paddingLeft: 5, 59 | borderWidth: variables.borderWidth, 60 | borderRadius: variables.inputGroupRoundedBorderRadius, 61 | borderColor: variables.inputBorderColor 62 | }, 63 | 64 | ".success": { 65 | "NativeBase.Icon": { 66 | color: variables.inputSuccessBorderColor 67 | }, 68 | "NativeBase.IconNB": { 69 | color: variables.inputSuccessBorderColor 70 | }, 71 | ".rounded": { 72 | borderRadius: 30, 73 | borderColor: variables.inputSuccessBorderColor 74 | }, 75 | ".regular": { 76 | borderColor: variables.inputSuccessBorderColor 77 | }, 78 | ".underline": { 79 | borderWidth: variables.borderWidth, 80 | borderTopWidth: 0, 81 | borderRightWidth: 0, 82 | borderLeftWidth: 0, 83 | borderColor: variables.inputSuccessBorderColor 84 | }, 85 | borderColor: variables.inputSuccessBorderColor 86 | }, 87 | 88 | ".error": { 89 | "NativeBase.Icon": { 90 | color: variables.inputErrorBorderColor 91 | }, 92 | "NativeBase.IconNB": { 93 | color: variables.inputErrorBorderColor 94 | }, 95 | ".rounded": { 96 | borderRadius: 30, 97 | borderColor: variables.inputErrorBorderColor 98 | }, 99 | ".regular": { 100 | borderColor: variables.inputErrorBorderColor 101 | }, 102 | ".underline": { 103 | borderWidth: variables.borderWidth, 104 | borderTopWidth: 0, 105 | borderRightWidth: 0, 106 | borderLeftWidth: 0, 107 | borderColor: variables.inputErrorBorderColor 108 | }, 109 | borderColor: variables.inputErrorBorderColor 110 | }, 111 | ".disabled": { 112 | "NativeBase.Icon": { 113 | color: "#384850" 114 | }, 115 | "NativeBase.IconNB": { 116 | color: "#384850" 117 | } 118 | }, 119 | 120 | paddingLeft: 5, 121 | borderWidth: variables.borderWidth, 122 | borderTopWidth: 0, 123 | borderRightWidth: 0, 124 | borderLeftWidth: 0, 125 | borderColor: variables.inputBorderColor, 126 | backgroundColor: "transparent", 127 | flexDirection: "row", 128 | alignItems: "center" 129 | }; 130 | 131 | return inputGroupTheme; 132 | }; 133 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Item.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | export default (variables /*: * */ = variable) => { 8 | const itemTheme = { 9 | ".floatingLabel": { 10 | "NativeBase.Input": { 11 | height: 50, 12 | top: 8, 13 | paddingTop: 3, 14 | paddingBottom: 7, 15 | ".multiline": { 16 | minHeight: variables.inputHeightBase, 17 | paddingTop: Platform.OS === "ios" ? 10 : 3, 18 | paddingBottom: Platform.OS === "ios" ? 14 : 10 19 | } 20 | }, 21 | "NativeBase.Label": { 22 | paddingTop: 5 23 | }, 24 | "NativeBase.Icon": { 25 | top: 6, 26 | paddingTop: 8 27 | }, 28 | "NativeBase.IconNB": { 29 | top: 6, 30 | paddingTop: 8 31 | } 32 | }, 33 | ".fixedLabel": { 34 | "NativeBase.Label": { 35 | position: null, 36 | top: null, 37 | left: null, 38 | right: null, 39 | flex: 1, 40 | height: null, 41 | width: null, 42 | fontSize: variables.inputFontSize 43 | }, 44 | "NativeBase.Input": { 45 | flex: 2, 46 | fontSize: variables.inputFontSize 47 | } 48 | }, 49 | ".stackedLabel": { 50 | "NativeBase.Label": { 51 | position: null, 52 | top: null, 53 | left: null, 54 | right: null, 55 | paddingTop: 5, 56 | alignSelf: "flex-start", 57 | fontSize: variables.inputFontSize - 2 58 | }, 59 | "NativeBase.Icon": { 60 | marginTop: 36 61 | }, 62 | "NativeBase.Input": { 63 | alignSelf: Platform.OS === "ios" ? "stretch" : "flex-start", 64 | flex: 1, 65 | width: Platform.OS === "ios" ? null : variables.deviceWidth - 25, 66 | fontSize: variables.inputFontSize, 67 | lineHeight: variables.inputLineHeight - 6, 68 | ".secureTextEntry": { 69 | fontSize: variables.inputFontSize - 4 70 | }, 71 | ".multiline": { 72 | paddingTop: Platform.OS === "ios" ? 9 : undefined, 73 | paddingBottom: Platform.OS === "ios" ? 9 : undefined 74 | } 75 | }, 76 | flexDirection: null, 77 | minHeight: variables.inputHeightBase + 15 78 | }, 79 | ".inlineLabel": { 80 | "NativeBase.Label": { 81 | position: null, 82 | top: null, 83 | left: null, 84 | right: null, 85 | paddingRight: 20, 86 | height: null, 87 | width: null, 88 | fontSize: variables.inputFontSize 89 | }, 90 | "NativeBase.Input": { 91 | paddingLeft: 5, 92 | fontSize: variables.inputFontSize 93 | }, 94 | flexDirection: "row" 95 | }, 96 | "NativeBase.Label": { 97 | fontSize: variables.inputFontSize, 98 | color: variables.inputColorPlaceholder, 99 | paddingRight: 5 100 | }, 101 | "NativeBase.Icon": { 102 | fontSize: 24, 103 | paddingRight: 8 104 | }, 105 | "NativeBase.IconNB": { 106 | fontSize: 24, 107 | paddingRight: 8 108 | }, 109 | "NativeBase.Input": { 110 | ".multiline": { 111 | height: null 112 | }, 113 | height: variables.inputHeightBase, 114 | color: variables.inputColor, 115 | flex: 1, 116 | top: Platform.OS === "ios" ? 1.5 : undefined, 117 | fontSize: variables.inputFontSize 118 | }, 119 | ".underline": { 120 | "NativeBase.Input": { 121 | paddingLeft: 15 122 | }, 123 | ".success": { 124 | borderColor: variables.inputSuccessBorderColor 125 | }, 126 | ".error": { 127 | borderColor: variables.inputErrorBorderColor 128 | }, 129 | borderWidth: variables.borderWidth * 2, 130 | borderTopWidth: 0, 131 | borderRightWidth: 0, 132 | borderLeftWidth: 0, 133 | borderColor: variables.inputBorderColor 134 | }, 135 | ".regular": { 136 | "NativeBase.Input": { 137 | paddingLeft: 8 138 | }, 139 | "NativeBase.Icon": { 140 | paddingLeft: 10 141 | }, 142 | ".success": { 143 | borderColor: variables.inputSuccessBorderColor 144 | }, 145 | ".error": { 146 | borderColor: variables.inputErrorBorderColor 147 | }, 148 | borderWidth: variables.borderWidth * 2, 149 | borderColor: variables.inputBorderColor 150 | }, 151 | ".rounded": { 152 | "NativeBase.Input": { 153 | paddingLeft: 8 154 | }, 155 | "NativeBase.Icon": { 156 | paddingLeft: 10 157 | }, 158 | ".success": { 159 | borderColor: variables.inputSuccessBorderColor 160 | }, 161 | ".error": { 162 | borderColor: variables.inputErrorBorderColor 163 | }, 164 | borderWidth: variables.borderWidth * 2, 165 | borderRadius: 30, 166 | borderColor: variables.inputBorderColor 167 | }, 168 | 169 | ".success": { 170 | "NativeBase.Icon": { 171 | color: variables.inputSuccessBorderColor 172 | }, 173 | "NativeBase.IconNB": { 174 | color: variables.inputSuccessBorderColor 175 | }, 176 | ".rounded": { 177 | borderRadius: 30, 178 | borderColor: variables.inputSuccessBorderColor 179 | }, 180 | ".regular": { 181 | borderColor: variables.inputSuccessBorderColor 182 | }, 183 | ".underline": { 184 | borderWidth: variables.borderWidth * 2, 185 | borderTopWidth: 0, 186 | borderRightWidth: 0, 187 | borderLeftWidth: 0, 188 | borderColor: variables.inputSuccessBorderColor 189 | }, 190 | borderColor: variables.inputSuccessBorderColor 191 | }, 192 | 193 | ".error": { 194 | "NativeBase.Icon": { 195 | color: variables.inputErrorBorderColor 196 | }, 197 | "NativeBase.IconNB": { 198 | color: variables.inputErrorBorderColor 199 | }, 200 | ".rounded": { 201 | borderRadius: 30, 202 | borderColor: variables.inputErrorBorderColor 203 | }, 204 | ".regular": { 205 | borderColor: variables.inputErrorBorderColor 206 | }, 207 | ".underline": { 208 | borderWidth: variables.borderWidth * 2, 209 | borderTopWidth: 0, 210 | borderRightWidth: 0, 211 | borderLeftWidth: 0, 212 | borderColor: variables.inputErrorBorderColor 213 | }, 214 | borderColor: variables.inputErrorBorderColor 215 | }, 216 | ".disabled": { 217 | "NativeBase.Icon": { 218 | color: "#384850" 219 | }, 220 | "NativeBase.IconNB": { 221 | color: "#384850" 222 | } 223 | }, 224 | ".picker": { 225 | marginLeft: 0 226 | }, 227 | 228 | borderWidth: variables.borderWidth * 2, 229 | borderTopWidth: 0, 230 | borderRightWidth: 0, 231 | borderLeftWidth: 0, 232 | borderColor: variables.inputBorderColor, 233 | backgroundColor: "transparent", 234 | flexDirection: "row", 235 | alignItems: "center", 236 | marginLeft: 2 237 | }; 238 | 239 | return itemTheme; 240 | }; 241 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Label.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const labelTheme = { 7 | ".focused": { 8 | width: 0 9 | }, 10 | fontSize: 17 11 | }; 12 | 13 | return labelTheme; 14 | }; 15 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Left.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const leftTheme = { 7 | flex: 1, 8 | alignSelf: 'center', 9 | alignItems: 'flex-start', 10 | }; 11 | 12 | return leftTheme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Picker.android.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const pickerTheme = { 7 | ".note": { 8 | color: "#8F8E95" 9 | }, 10 | // width: 90, 11 | marginRight: -4, 12 | flexGrow: 1 13 | }; 14 | 15 | return pickerTheme; 16 | }; 17 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Picker.ios.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const pickerTheme = {}; 7 | 8 | return pickerTheme; 9 | }; 10 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Picker.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const pickerTheme = { 7 | ".note": { 8 | color: "#8F8E95" 9 | }, 10 | // width: 90, 11 | marginRight: -4, 12 | flexGrow: 1 13 | }; 14 | 15 | return pickerTheme; 16 | }; 17 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Radio.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | export default (variables /*: * */ = variable) => { 8 | const radioTheme = { 9 | ".selected": { 10 | "NativeBase.IconNB": { 11 | color: Platform.OS === "ios" 12 | ? variables.radioColor 13 | : variables.radioSelectedColorAndroid, 14 | lineHeight: Platform.OS === "ios" ? 25 : variables.radioBtnLineHeight, 15 | height: Platform.OS === "ios" ? 20 : undefined 16 | } 17 | }, 18 | "NativeBase.IconNB": { 19 | color: Platform.OS === "ios" ? "transparent" : undefined, 20 | lineHeight: Platform.OS === "ios" 21 | ? undefined 22 | : variables.radioBtnLineHeight, 23 | fontSize: Platform.OS === "ios" ? undefined : variables.radioBtnSize 24 | } 25 | }; 26 | 27 | return radioTheme; 28 | }; 29 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Right.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const rightTheme = { 7 | 'NativeBase.Button': { 8 | alignSelf: null, 9 | }, 10 | flex: 1, 11 | alignSelf: 'center', 12 | alignItems: 'flex-end', 13 | }; 14 | 15 | return rightTheme; 16 | }; 17 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Segment.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platform = variables.platform; 7 | 8 | const segmentTheme = { 9 | height: 45, 10 | borderColor: variables.segmentBorderColorMain, 11 | flexDirection: "row", 12 | justifyContent: "center", 13 | backgroundColor: variables.segmentBackgroundColor, 14 | "NativeBase.Button": { 15 | alignSelf: "center", 16 | borderRadius: 0, 17 | paddingTop: 3, 18 | paddingBottom: 3, 19 | height: 30, 20 | backgroundColor: "transparent", 21 | borderWidth: 1, 22 | borderLeftWidth: 0, 23 | borderColor: variables.segmentBorderColor, 24 | elevation: 0, 25 | ".active": { 26 | backgroundColor: variables.segmentActiveBackgroundColor, 27 | "NativeBase.Text": { 28 | color: variables.segmentActiveTextColor 29 | }, 30 | "NativeBase.Icon": { 31 | color: variables.segmentActiveTextColor 32 | } 33 | }, 34 | ".first": { 35 | borderTopLeftRadius: platform === "ios" ? 5 : undefined, 36 | borderBottomLeftRadius: platform === "ios" ? 5 : undefined, 37 | borderLeftWidth: 1 38 | }, 39 | ".last": { 40 | borderTopRightRadius: platform === "ios" ? 5 : undefined, 41 | borderBottomRightRadius: platform === "ios" ? 5 : undefined 42 | }, 43 | "NativeBase.Text": { 44 | color: variables.segmentTextColor, 45 | fontSize: 14 46 | }, 47 | "NativeBase.Icon": { 48 | fontSize: 22, 49 | paddingTop: 0, 50 | color: variables.segmentTextColor 51 | } 52 | } 53 | }; 54 | 55 | return segmentTheme; 56 | }; 57 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Separator.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const theme = { 7 | '.group': { 8 | height: 50, 9 | paddingVertical: variables.listItemPadding - 8, 10 | paddingTop: variables.listItemPadding + 12, 11 | '.bordered': { 12 | height: 50, 13 | paddingVertical: variables.listItemPadding - 8, 14 | paddingTop: variables.listItemPadding + 12, 15 | }, 16 | }, 17 | '.bordered': { 18 | '.noTopBorder': { 19 | borderTopWidth: 0, 20 | }, 21 | '.noBottomBorder': { 22 | borderBottomWidth: 0, 23 | }, 24 | height: 35, 25 | paddingTop: variables.listItemPadding + 2, 26 | paddingBottom: variables.listItemPadding, 27 | borderBottomWidth: variables.borderWidth, 28 | borderTopWidth: variables.borderWidth, 29 | borderColor: variables.listBorderColor, 30 | }, 31 | 'NativeBase.Text': { 32 | fontSize: variables.tabBarTextSize - 2, 33 | color: '#777', 34 | }, 35 | '.noTopBorder': { 36 | borderTopWidth: 0, 37 | }, 38 | '.noBottomBorder': { 39 | borderBottomWidth: 0, 40 | }, 41 | height: 38, 42 | backgroundColor: '#F0EFF5', 43 | flex: 1, 44 | justifyContent: 'center', 45 | paddingLeft: variables.listItemPadding + 5, 46 | }; 47 | 48 | return theme; 49 | }; 50 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Spinner.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const spinnerTheme = { 7 | height: 80 8 | }; 9 | 10 | return spinnerTheme; 11 | }; 12 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Subtitle.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | export default (variables /*: * */ = variable) => { 8 | const subtitleTheme = { 9 | fontSize: variables.subTitleFontSize, 10 | fontFamily: variables.titleFontfamily, 11 | color: variables.subtitleColor, 12 | textAlign: "center", 13 | paddingLeft: Platform.OS === "ios" ? 4 : 0, 14 | marginLeft: Platform.OS === "ios" ? undefined : -3 15 | }; 16 | 17 | return subtitleTheme; 18 | }; 19 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/SwipeRow.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const swipeRowTheme = { 7 | "NativeBase.ListItem": { 8 | ".list": { 9 | backgroundColor: "#FFF", 10 | }, 11 | marginLeft: 0, 12 | }, 13 | "NativeBase.Left": { 14 | flex: 0, 15 | alignSelf: null, 16 | alignItems: null, 17 | "NativeBase.Button": { 18 | flex: 1, 19 | alignItems: "center", 20 | justifyContent: "center", 21 | alignSelf: "stretch", 22 | borderRadius: 0, 23 | }, 24 | }, 25 | "NativeBase.Right": { 26 | flex: 0, 27 | alignSelf: null, 28 | alignItems: null, 29 | "NativeBase.Button": { 30 | flex: 1, 31 | alignItems: "center", 32 | justifyContent: "center", 33 | alignSelf: "stretch", 34 | borderRadius: 0, 35 | }, 36 | }, 37 | "NativeBase.Button": { 38 | flex: 1, 39 | height: null, 40 | alignItems: "center", 41 | justifyContent: "center", 42 | alignSelf: "stretch", 43 | borderRadius: 0, 44 | }, 45 | }; 46 | 47 | return swipeRowTheme; 48 | }; 49 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Switch.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const switchTheme = { 7 | marginVertical: -5, 8 | }; 9 | 10 | return switchTheme; 11 | }; 12 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Tab.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const tabTheme = { 7 | flex: 1, 8 | backgroundColor: "#FFF" 9 | }; 10 | 11 | return tabTheme; 12 | }; 13 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/TabBar.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const tabBarTheme = { 7 | ".tabIcon": { 8 | height: undefined 9 | }, 10 | ".vertical": { 11 | height: 60 12 | }, 13 | "NativeBase.Button": { 14 | ".transparent": { 15 | "NativeBase.Text": { 16 | fontSize: variables.tabFontSize, 17 | color: variables.sTabBarActiveTextColor, 18 | fontWeight: "400" 19 | }, 20 | "NativeBase.IconNB": { 21 | color: variables.sTabBarActiveTextColor 22 | } 23 | }, 24 | "NativeBase.IconNB": { 25 | color: variables.sTabBarActiveTextColor 26 | }, 27 | "NativeBase.Text": { 28 | fontSize: variables.tabFontSize, 29 | color: variables.sTabBarActiveTextColor, 30 | fontWeight: "400" 31 | }, 32 | ".isTabActive": { 33 | "NativeBase.Text": { 34 | fontWeight: "900" 35 | } 36 | }, 37 | flex: 1, 38 | alignSelf: "stretch", 39 | alignItems: "center", 40 | justifyContent: "center", 41 | borderRadius: null, 42 | borderBottomColor: "transparent", 43 | backgroundColor: variables.tabBgColor 44 | }, 45 | height: 45, 46 | flexDirection: "row", 47 | justifyContent: "space-around", 48 | borderWidth: 1, 49 | borderTopWidth: 0, 50 | borderLeftWidth: 0, 51 | borderRightWidth: 0, 52 | borderBottomColor: "#ccc", 53 | backgroundColor: variables.tabBgColor 54 | }; 55 | 56 | return tabBarTheme; 57 | }; 58 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/TabContainer.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | import { Platform } from "react-native"; 5 | 6 | export default (variables /*: * */ = variable) => { 7 | const platformStyle = variables.platformStyle; 8 | const platform = variables.platform; 9 | 10 | const tabContainerTheme = { 11 | elevation: 3, 12 | height: 50, 13 | flexDirection: "row", 14 | shadowColor: platformStyle === "material" ? "#000" : undefined, 15 | shadowOffset: platformStyle === "material" 16 | ? { width: 0, height: 2 } 17 | : undefined, 18 | shadowOpacity: platformStyle === "material" ? 0.2 : undefined, 19 | shadowRadius: platformStyle === "material" ? 1.2 : undefined, 20 | justifyContent: "space-around", 21 | borderBottomWidth: Platform.OS === "ios" ? variables.borderWidth : 0, 22 | borderColor: variables.topTabBarBorderColor 23 | }; 24 | 25 | return tabContainerTheme; 26 | }; 27 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/TabHeading.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platform = variables.platform; 7 | 8 | const tabHeadingTheme = { 9 | flexDirection: "row", 10 | backgroundColor: variables.tabDefaultBg, 11 | flex: 1, 12 | alignItems: "center", 13 | justifyContent: "center", 14 | ".scrollable": { 15 | paddingHorizontal: 20, 16 | flex: platform === "android" ? 0 : 1, 17 | minWidth: platform === "android" ? undefined : 60 18 | }, 19 | "NativeBase.Text": { 20 | color: variables.topTabBarTextColor, 21 | marginHorizontal: 7 22 | }, 23 | "NativeBase.Icon": { 24 | color: variables.topTabBarTextColor, 25 | fontSize: platform === "ios" ? 26 : undefined 26 | }, 27 | ".active": { 28 | "NativeBase.Text": { 29 | color: variables.topTabBarActiveTextColor, 30 | fontWeight: "600" 31 | }, 32 | "NativeBase.Icon": { 33 | color: variables.topTabBarActiveTextColor 34 | } 35 | } 36 | }; 37 | 38 | return tabHeadingTheme; 39 | }; 40 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Text.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const textTheme = { 7 | fontSize: variables.DefaultFontSize, 8 | fontFamily: variables.fontFamily, 9 | color: variables.textColor, 10 | ".note": { 11 | color: "#a7a7a7", 12 | fontSize: variables.noteFontSize 13 | } 14 | }; 15 | 16 | return textTheme; 17 | }; 18 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Textarea.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const textAreaTheme = { 7 | ".underline": { 8 | borderBottomWidth: variables.borderWidth, 9 | marginTop: 5, 10 | borderColor: variables.inputBorderColor 11 | }, 12 | ".bordered": { 13 | borderWidth: 1, 14 | marginTop: 5, 15 | borderColor: variables.inputBorderColor 16 | }, 17 | color: variables.textColor, 18 | paddingLeft: 10, 19 | paddingRight: 5, 20 | fontSize: 15, 21 | textAlignVertical: "top" 22 | }; 23 | 24 | return textAreaTheme; 25 | }; 26 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Thumbnail.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from './../variables/platform'; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const thumbnailTheme = { 7 | '.square': { 8 | borderRadius: 0, 9 | '.small': { 10 | width: 36, 11 | height: 36, 12 | borderRadius: 0, 13 | }, 14 | '.large': { 15 | width: 80, 16 | height: 80, 17 | borderRadius: 0, 18 | }, 19 | }, 20 | '.small': { 21 | width: 36, 22 | height: 36, 23 | borderRadius: 18, 24 | '.square': { 25 | borderRadius: 0, 26 | }, 27 | }, 28 | '.large': { 29 | width: 80, 30 | height: 80, 31 | borderRadius: 40, 32 | '.square': { 33 | borderRadius: 0, 34 | }, 35 | }, 36 | width: 56, 37 | height: 56, 38 | borderRadius: 28, 39 | }; 40 | 41 | return thumbnailTheme; 42 | }; 43 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Title.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import { Platform } from "react-native"; 4 | 5 | import variable from "./../variables/platform"; 6 | 7 | export default (variables /*: * */ = variable) => { 8 | const titleTheme = { 9 | fontSize: variables.titleFontSize, 10 | fontFamily: variables.titleFontfamily, 11 | color: variables.titleFontColor, 12 | fontWeight: Platform.OS === "ios" ? "700" : undefined, 13 | textAlign: "center", 14 | paddingLeft: Platform.OS === "ios" ? 4 : 0, 15 | marginLeft: Platform.OS === "ios" ? undefined : -3, 16 | paddingTop: 1 17 | }; 18 | 19 | return titleTheme; 20 | }; 21 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/Toast.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const platform = variables.platform; 7 | 8 | const toastTheme = { 9 | ".danger": { 10 | backgroundColor: variables.brandDanger 11 | }, 12 | ".warning": { 13 | backgroundColor: variables.brandWarning 14 | }, 15 | ".success": { 16 | backgroundColor: variables.brandSuccess 17 | }, 18 | backgroundColor: "rgba(0,0,0,0.8)", 19 | borderRadius: platform === "ios" ? 5 : 0, 20 | flexDirection: "row", 21 | justifyContent: "space-between", 22 | alignItems: "center", 23 | padding: 10, 24 | minHeight: 50, 25 | "NativeBase.Text": { 26 | color: "#fff", 27 | flex: 1 28 | }, 29 | "NativeBase.Button": { 30 | backgroundColor: "transparent", 31 | height: 30, 32 | elevation: 0, 33 | "NativeBase.Text": { 34 | fontSize: 14 35 | } 36 | } 37 | }; 38 | 39 | return toastTheme; 40 | }; 41 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/View.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import variable from "./../variables/platform"; 4 | 5 | export default (variables /*: * */ = variable) => { 6 | const viewTheme = { 7 | ".padder": { 8 | padding: variables.contentPadding 9 | } 10 | }; 11 | 12 | return viewTheme; 13 | }; 14 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/components/index.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import _ from "lodash"; 4 | import bodyTheme from "./Body"; 5 | import leftTheme from "./Left"; 6 | import rightTheme from "./Right"; 7 | import headerTheme from "./Header"; 8 | import switchTheme from "./Switch"; 9 | import thumbnailTheme from "./Thumbnail"; 10 | import containerTheme from "./Container"; 11 | import contentTheme from "./Content"; 12 | import buttonTheme from "./Button"; 13 | import titleTheme from "./Title"; 14 | import subtitleTheme from "./Subtitle"; 15 | import inputGroupTheme from "./InputGroup"; 16 | import badgeTheme from "./Badge"; 17 | import checkBoxTheme from "./CheckBox"; 18 | import cardTheme from "./Card"; 19 | import radioTheme from "./Radio"; 20 | import h3Theme from "./H3"; 21 | import h2Theme from "./H2"; 22 | import h1Theme from "./H1"; 23 | import footerTheme from "./Footer"; 24 | import footerTabTheme from "./FooterTab"; 25 | import fabTheme from "./Fab"; 26 | import itemTheme from "./Item"; 27 | import labelTheme from "./Label"; 28 | import textAreaTheme from "./Textarea"; 29 | import textTheme from "./Text"; 30 | import toastTheme from "./Toast"; 31 | import tabTheme from "./Tab"; 32 | import tabBarTheme from "./TabBar"; 33 | import tabContainerTheme from "./TabContainer"; 34 | import viewTheme from "./View"; 35 | import tabHeadingTheme from "./TabHeading"; 36 | import iconTheme from "./Icon"; 37 | import inputTheme from "./Input"; 38 | import swipeRowTheme from "./SwipeRow"; 39 | import segmentTheme from "./Segment"; 40 | import spinnerTheme from "./Spinner"; 41 | import cardItemTheme from "./CardItem"; 42 | import listItemTheme from "./ListItem"; 43 | import formTheme from "./Form"; 44 | import separatorTheme from "./Separator"; 45 | import pickerTheme from "./Picker" 46 | import variable from "./../variables/platform"; 47 | 48 | export default (variables /*: * */ = variable) => { 49 | const theme = { 50 | variables, 51 | "NativeBase.Left": { 52 | ...leftTheme(variables) 53 | }, 54 | "NativeBase.Right": { 55 | ...rightTheme(variables) 56 | }, 57 | "NativeBase.Body": { 58 | ...bodyTheme(variables) 59 | }, 60 | 61 | "NativeBase.Header": { 62 | ...headerTheme(variables) 63 | }, 64 | 65 | "NativeBase.Button": { 66 | ...buttonTheme(variables) 67 | }, 68 | 69 | "NativeBase.Title": { 70 | ...titleTheme(variables) 71 | }, 72 | "NativeBase.Subtitle": { 73 | ...subtitleTheme(variables) 74 | }, 75 | 76 | "NativeBase.InputGroup": { 77 | ...inputGroupTheme(variables) 78 | }, 79 | 80 | "NativeBase.Input": { 81 | ...inputTheme(variables) 82 | }, 83 | 84 | "NativeBase.Badge": { 85 | ...badgeTheme(variables) 86 | }, 87 | 88 | "NativeBase.CheckBox": { 89 | ...checkBoxTheme(variables) 90 | }, 91 | 92 | "NativeBase.Radio": { 93 | ...radioTheme(variables) 94 | }, 95 | 96 | "NativeBase.Card": { 97 | ...cardTheme(variables) 98 | }, 99 | 100 | "NativeBase.CardItem": { 101 | ...cardItemTheme(variables) 102 | }, 103 | 104 | "NativeBase.Toast": { 105 | ...toastTheme(variables) 106 | }, 107 | 108 | "NativeBase.H1": { 109 | ...h1Theme(variables) 110 | }, 111 | "NativeBase.H2": { 112 | ...h2Theme(variables) 113 | }, 114 | "NativeBase.H3": { 115 | ...h3Theme(variables) 116 | }, 117 | "NativeBase.Form": { 118 | ...formTheme(variables) 119 | }, 120 | 121 | "NativeBase.Container": { 122 | ...containerTheme(variables) 123 | }, 124 | "NativeBase.Content": { 125 | ...contentTheme(variables) 126 | }, 127 | 128 | "NativeBase.Footer": { 129 | ...footerTheme(variables) 130 | }, 131 | 132 | "NativeBase.Tabs": { 133 | flex: 1 134 | }, 135 | 136 | "NativeBase.FooterTab": { 137 | ...footerTabTheme(variables) 138 | }, 139 | 140 | "NativeBase.ListItem": { 141 | ...listItemTheme(variables) 142 | }, 143 | 144 | "NativeBase.ListItem1": { 145 | ...listItemTheme(variables) 146 | }, 147 | 148 | "NativeBase.Icon": { 149 | ...iconTheme(variables) 150 | }, 151 | "NativeBase.IconNB": { 152 | ...iconTheme(variables) 153 | }, 154 | "NativeBase.Text": { 155 | ...textTheme(variables) 156 | }, 157 | "NativeBase.Spinner": { 158 | ...spinnerTheme(variables) 159 | }, 160 | 161 | "NativeBase.Fab": { 162 | ...fabTheme(variables) 163 | }, 164 | 165 | "NativeBase.Item": { 166 | ...itemTheme(variables) 167 | }, 168 | 169 | "NativeBase.Label": { 170 | ...labelTheme(variables) 171 | }, 172 | 173 | "NativeBase.Textarea": { 174 | ...textAreaTheme(variables) 175 | }, 176 | 177 | "NativeBase.PickerNB": { 178 | ...pickerTheme(variables), 179 | "NativeBase.Button": { 180 | "NativeBase.Text": {} 181 | } 182 | }, 183 | 184 | "NativeBase.Tab": { 185 | ...tabTheme(variables) 186 | }, 187 | 188 | "NativeBase.Segment": { 189 | ...segmentTheme(variables) 190 | }, 191 | 192 | "NativeBase.TabBar": { 193 | ...tabBarTheme(variables) 194 | }, 195 | "NativeBase.ViewNB": { 196 | ...viewTheme(variables) 197 | }, 198 | "NativeBase.TabHeading": { 199 | ...tabHeadingTheme(variables) 200 | }, 201 | "NativeBase.TabContainer": { 202 | ...tabContainerTheme(variables) 203 | }, 204 | "NativeBase.Switch": { 205 | ...switchTheme(variables) 206 | }, 207 | "NativeBase.Separator": { 208 | ...separatorTheme(variables) 209 | }, 210 | "NativeBase.SwipeRow": { 211 | ...swipeRowTheme(variables) 212 | }, 213 | "NativeBase.Thumbnail": { 214 | ...thumbnailTheme(variables) 215 | } 216 | }; 217 | 218 | const cssifyTheme = (grandparent, parent, parentKey) => { 219 | _.forEach(parent, (style, styleName) => { 220 | if ( 221 | styleName.indexOf(".") === 0 && 222 | parentKey && 223 | parentKey.indexOf(".") === 0 224 | ) { 225 | if (grandparent) { 226 | if (!grandparent[styleName]) { 227 | grandparent[styleName] = {}; 228 | } else { 229 | grandparent[styleName][parentKey] = style; 230 | } 231 | } 232 | } 233 | if (style && typeof style === "object" && styleName !== "fontVariant" && styleName !== "transform") { 234 | cssifyTheme(parent, style, styleName); 235 | } 236 | }); 237 | }; 238 | 239 | cssifyTheme(null, theme, null); 240 | 241 | return theme; 242 | }; 243 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/variables/commonColor.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import color from "color"; 4 | 5 | import { Platform, Dimensions, PixelRatio } from "react-native"; 6 | 7 | const deviceHeight = Dimensions.get("window").height; 8 | const deviceWidth = Dimensions.get("window").width; 9 | const platform = Platform.OS; 10 | const platformStyle = undefined; 11 | const isIphoneX = 12 | platform === "ios" && (deviceHeight === 812 || deviceWidth === 812 || deviceHeight === 896 || deviceWidth === 896); 13 | 14 | export default { 15 | platformStyle, 16 | platform, 17 | 18 | //Accordion 19 | headerStyle: "#edebed", 20 | iconStyle: "#000", 21 | contentStyle: "#f5f4f5", 22 | expandedIconStyle: "#000", 23 | accordionBorderColor: "#d3d3d3", 24 | 25 | //Android 26 | androidRipple: true, 27 | androidRippleColor: "rgba(256, 256, 256, 0.3)", 28 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)", 29 | btnUppercaseAndroidText: true, 30 | 31 | // Badge 32 | badgeBg: "#ED1727", 33 | badgeColor: "#fff", 34 | badgePadding: platform === "ios" ? 3 : 0, 35 | 36 | // Button 37 | btnFontFamily: platform === "ios" ? "System" : "Roboto_medium", 38 | btnDisabledBg: "#b5b5b5", 39 | buttonPadding: 6, 40 | get btnPrimaryBg() { 41 | return this.brandPrimary; 42 | }, 43 | get btnPrimaryColor() { 44 | return this.inverseTextColor; 45 | }, 46 | get btnInfoBg() { 47 | return this.brandInfo; 48 | }, 49 | get btnInfoColor() { 50 | return this.inverseTextColor; 51 | }, 52 | get btnSuccessBg() { 53 | return this.brandSuccess; 54 | }, 55 | get btnSuccessColor() { 56 | return this.inverseTextColor; 57 | }, 58 | get btnDangerBg() { 59 | return this.brandDanger; 60 | }, 61 | get btnDangerColor() { 62 | return this.inverseTextColor; 63 | }, 64 | get btnWarningBg() { 65 | return this.brandWarning; 66 | }, 67 | get btnWarningColor() { 68 | return this.inverseTextColor; 69 | }, 70 | get btnTextSize() { 71 | return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1; 72 | }, 73 | get btnTextSizeLarge() { 74 | return this.fontSizeBase * 1.5; 75 | }, 76 | get btnTextSizeSmall() { 77 | return this.fontSizeBase * 0.8; 78 | }, 79 | get borderRadiusLarge() { 80 | return this.fontSizeBase * 3.8; 81 | }, 82 | get iconSizeLarge() { 83 | return this.iconFontSize * 1.5; 84 | }, 85 | get iconSizeSmall() { 86 | return this.iconFontSize * 0.6; 87 | }, 88 | 89 | // Card 90 | cardDefaultBg: "#fff", 91 | cardBorderColor: "#ccc", 92 | cardBorderRadius: 2, 93 | cardItemPadding: platform === "ios" ? 10 : 12, 94 | 95 | // CheckBox 96 | CheckboxRadius: platform === "ios" ? 13 : 0, 97 | CheckboxBorderWidth: platform === "ios" ? 1 : 2, 98 | CheckboxPaddingLeft: platform === "ios" ? 4 : 2, 99 | CheckboxPaddingBottom: platform === "ios" ? 0 : 5, 100 | CheckboxIconSize: platform === "ios" ? 21 : 16, 101 | CheckboxIconMarginTop: platform === "ios" ? undefined : 1, 102 | CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17, 103 | checkboxBgColor: "#039BE5", 104 | checkboxSize: 20, 105 | checkboxTickColor: "#fff", 106 | 107 | // Color 108 | brandPrimary: platform === "ios" ? "#007aff" : "#3F51B5", 109 | brandInfo: "#62B1F6", 110 | brandSuccess: "#5cb85c", 111 | brandDanger: "#d9534f", 112 | brandWarning: "#f0ad4e", 113 | brandDark: "#000", 114 | brandLight: "#f4f4f4", 115 | 116 | //Container 117 | containerBgColor: "#fff", 118 | 119 | //Date Picker 120 | datePickerTextColor: "#000", 121 | datePickerBg: "transparent", 122 | 123 | // Font 124 | DefaultFontSize: 16, 125 | fontFamily: platform === "ios" ? "System" : "Roboto", 126 | fontSizeBase: 15, 127 | get fontSizeH1() { 128 | return this.fontSizeBase * 1.8; 129 | }, 130 | get fontSizeH2() { 131 | return this.fontSizeBase * 1.6; 132 | }, 133 | get fontSizeH3() { 134 | return this.fontSizeBase * 1.4; 135 | }, 136 | 137 | // Footer 138 | footerHeight: 55, 139 | footerDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 140 | footerPaddingBottom: 0, 141 | 142 | // FooterTab 143 | tabBarTextColor: platform === "ios" ? "#737373" : "#bfc6ea", 144 | tabBarTextSize: platform === "ios" ? 14 : 11, 145 | activeTab: platform === "ios" ? "#007aff" : "#fff", 146 | sTabBarActiveTextColor: "#007aff", 147 | tabBarActiveTextColor: platform === "ios" ? "#2874F0" : "#fff", 148 | tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", 149 | 150 | // Header 151 | toolbarBtnColor: platform === "ios" ? "#007aff" : "#fff", 152 | toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 153 | toolbarHeight: platform === "ios" ? 64 : 56, 154 | toolbarSearchIconSize: platform === "ios" ? 20 : 23, 155 | toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", 156 | searchBarHeight: platform === "ios" ? 30 : 40, 157 | searchBarInputHeight: platform === "ios" ? 30 : 50, 158 | toolbarBtnTextColor: platform === "ios" ? "#007aff" : "#fff", 159 | iosStatusbar: "dark-content", 160 | toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#3F51B5", 161 | get statusBarColor() { 162 | return color(this.toolbarDefaultBg) 163 | .darken(0.2) 164 | .hex(); 165 | }, 166 | get darkenHeader() { 167 | return color(this.tabBgColor) 168 | .darken(0.03) 169 | .hex(); 170 | }, 171 | 172 | // Icon 173 | iconFamily: "Ionicons", 174 | iconFontSize: platform === "ios" ? 30 : 28, 175 | iconHeaderSize: platform === "ios" ? 33 : 24, 176 | 177 | // InputGroup 178 | inputFontSize: 17, 179 | inputBorderColor: "#D9D5DC", 180 | inputSuccessBorderColor: "#2b8339", 181 | inputErrorBorderColor: "#ed2f2f", 182 | inputHeightBase: 50, 183 | get inputColor() { 184 | return this.textColor; 185 | }, 186 | get inputColorPlaceholder() { 187 | return "#575757"; 188 | }, 189 | 190 | // Line Height 191 | btnLineHeight: 19, 192 | lineHeightH1: 32, 193 | lineHeightH2: 27, 194 | lineHeightH3: 22, 195 | lineHeight: platform === "ios" ? 20 : 24, 196 | 197 | // List 198 | listBg: "transparent", 199 | listBorderColor: "#c9c9c9", 200 | listDividerBg: "#f4f4f4", 201 | listBtnUnderlayColor: "#DDD", 202 | listItemPadding: platform === "ios" ? 10 : 12, 203 | listNoteColor: "#808080", 204 | listNoteSize: 13, 205 | listItemSelected: platform === "ios" ? "#007aff" : "#3F51B5", 206 | 207 | // Progress Bar 208 | defaultProgressColor: "#E4202D", 209 | inverseProgressColor: "#1A191B", 210 | 211 | // Radio Button 212 | radioBtnSize: platform === "ios" ? 25 : 23, 213 | radioSelectedColorAndroid: "#3F51B5", 214 | radioBtnLineHeight: platform === "ios" ? 29 : 24, 215 | get radioColor() { 216 | return this.brandPrimary; 217 | }, 218 | 219 | // Segment 220 | segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5", 221 | segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff", 222 | segmentTextColor: platform === "ios" ? "#007aff" : "#fff", 223 | segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5", 224 | segmentBorderColor: platform === "ios" ? "#007aff" : "#fff", 225 | segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", 226 | 227 | // Spinner 228 | defaultSpinnerColor: "#45D56E", 229 | inverseSpinnerColor: "#1A191B", 230 | 231 | // Tab 232 | tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 233 | topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", 234 | topTabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff", 235 | topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", 236 | topTabBarActiveBorderColor: platform === "ios" ? "#007aff" : "#fff", 237 | 238 | // Tabs 239 | tabBgColor: "#F8F8F8", 240 | tabFontSize: 15, 241 | 242 | // Text 243 | textColor: "#000", 244 | inverseTextColor: "#fff", 245 | noteFontSize: 14, 246 | get defaultTextColor() { 247 | return this.textColor; 248 | }, 249 | 250 | // Title 251 | titleFontfamily: platform === "ios" ? "System" : "Roboto_medium", 252 | titleFontSize: platform === "ios" ? 17 : 19, 253 | subTitleFontSize: platform === "ios" ? 11 : 14, 254 | subtitleColor: platform === "ios" ? "#000" : "#fff", 255 | titleFontColor: platform === "ios" ? "#000" : "#fff", 256 | 257 | // Other 258 | borderRadiusBase: platform === "ios" ? 5 : 2, 259 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1), 260 | contentPadding: 10, 261 | dropdownLinkColor: "#414142", 262 | inputLineHeight: 24, 263 | deviceWidth, 264 | deviceHeight, 265 | isIphoneX, 266 | inputGroupRoundedBorderRadius: 30, 267 | 268 | //iPhoneX SafeArea 269 | Inset: { 270 | portrait: { 271 | topInset: 24, 272 | leftInset: 0, 273 | rightInset: 0, 274 | bottomInset: 34 275 | }, 276 | landscape: { 277 | topInset: 0, 278 | leftInset: 44, 279 | rightInset: 44, 280 | bottomInset: 21 281 | } 282 | } 283 | }; 284 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/variables/material.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import color from "color"; 4 | 5 | import { Platform, Dimensions, PixelRatio } from "react-native"; 6 | 7 | const deviceHeight = Dimensions.get("window").height; 8 | const deviceWidth = Dimensions.get("window").width; 9 | const platform = Platform.OS; 10 | const platformStyle = "material"; 11 | const isIphoneX = 12 | platform === "ios" && (deviceHeight === 812 || deviceWidth === 812 || deviceHeight === 896 || deviceWidth === 896); 13 | 14 | export default { 15 | platformStyle, 16 | platform, 17 | 18 | //Accordion 19 | headerStyle: "#edebed", 20 | iconStyle: "#000", 21 | contentStyle: "#f5f4f5", 22 | expandedIconStyle: "#000", 23 | accordionBorderColor: "#d3d3d3", 24 | 25 | // Android 26 | androidRipple: true, 27 | androidRippleColor: "rgba(256, 256, 256, 0.3)", 28 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)", 29 | btnUppercaseAndroidText: true, 30 | 31 | // Badge 32 | badgeBg: "#ED1727", 33 | badgeColor: "#fff", 34 | badgePadding: 0, 35 | 36 | // Button 37 | btnFontFamily: "Roboto", 38 | btnDisabledBg: "#b5b5b5", 39 | buttonPadding: 6, 40 | get btnPrimaryBg() { 41 | return this.brandPrimary; 42 | }, 43 | get btnPrimaryColor() { 44 | return this.inverseTextColor; 45 | }, 46 | get btnInfoBg() { 47 | return this.brandInfo; 48 | }, 49 | get btnInfoColor() { 50 | return this.inverseTextColor; 51 | }, 52 | get btnSuccessBg() { 53 | return this.brandSuccess; 54 | }, 55 | get btnSuccessColor() { 56 | return this.inverseTextColor; 57 | }, 58 | get btnDangerBg() { 59 | return this.brandDanger; 60 | }, 61 | get btnDangerColor() { 62 | return this.inverseTextColor; 63 | }, 64 | get btnWarningBg() { 65 | return this.brandWarning; 66 | }, 67 | get btnWarningColor() { 68 | return this.inverseTextColor; 69 | }, 70 | get btnTextSize() { 71 | return this.fontSizeBase - 1; 72 | }, 73 | get btnTextSizeLarge() { 74 | return this.fontSizeBase * 1.5; 75 | }, 76 | get btnTextSizeSmall() { 77 | return this.fontSizeBase * 0.8; 78 | }, 79 | get borderRadiusLarge() { 80 | return this.fontSizeBase * 3.8; 81 | }, 82 | get iconSizeLarge() { 83 | return this.iconFontSize * 1.5; 84 | }, 85 | get iconSizeSmall() { 86 | return this.iconFontSize * 0.6; 87 | }, 88 | 89 | // Card 90 | cardDefaultBg: "#fff", 91 | cardBorderColor: "#ccc", 92 | cardBorderRadius: 2, 93 | cardItemPadding: platform === "ios" ? 10 : 12, 94 | 95 | // CheckBox 96 | CheckboxRadius: 0, 97 | CheckboxBorderWidth: 2, 98 | CheckboxPaddingLeft: 2, 99 | CheckboxPaddingBottom: 5, 100 | CheckboxIconSize: 16, 101 | CheckboxIconMarginTop: 1, 102 | CheckboxFontSize: 17, 103 | checkboxBgColor: "#039BE5", 104 | checkboxSize: 20, 105 | checkboxTickColor: "#fff", 106 | 107 | // Color 108 | brandPrimary: "#3F51B5", 109 | brandInfo: "#62B1F6", 110 | brandSuccess: "#5cb85c", 111 | brandDanger: "#d9534f", 112 | brandWarning: "#f0ad4e", 113 | brandDark: "#000", 114 | brandLight: "#f4f4f4", 115 | 116 | //Container 117 | containerBgColor: "#fff", 118 | 119 | //Date Picker 120 | datePickerTextColor: "#000", 121 | datePickerBg: "transparent", 122 | 123 | // Font 124 | DefaultFontSize: 16, 125 | fontFamily: "Roboto", 126 | fontSizeBase: 15, 127 | get fontSizeH1() { 128 | return this.fontSizeBase * 1.8; 129 | }, 130 | get fontSizeH2() { 131 | return this.fontSizeBase * 1.6; 132 | }, 133 | get fontSizeH3() { 134 | return this.fontSizeBase * 1.4; 135 | }, 136 | 137 | // Footer 138 | footerHeight: 55, 139 | footerDefaultBg: "#3F51B5", 140 | footerPaddingBottom: 0, 141 | 142 | // FooterTab 143 | tabBarTextColor: "#bfc6ea", 144 | tabBarTextSize: 11, 145 | activeTab: "#fff", 146 | sTabBarActiveTextColor: "#007aff", 147 | tabBarActiveTextColor: "#fff", 148 | tabActiveBgColor: "#3F51B5", 149 | 150 | // Header 151 | toolbarBtnColor: "#fff", 152 | toolbarDefaultBg: "#3F51B5", 153 | toolbarHeight: 56, 154 | toolbarSearchIconSize: 23, 155 | toolbarInputColor: "#fff", 156 | searchBarHeight: platform === "ios" ? 30 : 40, 157 | searchBarInputHeight: platform === "ios" ? 40 : 50, 158 | toolbarBtnTextColor: "#fff", 159 | toolbarDefaultBorder: "#3F51B5", 160 | iosStatusbar: "light-content", 161 | get statusBarColor() { 162 | return color(this.toolbarDefaultBg) 163 | .darken(0.2) 164 | .hex(); 165 | }, 166 | get darkenHeader() { 167 | return color(this.tabBgColor) 168 | .darken(0.03) 169 | .hex(); 170 | }, 171 | 172 | // Icon 173 | iconFamily: "Ionicons", 174 | iconFontSize: 28, 175 | iconHeaderSize: 24, 176 | 177 | // InputGroup 178 | inputFontSize: 17, 179 | inputBorderColor: "#D9D5DC", 180 | inputSuccessBorderColor: "#2b8339", 181 | inputErrorBorderColor: "#ed2f2f", 182 | inputHeightBase: 50, 183 | get inputColor() { 184 | return this.textColor; 185 | }, 186 | get inputColorPlaceholder() { 187 | return "#575757"; 188 | }, 189 | 190 | // Line Height 191 | btnLineHeight: 19, 192 | lineHeightH1: 32, 193 | lineHeightH2: 27, 194 | lineHeightH3: 22, 195 | lineHeight: 24, 196 | 197 | // List 198 | listBg: "transparent", 199 | listBorderColor: "#c9c9c9", 200 | listDividerBg: "#f4f4f4", 201 | listBtnUnderlayColor: "#DDD", 202 | listItemPadding: 12, 203 | listNoteColor: "#808080", 204 | listNoteSize: 13, 205 | listItemSelected: "#3F51B5", 206 | 207 | // Progress Bar 208 | defaultProgressColor: "#E4202D", 209 | inverseProgressColor: "#1A191B", 210 | 211 | // Radio Button 212 | radioBtnSize: 23, 213 | radioSelectedColorAndroid: "#3F51B5", 214 | radioBtnLineHeight: 24, 215 | get radioColor() { 216 | return this.brandPrimary; 217 | }, 218 | 219 | // Segment 220 | segmentBackgroundColor: "#3F51B5", 221 | segmentActiveBackgroundColor: "#fff", 222 | segmentTextColor: "#fff", 223 | segmentActiveTextColor: "#3F51B5", 224 | segmentBorderColor: "#fff", 225 | segmentBorderColorMain: "#3F51B5", 226 | 227 | // Spinner 228 | defaultSpinnerColor: "#45D56E", 229 | inverseSpinnerColor: "#1A191B", 230 | 231 | // Tab 232 | tabDefaultBg: "#3F51B5", 233 | topTabBarTextColor: "#b3c7f9", 234 | topTabBarActiveTextColor: "#fff", 235 | topTabBarBorderColor: "#fff", 236 | topTabBarActiveBorderColor: "#fff", 237 | 238 | // Tabs 239 | tabBgColor: "#F8F8F8", 240 | tabFontSize: 15, 241 | 242 | // Text 243 | textColor: "#000", 244 | inverseTextColor: "#fff", 245 | noteFontSize: 14, 246 | get defaultTextColor() { 247 | return this.textColor; 248 | }, 249 | 250 | // Title 251 | titleFontfamily: "Roboto", 252 | titleFontSize: 19, 253 | subTitleFontSize: 14, 254 | subtitleColor: "#FFF", 255 | titleFontColor: "#FFF", 256 | 257 | // Other 258 | borderRadiusBase: 2, 259 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1), 260 | contentPadding: 10, 261 | dropdownLinkColor: "#414142", 262 | inputLineHeight: 24, 263 | deviceWidth, 264 | deviceHeight, 265 | isIphoneX, 266 | inputGroupRoundedBorderRadius: 30, 267 | 268 | //iPhoneX SafeArea 269 | Inset: { 270 | portrait: { 271 | topInset: 24, 272 | leftInset: 0, 273 | rightInset: 0, 274 | bottomInset: 34 275 | }, 276 | landscape: { 277 | topInset: 0, 278 | leftInset: 44, 279 | rightInset: 44, 280 | bottomInset: 21 281 | } 282 | } 283 | }; 284 | -------------------------------------------------------------------------------- /NativePrueba/src/theme/variables/platform.js: -------------------------------------------------------------------------------- 1 | // @flow 2 | 3 | import color from "color"; 4 | 5 | import { Platform, Dimensions, PixelRatio } from "react-native"; 6 | 7 | const deviceHeight = Dimensions.get("window").height; 8 | const deviceWidth = Dimensions.get("window").width; 9 | const platform = Platform.OS; 10 | const platformStyle = undefined; 11 | const isIphoneX = 12 | platform === "ios" && (deviceHeight === 812 || deviceWidth === 812 || deviceHeight === 896 || deviceWidth === 896); 13 | 14 | export default { 15 | platformStyle, 16 | platform, 17 | 18 | //Accordion 19 | headerStyle: "#edebed", 20 | iconStyle: "#000", 21 | contentStyle: "#f5f4f5", 22 | expandedIconStyle: "#000", 23 | accordionBorderColor: "#d3d3d3", 24 | 25 | // Android 26 | androidRipple: true, 27 | androidRippleColor: "rgba(256, 256, 256, 0.3)", 28 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)", 29 | btnUppercaseAndroidText: true, 30 | 31 | // Badge 32 | badgeBg: "#ED1727", 33 | badgeColor: "#fff", 34 | badgePadding: platform === "ios" ? 3 : 0, 35 | 36 | // Button 37 | btnFontFamily: platform === "ios" ? "System" : "Roboto_medium", 38 | btnDisabledBg: "#b5b5b5", 39 | buttonPadding: 6, 40 | get btnPrimaryBg() { 41 | return this.brandPrimary; 42 | }, 43 | get btnPrimaryColor() { 44 | return this.inverseTextColor; 45 | }, 46 | get btnInfoBg() { 47 | return this.brandInfo; 48 | }, 49 | get btnInfoColor() { 50 | return this.inverseTextColor; 51 | }, 52 | get btnSuccessBg() { 53 | return this.brandSuccess; 54 | }, 55 | get btnSuccessColor() { 56 | return this.inverseTextColor; 57 | }, 58 | get btnDangerBg() { 59 | return this.brandDanger; 60 | }, 61 | get btnDangerColor() { 62 | return this.inverseTextColor; 63 | }, 64 | get btnWarningBg() { 65 | return this.brandWarning; 66 | }, 67 | get btnWarningColor() { 68 | return this.inverseTextColor; 69 | }, 70 | get btnTextSize() { 71 | return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1; 72 | }, 73 | get btnTextSizeLarge() { 74 | return this.fontSizeBase * 1.5; 75 | }, 76 | get btnTextSizeSmall() { 77 | return this.fontSizeBase * 0.8; 78 | }, 79 | get borderRadiusLarge() { 80 | return this.fontSizeBase * 3.8; 81 | }, 82 | get iconSizeLarge() { 83 | return this.iconFontSize * 1.5; 84 | }, 85 | get iconSizeSmall() { 86 | return this.iconFontSize * 0.6; 87 | }, 88 | 89 | // Card 90 | cardDefaultBg: "#fff", 91 | cardBorderColor: "#ccc", 92 | cardBorderRadius: 2, 93 | cardItemPadding: platform === "ios" ? 10 : 12, 94 | 95 | // CheckBox 96 | CheckboxRadius: platform === "ios" ? 13 : 0, 97 | CheckboxBorderWidth: platform === "ios" ? 1 : 2, 98 | CheckboxPaddingLeft: platform === "ios" ? 4 : 2, 99 | CheckboxPaddingBottom: platform === "ios" ? 0 : 5, 100 | CheckboxIconSize: platform === "ios" ? 21 : 16, 101 | CheckboxIconMarginTop: platform === "ios" ? undefined : 1, 102 | CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 17, 103 | checkboxBgColor: "#039BE5", 104 | checkboxSize: 20, 105 | checkboxTickColor: "#fff", 106 | 107 | // Color 108 | brandPrimary: platform === "ios" ? "#007aff" : "#3F51B5", 109 | brandInfo: "#62B1F6", 110 | brandSuccess: "#5cb85c", 111 | brandDanger: "#d9534f", 112 | brandWarning: "#f0ad4e", 113 | brandDark: "#000", 114 | brandLight: "#f4f4f4", 115 | 116 | //Container 117 | containerBgColor: "#fff", 118 | 119 | //Date Picker 120 | datePickerTextColor: "#000", 121 | datePickerBg: "transparent", 122 | 123 | // Font 124 | DefaultFontSize: 16, 125 | fontFamily: platform === "ios" ? "System" : "Roboto", 126 | fontSizeBase: 15, 127 | get fontSizeH1() { 128 | return this.fontSizeBase * 1.8; 129 | }, 130 | get fontSizeH2() { 131 | return this.fontSizeBase * 1.6; 132 | }, 133 | get fontSizeH3() { 134 | return this.fontSizeBase * 1.4; 135 | }, 136 | 137 | // Footer 138 | footerHeight: 55, 139 | footerDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 140 | footerPaddingBottom: 0, 141 | 142 | // FooterTab 143 | tabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", 144 | tabBarTextSize: platform === "ios" ? 14 : 11, 145 | activeTab: platform === "ios" ? "#007aff" : "#fff", 146 | sTabBarActiveTextColor: "#007aff", 147 | tabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff", 148 | tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5", 149 | 150 | // Header 151 | toolbarBtnColor: platform === "ios" ? "#007aff" : "#fff", 152 | toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 153 | toolbarHeight: platform === "ios" ? 64 : 56, 154 | toolbarSearchIconSize: platform === "ios" ? 20 : 23, 155 | toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff", 156 | searchBarHeight: platform === "ios" ? 30 : 40, 157 | searchBarInputHeight: platform === "ios" ? 30 : 50, 158 | toolbarBtnTextColor: platform === "ios" ? "#007aff" : "#fff", 159 | toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#3F51B5", 160 | iosStatusbar: platform === "ios" ? "dark-content" : "light-content", 161 | get statusBarColor() { 162 | return color(this.toolbarDefaultBg) 163 | .darken(0.2) 164 | .hex(); 165 | }, 166 | get darkenHeader() { 167 | return color(this.tabBgColor) 168 | .darken(0.03) 169 | .hex(); 170 | }, 171 | 172 | // Icon 173 | iconFamily: "Ionicons", 174 | iconFontSize: platform === "ios" ? 30 : 28, 175 | iconHeaderSize: platform === "ios" ? 33 : 24, 176 | 177 | // InputGroup 178 | inputFontSize: 17, 179 | inputBorderColor: "#D9D5DC", 180 | inputSuccessBorderColor: "#2b8339", 181 | inputErrorBorderColor: "#ed2f2f", 182 | inputHeightBase: 50, 183 | get inputColor() { 184 | return this.textColor; 185 | }, 186 | get inputColorPlaceholder() { 187 | return "#575757"; 188 | }, 189 | 190 | // Line Height 191 | btnLineHeight: 19, 192 | lineHeightH1: 32, 193 | lineHeightH2: 27, 194 | lineHeightH3: 22, 195 | lineHeight: platform === "ios" ? 20 : 24, 196 | listItemSelected: platform === "ios" ? "#007aff" : "#3F51B5", 197 | 198 | // List 199 | listBg: "transparent", 200 | listBorderColor: "#c9c9c9", 201 | listDividerBg: "#f4f4f4", 202 | listBtnUnderlayColor: "#DDD", 203 | listItemPadding: platform === "ios" ? 10 : 12, 204 | listNoteColor: "#808080", 205 | listNoteSize: 13, 206 | 207 | // Progress Bar 208 | defaultProgressColor: "#E4202D", 209 | inverseProgressColor: "#1A191B", 210 | 211 | // Radio Button 212 | radioBtnSize: platform === "ios" ? 25 : 23, 213 | radioSelectedColorAndroid: "#3F51B5", 214 | radioBtnLineHeight: platform === "ios" ? 29 : 24, 215 | get radioColor() { 216 | return this.brandPrimary; 217 | }, 218 | 219 | // Segment 220 | segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5", 221 | segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff", 222 | segmentTextColor: platform === "ios" ? "#007aff" : "#fff", 223 | segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5", 224 | segmentBorderColor: platform === "ios" ? "#007aff" : "#fff", 225 | segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5", 226 | 227 | // Spinner 228 | defaultSpinnerColor: "#45D56E", 229 | inverseSpinnerColor: "#1A191B", 230 | 231 | // Tab 232 | tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5", 233 | topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9", 234 | topTabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff", 235 | topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff", 236 | topTabBarActiveBorderColor: platform === "ios" ? "#007aff" : "#fff", 237 | 238 | // Tabs 239 | tabBgColor: "#F8F8F8", 240 | tabFontSize: 15, 241 | 242 | // Text 243 | textColor: "#000", 244 | inverseTextColor: "#fff", 245 | noteFontSize: 14, 246 | get defaultTextColor() { 247 | return this.textColor; 248 | }, 249 | 250 | // Title 251 | titleFontfamily: platform === "ios" ? "System" : "Roboto_medium", 252 | titleFontSize: platform === "ios" ? 17 : 19, 253 | subTitleFontSize: platform === "ios" ? 11 : 14, 254 | subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF", 255 | titleFontColor: platform === "ios" ? "#000" : "#FFF", 256 | 257 | // Other 258 | borderRadiusBase: platform === "ios" ? 5 : 2, 259 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1), 260 | contentPadding: 10, 261 | dropdownLinkColor: "#414142", 262 | inputLineHeight: 24, 263 | deviceWidth, 264 | deviceHeight, 265 | isIphoneX, 266 | inputGroupRoundedBorderRadius: 30, 267 | 268 | //iPhoneX SafeArea 269 | Inset: { 270 | portrait: { 271 | topInset: 24, 272 | leftInset: 0, 273 | rightInset: 0, 274 | bottomInset: 34 275 | }, 276 | landscape: { 277 | topInset: 0, 278 | leftInset: 44, 279 | rightInset: 44, 280 | bottomInset: 21 281 | } 282 | } 283 | }; 284 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # React Native App for a differential mobile robot 2 | 3 | ## 1. Prerequisites 4 | 5 |

6 | Have installed on your computer, ROS Melodic, ROS Melodic packages: gazebo ros plugin, gazebo ros, react-native. 7 |

8 | 9 | Having created a catkin workspace. 10 | 11 | ## 2. Packages 12 | 13 |

14 | The ReactNativeControl folder has the control of robot and the interaction with the reat-native app. If you want to use the same robot, I invite you a my other porject a clone the repository: 15 |

16 | 17 | 18 | 19 |

20 | The react-native app is into NativePrueba folder online clone the repository, go to the NativePrueba folder and puth the followings command: 21 |

22 | 23 | npm option: 24 | 25 | npm install 26 | 27 | or yarn option: 28 | 29 | yarn install 30 | 31 | runs the aplication with an emulator of your phone: 32 | 33 | react-native run-android 34 | 35 |

36 | For the master, you have to init the rosbridge server with this command: 37 |

38 | 39 | roslaunch rosbridge_server rosbridge_websocket.launch 40 | 41 |

42 | If you want to use the robot designed, you have to install the package of the previous link in your catkin workspace, and put the following command in other terminal: 43 |

44 | 45 | roslaunch diferencial 01-diferencial.launch 46 | 47 |

48 | Finally, have to run the control node, for that you have to install as package the ReactNativeControl folder in your catkin workspace and put the next line: 49 |

50 | 51 | rosrun ReactNativeControl ControlReactNative.py 52 | 53 | ## 3. Description 54 | 55 |

56 | The App is a ROS node that can communicate with the master with rosbridge. For the frond-end I use native-base and for the ROS interaction I use roslibjs. This app use Redux and Redux-persist for managing the states of the app, as you can see in the animation: 57 |

58 | 59 |

60 | 61 |

62 | 63 | And the next animation shows the communication of the App with the master node with rosbridge. 64 | 65 |

66 | 67 |

68 | 69 | ## 4. Results 70 | 71 |

72 | In this demostration I use my Android cellphone and ApowerMirror for shows the screen of phone. If you want to use ApowerMirror you can donwload in the next link: 73 |

74 | 75 | 76 | 77 |

78 | This app publish a topic named "/mode" for the controller know if the app user is in teleoperation, posture or trajectory control mode. The next Table shows the messages sends to the topic "/mode" depending the app mode operation that the ControlReactNative node is suscribed: 79 |

80 | 81 | | Mode | Message (stds_msgs:string) | 82 | | --- | --- | 83 | | Teleoperation | 'Teleoperation' | 84 | | Posture Control | 'Posture Control' | 85 | | Trajectory Control | 'Tray Control' | 86 | 87 |

88 | For teleoperation mode, you can chose the name topic to publihs velocities of robot. For my robot, the name topic is "/mobile_base_controller/cmd_vel", this animation shows the teleoperation mode. 89 |

90 | 91 |

92 | 93 |

94 | 95 |

96 | In the settings button, you can set the velocities of robot. 97 | 98 | In the posture control mode, the user can set the X, Y position and the robot is going to that point. The x and y references is sending as ROS´parameters. The next animation shows the posture control mode of the robot. 99 |

100 | 101 |

102 | 103 |

104 | 105 |

106 | Finally the trajectory mode, this mode the user can chose the trajectory of the robot. When you chose a different trajectory the app sends a ROS' parameter named TrayMode. The following animation shows this mode. 107 |

108 | 109 |

110 | 111 |

112 | 113 | ## 5. Contact with me 114 | 115 | Linkedin: 116 | -------------------------------------------------------------------------------- /ReactNativeControl/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8.3) 2 | project(ReactNativeControl) 3 | 4 | ## Compile as C++11, supported in ROS Kinetic and newer 5 | # add_compile_options(-std=c++11) 6 | 7 | ## Find catkin macros and libraries 8 | ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) 9 | ## is used, also find other catkin packages 10 | find_package(catkin REQUIRED COMPONENTS 11 | rospy 12 | ) 13 | 14 | ## System dependencies are found with CMake's conventions 15 | # find_package(Boost REQUIRED COMPONENTS system) 16 | 17 | 18 | ## Uncomment this if the package has a setup.py. This macro ensures 19 | ## modules and global scripts declared therein get installed 20 | ## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html 21 | # catkin_python_setup() 22 | 23 | ################################################ 24 | ## Declare ROS messages, services and actions ## 25 | ################################################ 26 | 27 | ## To declare and build messages, services or actions from within this 28 | ## package, follow these steps: 29 | ## * Let MSG_DEP_SET be the set of packages whose message types you use in 30 | ## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...). 31 | ## * In the file package.xml: 32 | ## * add a build_depend tag for "message_generation" 33 | ## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET 34 | ## * If MSG_DEP_SET isn't empty the following dependency has been pulled in 35 | ## but can be declared for certainty nonetheless: 36 | ## * add a exec_depend tag for "message_runtime" 37 | ## * In this file (CMakeLists.txt): 38 | ## * add "message_generation" and every package in MSG_DEP_SET to 39 | ## find_package(catkin REQUIRED COMPONENTS ...) 40 | ## * add "message_runtime" and every package in MSG_DEP_SET to 41 | ## catkin_package(CATKIN_DEPENDS ...) 42 | ## * uncomment the add_*_files sections below as needed 43 | ## and list every .msg/.srv/.action file to be processed 44 | ## * uncomment the generate_messages entry below 45 | ## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...) 46 | 47 | ## Generate messages in the 'msg' folder 48 | # add_message_files( 49 | # FILES 50 | # Message1.msg 51 | # Message2.msg 52 | # ) 53 | 54 | ## Generate services in the 'srv' folder 55 | # add_service_files( 56 | # FILES 57 | # Service1.srv 58 | # Service2.srv 59 | # ) 60 | 61 | ## Generate actions in the 'action' folder 62 | # add_action_files( 63 | # FILES 64 | # Action1.action 65 | # Action2.action 66 | # ) 67 | 68 | ## Generate added messages and services with any dependencies listed here 69 | # generate_messages( 70 | # DEPENDENCIES 71 | # std_msgs # Or other packages containing msgs 72 | # ) 73 | 74 | ################################################ 75 | ## Declare ROS dynamic reconfigure parameters ## 76 | ################################################ 77 | 78 | ## To declare and build dynamic reconfigure parameters within this 79 | ## package, follow these steps: 80 | ## * In the file package.xml: 81 | ## * add a build_depend and a exec_depend tag for "dynamic_reconfigure" 82 | ## * In this file (CMakeLists.txt): 83 | ## * add "dynamic_reconfigure" to 84 | ## find_package(catkin REQUIRED COMPONENTS ...) 85 | ## * uncomment the "generate_dynamic_reconfigure_options" section below 86 | ## and list every .cfg file to be processed 87 | 88 | ## Generate dynamic reconfigure parameters in the 'cfg' folder 89 | # generate_dynamic_reconfigure_options( 90 | # cfg/DynReconf1.cfg 91 | # cfg/DynReconf2.cfg 92 | # ) 93 | 94 | ################################### 95 | ## catkin specific configuration ## 96 | ################################### 97 | ## The catkin_package macro generates cmake config files for your package 98 | ## Declare things to be passed to dependent projects 99 | ## INCLUDE_DIRS: uncomment this if your package contains header files 100 | ## LIBRARIES: libraries you create in this project that dependent projects also need 101 | ## CATKIN_DEPENDS: catkin_packages dependent projects also need 102 | ## DEPENDS: system dependencies of this project that dependent projects also need 103 | catkin_package( 104 | # INCLUDE_DIRS include 105 | # LIBRARIES ReactNativeControl 106 | # CATKIN_DEPENDS rospy 107 | # DEPENDS system_lib 108 | ) 109 | 110 | ########### 111 | ## Build ## 112 | ########### 113 | 114 | ## Specify additional locations of header files 115 | ## Your package locations should be listed before other locations 116 | include_directories( 117 | # include 118 | ${catkin_INCLUDE_DIRS} 119 | ) 120 | 121 | ## Declare a C++ library 122 | # add_library(${PROJECT_NAME} 123 | # src/${PROJECT_NAME}/ReactNativeControl.cpp 124 | # ) 125 | 126 | ## Add cmake target dependencies of the library 127 | ## as an example, code may need to be generated before libraries 128 | ## either from message generation or dynamic reconfigure 129 | # add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 130 | 131 | ## Declare a C++ executable 132 | ## With catkin_make all packages are built within a single CMake context 133 | ## The recommended prefix ensures that target names across packages don't collide 134 | # add_executable(${PROJECT_NAME}_node src/ReactNativeControl_node.cpp) 135 | 136 | ## Rename C++ executable without prefix 137 | ## The above recommended prefix causes long target names, the following renames the 138 | ## target back to the shorter version for ease of user use 139 | ## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node" 140 | # set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "") 141 | 142 | ## Add cmake target dependencies of the executable 143 | ## same as for the library above 144 | # add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS}) 145 | 146 | ## Specify libraries to link a library or executable target against 147 | # target_link_libraries(${PROJECT_NAME}_node 148 | # ${catkin_LIBRARIES} 149 | # ) 150 | 151 | ############# 152 | ## Install ## 153 | ############# 154 | 155 | # all install targets should use catkin DESTINATION variables 156 | # See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html 157 | 158 | ## Mark executable scripts (Python etc.) for installation 159 | ## in contrast to setup.py, you can choose the destination 160 | # catkin_install_python(PROGRAMS 161 | # scripts/my_python_script 162 | # DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 163 | # ) 164 | 165 | ## Mark executables for installation 166 | ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_executables.html 167 | # install(TARGETS ${PROJECT_NAME}_node 168 | # RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} 169 | # ) 170 | 171 | ## Mark libraries for installation 172 | ## See http://docs.ros.org/melodic/api/catkin/html/howto/format1/building_libraries.html 173 | # install(TARGETS ${PROJECT_NAME} 174 | # ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 175 | # LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION} 176 | # RUNTIME DESTINATION ${CATKIN_GLOBAL_BIN_DESTINATION} 177 | # ) 178 | 179 | ## Mark cpp header files for installation 180 | # install(DIRECTORY include/${PROJECT_NAME}/ 181 | # DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION} 182 | # FILES_MATCHING PATTERN "*.h" 183 | # PATTERN ".svn" EXCLUDE 184 | # ) 185 | 186 | ## Mark other files for installation (e.g. launch and bag files, etc.) 187 | # install(FILES 188 | # # myfile1 189 | # # myfile2 190 | # DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} 191 | # ) 192 | 193 | ############# 194 | ## Testing ## 195 | ############# 196 | 197 | ## Add gtest based cpp test target and link libraries 198 | # catkin_add_gtest(${PROJECT_NAME}-test test/test_ReactNativeControl.cpp) 199 | # if(TARGET ${PROJECT_NAME}-test) 200 | # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) 201 | # endif() 202 | 203 | ## Add folders to be run by python nosetests 204 | # catkin_add_nosetests(test) 205 | -------------------------------------------------------------------------------- /ReactNativeControl/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | ReactNativeControl 4 | 0.0.0 5 | The ReactNativeControl package 6 | 7 | 8 | 9 | 10 | juan 11 | 12 | 13 | 14 | 15 | 16 | TODO 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | catkin 52 | rospy 53 | rospy 54 | rospy 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | -------------------------------------------------------------------------------- /ReactNativeControl/src/ControlReactNative.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import rospy 3 | from std_msgs.msg import String 4 | import math 5 | import tf 6 | from tf.transformations import euler_from_quaternion 7 | from nav_msgs.msg import Odometry 8 | import geometry_msgs.msg 9 | import numpy as np 10 | 11 | OperationType = 'Teleoperation' 12 | ESCALAR_FACTOR=70.0 13 | p_ref_ant=np.array([[0.0],[0.0]]) 14 | p_ref=np.array([[0.0],[0.0]]) 15 | x= 0.0 16 | y= 0.0 17 | theta=0.0 18 | m=0 19 | 20 | #ODOMETRY DATA 21 | def Odom(msg): 22 | global x 23 | global y 24 | global theta 25 | 26 | x=msg.pose.pose.position.x 27 | y=msg.pose.pose.position.y 28 | rot_q=msg.pose.pose.orientation 29 | angles=euler_from_quaternion([rot_q.x, rot_q.y, rot_q.z, rot_q.w]) 30 | theta=angles[2] 31 | 32 | def callback(data): 33 | global OperationType 34 | 35 | OperationType = data.data 36 | 37 | def PostureReference(x_ant,y_ant): 38 | 39 | x = rospy.get_param('x_position',x_ant) 40 | y = rospy.get_param('y_position',y_ant) 41 | return x, y 42 | 43 | def TrayReference(tray): 44 | tray = rospy.get_param('TrayMode',tray) 45 | t = rospy.Time.now().to_sec() * math.pi 46 | if tray == 1: 47 | x = 2.0 * math.cos(t/ESCALAR_FACTOR) 48 | y = 2.0 * math.sin(t/ESCALAR_FACTOR) 49 | elif tray == 2: 50 | x = 2.0 * math.sin(t/ESCALAR_FACTOR)/(1+math.pow(math.cos(t/ESCALAR_FACTOR),2)) 51 | y = 2.0 * math.sin(t/ESCALAR_FACTOR) * math.cos(t/ESCALAR_FACTOR)/(1+math.pow(math.cos(t/ESCALAR_FACTOR),2)) 52 | elif tray == 3: 53 | x = 2.0 * math.sin(t/ESCALAR_FACTOR)/(1+math.pow(math.sin(t/ESCALAR_FACTOR),2)) 54 | y = 2.0 * math.sin(t/ESCALAR_FACTOR) * math.cos(t/ESCALAR_FACTOR)/(1+math.pow(math.sin(t/ESCALAR_FACTOR),2)) 55 | else: 56 | x = 0.0 57 | y = 0.0 58 | return x, y, tray 59 | 60 | #iNVERSE KINEMATIC PID CONTROL 61 | def Control(angle,x_pos,y_pos,pos_before,pos_ref,K_sin): 62 | Jr=np.array([[math.cos(angle) ,-0.15 * math.sin(angle)],[math.sin(angle) ,0.15 * math.cos(angle)]]) 63 | Jr_inv=np.linalg.inv(Jr) 64 | K=np.array([[K_sin[0], 0],[0, K_sin[1]]]) 65 | posp_d=pos_ref - pos_before 66 | pos=np.array([[x_pos],[y_pos]]) 67 | pos_error=pos_ref - pos 68 | pos_error[0, 0]=math.tanh(pos_error[0, 0]) 69 | pos_error[1, 0]=math.tanh(pos_error[1, 0]) 70 | c=np.dot(Jr_inv, (10 * posp_d + np.dot(K,pos_error))) 71 | c1=c[0, 0] 72 | c2=c[1, 0] 73 | return c1,c2 74 | 75 | if __name__ == '__main__': 76 | 77 | rospy.init_node('ControlReactNative', anonymous=True) 78 | diff_vel = rospy.Publisher('/mobile_base_controller/cmd_vel', geometry_msgs.msg.Twist,queue_size=1) 79 | rospy.Subscriber("mode", String, callback) 80 | sub_odom = rospy.Subscriber('/mobile_base_controller/odom',Odometry,Odom) 81 | br = tf.TransformBroadcaster() 82 | rate = rospy.Rate(10.0) 83 | while not rospy.is_shutdown(): 84 | if OperationType != 'Teleoperation': 85 | p_ref_ant[0, 0], p_ref_ant[1, 0] = p_ref[0, 0], p_ref[1, 0] 86 | if a == 0: 87 | diff_vel = rospy.Publisher('/mobile_base_controller/cmd_vel', geometry_msgs.msg.Twist,queue_size=1) 88 | a = 1 89 | if OperationType == 'Posture Control': 90 | p_ref[0, 0], p_ref[1, 0] = PostureReference(p_ref[0, 0], p_ref[1, 0]) 91 | else: 92 | p_ref[0, 0], p_ref[1, 0], m = TrayReference(m) 93 | 94 | br.sendTransform(( p_ref[0, 0], p_ref[1, 0], 0.0), 95 | (0.0, 0.0, 0.0, 1.0), 96 | rospy.Time.now(), 97 | "ref", 98 | "odom") 99 | 100 | linear, angular = Control(theta, x, y, p_ref_ant, p_ref, [0.6, 0.6]) 101 | cmd = geometry_msgs.msg.Twist() 102 | cmd.linear.x = linear 103 | cmd.angular.z = angular 104 | diff_vel.publish(cmd) 105 | else: 106 | a = 0 107 | diff_vel.unregister() 108 | rate.sleep() --------------------------------------------------------------------------------