├── .watchmanconfig
├── src
├── components
│ ├── Fab
│ │ ├── styles.js
│ │ └── index.js
│ ├── Status
│ │ ├── styles.js
│ │ └── index.js
│ ├── Splash
│ │ ├── styles.js
│ │ └── index.js
│ ├── AppIntro
│ │ ├── style.js
│ │ └── slides.js
│ └── RenderImages
│ │ └── index.js
├── containers
│ ├── Home
│ │ ├── styles.js
│ │ ├── index.js
│ │ └── videos.js
│ ├── NotSaved
│ │ ├── styles.js
│ │ └── index.js
│ ├── Saved
│ │ ├── styles.js
│ │ └── index.js
│ ├── tabs.js
│ └── index.js
├── images
│ ├── 1.jpg
│ ├── 2.jpg
│ ├── 3.jpg
│ ├── 4.jpg
│ └── 5.jpg
├── stores
│ ├── index.js
│ ├── configurestore.prod.js
│ └── configurestore.dev.js
├── reducers
│ ├── index.js
│ ├── nav.js
│ ├── videos.js
│ ├── images.js
│ └── getStatus.js
├── actions
│ ├── videos.js
│ ├── images.js
│ └── getStatus.js
├── constants
│ └── index.js
└── utils
│ └── helpers.js
├── .gitattributes
├── .babelrc
├── app.json
├── android
├── app
│ ├── src
│ │ └── main
│ │ │ ├── res
│ │ │ ├── values
│ │ │ │ ├── strings.xml
│ │ │ │ └── styles.xml
│ │ │ ├── mipmap-hdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-mdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── mipmap-xxhdpi
│ │ │ │ └── ic_launcher.png
│ │ │ ├── drawable-mdpi
│ │ │ │ ├── src_images_1.jpg
│ │ │ │ ├── src_images_2.png
│ │ │ │ ├── src_images_3.jpg
│ │ │ │ ├── src_images_4.jpg
│ │ │ │ ├── src_images_5.jpg
│ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ ├── drawable-hdpi
│ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ ├── drawable-xhdpi
│ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ ├── drawable-xxhdpi
│ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ └── drawable-xxxhdpi
│ │ │ │ └── node_modules_reactnavigation_src_views_assets_backicon.png
│ │ │ ├── assets
│ │ │ ├── fonts
│ │ │ │ ├── Entypo.ttf
│ │ │ │ ├── Roboto.ttf
│ │ │ │ ├── Zocial.ttf
│ │ │ │ ├── EvilIcons.ttf
│ │ │ │ ├── Feather.ttf
│ │ │ │ ├── Ionicons.ttf
│ │ │ │ ├── Octicons.ttf
│ │ │ │ ├── FontAwesome.ttf
│ │ │ │ ├── Foundation.ttf
│ │ │ │ ├── MaterialIcons.ttf
│ │ │ │ ├── Roboto_medium.ttf
│ │ │ │ ├── SimpleLineIcons.ttf
│ │ │ │ ├── rubicon-icon-font.ttf
│ │ │ │ └── MaterialCommunityIcons.ttf
│ │ │ └── index.android.bundle.meta
│ │ │ ├── java
│ │ │ └── com
│ │ │ │ └── whatsappdownloader
│ │ │ │ ├── MainActivity.java
│ │ │ │ └── MainApplication.java
│ │ │ └── AndroidManifest.xml
│ ├── BUCK
│ ├── proguard-rules.pro
│ └── build.gradle
├── keystores
│ ├── debug.keystore.properties
│ └── BUCK
├── gradle
│ └── wrapper
│ │ ├── gradle-wrapper.jar
│ │ └── gradle-wrapper.properties
├── build.gradle
├── settings.gradle
├── gradle.properties
├── gradlew.bat
└── gradlew
├── ios
├── whatsappDownloader
│ ├── Images.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── AppDelegate.h
│ ├── main.m
│ ├── AppDelegate.m
│ ├── Info.plist
│ └── Base.lproj
│ │ └── LaunchScreen.xib
├── whatsappDownloaderTests
│ ├── Info.plist
│ └── whatsappDownloaderTests.m
├── whatsappDownloader-tvOSTests
│ └── Info.plist
├── whatsappDownloader-tvOS
│ └── Info.plist
└── whatsappDownloader.xcodeproj
│ └── xcshareddata
│ └── xcschemes
│ ├── whatsappDownloader.xcscheme
│ └── whatsappDownloader-tvOS.xcscheme
├── .buckconfig
├── index.js
├── index.android.js
├── native-base-theme
├── components
│ ├── Picker.ios.js
│ ├── Spinner.js
│ ├── Switch.js
│ ├── Tab.js
│ ├── Icon.js
│ ├── Body.js
│ ├── Left.js
│ ├── View.js
│ ├── Label.js
│ ├── H1.js
│ ├── H2.js
│ ├── H3.js
│ ├── Picker.android.js
│ ├── Right.js
│ ├── Subtitle.js
│ ├── Container.js
│ ├── Text.js
│ ├── Content.js
│ ├── Title.js
│ ├── Input.js
│ ├── Fab.js
│ ├── Textarea.js
│ ├── Card.js
│ ├── Thumbnail.js
│ ├── Radio.js
│ ├── TabContainer.js
│ ├── Toast.js
│ ├── Badge.js
│ ├── SwipeRow.js
│ ├── TabHeading.js
│ ├── CheckBox.js
│ ├── Separator.js
│ ├── Segment.js
│ ├── TabBar.js
│ ├── Form.js
│ ├── FooterTab.js
│ ├── Footer.js
│ ├── InputGroup.js
│ ├── CardItem.js
│ ├── Item.js
│ ├── index.js
│ ├── Button.js
│ └── Header.js
└── variables
│ ├── material.js
│ ├── platform.js
│ └── commonColor.js
├── __tests__
└── App.js
├── App.js
├── README.md
├── .gitignore
├── LICENSE
├── package.json
└── .flowconfig
/.watchmanconfig:
--------------------------------------------------------------------------------
1 | {}
--------------------------------------------------------------------------------
/src/components/Fab/styles.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/components/Status/styles.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/containers/Home/styles.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/containers/NotSaved/styles.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/containers/Saved/styles.js:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.pbxproj -text
2 |
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["react-native"]
3 | }
4 |
--------------------------------------------------------------------------------
/app.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "whatsappDownloader",
3 | "displayName": "whatsappDownloader"
4 | }
--------------------------------------------------------------------------------
/src/images/1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/src/images/1.jpg
--------------------------------------------------------------------------------
/src/images/2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/src/images/2.jpg
--------------------------------------------------------------------------------
/src/images/3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/src/images/3.jpg
--------------------------------------------------------------------------------
/src/images/4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/src/images/4.jpg
--------------------------------------------------------------------------------
/src/images/5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/src/images/5.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | whatsappDownloader
3 |
4 |
--------------------------------------------------------------------------------
/src/components/Status/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 |
3 | import { Container, Content, View } from 'native-base';
--------------------------------------------------------------------------------
/ios/whatsappDownloader/Images.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
7 |
--------------------------------------------------------------------------------
/.buckconfig:
--------------------------------------------------------------------------------
1 |
2 | [android]
3 | target = Google Inc.:Google APIs:23
4 |
5 | [maven_repositories]
6 | central = https://repo1.maven.org/maven2
7 |
--------------------------------------------------------------------------------
/android/keystores/debug.keystore.properties:
--------------------------------------------------------------------------------
1 | key.store=debug.keystore
2 | key.alias=androiddebugkey
3 | key.store.password=android
4 | key.alias.password=android
5 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Entypo.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Entypo.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Roboto.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Zocial.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Zocial.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/EvilIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/EvilIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Feather.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Feather.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Ionicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Ionicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Octicons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Octicons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/FontAwesome.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/FontAwesome.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Foundation.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Foundation.ttf
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import WhatsappDownloader from './App';
3 |
4 | AppRegistry.registerComponent('whatsappDownloader', () => WhatsappDownloader);
5 |
6 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/MaterialIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/Roboto_medium.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/Roboto_medium.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/index.android.js:
--------------------------------------------------------------------------------
1 | import { AppRegistry } from 'react-native';
2 | import WhatsappDownloader from './App';
3 |
4 | AppRegistry.registerComponent('whatsappDownloader', () => WhatsappDownloader);
5 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/SimpleLineIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/SimpleLineIcons.ttf
--------------------------------------------------------------------------------
/android/app/src/main/assets/index.android.bundle.meta:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/index.android.bundle.meta
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/rubicon-icon-font.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/rubicon-icon-font.ttf
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/src_images_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/src_images_1.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/src_images_2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/src_images_2.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/src_images_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/src_images_3.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/src_images_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/src_images_4.jpg
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/src_images_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/src_images_5.jpg
--------------------------------------------------------------------------------
/android/keystores/BUCK:
--------------------------------------------------------------------------------
1 | keystore(
2 | name = "debug",
3 | properties = "debug.keystore.properties",
4 | store = "debug.keystore",
5 | visibility = [
6 | "PUBLIC",
7 | ],
8 | )
9 |
--------------------------------------------------------------------------------
/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/assets/fonts/MaterialCommunityIcons.ttf
--------------------------------------------------------------------------------
/native-base-theme/components/Picker.ios.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const pickerTheme = {};
5 |
6 | return pickerTheme;
7 | };
8 |
--------------------------------------------------------------------------------
/native-base-theme/components/Spinner.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const spinnerTheme = {
5 | height: 80
6 | };
7 |
8 | return spinnerTheme;
9 | };
10 |
--------------------------------------------------------------------------------
/native-base-theme/components/Switch.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const switchTheme = {
5 | marginVertical: -5,
6 | };
7 |
8 | return switchTheme;
9 | };
10 |
--------------------------------------------------------------------------------
/android/app/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/native-base-theme/components/Tab.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const tabTheme = {
5 | flex: 1,
6 | backgroundColor: "#FFF"
7 | };
8 |
9 | return tabTheme;
10 | };
11 |
--------------------------------------------------------------------------------
/android/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | zipStoreBase=GRADLE_USER_HOME
4 | zipStorePath=wrapper/dists
5 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
6 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-hdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-mdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/native-base-theme/components/Icon.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const iconTheme = {
5 | fontSize: variables.iconFontSize,
6 | color: "#000"
7 | };
8 |
9 | return iconTheme;
10 | };
11 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-xhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-xxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/native-base-theme/components/Body.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const bodyTheme = {
5 | flex: 1,
6 | alignItems: 'center',
7 | alignSelf: 'center',
8 | };
9 |
10 | return bodyTheme;
11 | };
12 |
--------------------------------------------------------------------------------
/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/raheemazeezabiodun/react-native-whatsapp-status-downloader/HEAD/android/app/src/main/res/drawable-xxxhdpi/node_modules_reactnavigation_src_views_assets_backicon.png
--------------------------------------------------------------------------------
/native-base-theme/components/Left.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const leftTheme = {
5 | flex: 1,
6 | alignSelf: 'center',
7 | alignItems: 'flex-start',
8 | };
9 |
10 | return leftTheme;
11 | };
12 |
--------------------------------------------------------------------------------
/native-base-theme/components/View.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const viewTheme = {
5 | ".padder": {
6 | padding: variables.contentPadding
7 | }
8 | };
9 |
10 | return viewTheme;
11 | };
12 |
--------------------------------------------------------------------------------
/src/stores/index.js:
--------------------------------------------------------------------------------
1 | import { DEV_MODE } from '../constants';
2 |
3 | if (DEV_MODE) {
4 | module.exports = require('./configurestore.dev'); // eslint-disable-line global-require
5 | } else {
6 | module.exports = require('./configurestore.prod'); // eslint-disable-line global-require
7 | }
--------------------------------------------------------------------------------
/native-base-theme/components/Label.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const labelTheme = {
5 | ".focused": {
6 | width: 0
7 | },
8 | fontSize: 17
9 | };
10 |
11 | return labelTheme;
12 | };
13 |
--------------------------------------------------------------------------------
/native-base-theme/components/H1.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const h1Theme = {
5 | color: variables.textColor,
6 | fontSize: variables.fontSizeH1,
7 | lineHeight: variables.lineHeightH1,
8 | };
9 |
10 | return h1Theme;
11 | };
12 |
--------------------------------------------------------------------------------
/native-base-theme/components/H2.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const h2Theme = {
5 | color: variables.textColor,
6 | fontSize: variables.fontSizeH2,
7 | lineHeight: variables.lineHeightH2,
8 | };
9 |
10 | return h2Theme;
11 | };
12 |
--------------------------------------------------------------------------------
/native-base-theme/components/H3.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const h3Theme = {
5 | color: variables.textColor,
6 | fontSize: variables.fontSizeH3,
7 | lineHeight: variables.lineHeightH3
8 | };
9 |
10 | return h3Theme;
11 | };
12 |
--------------------------------------------------------------------------------
/native-base-theme/components/Picker.android.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const pickerTheme = {
5 | ".note": {
6 | color: "#8F8E95"
7 | },
8 | width: 90,
9 | marginRight: -4
10 | };
11 |
12 | return pickerTheme;
13 | };
14 |
--------------------------------------------------------------------------------
/__tests__/App.js:
--------------------------------------------------------------------------------
1 | import 'react-native';
2 | import React from 'react';
3 | import App from '../App';
4 |
5 | // Note: test renderer must be required after react-native.
6 | import renderer from 'react-test-renderer';
7 |
8 | it('renders correctly', () => {
9 | const tree = renderer.create(
10 |
11 | );
12 | });
13 |
--------------------------------------------------------------------------------
/src/stores/configurestore.prod.js:
--------------------------------------------------------------------------------
1 | import { createStore, compose, applyMiddleware } from 'redux';
2 | import thunk from 'redux-thunk';
3 | import reducers from '../reducers';
4 |
5 | export default function configureStore() {
6 | const middleware = applyMiddleware(thunk);
7 | return compose(middleware)(createStore)(reducers);
8 | }
9 |
--------------------------------------------------------------------------------
/native-base-theme/components/Right.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const rightTheme = {
5 | 'NativeBase.Button': {
6 | alignSelf: null,
7 | },
8 | flex: 1,
9 | alignSelf: 'center',
10 | alignItems: 'flex-end',
11 | };
12 |
13 | return rightTheme;
14 | };
15 |
--------------------------------------------------------------------------------
/native-base-theme/components/Subtitle.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const subtitleTheme = {
5 | fontSize: variables.subTitleFontSize,
6 | fontFamily: variables.titleFontfamily,
7 | color: variables.subtitleColor,
8 | textAlign: 'center',
9 | };
10 |
11 | return subtitleTheme;
12 | };
13 |
--------------------------------------------------------------------------------
/src/reducers/index.js:
--------------------------------------------------------------------------------
1 | import { combineReducers } from 'redux';
2 | import navReducer from './nav';
3 | import statusReducer from './getStatus';
4 | import imagesReducer from './images';
5 | import videoReducer from './videos';
6 |
7 | export default combineReducers({
8 | nav: navReducer,
9 | whatsappStatus: statusReducer,
10 | images: imagesReducer,
11 | videos: videoReducer
12 | })
13 |
--------------------------------------------------------------------------------
/native-base-theme/components/Container.js:
--------------------------------------------------------------------------------
1 | import { Platform, Dimensions } from "react-native";
2 |
3 | import variable from "./../variables/platform";
4 |
5 | const deviceHeight = Dimensions.get("window").height;
6 | export default (variables = variable) => {
7 | const theme = {
8 | flex: 1,
9 | height: Platform.OS === "ios" ? deviceHeight : deviceHeight - 20
10 | };
11 |
12 | return theme;
13 | };
14 |
--------------------------------------------------------------------------------
/src/reducers/nav.js:
--------------------------------------------------------------------------------
1 | import { MainNavigation } from '../containers';
2 |
3 |
4 | const initialState = MainNavigation.router.getStateForAction(MainNavigation.router.getActionForPathAndParams('Home'));
5 |
6 | const navReducer = (state = initialState, action) => {
7 | const newState = MainNavigation.router.getStateForAction(action, state);
8 | return newState || state;
9 | };
10 |
11 | export default navReducer;
--------------------------------------------------------------------------------
/native-base-theme/components/Text.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const textTheme = {
5 | fontSize: variables.DefaultFontSize - 1,
6 | fontFamily: variables.fontFamily,
7 | color: variables.textColor,
8 | ".note": {
9 | color: "#a7a7a7",
10 | fontSize: variables.noteFontSize
11 | }
12 | };
13 |
14 | return textTheme;
15 | };
16 |
--------------------------------------------------------------------------------
/native-base-theme/components/Content.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const contentTheme = {
5 | ".padder": {
6 | padding: variables.contentPadding
7 | },
8 | flex: 1,
9 | backgroundColor: "transparent",
10 | "NativeBase.Segment": {
11 | borderWidth: 0,
12 | backgroundColor: "transparent"
13 | }
14 | };
15 |
16 | return contentTheme;
17 | };
18 |
--------------------------------------------------------------------------------
/src/components/Splash/styles.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet } from 'react-native';
2 |
3 | export const styles = StyleSheet.create({
4 | container: {
5 | flex: 1,
6 | justifyContent: 'center',
7 | alignItems: 'center',
8 | backgroundColor: 'dodgerblue'
9 | },
10 | welcome: {
11 | fontSize: 30,
12 | textAlign: 'center',
13 | margin: 10,
14 | color: '#FFF',
15 | fontFamily: 'Iowan Old Style'
16 | }
17 | });
--------------------------------------------------------------------------------
/native-base-theme/components/Title.js:
--------------------------------------------------------------------------------
1 | import { Platform } from "react-native";
2 |
3 | import variable from "./../variables/platform";
4 |
5 | export default (variables = variable) => {
6 | const titleTheme = {
7 | fontSize: variables.titleFontSize,
8 | fontFamily: variables.titleFontfamily,
9 | color: variables.titleFontColor,
10 | fontWeight: Platform.OS === "ios" ? "600" : undefined,
11 | textAlign: "center"
12 | };
13 |
14 | return titleTheme;
15 | };
16 |
--------------------------------------------------------------------------------
/native-base-theme/components/Input.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const inputTheme = {
5 | '.multiline': {
6 | height: null,
7 | },
8 | height: variables.inputHeightBase,
9 | color: variables.inputColor,
10 | paddingLeft: 5,
11 | paddingRight: 5,
12 | flex: 1,
13 | fontSize: variables.inputFontSize,
14 | lineHeight: variables.inputLineHeight,
15 | };
16 |
17 | return inputTheme;
18 | };
19 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/whatsappdownloader/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.whatsappdownloader;
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.
9 | * This is used to schedule rendering of the component.
10 | */
11 | @Override
12 | protected String getMainComponentName() {
13 | return "whatsappDownloader";
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/AppDelegate.h:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | @interface AppDelegate : UIResponder
13 |
14 | @property (nonatomic, strong) UIWindow *window;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/main.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 |
12 | #import "AppDelegate.h"
13 |
14 | int main(int argc, char * argv[]) {
15 | @autoreleasepool {
16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
17 | }
18 | }
19 |
--------------------------------------------------------------------------------
/App.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Provider } from 'react-redux';
3 | import { Root } from 'native-base';
4 |
5 | import configureStore from './src/stores/configurestore.dev';
6 | import MainNavigationWithState from './src/containers';
7 |
8 | const store = configureStore();
9 |
10 | export default class WhatsappDownloader extends Component {
11 |
12 | render() {
13 | return (
14 |
15 |
16 |
17 |
18 |
19 | );
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/native-base-theme/components/Fab.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 |
6 | const fabTheme = {
7 | "NativeBase.Button": {
8 | alignItems: "center",
9 | padding: null,
10 | justifyContent: "center",
11 | "NativeBase.Icon": {
12 | alignSelf: "center",
13 | fontSize: 20,
14 | marginLeft: 0,
15 | marginRight: 0,
16 | },
17 | "NativeBase.IconNB": {
18 | alignSelf: "center",
19 | fontSize: 20,
20 | marginLeft: 0,
21 | marginRight: 0,
22 | },
23 | },
24 | };
25 |
26 | return fabTheme;
27 | };
28 |
--------------------------------------------------------------------------------
/native-base-theme/components/Textarea.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const textAreaTheme = {
5 | ".underline": {
6 | borderBottomWidth: variables.borderWidth,
7 | marginTop: 5,
8 | borderColor: variables.inputBorderColor
9 | },
10 | ".bordered": {
11 | borderWidth: 1,
12 | marginTop: 5,
13 | borderColor: variables.inputBorderColor
14 | },
15 | color: variables.textColor,
16 | paddingLeft: 10,
17 | paddingRight: 5,
18 | fontSize: 15,
19 | textAlignVertical: "top"
20 | };
21 |
22 | return textAreaTheme;
23 | };
24 |
--------------------------------------------------------------------------------
/android/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 | repositories {
5 | jcenter()
6 | }
7 | dependencies {
8 | classpath 'com.android.tools.build:gradle:2.2.3'
9 |
10 | // NOTE: Do not place your application dependencies here; they belong
11 | // in the individual module build.gradle files
12 | }
13 | }
14 |
15 | allprojects {
16 | repositories {
17 | mavenLocal()
18 | jcenter()
19 | maven {
20 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21 | url "$rootDir/../node_modules/react-native/android"
22 | }
23 | }
24 | }
25 |
--------------------------------------------------------------------------------
/src/reducers/videos.js:
--------------------------------------------------------------------------------
1 | import {
2 | FETCH_WHATSAPP_STATUS_VIDEOS_START,
3 | FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS,
4 | } from '../constants';
5 |
6 | import { createReducer } from '../utils/helpers';
7 |
8 |
9 | const initialState = {
10 | request: false,
11 | files: [],
12 | error: null
13 | };
14 |
15 | export default createReducer(initialState, {
16 | [FETCH_WHATSAPP_STATUS_VIDEOS_START]: (state, payload) => {
17 | return Object.assign({}, state, {
18 | request: true
19 | })
20 | },
21 | [FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS]: (state, payload) => {
22 | return Object.assign({}, state, {
23 | request: false,
24 | files: payload.videos
25 | })
26 | }
27 | })
28 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/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 | }
--------------------------------------------------------------------------------
/native-base-theme/components/Card.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const cardTheme = {
5 | ".transparent": {
6 | shadowColor: null,
7 | shadowOffset: null,
8 | shadowOpacity: null,
9 | shadowRadius: null,
10 | elevation: null
11 | },
12 | marginVertical: 5,
13 | marginHorizontal: 2,
14 | flex: 1,
15 | borderWidth: variables.borderWidth,
16 | borderRadius: 2,
17 | borderColor: variables.cardBorderColor,
18 | flexWrap: "nowrap",
19 | backgroundColor: variables.cardDefaultBg,
20 | shadowColor: "#000",
21 | shadowOffset: { width: 0, height: 2 },
22 | shadowOpacity: 0.1,
23 | shadowRadius: 1.5,
24 | elevation: 3
25 | };
26 |
27 | return cardTheme;
28 | };
29 |
--------------------------------------------------------------------------------
/native-base-theme/components/Thumbnail.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const thumbnailTheme = {
5 | '.square': {
6 | borderRadius: 0,
7 | '.small': {
8 | width: 36,
9 | height: 36,
10 | borderRadius: 0,
11 | },
12 | '.large': {
13 | width: 80,
14 | height: 80,
15 | borderRadius: 0,
16 | },
17 | },
18 | '.small': {
19 | width: 36,
20 | height: 36,
21 | borderRadius: 18,
22 | '.square': {
23 | borderRadius: 0,
24 | },
25 | },
26 | '.large': {
27 | width: 80,
28 | height: 80,
29 | borderRadius: 40,
30 | '.square': {
31 | borderRadius: 0,
32 | },
33 | },
34 | width: 56,
35 | height: 56,
36 | borderRadius: 28,
37 | };
38 |
39 | return thumbnailTheme;
40 | };
41 |
--------------------------------------------------------------------------------
/src/stores/configurestore.dev.js:
--------------------------------------------------------------------------------
1 | import { createStore, compose, applyMiddleware } from 'redux';
2 | import devTools from 'remote-redux-devtools';
3 | import { createLogger } from 'redux-logger';
4 | import { createReactNavigationReduxMiddleware } from 'react-navigation-redux-helpers';
5 | import thunk from 'redux-thunk';
6 | import reducers from '../reducers';
7 |
8 | const logger = createLogger();
9 | const reactNavigationReduxMiddleware = createReactNavigationReduxMiddleware(
10 | "root",
11 | state => state.nav,
12 | );
13 |
14 | export default function configureStore() {
15 | const middleware = applyMiddleware(thunk, logger, reactNavigationReduxMiddleware);
16 | const createStoreWithMiddleware = compose(middleware, devTools());
17 | return createStoreWithMiddleware(createStore)(reducers);
18 |
19 | };
20 |
--------------------------------------------------------------------------------
/ios/whatsappDownloaderTests/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 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader-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 |
--------------------------------------------------------------------------------
/android/settings.gradle:
--------------------------------------------------------------------------------
1 | rootProject.name = 'whatsappDownloader'
2 | include ':react-native-fabric'
3 | project(':react-native-fabric').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fabric/android')
4 | include ':react-native-tts'
5 | project(':react-native-tts').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-tts/android')
6 | include ':react-native-video'
7 | project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
8 | include ':react-native-fetch-blob'
9 | project(':react-native-fetch-blob').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fetch-blob/android')
10 | include ':react-native-vector-icons'
11 | project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')
12 |
13 | include ':app'
14 |
--------------------------------------------------------------------------------
/native-base-theme/components/Radio.js:
--------------------------------------------------------------------------------
1 | import { Platform } from "react-native";
2 |
3 | import variable from "./../variables/platform";
4 |
5 | export default (variables = variable) => {
6 | const radioTheme = {
7 | ".selected": {
8 | "NativeBase.IconNB": {
9 | color: Platform.OS === "ios"
10 | ? variables.radioColor
11 | : variables.radioSelectedColorAndroid,
12 | lineHeight: Platform.OS === "ios" ? 25 : variables.radioBtnLineHeight,
13 | height: Platform.OS === "ios" ? 20 : undefined
14 | }
15 | },
16 | "NativeBase.IconNB": {
17 | color: Platform.OS === "ios" ? "transparent" : undefined,
18 | lineHeight: Platform.OS === "ios"
19 | ? undefined
20 | : variables.radioBtnLineHeight,
21 | fontSize: Platform.OS === "ios" ? undefined : variables.radioBtnSize
22 | }
23 | };
24 |
25 | return radioTheme;
26 | };
27 |
--------------------------------------------------------------------------------
/native-base-theme/components/TabContainer.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 | import { Platform } from "react-native";
3 |
4 | export default (variables = variable) => {
5 | const platformStyle = variables.platformStyle;
6 | const platform = variables.platform;
7 |
8 | const tabContainerTheme = {
9 | elevation: 3,
10 | height: 50,
11 | flexDirection: "row",
12 | shadowColor: platformStyle === "material" ? "#000" : undefined,
13 | shadowOffset: platformStyle === "material"
14 | ? { width: 0, height: 2 }
15 | : undefined,
16 | shadowOpacity: platformStyle === "material" ? 0.2 : undefined,
17 | shadowRadius: platformStyle === "material" ? 1.2 : undefined,
18 | justifyContent: "space-around",
19 | borderBottomWidth: Platform.OS === "ios" ? variables.borderWidth : 0,
20 | borderColor: variables.topTabBarBorderColor
21 | };
22 |
23 | return tabContainerTheme;
24 | };
25 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # react-native-whatsapp-status-downloader
2 |
3 | A react native app for downloading whatsapp status
4 |
5 | I decided to create this app when my friend posted a very funny video on his whatsapp status.
6 |
7 | Whatsapp status files is located in */Whatsapp/media/.statuses* directory
8 |
9 | This project crawls throughout the directory with the help of `react-native-fetch-blob`
10 |
11 | Running locally
12 | ```sh
13 | git clone https://github.com/raheemazeezabiodun/react-native-whatsapp-status-downloader.git
14 | cd react-native-whatsapp-status-downloader
15 | npm install
16 | ```
17 |
18 | create a [fabric](https://fabric.io) api key for handling crashes and add it to `Android/app/src/main/AndroidManifest.xml` file
19 |
20 | Bundle the apk together with
21 | ```sh
22 | npm run bundle-android
23 | ```
24 |
25 | Star this project if you like it.
26 |
27 | Created by Raheem Azeez Abiodun([@raheemazeezabiodun](https://github.com/raheemazeezabiodun)).
28 |
--------------------------------------------------------------------------------
/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 | android.useDeprecatedNdk=true
21 |
--------------------------------------------------------------------------------
/src/containers/Saved/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Header, Title, Content, Footer, FooterTab, Button, Left, Right, Body, Icon, Text } from 'native-base';
3 |
4 |
5 | export default class Saved extends Component {
6 |
7 | componentDidMount() {
8 | //setTimeout(this.props.navigation.navigate('AppIntro'), 3000)
9 | }
10 |
11 | render() {
12 | return (
13 |
14 |
15 |
16 | This is Content Section
17 |
18 |
19 |
26 |
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/src/containers/NotSaved/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Header, Title, Content, Footer, FooterTab, Button, Left, Right, Body, Icon, Text } from 'native-base';
3 |
4 |
5 | export default class NotSaved extends Component {
6 |
7 | componentDidMount() {
8 | //setTimeout(this.props.navigation.navigate('AppIntro'), 3000)
9 | }
10 |
11 | render() {
12 | return (
13 |
14 |
15 |
16 | This is Content Section
17 |
18 |
19 |
26 |
27 | );
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/.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 | project.xcworkspace
24 |
25 | # Android/IntelliJ
26 | #
27 | build/
28 | .idea
29 | .gradle
30 | local.properties
31 | *.iml
32 |
33 | # node.js
34 | #
35 | node_modules/
36 | npm-debug.log
37 | yarn-error.log
38 |
39 | # BUCK
40 | buck-out/
41 | \.buckd/
42 | *.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 |
--------------------------------------------------------------------------------
/src/reducers/images.js:
--------------------------------------------------------------------------------
1 | import {
2 | FETCH_WHATSAPP_STATUS_IMAGES_START,
3 | FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS,
4 | FETCH_WHATSAPP_STATUS_IMAGES_FAIL
5 | } from '../constants';
6 |
7 | import { createReducer } from '../utils/helpers';
8 |
9 |
10 | const initialState = {
11 | request: false,
12 | files: [],
13 | error: null
14 | };
15 |
16 | export default createReducer(initialState, {
17 | [FETCH_WHATSAPP_STATUS_IMAGES_START]: (state, payload) => {
18 | return Object.assign({}, state, {
19 | request: true
20 | })
21 | },
22 | [FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS]: (state, payload) => {
23 | return Object.assign({}, state, {
24 | request: false,
25 | files: payload.images
26 | })
27 | },
28 | [FETCH_WHATSAPP_STATUS_IMAGES_FAIL]: (state, payload) => {
29 | return Object.assign({}, state, {
30 | request: false,
31 | error: payload.error
32 | })
33 | }
34 | })
35 |
--------------------------------------------------------------------------------
/src/reducers/getStatus.js:
--------------------------------------------------------------------------------
1 | import {
2 | FETCH_WHATSAPP_STATUS_FILES_START,
3 | FETCH_WHATSAPP_STATUS_FILES_SUCCESS,
4 | FETCH_WHATSAPP_STATUS_FILES_FAIL
5 | } from '../constants';
6 |
7 | import { createReducer } from '../utils/helpers';
8 |
9 |
10 | const initialState = {
11 | request: false,
12 | files: [],
13 | error: null
14 | };
15 |
16 | export default createReducer(initialState, {
17 | [FETCH_WHATSAPP_STATUS_FILES_SUCCESS]: (state, payload) => {
18 | return Object.assign({}, state, {
19 | request: true
20 | })
21 | },
22 | [FETCH_WHATSAPP_STATUS_FILES_SUCCESS]: (state, payload) => {
23 | return Object.assign({}, state, {
24 | request: false,
25 | files: payload.statusFiles
26 | })
27 | },
28 | [FETCH_WHATSAPP_STATUS_FILES_FAIL]: (state, payload) => {
29 | return Object.assign({}, state, {
30 | request: false,
31 | error: payload.error
32 | })
33 | }
34 | })
35 |
--------------------------------------------------------------------------------
/native-base-theme/components/Toast.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 |
6 | const toastTheme = {
7 | ".danger": {
8 | backgroundColor: variables.brandDanger
9 | },
10 | ".warning": {
11 | backgroundColor: variables.brandWarning
12 | },
13 | ".success": {
14 | backgroundColor: variables.brandSuccess
15 | },
16 | backgroundColor: "rgba(0,0,0,0.8)",
17 | borderRadius: platform === "ios" ? 5 : 0,
18 | flexDirection: "row",
19 | justifyContent: "space-between",
20 | alignItems: "center",
21 | padding: 10,
22 | minHeight: 50,
23 | "NativeBase.Text": {
24 | color: "#fff",
25 | flex: 1
26 | },
27 | "NativeBase.Button": {
28 | backgroundColor: "transparent",
29 | height: 30,
30 | elevation: 0,
31 | "NativeBase.Text": {
32 | fontSize: 14
33 | }
34 | }
35 | };
36 |
37 | return toastTheme;
38 | };
39 |
--------------------------------------------------------------------------------
/src/components/AppIntro/style.js:
--------------------------------------------------------------------------------
1 | import { StyleSheet, Dimensions } from 'react-native';
2 |
3 | export const styles = StyleSheet.create({
4 | buttonCircle: {
5 | width: 40,
6 | height: 40,
7 | backgroundColor: 'rgba(0, 0, 0, .2)',
8 | borderRadius: 20,
9 | justifyContent: 'center',
10 | alignItems: 'center',
11 | },
12 | image: {
13 | width: Dimensions.get('screen').width,
14 | height: Dimensions.get('screen').height,
15 | },
16 | titleContainer: {
17 | justifyContent: 'center',
18 | alignItems: 'center',
19 | },
20 | titleStyle: {
21 | color: '#FFF',
22 | fontSize: 30,
23 | paddingTop: 30
24 | },
25 | descriptionContainer: {
26 | flex: 1,
27 | justifyContent: 'center',
28 | alignItems: 'center',
29 | },
30 | descriptionStyle: {
31 | color: '#FFF',
32 | fontSize: 20,
33 | textAlign: 'center',
34 | fontWeight: 'bold'
35 | }
36 | });
37 |
--------------------------------------------------------------------------------
/native-base-theme/components/Badge.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const badgeTheme = {
5 | ".primary": {
6 | backgroundColor: variables.btnPrimaryBg
7 | },
8 | ".warning": {
9 | backgroundColor: variables.btnWarningBg
10 | },
11 | ".info": {
12 | backgroundColor: variables.btnInfoBg
13 | },
14 | ".success": {
15 | backgroundColor: variables.btnSuccessBg
16 | },
17 | ".danger": {
18 | backgroundColor: variables.btnDangerBg
19 | },
20 | "NativeBase.Text": {
21 | color: variables.badgeColor,
22 | fontSize: variables.fontSizeBase,
23 | lineHeight: variables.lineHeight - 1,
24 | textAlign: "center",
25 | paddingHorizontal: 3
26 | },
27 | backgroundColor: variables.badgeBg,
28 | padding: variables.badgePadding,
29 | paddingHorizontal: 6,
30 | alignSelf: "flex-start",
31 | borderRadius: 13.5,
32 | height: 27
33 | };
34 | return badgeTheme;
35 | };
36 |
--------------------------------------------------------------------------------
/src/actions/videos.js:
--------------------------------------------------------------------------------
1 | import {
2 | FETCH_WHATSAPP_STATUS_VIDEOS_START,
3 | FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS,
4 | FETCH_WHATSAPP_STATUS_VIDEOS_FAIL
5 | } from '../constants';
6 |
7 |
8 | export function fetchWhatsappStatusVideosStart() {
9 | return {
10 | type: FETCH_WHATSAPP_STATUS_VIDEOS_START
11 | }
12 | }
13 |
14 | export function fetchWhatsappStatusVideosSuccess(videos) {
15 | return {
16 | type: FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS,
17 | payload: {
18 | videos
19 | }
20 | }
21 | }
22 |
23 | export function fetchWhatsappStatusVideosFail(error) {
24 | return {
25 | type: FETCH_WHATSAPP_STATUS_VIDEOS_FAIL,
26 | error
27 | }
28 | }
29 |
30 | export function getWhatsappVideos(statusFiles) {
31 | return (dispatch) => {
32 | dispatch(fetchWhatsappStatusVideosStart());
33 | let videos = statusFiles.filter((elem, index) => elem.endsWith('.mp4'));
34 | return dispatch(fetchWhatsappStatusVideosSuccess(videos));
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/native-base-theme/components/SwipeRow.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const swipeRowTheme = {
5 | "NativeBase.ListItem": {
6 | ".list": {
7 | backgroundColor: "#FFF",
8 | },
9 | marginLeft: 0,
10 | },
11 | "NativeBase.Left": {
12 | flex: 0,
13 | alignSelf: null,
14 | alignItems: null,
15 | "NativeBase.Button": {
16 | flex: 1,
17 | alignItems: "center",
18 | justifyContent: "center",
19 | alignSelf: "stretch",
20 | borderRadius: 0,
21 | },
22 | },
23 | "NativeBase.Right": {
24 | flex: 0,
25 | alignSelf: null,
26 | alignItems: null,
27 | "NativeBase.Button": {
28 | flex: 1,
29 | alignItems: "center",
30 | justifyContent: "center",
31 | alignSelf: "stretch",
32 | borderRadius: 0,
33 | },
34 | },
35 | "NativeBase.Button": {
36 | flex: 1,
37 | height: null,
38 | alignItems: "center",
39 | justifyContent: "center",
40 | alignSelf: "stretch",
41 | borderRadius: 0,
42 | },
43 | };
44 |
45 | return swipeRowTheme;
46 | };
47 |
--------------------------------------------------------------------------------
/src/actions/images.js:
--------------------------------------------------------------------------------
1 | import {
2 | FETCH_WHATSAPP_STATUS_IMAGES_START,
3 | FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS,
4 | FETCH_WHATSAPP_STATUS_IMAGES_FAIL
5 | } from '../constants';
6 | import { getWhatsappStatusDirectory } from '../utils/helpers';
7 |
8 |
9 | export function fetchWhatsappStatusImagesStart() {
10 | return {
11 | type: FETCH_WHATSAPP_STATUS_IMAGES_START
12 | }
13 | }
14 |
15 | export function fetchWhatsappStatusImagesSuccess(images) {
16 | return {
17 | type: FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS,
18 | payload: {
19 | images
20 | }
21 | }
22 | }
23 |
24 | export function fetchWhatsappStatusImagesFail(error) {
25 | return {
26 | type: FETCH_WHATSAPP_STATUS_IMAGES_FAIL,
27 | error
28 | }
29 | }
30 |
31 | export function getWhatsappImages(statusFiles) {
32 | return (dispatch) => {
33 | dispatch(fetchWhatsappStatusImagesStart());
34 | let images = statusFiles.filter((elem, index) => elem.endsWith('.jpg'));
35 | return dispatch(fetchWhatsappStatusImagesSuccess(images));
36 |
37 | }
38 | }
--------------------------------------------------------------------------------
/native-base-theme/components/TabHeading.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 |
6 | const tabHeadingTheme = {
7 | flexDirection: "row",
8 | backgroundColor: variables.tabDefaultBg,
9 | flex: 1,
10 | alignItems: "center",
11 | justifyContent: "center",
12 | ".scrollable": {
13 | paddingHorizontal: 20,
14 | flex: platform === "android" ? 0 : 1,
15 | minWidth: platform === "android" ? undefined : 60
16 | },
17 | "NativeBase.Text": {
18 | color: variables.topTabBarTextColor,
19 | marginHorizontal: 7
20 | },
21 | "NativeBase.Icon": {
22 | color: variables.topTabBarTextColor,
23 | fontSize: platform === "ios" ? 26 : undefined
24 | },
25 | ".active": {
26 | "NativeBase.Text": {
27 | color: variables.topTabBarActiveTextColor,
28 | fontWeight: "600"
29 | },
30 | "NativeBase.Icon": {
31 | color: variables.topTabBarActiveTextColor
32 | }
33 | }
34 | };
35 |
36 | return tabHeadingTheme;
37 | };
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 Raheem Azeez Abiodun
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/constants/index.js:
--------------------------------------------------------------------------------
1 | import { Platform } from 'react-native';
2 | import RNFetchBlob from 'react-native-fetch-blob'
3 |
4 |
5 | const dirs = RNFetchBlob.fs.dirs;
6 | export const SDCARD_DIR = Platform.OS === 'android' ? dirs.SDCardDir: '';
7 |
8 | export const DIRECTORY_NAME = 'whatsappStatusDownloader';
9 |
10 | export const DEV_MODE = true;
11 |
12 | export const FETCH_WHATSAPP_STATUS_FILES_START = 'FETCH_WHATSAPP_STATUS_FILES_START';
13 | export const FETCH_WHATSAPP_STATUS_FILES_SUCCESS = 'FETCH_WHATSAPP_STATUS_FILES_SUCCESS';
14 | export const FETCH_WHATSAPP_STATUS_FILES_FAIL = 'FETCH_WHATSAPP_STATUS_FILES_FAIL';
15 |
16 | export const FETCH_WHATSAPP_STATUS_IMAGES_START = 'FETCH_WHATSAPP_STATUS_IMAGES_START';
17 | export const FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS = 'FETCH_WHATSAPP_STATUS_IMAGES_SUCCESS';
18 | export const FETCH_WHATSAPP_STATUS_IMAGES_FAIL = 'FETCH_WHATSAPP_STATUS_IMAGES_FAIL';
19 |
20 | export const FETCH_WHATSAPP_STATUS_VIDEOS_START = 'FETCH_WHATSAPP_STATUS_VIDEOS_START';
21 | export const FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS = 'FETCH_WHATSAPP_STATUS_VIDEOS_SUCCESS';
22 | export const FETCH_WHATSAPP_STATUS_VIDEOS_FAIL = 'FETCH_WHATSAPP_STATUS_VIDEOS_FAIL';
23 |
24 |
--------------------------------------------------------------------------------
/native-base-theme/components/CheckBox.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const checkBoxTheme = {
5 | ".checked": {
6 | "NativeBase.Icon": {
7 | color: variables.checkboxTickColor
8 | },
9 | "NativeBase.IconNB": {
10 | color: variables.checkboxTickColor
11 | }
12 | },
13 | "NativeBase.Icon": {
14 | color: "transparent",
15 | lineHeight: variables.CheckboxIconSize,
16 | marginTop: variables.CheckboxIconMarginTop,
17 | fontSize: variables.CheckboxFontSize
18 | },
19 | "NativeBase.IconNB": {
20 | color: "transparent",
21 | lineHeight: variables.CheckboxIconSize,
22 | marginTop: variables.CheckboxIconMarginTop,
23 | fontSize: variables.CheckboxFontSize
24 | },
25 | borderRadius: variables.CheckboxRadius,
26 | overflow: "hidden",
27 | width: variables.checkboxSize,
28 | height: variables.checkboxSize,
29 | borderWidth: variables.CheckboxBorderWidth,
30 | paddingLeft: variables.CheckboxPaddingLeft - 1,
31 | paddingBottom: variables.CheckboxPaddingBottom,
32 | left: 10
33 | };
34 |
35 | return checkBoxTheme;
36 | };
37 |
--------------------------------------------------------------------------------
/native-base-theme/components/Separator.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const theme = {
5 | '.group': {
6 | height: 50,
7 | paddingVertical: variables.listItemPadding - 8,
8 | paddingTop: variables.listItemPadding + 12,
9 | '.bordered': {
10 | height: 50,
11 | paddingVertical: variables.listItemPadding - 8,
12 | paddingTop: variables.listItemPadding + 12,
13 | },
14 | },
15 | '.bordered': {
16 | '.noTopBorder': {
17 | borderTopWidth: 0,
18 | },
19 | '.noBottomBorder': {
20 | borderBottomWidth: 0,
21 | },
22 | height: 35,
23 | paddingTop: variables.listItemPadding + 2,
24 | paddingBottom: variables.listItemPadding,
25 | borderBottomWidth: variables.borderWidth,
26 | borderTopWidth: variables.borderWidth,
27 | borderColor: variables.listBorderColor,
28 | },
29 | 'NativeBase.Text': {
30 | fontSize: variables.tabBarTextSize - 2,
31 | color: '#777',
32 | },
33 | '.noTopBorder': {
34 | borderTopWidth: 0,
35 | },
36 | '.noBottomBorder': {
37 | borderBottomWidth: 0,
38 | },
39 | height: 38,
40 | backgroundColor: '#F0EFF5',
41 | flex: 1,
42 | justifyContent: 'center',
43 | paddingLeft: variables.listItemPadding + 5,
44 | };
45 |
46 | return theme;
47 | };
48 |
--------------------------------------------------------------------------------
/src/actions/getStatus.js:
--------------------------------------------------------------------------------
1 | import RNFetchBlob from 'react-native-fetch-blob';
2 | import {
3 | FETCH_WHATSAPP_STATUS_FILES_START,
4 | FETCH_WHATSAPP_STATUS_FILES_SUCCESS,
5 | FETCH_WHATSAPP_STATUS_FILES_FAIL
6 | } from '../constants';
7 |
8 | import { getWhatsappStatusDirectory } from '../utils/helpers';
9 |
10 | export function fetchWhatsappStatusFilesStart() {
11 | return {
12 | type: FETCH_WHATSAPP_STATUS_FILES_START
13 | }
14 | }
15 |
16 | export function fetchWhatsappStatusFilesSuccess(statusFiles) {
17 | return {
18 | type: FETCH_WHATSAPP_STATUS_FILES_SUCCESS,
19 | payload: {
20 | statusFiles: statusFiles
21 | }
22 | }
23 | }
24 |
25 | export function fetchWhatsappStatusFilesFail(error) {
26 | return {
27 | type: FETCH_WHATSAPP_STATUS_FILES_FAIL,
28 | error
29 | }
30 | }
31 |
32 | export function fecthWhatsappStatus(){
33 | return (dispatch => {
34 | dispatch(fetchWhatsappStatusFilesStart());
35 | console.log(getWhatsappStatusDirectory())
36 | RNFetchBlob.fs.ls(getWhatsappStatusDirectory())
37 | .then(data => {
38 | dispatch(fetchWhatsappStatusFilesSuccess(data))
39 | }).catch(error => {
40 | dispatch(fetchWhatsappStatusFilesFail(error));
41 | });
42 |
43 | })
44 | }
45 |
--------------------------------------------------------------------------------
/native-base-theme/components/Segment.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 |
6 | const segmentTheme = {
7 | height: 45,
8 | borderColor: variables.segmentBorderColorMain,
9 | flexDirection: "row",
10 | justifyContent: "center",
11 | backgroundColor: variables.segmentBackgroundColor,
12 | "NativeBase.Button": {
13 | alignSelf: "center",
14 | borderRadius: 0,
15 | paddingHorizontal: 20,
16 | height: 30,
17 | backgroundColor: "transparent",
18 | borderWidth: 1,
19 | borderLeftWidth: 0,
20 | borderColor: variables.segmentBorderColor,
21 | elevation: 0,
22 | ".active": {
23 | backgroundColor: variables.segmentActiveBackgroundColor,
24 | "NativeBase.Text": {
25 | color: variables.segmentActiveTextColor,
26 | },
27 | },
28 | ".first": {
29 | borderTopLeftRadius: platform === "ios" ? 5 : undefined,
30 | borderBottomLeftRadius: platform === "ios" ? 5 : undefined,
31 | borderLeftWidth: 1,
32 | },
33 | ".last": {
34 | borderTopRightRadius: platform === "ios" ? 5 : undefined,
35 | borderBottomRightRadius: platform === "ios" ? 5 : undefined,
36 | },
37 | "NativeBase.Text": {
38 | color: variables.segmentTextColor,
39 | fontSize: 14,
40 | },
41 | },
42 | };
43 |
44 | return segmentTheme;
45 | };
46 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "whatsappDownloader",
3 | "version": "0.0.1",
4 | "private": true,
5 | "scripts": {
6 | "start": "node node_modules/react-native/local-cli/cli.js start",
7 | "test": "jest",
8 | "bundle-android": "react-native bundle --platform android --dev false --entry-file index.android.js --bundle-output android/app/src/main/assets/index.android.bundle --sourcemap-output android/app/src/main/assets/index.android.map --assets-dest android/app/src/main/res/"
9 | },
10 | "dependencies": {
11 | "native-base": "^2.3.8",
12 | "react": "16.2.0",
13 | "react-native": "0.53.0",
14 | "react-native-app-intro-slider": "^0.2.3",
15 | "react-native-fabric": "^0.5.1",
16 | "react-native-fetch-blob": "^0.10.8",
17 | "react-native-simple-store": "^1.3.0",
18 | "react-native-vector-icons": "^4.5.0",
19 | "react-native-video": "^2.0.0",
20 | "react-native-video-player": "^0.9.0",
21 | "react-navigation": "^1.0.3",
22 | "react-navigation-redux-helpers": "^1.0.1",
23 | "react-redux": "^5.0.6",
24 | "redux": "^3.7.2",
25 | "redux-thunk": "^2.2.0"
26 | },
27 | "devDependencies": {
28 | "babel-jest": "22.2.0",
29 | "babel-preset-react-native": "4.0.0",
30 | "jest": "22.2.1",
31 | "react-test-renderer": "16.2.0",
32 | "redux-logger": "^3.0.6",
33 | "remote-redux-devtools": "^0.5.12"
34 | },
35 | "jest": {
36 | "preset": "react-native"
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/components/Fab/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Header, Title, Content, Footer, FooterTab, Button, Left, Right, Body, Icon, Text, Fab } from 'native-base';
3 |
4 |
5 | export default class FAB extends Component {
6 |
7 | constructor(props) {
8 | super(props);
9 | this.state = {
10 | active: false
11 | }
12 | }
13 |
14 | componentDidMount() {
15 | }
16 |
17 | render() {
18 | return (
19 |
20 | this.setState({ active: !this.state.active })}>
27 |
28 |
32 |
35 |
38 |
39 |
40 |
41 | );
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/AppDelegate.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import "AppDelegate.h"
11 |
12 | #import
13 | #import
14 |
15 | @implementation AppDelegate
16 |
17 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
18 | {
19 | NSURL *jsCodeLocation;
20 |
21 | jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
22 |
23 | RCTRootView *rootView = [[RCTRootView alloc] initWithBundleURL:jsCodeLocation
24 | moduleName:@"whatsappDownloader"
25 | initialProperties:nil
26 | launchOptions:launchOptions];
27 | rootView.backgroundColor = [[UIColor alloc] initWithRed:1.0f green:1.0f blue:1.0f alpha:1];
28 |
29 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
30 | UIViewController *rootViewController = [UIViewController new];
31 | rootViewController.view = rootView;
32 | self.window.rootViewController = rootViewController;
33 | [self.window makeKeyAndVisible];
34 | return YES;
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/native-base-theme/components/TabBar.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const tabBarTheme = {
5 | ".tabIcon": {
6 | height: undefined
7 | },
8 | ".vertical": {
9 | height: 60
10 | },
11 | "NativeBase.Button": {
12 | ".transparent": {
13 | "NativeBase.Text": {
14 | fontSize: variables.tabFontSize,
15 | color: variables.sTabBarActiveTextColor,
16 | fontWeight: "400"
17 | },
18 | "NativeBase.IconNB": {
19 | color: variables.sTabBarActiveTextColor
20 | }
21 | },
22 | "NativeBase.IconNB": {
23 | color: variables.sTabBarActiveTextColor
24 | },
25 | "NativeBase.Text": {
26 | fontSize: variables.tabFontSize,
27 | color: variables.sTabBarActiveTextColor,
28 | fontWeight: "400"
29 | },
30 | ".isTabActive": {
31 | "NativeBase.Text": {
32 | fontWeight: "900"
33 | }
34 | },
35 | flex: 1,
36 | alignSelf: "stretch",
37 | alignItems: "center",
38 | justifyContent: "center",
39 | borderRadius: null,
40 | borderBottomColor: "transparent",
41 | backgroundColor: variables.tabBgColor
42 | },
43 | height: 45,
44 | flexDirection: "row",
45 | justifyContent: "space-around",
46 | borderWidth: 1,
47 | borderTopWidth: 0,
48 | borderLeftWidth: 0,
49 | borderRightWidth: 0,
50 | borderBottomColor: "#ccc",
51 | backgroundColor: variables.tabBgColor
52 | };
53 |
54 | return tabBarTheme;
55 | };
56 |
--------------------------------------------------------------------------------
/android/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
15 |
21 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/.flowconfig:
--------------------------------------------------------------------------------
1 | [ignore]
2 | ; We fork some components by platform
3 | .*/*[.]android.js
4 |
5 | ; Ignore "BUCK" generated dirs
6 | /\.buckd/
7 |
8 | ; Ignore unexpected extra "@providesModule"
9 | .*/node_modules/.*/node_modules/fbjs/.*
10 |
11 | ; Ignore duplicate module providers
12 | ; For RN Apps installed via npm, "Libraries" folder is inside
13 | ; "node_modules/react-native" but in the source repo it is in the root
14 | .*/Libraries/react-native/React.js
15 |
16 | ; Ignore polyfills
17 | .*/Libraries/polyfills/.*
18 |
19 | ; Ignore metro
20 | .*/node_modules/metro/.*
21 |
22 | [include]
23 |
24 | [libs]
25 | node_modules/react-native/Libraries/react-native/react-native-interface.js
26 | node_modules/react-native/flow/
27 | node_modules/react-native/flow-github/
28 |
29 | [options]
30 | emoji=true
31 |
32 | module.system=haste
33 |
34 | munge_underscores=true
35 |
36 | module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
37 |
38 | module.file_ext=.js
39 | module.file_ext=.jsx
40 | module.file_ext=.json
41 | module.file_ext=.native.js
42 |
43 | suppress_type=$FlowIssue
44 | suppress_type=$FlowFixMe
45 | suppress_type=$FlowFixMeProps
46 | suppress_type=$FlowFixMeState
47 |
48 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
49 | suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
50 | suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
51 | suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
52 |
53 | [version]
54 | ^0.63.0
55 |
--------------------------------------------------------------------------------
/src/containers/tabs.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import { TabNavigator } from 'react-navigation';
3 | import Icon from 'react-native-vector-icons/Ionicons';
4 |
5 | import Index from './Home';
6 | import Videos from './Home/videos';
7 | import NotSaved from './NotSaved';
8 |
9 |
10 | export const Tab = TabNavigator({
11 | Index: {
12 | screen: Index,
13 | navigationOptions: ({ navigation }) => ({
14 | title: 'Images',
15 | }),
16 | },
17 | Videos: {
18 | screen: Videos,
19 | navigationOptions: ({ navigation }) => ({
20 | title: 'Videos',
21 | }),
22 | }
23 | }, {
24 | navigationOptions: ({ navigation }) => ({
25 | tabBarIcon: ({ focused, tintColor }) => {
26 | const { routeName } = navigation.state;
27 | let iconName;
28 | if (routeName === 'Index') {
29 | iconName = `ios-information-circle${focused ? '' : '-outline'}`;
30 | } else if (routeName === 'Saved') {
31 | iconName = `ios-options${focused ? '' : '-outline'}`;
32 | } else if (routeName === 'NotSaved') {
33 | iconName = `ios-options${focused ? '' : '-outline'}`;
34 | }
35 |
36 | // You can return any component that you like here! We usually use an
37 | // icon component from react-native-vector-icons
38 | return ;
39 | },
40 | }),
41 | tabBarOptions: {
42 | activeTintColor: 'white',
43 | inactiveTintColor: 'gray',
44 | },
45 | tabBarPosition: 'bottom',
46 | animationEnabled: true,
47 | swipeEnabled: true,
48 | });
49 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader-tvOS/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 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleSignature
20 | ????
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UILaunchStoryboardName
26 | LaunchScreen
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UIViewControllerBasedStatusBarAppearance
38 |
39 | NSLocationWhenInUseUsageDescription
40 |
41 | NSAppTransportSecurity
42 |
43 |
44 | NSExceptionDomains
45 |
46 | localhost
47 |
48 | NSExceptionAllowsInsecureHTTPLoads
49 |
50 |
51 |
52 |
53 |
54 |
55 |
--------------------------------------------------------------------------------
/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 | lib_deps = []
12 |
13 | for jarfile in glob(['libs/*.jar']):
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 |
21 | for aarfile in glob(['libs/*.aar']):
22 | name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23 | lib_deps.append(':' + name)
24 | android_prebuilt_aar(
25 | name = name,
26 | aar = aarfile,
27 | )
28 |
29 | android_library(
30 | name = "all-libs",
31 | exported_deps = lib_deps,
32 | )
33 |
34 | android_library(
35 | name = "app-code",
36 | srcs = glob([
37 | "src/main/java/**/*.java",
38 | ]),
39 | deps = [
40 | ":all-libs",
41 | ":build_config",
42 | ":res",
43 | ],
44 | )
45 |
46 | android_build_config(
47 | name = "build_config",
48 | package = "com.whatsappdownloader",
49 | )
50 |
51 | android_resource(
52 | name = "res",
53 | package = "com.whatsappdownloader",
54 | res = "src/main/res",
55 | )
56 |
57 | android_binary(
58 | name = "app",
59 | keystore = "//android/keystores:debug",
60 | manifest = "src/main/AndroidManifest.xml",
61 | package_type = "debug",
62 | deps = [
63 | ":app-code",
64 | ],
65 | )
66 |
--------------------------------------------------------------------------------
/android/app/src/main/java/com/whatsappdownloader/MainApplication.java:
--------------------------------------------------------------------------------
1 | package com.whatsappdownloader;
2 |
3 | import android.app.Application;
4 |
5 | import com.facebook.react.ReactApplication;
6 | import com.smixx.fabric.FabricPackage;
7 | import net.no_mad.tts.TextToSpeechPackage;
8 | import com.brentvatne.react.ReactVideoPackage;
9 | import com.RNFetchBlob.RNFetchBlobPackage;
10 | import com.oblador.vectoricons.VectorIconsPackage;
11 | import com.facebook.react.ReactNativeHost;
12 | import com.facebook.react.ReactPackage;
13 | import com.facebook.react.shell.MainReactPackage;
14 | import com.facebook.soloader.SoLoader;
15 | import com.crashlytics.android.Crashlytics;
16 | import io.fabric.sdk.android.Fabric;
17 |
18 | import java.util.Arrays;
19 | import java.util.List;
20 |
21 | public class MainApplication extends Application implements ReactApplication {
22 |
23 | private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
24 | @Override
25 | public boolean getUseDeveloperSupport() {
26 | return BuildConfig.DEBUG;
27 | }
28 |
29 | @Override
30 | protected List getPackages() {
31 | return Arrays.asList(
32 | new MainReactPackage(),
33 | new FabricPackage(),
34 | new TextToSpeechPackage(),
35 | new ReactVideoPackage(),
36 | new RNFetchBlobPackage(),
37 | new VectorIconsPackage()
38 | );
39 | }
40 |
41 | @Override
42 | protected String getJSMainModuleName() {
43 | return "index";
44 | }
45 | };
46 |
47 | @Override
48 | public ReactNativeHost getReactNativeHost() {
49 | return mReactNativeHost;
50 | }
51 |
52 | @Override
53 | public void onCreate() {
54 | super.onCreate();
55 | Fabric.with(this, new Crashlytics());
56 | SoLoader.init(this, /* native exopackage */ false);
57 | }
58 | }
59 |
--------------------------------------------------------------------------------
/src/components/Splash/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Content, Footer, FooterTab, Button, H1, Text } from 'native-base';
3 | import { View } from 'react-native';
4 | import { connect } from 'react-redux';
5 | import { bindActionCreators } from 'redux';
6 | import Storage from 'react-native-simple-store';
7 |
8 | import * as statusActions from '../../actions/getStatus';
9 | import { styles } from './styles';
10 |
11 |
12 | class Splash extends Component {
13 |
14 | componentDidMount() {
15 | this.props.statusActions.fecthWhatsappStatus();
16 | setTimeout(() => {
17 | this.decideNextScreen();
18 | }, 1000)
19 |
20 | }
21 |
22 | decideNextScreen = () => {
23 | Storage.get('introScreenSeen')
24 | .then((introScreenSeen) => {
25 | if (introScreenSeen) {
26 | this.props.navigation.navigate('Tab');
27 | } else {
28 | this.props.navigation.navigate('AppIntro');
29 | }
30 | })
31 | };
32 |
33 | render() {
34 | return (
35 |
36 |
37 |
38 | Whatsapp Status Downloader
39 |
40 |
41 |
48 |
49 | );
50 | }
51 | }
52 |
53 | const mapStateToProps = (state) => {
54 | return {
55 |
56 | }
57 | };
58 |
59 | const mapDispatchToProps = (dispatch) => {
60 | return {
61 | dispatch,
62 | statusActions: bindActionCreators(statusActions, dispatch)
63 | }
64 | };
65 |
66 | export default connect(mapStateToProps, mapDispatchToProps)(Splash);
67 |
--------------------------------------------------------------------------------
/native-base-theme/components/Form.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 |
6 | const theme = {
7 | "NativeBase.Item": {
8 | ".fixedLabel": {
9 | "NativeBase.Label": {
10 | paddingLeft: null
11 | },
12 | marginLeft: 15
13 | },
14 | ".inlineLabel": {
15 | "NativeBase.Label": {
16 | paddingLeft: null
17 | },
18 | marginLeft: 15
19 | },
20 | ".placeholderLabel": {
21 | "NativeBase.Input": {}
22 | },
23 | ".stackedLabel": {
24 | "NativeBase.Label": {
25 | top: 5,
26 | paddingLeft: null
27 | },
28 | "NativeBase.Input": {
29 | paddingLeft: null,
30 | marginLeft: null
31 | },
32 | "NativeBase.Icon": {
33 | marginTop: 36
34 | },
35 | marginLeft: 15
36 | },
37 | ".floatingLabel": {
38 | "NativeBase.Input": {
39 | paddingLeft: null,
40 | top: 10,
41 | marginLeft: null
42 | },
43 | "NativeBase.Label": {
44 | left: 0,
45 | top: 6
46 | },
47 | "NativeBase.Icon": {
48 | top: 6
49 | },
50 | marginTop: 15,
51 | marginLeft: 15
52 | },
53 | ".regular": {
54 | "NativeBase.Label": {
55 | left: 0
56 | },
57 | marginLeft: 0
58 | },
59 | ".rounded": {
60 | "NativeBase.Label": {
61 | left: 0
62 | },
63 | marginLeft: 0
64 | },
65 | ".underline": {
66 | "NativeBase.Label": {
67 | left: 0,
68 | top: 0,
69 | position: "relative"
70 | },
71 | "NativeBase.Input": {
72 | left: -15
73 | },
74 | marginLeft: 15
75 | },
76 | ".last": {
77 | marginLeft: 0,
78 | paddingLeft: 15
79 | },
80 | "NativeBase.Label": {
81 | paddingRight: 5
82 | },
83 | marginLeft: 15
84 | }
85 | };
86 |
87 | return theme;
88 | };
89 |
--------------------------------------------------------------------------------
/src/utils/helpers.js:
--------------------------------------------------------------------------------
1 | import RNFetchBlob from 'react-native-fetch-blob';
2 | import { Toast } from 'native-base';
3 | import { DIRECTORY_NAME } from '../constants';
4 |
5 |
6 | const dirs = RNFetchBlob.fs.dirs;
7 |
8 | export function getWhatsappStatusDirectory() {
9 | return dirs.SDCardDir + '/whatsapp/media/.statuses';
10 | }
11 |
12 | export function getDownloadDirectory() {
13 | return dirs.DownloadDir
14 | }
15 |
16 | export function getWhatsappStatusFiles() {
17 | let status = [];
18 | RNFetchBlob.fs.ls(getWhatsappStatusDirectory())
19 | .then(data => {
20 | status = data
21 | }).catch(error => {
22 | console.log(error)
23 | });
24 | return status
25 | }
26 |
27 | export function downloadFiles(file_path, file_name) {
28 | // download file and confirm it is saved
29 | console.log(file_path);
30 | RNFetchBlob.fs.cp(file_path, `${getDownloadDirectory()}/${DIRECTORY_NAME}/${file_name}`)
31 | .then((exist) => {
32 | console.log(file_path, exist);
33 |
34 | Toast.show({
35 | text: 'File saved in downloads folder ',
36 | position: 'bottom',
37 | buttonText: 'Okay',
38 | type: 'success'
39 | })
40 | }).catch((error) => {
41 | Toast.show({
42 | text: 'File not saved',
43 | position: 'bottom',
44 | buttonText: 'Okay',
45 | type: 'danger'
46 | })
47 | });
48 | }
49 |
50 | export function createDirectory() {
51 | RNFetchBlob.fs.isDir(`${getDownloadDirectory()}/${DIRECTORY_NAME}`)
52 | .then((exists) => {
53 | if (exists) {
54 | return `${getDownloadDirectory()}/${DIRECTORY_NAME}`;
55 | } else {
56 | return RNFetchBlob.fs.mkdir(`${getDownloadDirectory()}/${DIRECTORY_NAME}`);
57 | }
58 | })
59 | }
60 |
61 | export function createReducer(initialState, reducerMap) {
62 | return (state = initialState, action) => {
63 | const reducer = reducerMap[action.type];
64 | return reducer ? reducer(state, action.payload) : state;
65 | };
66 | }
67 |
68 | export function getSavedStatus() {
69 | return `${dirs.DownloadDir}/${DIRECTORY_NAME}`;
70 | }
71 |
--------------------------------------------------------------------------------
/native-base-theme/components/FooterTab.js:
--------------------------------------------------------------------------------
1 | import { Platform } from "react-native";
2 |
3 | import variable from "./../variables/platform";
4 |
5 | export default (variables = variable) => {
6 | const platform = variables.platform;
7 |
8 | const footerTabTheme = {
9 | "NativeBase.Button": {
10 | ".active": {
11 | "NativeBase.Text": {
12 | color: variables.tabBarActiveTextColor,
13 | fontSize: variables.tabBarTextSize,
14 | lineHeight: 16
15 | },
16 | "NativeBase.Icon": {
17 | color: variables.tabBarActiveTextColor
18 | },
19 | "NativeBase.IconNB": {
20 | color: variables.tabBarActiveTextColor
21 | },
22 | backgroundColor: variables.tabActiveBgColor
23 | },
24 | flexDirection: null,
25 | backgroundColor: "transparent",
26 | borderColor: null,
27 | elevation: 0,
28 | shadowColor: null,
29 | shadowOffset: null,
30 | shadowRadius: null,
31 | shadowOpacity: null,
32 | alignSelf: "center",
33 | flex: 1,
34 | height: (variables.footerHeight - (variables.isIphoneX ? 34 : 0)),
35 | justifyContent: "center",
36 | ".badge": {
37 | "NativeBase.Badge": {
38 | "NativeBase.Text": {
39 | fontSize: 11,
40 | fontWeight: platform === "ios" ? "600" : undefined,
41 | lineHeight: 14
42 | },
43 | top: -3,
44 | alignSelf: "center",
45 | left: 10,
46 | zIndex: 99,
47 | height: 18,
48 | padding: 1.7,
49 | paddingHorizontal: 3
50 | },
51 | "NativeBase.Icon": {
52 | marginTop: -18
53 | }
54 | },
55 | "NativeBase.Icon": {
56 | color: variables.tabBarTextColor
57 | },
58 | "NativeBase.IconNB": {
59 | color: variables.tabBarTextColor
60 | },
61 | "NativeBase.Text": {
62 | color: variables.tabBarTextColor,
63 | fontSize: variables.tabBarTextSize,
64 | lineHeight: 16
65 | }
66 | },
67 | backgroundColor: Platform.OS === "android"
68 | ? variables.tabActiveBgColor
69 | : undefined,
70 | flexDirection: "row",
71 | justifyContent: "space-between",
72 | flex: 1,
73 | alignSelf: "stretch"
74 | };
75 |
76 | return footerTabTheme;
77 | };
78 |
--------------------------------------------------------------------------------
/ios/whatsappDownloaderTests/whatsappDownloaderTests.m:
--------------------------------------------------------------------------------
1 | /**
2 | * Copyright (c) 2015-present, Facebook, Inc.
3 | * All rights reserved.
4 | *
5 | * This source code is licensed under the BSD-style license found in the
6 | * LICENSE file in the root directory of this source tree. An additional grant
7 | * of patent rights can be found in the PATENTS file in the same directory.
8 | */
9 |
10 | #import
11 | #import
12 |
13 | #import
14 | #import
15 |
16 | #define TIMEOUT_SECONDS 600
17 | #define TEXT_TO_LOOK_FOR @"Welcome to React Native!"
18 |
19 | @interface whatsappDownloaderTests : XCTestCase
20 |
21 | @end
22 |
23 | @implementation whatsappDownloaderTests
24 |
25 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test
26 | {
27 | if (test(view)) {
28 | return YES;
29 | }
30 | for (UIView *subview in [view subviews]) {
31 | if ([self findSubviewInView:subview matching:test]) {
32 | return YES;
33 | }
34 | }
35 | return NO;
36 | }
37 |
38 | - (void)testRendersWelcomeScreen
39 | {
40 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController];
41 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS];
42 | BOOL foundElement = NO;
43 |
44 | __block NSString *redboxError = nil;
45 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) {
46 | if (level >= RCTLogLevelError) {
47 | redboxError = message;
48 | }
49 | });
50 |
51 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) {
52 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
53 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]];
54 |
55 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) {
56 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) {
57 | return YES;
58 | }
59 | return NO;
60 | }];
61 | }
62 |
63 | RCTSetLogFunction(RCTDefaultLogFunction);
64 |
65 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError);
66 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS);
67 | }
68 |
69 |
70 | @end
71 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleDisplayName
8 | whatsappDownloader
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)
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 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIRequiredDeviceCapabilities
30 |
31 | armv7
32 |
33 | UISupportedInterfaceOrientations
34 |
35 | UIInterfaceOrientationPortrait
36 | UIInterfaceOrientationLandscapeLeft
37 | UIInterfaceOrientationLandscapeRight
38 |
39 | UIViewControllerBasedStatusBarAppearance
40 |
41 | NSLocationWhenInUseUsageDescription
42 |
43 | NSAppTransportSecurity
44 |
45 | NSExceptionDomains
46 |
47 | localhost
48 |
49 | NSExceptionAllowsInsecureHTTPLoads
50 |
51 |
52 |
53 |
54 | UIAppFonts
55 |
56 | Entypo.ttf
57 | EvilIcons.ttf
58 | Feather.ttf
59 | FontAwesome.ttf
60 | Foundation.ttf
61 | Ionicons.ttf
62 | MaterialCommunityIcons.ttf
63 | MaterialIcons.ttf
64 | Octicons.ttf
65 | SimpleLineIcons.ttf
66 | Zocial.ttf
67 | Roboto_medium.ttf
68 | Roboto.ttf
69 | rubicon-icon-font.ttf
70 |
71 |
72 |
73 |
--------------------------------------------------------------------------------
/src/containers/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { StackNavigator, addNavigationHelpers } from 'react-navigation';
3 | import { View, BackHandler } from 'react-native';
4 | import { connect } from 'react-redux';
5 | import { createReduxBoundAddListener, createReactNavigationReduxMiddleware } from 'react-navigation-redux-helpers';
6 |
7 | import Splash from '../../src/components/Splash';
8 | import AppIntroSlider from '../../src/components/AppIntro/slides';
9 | import { Tab } from '../../src/containers/tabs';
10 |
11 |
12 | export const MainNavigation = StackNavigator({
13 | Home: {
14 | screen: Splash,
15 | navigationOptions: ({ navigation }) => { return ({ header: null }) }
16 | },
17 | AppIntro: {
18 | screen: AppIntroSlider,
19 | navigationOptions: ({ navigation }) => { return ({ header: null }) }
20 | },
21 | Tab: {
22 | screen: Tab,
23 | navigationOptions: ({ navigation }) => { return ({ header: null }) }
24 | }
25 | });
26 | const middleware = createReactNavigationReduxMiddleware(
27 | "root",
28 | state => state.nav,
29 | );
30 | const addListener = createReduxBoundAddListener("root");
31 |
32 |
33 | // hook the main navigation with redux
34 | class MainNavigationWithState extends Component {
35 |
36 | // componentDidMount() {
37 | // BackHandler.addEventListener('backPress', () => {
38 | // const { dispatch, nav } = this.props;
39 | // if (this.shouldCloseApp(nav)) return false;
40 | // dispatch({
41 | // type: 'Navigation/BACK'
42 | // });
43 | // return true;
44 | // });
45 | // }
46 | //
47 | // componentWillUnmount() {
48 | // BackHandler.removeEventListener('backPress');
49 | // }
50 | //
51 | // shouldCloseApp = (nav) => {
52 | // return nav.index === 0;
53 | // };
54 |
55 | render() {
56 | return (
57 |
58 |
64 |
65 | );
66 | }
67 | }
68 |
69 | function mapStateToProps(state) {
70 | return {
71 | nav: state.nav
72 | };
73 | }
74 |
75 |
76 | export default connect(mapStateToProps)(MainNavigationWithState);
--------------------------------------------------------------------------------
/src/components/RenderImages/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { ListView, Image } from 'react-native';
3 | import { Container, Card, CardItem, Button, Icon, Left, Right, Text, Body, Segment } from 'native-base';
4 |
5 | import { getWhatsappStatusDirectory, downloadFiles } from '../../utils/helpers';
6 |
7 |
8 | const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { return r1 !== r2; } });
9 |
10 | export default class RenderImage extends Component {
11 |
12 | constructor(props) {
13 | super(props);
14 | this.state = {
15 | dataSource: ds.cloneWithRows([]),
16 | show: false,
17 | refreshing: false
18 | }
19 | }
20 |
21 | componentDidMount() {
22 | console.log(this.props, this.props.images)
23 | }
24 |
25 | renderRow = (rowData) => {
26 | let dir = getWhatsappStatusDirectory() + '/' + rowData;
27 | console.log(dir);
28 | return (
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
41 |
42 |
43 |
44 | )
45 | }
46 |
47 | renderRowData = () => {
48 | let content = null;
49 | if (this.state.show) {
50 | content = (
51 |
56 | }
57 | />
58 | );
59 | } else {
60 | content = this.renderEmptyRow();
61 | }
62 | return content;
63 | };
64 |
65 | renderEmptyRow = () => {
66 | let content = null;
67 | if (this.state.dataSource.length < 1 && this.state.show) {
68 | content = (
69 | No Status Found
70 | );
71 | }
72 | return content;
73 | };
74 |
75 | render() {
76 | return (
77 |
78 | {this.renderRow()}
79 |
80 | )
81 | }
82 | }
--------------------------------------------------------------------------------
/android/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
12 | set DEFAULT_JVM_OPTS=
13 |
14 | set DIRNAME=%~dp0
15 | if "%DIRNAME%" == "" set DIRNAME=.
16 | set APP_BASE_NAME=%~n0
17 | set APP_HOME=%DIRNAME%
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windowz variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 | if "%@eval[2+2]" == "4" goto 4NT_args
53 |
54 | :win9xME_args
55 | @rem Slurp the command line arguments.
56 | set CMD_LINE_ARGS=
57 | set _SKIP=2
58 |
59 | :win9xME_args_slurp
60 | if "x%~1" == "x" goto execute
61 |
62 | set CMD_LINE_ARGS=%*
63 | goto execute
64 |
65 | :4NT_args
66 | @rem Get arguments from the 4NT Shell from JP Software
67 | set CMD_LINE_ARGS=%$
68 |
69 | :execute
70 | @rem Setup the command line
71 |
72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
73 |
74 | @rem Execute Gradle
75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
76 |
77 | :end
78 | @rem End local scope for the variables with windows NT shell
79 | if "%ERRORLEVEL%"=="0" goto mainEnd
80 |
81 | :fail
82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
83 | rem the _cmd.exe /c_ return code!
84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
85 | exit /b 1
86 |
87 | :mainEnd
88 | if "%OS%"=="Windows_NT" endlocal
89 |
90 | :omega
91 |
--------------------------------------------------------------------------------
/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 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | # Disabling obfuscation is useful if you collect stack traces from production crashes
20 | # (unless you are using a system that supports de-obfuscate the stack traces).
21 | -dontobfuscate
22 |
23 | # React Native
24 |
25 | # Keep our interfaces so they can be used by other ProGuard rules.
26 | # See http://sourceforge.net/p/proguard/bugs/466/
27 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28 | -keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29 | -keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30 |
31 | # Do not strip any method/class that is annotated with @DoNotStrip
32 | -keep @com.facebook.proguard.annotations.DoNotStrip class *
33 | -keep @com.facebook.common.internal.DoNotStrip class *
34 | -keepclassmembers class * {
35 | @com.facebook.proguard.annotations.DoNotStrip *;
36 | @com.facebook.common.internal.DoNotStrip *;
37 | }
38 |
39 | -keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40 | void set*(***);
41 | *** get*();
42 | }
43 |
44 | -keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45 | -keep class * extends com.facebook.react.bridge.NativeModule { *; }
46 | -keepclassmembers,includedescriptorclasses class * { native ; }
47 | -keepclassmembers class * { @com.facebook.react.uimanager.UIProp ; }
48 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp ; }
49 | -keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup ; }
50 |
51 | -dontwarn com.facebook.react.**
52 |
53 | # TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54 | # See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55 | -dontwarn android.text.StaticLayout
56 |
57 | # okhttp
58 |
59 | -keepattributes Signature
60 | -keepattributes *Annotation*
61 | -keep class okhttp3.** { *; }
62 | -keep interface okhttp3.** { *; }
63 | -dontwarn okhttp3.**
64 |
65 | # okio
66 |
67 | -keep class sun.misc.Unsafe { *; }
68 | -dontwarn java.nio.file.*
69 | -dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70 | -dontwarn okio.**
71 |
--------------------------------------------------------------------------------
/native-base-theme/components/Footer.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const platformStyle = variables.platformStyle;
5 | const platform = variables.platform;
6 |
7 | const footerTheme = {
8 | "NativeBase.Left": {
9 | "NativeBase.Button": {
10 | ".transparent": {
11 | backgroundColor: "transparent",
12 | borderColor: null,
13 | elevation: 0,
14 | shadowColor: null,
15 | shadowOffset: null,
16 | shadowRadius: null,
17 | shadowOpacity: null
18 | },
19 | "NativeBase.Icon": {
20 | color: variables.topTabBarActiveTextColor
21 | },
22 | "NativeBase.IconNB": {
23 | color: variables.topTabBarActiveTextColor
24 | },
25 | alignSelf: null
26 | },
27 | flex: 1,
28 | alignSelf: "center",
29 | alignItems: "flex-start"
30 | },
31 | "NativeBase.Body": {
32 | flex: 1,
33 | alignItems: "center",
34 | alignSelf: "center",
35 | flexDirection: "row",
36 | "NativeBase.Button": {
37 | alignSelf: "center",
38 | ".transparent": {
39 | backgroundColor: "transparent",
40 | borderColor: null,
41 | elevation: 0,
42 | shadowColor: null,
43 | shadowOffset: null,
44 | shadowRadius: null,
45 | shadowOpacity: null
46 | },
47 | ".full": {
48 | height: variables.footerHeight,
49 | paddingBottom:variables.footerPaddingBottom,
50 | flex: 1
51 | },
52 | "NativeBase.Icon": {
53 | color: variables.topTabBarActiveTextColor
54 | },
55 | "NativeBase.IconNB": {
56 | color: variables.topTabBarActiveTextColor
57 | }
58 | }
59 | },
60 | "NativeBase.Right": {
61 | "NativeBase.Button": {
62 | ".transparent": {
63 | backgroundColor: "transparent",
64 | borderColor: null,
65 | elevation: 0,
66 | shadowColor: null,
67 | shadowOffset: null,
68 | shadowRadius: null,
69 | shadowOpacity: null
70 | },
71 | "NativeBase.Icon": {
72 | color: variables.topTabBarActiveTextColor
73 | },
74 | "NativeBase.IconNB": {
75 | color: variables.topTabBarActiveTextColor
76 | },
77 | alignSelf: null
78 | },
79 | flex: 1,
80 | alignSelf: "center",
81 | alignItems: "flex-end"
82 | },
83 | backgroundColor: variables.footerDefaultBg,
84 | flexDirection: "row",
85 | justifyContent: "center",
86 | borderTopWidth: platform === "ios" && platformStyle !== "material"
87 | ? variables.borderWidth
88 | : undefined,
89 | borderColor: platform === "ios" && platformStyle !== "material"
90 | ? "#cbcbcb"
91 | : undefined,
92 | height: variables.footerHeight,
93 | paddingBottom:variables.footerPaddingBottom,
94 | elevation: 3,
95 | left: 0,
96 | right: 0
97 | };
98 | return footerTheme;
99 | };
100 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader/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 |
--------------------------------------------------------------------------------
/native-base-theme/components/InputGroup.js:
--------------------------------------------------------------------------------
1 | import variable from "./../variables/platform";
2 |
3 | export default (variables = variable) => {
4 | const inputGroupTheme = {
5 | "NativeBase.Icon": {
6 | fontSize: 24,
7 | color: variables.sTabBarActiveTextColor,
8 | paddingHorizontal: 5
9 | },
10 | "NativeBase.IconNB": {
11 | fontSize: 24,
12 | color: variables.sTabBarActiveTextColor,
13 | paddingHorizontal: 5
14 | },
15 | "NativeBase.Input": {
16 | height: variables.inputHeightBase,
17 | color: variables.inputColor,
18 | paddingLeft: 5,
19 | paddingRight: 5,
20 | flex: 1,
21 | fontSize: variables.inputFontSize,
22 | lineHeight: variables.inputLineHeight
23 | },
24 | ".underline": {
25 | ".success": {
26 | borderColor: variables.inputSuccessBorderColor
27 | },
28 | ".error": {
29 | borderColor: variables.inputErrorBorderColor
30 | },
31 | paddingLeft: 5,
32 | borderWidth: variables.borderWidth,
33 | borderTopWidth: 0,
34 | borderRightWidth: 0,
35 | borderLeftWidth: 0,
36 | borderColor: variables.inputBorderColor
37 | },
38 | ".regular": {
39 | ".success": {
40 | borderColor: variables.inputSuccessBorderColor
41 | },
42 | ".error": {
43 | borderColor: variables.inputErrorBorderColor
44 | },
45 | paddingLeft: 5,
46 | borderWidth: variables.borderWidth,
47 | borderColor: variables.inputBorderColor
48 | },
49 | ".rounded": {
50 | ".success": {
51 | borderColor: variables.inputSuccessBorderColor
52 | },
53 | ".error": {
54 | borderColor: variables.inputErrorBorderColor
55 | },
56 | paddingLeft: 5,
57 | borderWidth: variables.borderWidth,
58 | borderRadius: variables.inputGroupRoundedBorderRadius,
59 | borderColor: variables.inputBorderColor
60 | },
61 |
62 | ".success": {
63 | "NativeBase.Icon": {
64 | color: variables.inputSuccessBorderColor
65 | },
66 | "NativeBase.IconNB": {
67 | color: variables.inputSuccessBorderColor
68 | },
69 | ".rounded": {
70 | borderRadius: 30,
71 | borderColor: variables.inputSuccessBorderColor
72 | },
73 | ".regular": {
74 | borderColor: variables.inputSuccessBorderColor
75 | },
76 | ".underline": {
77 | borderWidth: variables.borderWidth,
78 | borderTopWidth: 0,
79 | borderRightWidth: 0,
80 | borderLeftWidth: 0,
81 | borderColor: variables.inputSuccessBorderColor
82 | },
83 | borderColor: variables.inputSuccessBorderColor
84 | },
85 |
86 | ".error": {
87 | "NativeBase.Icon": {
88 | color: variables.inputErrorBorderColor
89 | },
90 | "NativeBase.IconNB": {
91 | color: variables.inputErrorBorderColor
92 | },
93 | ".rounded": {
94 | borderRadius: 30,
95 | borderColor: variables.inputErrorBorderColor
96 | },
97 | ".regular": {
98 | borderColor: variables.inputErrorBorderColor
99 | },
100 | ".underline": {
101 | borderWidth: variables.borderWidth,
102 | borderTopWidth: 0,
103 | borderRightWidth: 0,
104 | borderLeftWidth: 0,
105 | borderColor: variables.inputErrorBorderColor
106 | },
107 | borderColor: variables.inputErrorBorderColor
108 | },
109 | ".disabled": {
110 | "NativeBase.Icon": {
111 | color: "#384850"
112 | },
113 | "NativeBase.IconNB": {
114 | color: "#384850"
115 | }
116 | },
117 |
118 | paddingLeft: 5,
119 | borderWidth: variables.borderWidth,
120 | borderTopWidth: 0,
121 | borderRightWidth: 0,
122 | borderLeftWidth: 0,
123 | borderColor: variables.inputBorderColor,
124 | backgroundColor: "transparent",
125 | flexDirection: "row",
126 | alignItems: "center"
127 | };
128 |
129 | return inputGroupTheme;
130 | };
131 |
--------------------------------------------------------------------------------
/src/containers/Home/index.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Card, CardItem, Button, Icon, Left, Right, Text, Body, Segment } from 'native-base';
3 | import { connect } from 'react-redux';
4 | import { Image, RefreshControl, ListView, View, StyleSheet, Dimensions } from 'react-native';
5 | import { bindActionCreators } from 'redux';
6 | import RNFetchBlob from 'react-native-fetch-blob';
7 |
8 | import FAB from '../../components/Fab';
9 | import * as fetchWhatsaappFilesActions from '../../actions/getStatus';
10 | import * as fetchWhatsappImagesActions from '../../actions/images';
11 | import { getWhatsappStatusDirectory, downloadFiles } from '../../utils/helpers';
12 | import RenderImage from '../../components/RenderImages';
13 |
14 | const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { return r1 !== r2; } });
15 |
16 |
17 | class Index extends Component {
18 |
19 | constructor(props) {
20 | super(props);
21 | this.state = {
22 | dataSource: ds.cloneWithRows([]),
23 | show: false,
24 | refreshing: false,
25 | images: true
26 | }
27 | }
28 |
29 |
30 | componentDidMount() {
31 | this.props.imageActions.getWhatsappImages(this.props.statusFiles.files);
32 | }
33 |
34 | componentWillReceiveProps(nextProps) {
35 | if (nextProps && nextProps.statusFiles) {
36 | this.setState({
37 | dataSource: ds.cloneWithRows(nextProps.images.files),
38 | show: true })
39 | }
40 | }
41 |
42 |
43 | renderRow = (rowData) => {
44 | let dir = getWhatsappStatusDirectory() + '/' + rowData;
45 | console.log(dir);
46 | return (
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
58 |
59 |
60 |
61 | )
62 | }
63 |
64 | renderRowData = () => {
65 | let content = null;
66 | if (this.state.show) {
67 | content = (
68 |
73 | }
74 | />
75 | );
76 | } else {
77 | content = this.renderEmptyRow();
78 | }
79 | return content;
80 | };
81 |
82 | renderEmptyRow = () => {
83 | let content = null;
84 | if (this.state.dataSource.length < 1 && this.state.show) {
85 | content = (
86 | No Status Found
87 | );
88 | }
89 | return content;
90 | };
91 |
92 | render() {
93 | return (
94 |
95 | {this.renderRowData()}
96 |
97 | );
98 | }
99 | }
100 |
101 | const mapStateToProps = (state) => {
102 | return {
103 | statusFiles: state.whatsappStatus,
104 | images: state.images
105 | }
106 | };
107 |
108 | const mapDispatchToProps = (dispatch) => {
109 | return {
110 | dispatch,
111 | imageActions: bindActionCreators(fetchWhatsappImagesActions, dispatch),
112 | actions: bindActionCreators(fetchWhatsaappFilesActions, dispatch)
113 | }
114 | };
115 |
116 | export default connect(mapStateToProps, mapDispatchToProps)(Index);
117 |
118 |
--------------------------------------------------------------------------------
/src/components/AppIntro/slides.js:
--------------------------------------------------------------------------------
1 | import React from 'react';
2 | import Icon from 'react-native-vector-icons/FontAwesome';
3 | import { StyleSheet, View, Text, Image, ImageBackground } from 'react-native';
4 | import { H1 } from 'native-base';
5 | import AppIntroSlider from 'react-native-app-intro-slider';
6 | import Storage from 'react-native-simple-store';
7 |
8 | import { styles } from './style';
9 | import { createDirectory } from '../../utils/helpers';
10 |
11 | const slides = [
12 | {
13 | key: 'Welcome',
14 | title: 'Welcome',
15 | text: 'This app allows you download whatsapp status without internet connection',
16 | image: require('../../images/1.jpg'),
17 | dotColor: '#000'
18 | },
19 | {
20 | key: 'Download',
21 | title: 'Step 1',
22 | text: 'To download any status \n you must have viewed the \n status on whatsapp.',
23 | image: require('../../images/2.jpg'),
24 | },
25 | {
26 | key: 'Download2',
27 | title: 'Step 2',
28 | text: 'After viewing it on whatsapp \n launch this app and the status will be \ available for download',
29 | image: require('../../images/3.jpg'),
30 | },
31 | {
32 | key: 'Directory',
33 | title: 'Folder',
34 | text: 'All status are downloaded into Downloads/whatsappStatusDownloader directory.',
35 | image: require('../../images/4.jpg'),
36 | },
37 | {
38 | key: 'Voice',
39 | title: 'Accessibility',
40 | text: 'You can download with your voice by saying \n Hey, Download all videos\n Hey, Download all images \n ' +
41 | 'Hey Download All status (this will download both videos and images together)',
42 | image: require('../../images/5.jpg'),
43 | },
44 | {
45 | key: 'Credit',
46 | title: 'Credit',
47 | text: 'This app is built by Raheem Azeez Abiodun (raheezeez4@gmail.com)',
48 | image: require('../../images/1.jpg'),
49 | },
50 | {
51 | key: 'License',
52 | title: 'License',
53 | text: 'You can share this app with your friends but you are not allowed to sell it or claim ownership',
54 | image: require('../../images/2.png'),
55 | }
56 | ];
57 |
58 |
59 | export default class IntroSlides extends React.Component {
60 |
61 | _renderItem = (props) => {
62 | return (
63 |
64 |
65 |
66 | {props.title}
67 |
68 |
69 | {props.text}
70 |
71 |
72 |
73 | )
74 | }
75 |
76 | _renderNextButton = () => {
77 | return (
78 |
79 |
85 |
86 | );
87 | };
88 |
89 | _renderDoneButton = () => {
90 | return (
91 |
92 |
98 |
99 | );
100 | };
101 |
102 | _onDone = () => {
103 | Storage.save('introScreenSeen', true);
104 | createDirectory();
105 | this.props.navigation.navigate('Tab')
106 | };
107 |
108 | render() {
109 | return (
110 |
117 | );
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/src/containers/Home/videos.js:
--------------------------------------------------------------------------------
1 | import React, { Component } from 'react';
2 | import { Container, Card, CardItem, Button, Icon, Left, Right, Text, Body, Segment } from 'native-base';
3 | import { connect } from 'react-redux';
4 | import { Image, RefreshControl, ListView, View, StyleSheet, Dimensions } from 'react-native';
5 | import { bindActionCreators } from 'redux';
6 | import RNFetchBlob from 'react-native-fetch-blob';
7 | import VideoPlayer from 'react-native-video-player';
8 |
9 | import FAB from '../../components/Fab';
10 | import * as fetchWhatsaappFilesActions from '../../actions/getStatus';
11 | import * as fetchWhatsappVideosActions from '../../actions/videos';
12 | import { getWhatsappStatusDirectory, downloadFiles } from '../../utils/helpers';
13 | import RenderImage from '../../components/RenderImages';
14 |
15 | const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => { return r1 !== r2; } });
16 |
17 |
18 | class Videos extends Component {
19 |
20 | constructor(props) {
21 | super(props);
22 | this.state = {
23 | videoSource: ds.cloneWithRows([]),
24 | show: false,
25 | refreshing: false,
26 | videos: false
27 | }
28 | }
29 |
30 | componentDidMount() {
31 | this.props.videoActions.getWhatsappVideos(this.props.statusFiles.files);
32 | }
33 |
34 | componentWillReceiveProps(nextProps) {
35 | if (nextProps && nextProps.statusFiles) {
36 | this.setState({
37 | videoSource: ds.cloneWithRows(nextProps.videos.files),
38 | show: true })
39 | }
40 | }
41 |
42 | renderVideoRow = (rowData) => {
43 | let dir = getWhatsappStatusDirectory() + '/' + rowData;
44 | console.log(dir);
45 | return (
46 |
47 |
48 |
49 |
50 | this.player = r}
57 | />
58 |
71 |
72 |
73 | downloadFiles(dir, rowData)}>
74 |
75 |
76 |
77 |
78 |
79 | )
80 | }
81 |
82 | renderVideoRowData = () => {
83 | let content = null;
84 | if (this.state.show) {
85 | content = (
86 |
91 | }
92 | />
93 | );
94 | } else {
95 | content = this.renderEmptyRow();
96 | }
97 | return content;
98 | };
99 |
100 | renderVideoEmptyRow = () => {
101 | let content = null;
102 | if (this.state.videoSource.length < 1 && this.state.show) {
103 | content = (
104 | No Video Found
105 | );
106 | }
107 | return content;
108 | };
109 |
110 | render() {
111 | return (
112 |
113 | {this.renderVideoRowData()}
114 |
115 | );
116 | }
117 | }
118 |
119 | const mapStateToProps = (state) => {
120 | return {
121 | statusFiles: state.whatsappStatus,
122 | videos: state.videos
123 | }
124 | };
125 |
126 | const mapDispatchToProps = (dispatch) => {
127 | return {
128 | dispatch,
129 | actions: bindActionCreators(fetchWhatsaappFilesActions, dispatch),
130 | videoActions: bindActionCreators(fetchWhatsappVideosActions, dispatch)
131 | }
132 | };
133 |
134 | export default connect(mapStateToProps, mapDispatchToProps)(Videos);
135 |
136 |
--------------------------------------------------------------------------------
/native-base-theme/components/CardItem.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const platform = variables.platform;
5 | const transparentBtnCommon = {
6 | 'NativeBase.Text': {
7 | fontSize: variables.DefaultFontSize - 4,
8 | color: variables.sTabBarActiveTextColor,
9 | },
10 | 'NativeBase.Icon': {
11 | fontSize: variables.iconFontSize - 10,
12 | color: variables.sTabBarActiveTextColor,
13 | marginHorizontal: null,
14 | },
15 | 'NativeBase.IconNB': {
16 | fontSize: variables.iconFontSize - 10,
17 | color: variables.sTabBarActiveTextColor,
18 | },
19 | paddingVertical: null,
20 | paddingHorizontal: null
21 | }
22 |
23 | const cardItemTheme = {
24 | 'NativeBase.Left': {
25 | 'NativeBase.Body': {
26 | 'NativeBase.Text': {
27 | '.note': {
28 | color: variables.listNoteColor,
29 | fontWeight: '400',
30 | marginRight: 20,
31 | },
32 | },
33 | flex: 1,
34 | marginLeft: 10,
35 | alignItems: null,
36 | },
37 | 'NativeBase.Icon': {
38 | fontSize: variables.iconFontSize,
39 | },
40 | 'NativeBase.IconNB': {
41 | fontSize: variables.iconFontSize,
42 | },
43 | 'NativeBase.Text': {
44 | marginLeft: 10,
45 | alignSelf: 'center',
46 | },
47 | 'NativeBase.Button': {
48 | '.transparent': {
49 | ...transparentBtnCommon,
50 | paddingRight: variables.listItemPadding + 5,
51 | },
52 | },
53 | flex: 1,
54 | flexDirection: 'row',
55 | alignItems: 'center',
56 | },
57 |
58 | '.content': {
59 | 'NativeBase.Text': {
60 | color: platform === 'ios' ? '#555' : '#222',
61 | fontSize: variables.DefaultFontSize - 3,
62 | },
63 | },
64 | '.cardBody': {
65 | padding: -5,
66 | 'NativeBase.Text': {
67 | marginTop: 5,
68 | },
69 | },
70 | 'NativeBase.Body': {
71 | 'NativeBase.Text': {
72 | '.note': {
73 | color: variables.listNoteColor,
74 | fontWeight: '200',
75 | marginRight: 20,
76 | },
77 | },
78 | 'NativeBase.Button': {
79 | '.transparent': {
80 | ...transparentBtnCommon,
81 | paddingRight: variables.listItemPadding + 5,
82 | alignSelf: 'stretch',
83 | },
84 | },
85 | flex: 1,
86 | alignSelf: 'stretch',
87 | alignItems: 'flex-start',
88 | },
89 | 'NativeBase.Right': {
90 | 'NativeBase.Badge': {
91 | alignSelf: null,
92 | },
93 | 'NativeBase.Button': {
94 | '.transparent': {
95 | ...transparentBtnCommon
96 | },
97 | alignSelf: null,
98 | },
99 | 'NativeBase.Icon': {
100 | alignSelf: null,
101 | fontSize: variables.iconFontSize - 8,
102 | color: variables.cardBorderColor,
103 | },
104 | 'NativeBase.IconNB': {
105 | alignSelf: null,
106 | fontSize: variables.iconFontSize - 8,
107 | color: variables.cardBorderColor,
108 | },
109 | 'NativeBase.Text': {
110 | fontSize: variables.DefaultFontSize - 2,
111 | alignSelf: null,
112 | },
113 | 'NativeBase.Thumbnail': {
114 | alignSelf: null,
115 | },
116 | 'NativeBase.Image': {
117 | alignSelf: null,
118 | },
119 | 'NativeBase.Radio': {
120 | alignSelf: null,
121 | },
122 | 'NativeBase.Checkbox': {
123 | alignSelf: null,
124 | },
125 | 'NativeBase.Switch': {
126 | alignSelf: null,
127 | },
128 | flex: 0.8,
129 | },
130 | '.header': {
131 | 'NativeBase.Text': {
132 | fontSize: 16,
133 | fontWeight: platform === 'ios' ? '500' : undefined,
134 | },
135 | '.bordered': {
136 | 'NativeBase.Text': {
137 | color: variables.sTabBarActiveTextColor,
138 | fontWeight: platform === 'ios' ? '500' : undefined,
139 | },
140 | borderBottomWidth: platform === 'ios' ? variables.borderWidth : null,
141 | },
142 | borderBottomWidth: null,
143 | paddingVertical: variables.listItemPadding + 5,
144 | },
145 | '.footer': {
146 | 'NativeBase.Text': {
147 | fontSize: 16,
148 | fontWeight: platform === 'ios' ? '500' : undefined,
149 | },
150 | '.bordered': {
151 | 'NativeBase.Text': {
152 | color: variables.activeTab,
153 | fontWeight: '500',
154 | },
155 | borderTopWidth: platform === 'ios' ? variables.borderWidth : null,
156 | },
157 | borderBottomWidth: null,
158 | },
159 | 'NativeBase.Text': {
160 | '.note': {
161 | color: variables.listNoteColor,
162 | fontWeight: '200',
163 | },
164 | },
165 |
166 | 'NativeBase.Icon': {
167 | width: variables.iconFontSize + 5,
168 | fontSize: variables.iconFontSize - 2,
169 | },
170 | 'NativeBase.IconNB': {
171 | width: variables.iconFontSize + 5,
172 | fontSize: variables.iconFontSize - 2,
173 | },
174 |
175 | '.bordered': {
176 | borderBottomWidth: variables.borderWidth,
177 | borderColor: variables.cardBorderColor,
178 | },
179 | flexDirection: 'row',
180 | alignItems: 'center',
181 | borderRadius: 2,
182 | padding: variables.listItemPadding + 5,
183 | paddingVertical: variables.listItemPadding,
184 | backgroundColor: variables.cardDefaultBg,
185 | };
186 |
187 | return cardItemTheme;
188 | };
189 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader.xcodeproj/xcshareddata/xcschemes/whatsappDownloader.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/ios/whatsappDownloader.xcodeproj/xcshareddata/xcschemes/whatsappDownloader-tvOS.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
29 |
35 |
36 |
37 |
43 |
49 |
50 |
51 |
52 |
53 |
58 |
59 |
61 |
67 |
68 |
69 |
70 |
71 |
77 |
78 |
79 |
80 |
81 |
82 |
92 |
94 |
100 |
101 |
102 |
103 |
104 |
105 |
111 |
113 |
119 |
120 |
121 |
122 |
124 |
125 |
128 |
129 |
130 |
--------------------------------------------------------------------------------
/android/gradlew:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | ##############################################################################
4 | ##
5 | ## Gradle start up script for UN*X
6 | ##
7 | ##############################################################################
8 |
9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
10 | DEFAULT_JVM_OPTS=""
11 |
12 | APP_NAME="Gradle"
13 | APP_BASE_NAME=`basename "$0"`
14 |
15 | # Use the maximum available, or set MAX_FD != -1 to use that value.
16 | MAX_FD="maximum"
17 |
18 | warn ( ) {
19 | echo "$*"
20 | }
21 |
22 | die ( ) {
23 | echo
24 | echo "$*"
25 | echo
26 | exit 1
27 | }
28 |
29 | # OS specific support (must be 'true' or 'false').
30 | cygwin=false
31 | msys=false
32 | darwin=false
33 | case "`uname`" in
34 | CYGWIN* )
35 | cygwin=true
36 | ;;
37 | Darwin* )
38 | darwin=true
39 | ;;
40 | MINGW* )
41 | msys=true
42 | ;;
43 | esac
44 |
45 | # For Cygwin, ensure paths are in UNIX format before anything is touched.
46 | if $cygwin ; then
47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
48 | fi
49 |
50 | # Attempt to set APP_HOME
51 | # Resolve links: $0 may be a link
52 | PRG="$0"
53 | # Need this for relative symlinks.
54 | while [ -h "$PRG" ] ; do
55 | ls=`ls -ld "$PRG"`
56 | link=`expr "$ls" : '.*-> \(.*\)$'`
57 | if expr "$link" : '/.*' > /dev/null; then
58 | PRG="$link"
59 | else
60 | PRG=`dirname "$PRG"`"/$link"
61 | fi
62 | done
63 | SAVED="`pwd`"
64 | cd "`dirname \"$PRG\"`/" >&-
65 | APP_HOME="`pwd -P`"
66 | cd "$SAVED" >&-
67 |
68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
69 |
70 | # Determine the Java command to use to start the JVM.
71 | if [ -n "$JAVA_HOME" ] ; then
72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
73 | # IBM's JDK on AIX uses strange locations for the executables
74 | JAVACMD="$JAVA_HOME/jre/sh/java"
75 | else
76 | JAVACMD="$JAVA_HOME/bin/java"
77 | fi
78 | if [ ! -x "$JAVACMD" ] ; then
79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
80 |
81 | Please set the JAVA_HOME variable in your environment to match the
82 | location of your Java installation."
83 | fi
84 | else
85 | JAVACMD="java"
86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
87 |
88 | Please set the JAVA_HOME variable in your environment to match the
89 | location of your Java installation."
90 | fi
91 |
92 | # Increase the maximum file descriptors if we can.
93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
94 | MAX_FD_LIMIT=`ulimit -H -n`
95 | if [ $? -eq 0 ] ; then
96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
97 | MAX_FD="$MAX_FD_LIMIT"
98 | fi
99 | ulimit -n $MAX_FD
100 | if [ $? -ne 0 ] ; then
101 | warn "Could not set maximum file descriptor limit: $MAX_FD"
102 | fi
103 | else
104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
105 | fi
106 | fi
107 |
108 | # For Darwin, add options to specify how the application appears in the dock
109 | if $darwin; then
110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
111 | fi
112 |
113 | # For Cygwin, switch paths to Windows format before running java
114 | if $cygwin ; then
115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"`
116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
117 |
118 | # We build the pattern for arguments to be converted via cygpath
119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
120 | SEP=""
121 | for dir in $ROOTDIRSRAW ; do
122 | ROOTDIRS="$ROOTDIRS$SEP$dir"
123 | SEP="|"
124 | done
125 | OURCYGPATTERN="(^($ROOTDIRS))"
126 | # Add a user-defined pattern to the cygpath arguments
127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then
128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
129 | fi
130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh
131 | i=0
132 | for arg in "$@" ; do
133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
135 |
136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
138 | else
139 | eval `echo args$i`="\"$arg\""
140 | fi
141 | i=$((i+1))
142 | done
143 | case $i in
144 | (0) set -- ;;
145 | (1) set -- "$args0" ;;
146 | (2) set -- "$args0" "$args1" ;;
147 | (3) set -- "$args0" "$args1" "$args2" ;;
148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
154 | esac
155 | fi
156 |
157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
158 | function splitJvmOpts() {
159 | JVM_OPTS=("$@")
160 | }
161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
163 |
164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
165 |
--------------------------------------------------------------------------------
/native-base-theme/components/Item.js:
--------------------------------------------------------------------------------
1 | import { Platform } from "react-native";
2 |
3 | import variable from "./../variables/platform";
4 |
5 | export default (variables = variable) => {
6 | const itemTheme = {
7 | ".floatingLabel": {
8 | "NativeBase.Input": {
9 | height: 50,
10 | top: 8
11 | },
12 | "NativeBase.Label": {
13 | top: 8
14 | },
15 | "NativeBase.Icon": {
16 | top: 6
17 | }
18 | },
19 | ".fixedLabel": {
20 | "NativeBase.Label": {
21 | position: null,
22 | top: null,
23 | left: null,
24 | right: null,
25 | flex: 1,
26 | height: null,
27 | width: null,
28 | fontSize: variables.inputFontSize
29 | },
30 | "NativeBase.Input": {
31 | flex: 2,
32 | fontSize: variables.inputFontSize
33 | }
34 | },
35 | ".stackedLabel": {
36 | "NativeBase.Label": {
37 | position: null,
38 | top: null,
39 | left: null,
40 | right: null,
41 | paddingTop: 5,
42 | alignSelf: "flex-start",
43 | fontSize: variables.inputFontSize - 2
44 | },
45 | "NativeBase.Icon": {
46 | marginTop: 36
47 | },
48 | "NativeBase.Input": {
49 | alignSelf: Platform.OS === "ios" ? "stretch" : "flex-start",
50 | flex: 1,
51 | width: Platform.OS === "ios" ? null : variables.deviceWidth - 25,
52 | fontSize: variables.inputFontSize
53 | },
54 | flexDirection: null
55 | },
56 | ".inlineLabel": {
57 | "NativeBase.Label": {
58 | position: null,
59 | top: null,
60 | left: null,
61 | right: null,
62 | paddingRight: 20,
63 | height: null,
64 | width: null,
65 | fontSize: variables.inputFontSize
66 | },
67 | "NativeBase.Input": {
68 | paddingLeft: 5,
69 | fontSize: variables.inputFontSize
70 | },
71 | flexDirection: "row"
72 | },
73 | "NativeBase.Label": {
74 | fontSize: variables.inputFontSize,
75 | color: variables.inputColorPlaceholder,
76 | paddingRight: 5
77 | },
78 | "NativeBase.Icon": {
79 | fontSize: 24,
80 | paddingRight: 8
81 | },
82 | "NativeBase.IconNB": {
83 | fontSize: 24,
84 | paddingRight: 8
85 | },
86 | "NativeBase.Input": {
87 | ".multiline": {
88 | height: null
89 | },
90 | height: variables.inputHeightBase,
91 | color: variables.inputColor,
92 | flex: 1,
93 | top: Platform.OS === "ios" ? 1.5 : undefined,
94 | fontSize: variables.inputFontSize,
95 | lineHeight: variables.inputLineHeight
96 | },
97 | ".underline": {
98 | "NativeBase.Input": {
99 | paddingLeft: 15
100 | },
101 | ".success": {
102 | borderColor: variables.inputSuccessBorderColor
103 | },
104 | ".error": {
105 | borderColor: variables.inputErrorBorderColor
106 | },
107 | borderWidth: variables.borderWidth * 2,
108 | borderTopWidth: 0,
109 | borderRightWidth: 0,
110 | borderLeftWidth: 0,
111 | borderColor: variables.inputBorderColor
112 | },
113 | ".regular": {
114 | "NativeBase.Input": {
115 | paddingLeft: 8
116 | },
117 | "NativeBase.Icon": {
118 | paddingLeft: 10
119 | },
120 | ".success": {
121 | borderColor: variables.inputSuccessBorderColor
122 | },
123 | ".error": {
124 | borderColor: variables.inputErrorBorderColor
125 | },
126 | borderWidth: variables.borderWidth * 2,
127 | borderColor: variables.inputBorderColor
128 | },
129 | ".rounded": {
130 | "NativeBase.Input": {
131 | paddingLeft: 8
132 | },
133 | "NativeBase.Icon": {
134 | paddingLeft: 10
135 | },
136 | ".success": {
137 | borderColor: variables.inputSuccessBorderColor
138 | },
139 | ".error": {
140 | borderColor: variables.inputErrorBorderColor
141 | },
142 | borderWidth: variables.borderWidth * 2,
143 | borderRadius: 30,
144 | borderColor: variables.inputBorderColor
145 | },
146 |
147 | ".success": {
148 | "NativeBase.Icon": {
149 | color: variables.inputSuccessBorderColor
150 | },
151 | "NativeBase.IconNB": {
152 | color: variables.inputSuccessBorderColor
153 | },
154 | ".rounded": {
155 | borderRadius: 30,
156 | borderColor: variables.inputSuccessBorderColor
157 | },
158 | ".regular": {
159 | borderColor: variables.inputSuccessBorderColor
160 | },
161 | ".underline": {
162 | borderWidth: variables.borderWidth * 2,
163 | borderTopWidth: 0,
164 | borderRightWidth: 0,
165 | borderLeftWidth: 0,
166 | borderColor: variables.inputSuccessBorderColor
167 | },
168 | borderColor: variables.inputSuccessBorderColor
169 | },
170 |
171 | ".error": {
172 | "NativeBase.Icon": {
173 | color: variables.inputErrorBorderColor
174 | },
175 | "NativeBase.IconNB": {
176 | color: variables.inputErrorBorderColor
177 | },
178 | ".rounded": {
179 | borderRadius: 30,
180 | borderColor: variables.inputErrorBorderColor
181 | },
182 | ".regular": {
183 | borderColor: variables.inputErrorBorderColor
184 | },
185 | ".underline": {
186 | borderWidth: variables.borderWidth * 2,
187 | borderTopWidth: 0,
188 | borderRightWidth: 0,
189 | borderLeftWidth: 0,
190 | borderColor: variables.inputErrorBorderColor
191 | },
192 | borderColor: variables.inputErrorBorderColor
193 | },
194 | ".disabled": {
195 | "NativeBase.Icon": {
196 | color: "#384850"
197 | },
198 | "NativeBase.IconNB": {
199 | color: "#384850"
200 | }
201 | },
202 |
203 | borderWidth: variables.borderWidth * 2,
204 | borderTopWidth: 0,
205 | borderRightWidth: 0,
206 | borderLeftWidth: 0,
207 | borderColor: variables.inputBorderColor,
208 | backgroundColor: "transparent",
209 | flexDirection: "row",
210 | alignItems: "center",
211 | marginLeft: 2
212 | };
213 |
214 | return itemTheme;
215 | };
216 |
--------------------------------------------------------------------------------
/native-base-theme/components/index.js:
--------------------------------------------------------------------------------
1 | import _ from "lodash";
2 | import bodyTheme from "./Body";
3 | import leftTheme from "./Left";
4 | import rightTheme from "./Right";
5 | import headerTheme from "./Header";
6 | import switchTheme from "./Switch";
7 | import thumbnailTheme from "./Thumbnail";
8 | import containerTheme from "./Container";
9 | import contentTheme from "./Content";
10 | import buttonTheme from "./Button";
11 | import titleTheme from "./Title";
12 | import subtitleTheme from "./Subtitle";
13 | import inputGroupTheme from "./InputGroup";
14 | import badgeTheme from "./Badge";
15 | import checkBoxTheme from "./CheckBox";
16 | import cardTheme from "./Card";
17 | import radioTheme from "./Radio";
18 | import h3Theme from "./H3";
19 | import h2Theme from "./H2";
20 | import h1Theme from "./H1";
21 | import footerTheme from "./Footer";
22 | import footerTabTheme from "./FooterTab";
23 | import fabTheme from "./Fab";
24 | import itemTheme from "./Item";
25 | import labelTheme from "./Label";
26 | import textAreaTheme from "./Textarea";
27 | import textTheme from "./Text";
28 | import toastTheme from "./Toast";
29 | import tabTheme from "./Tab";
30 | import tabBarTheme from "./TabBar";
31 | import tabContainerTheme from "./TabContainer";
32 | import viewTheme from "./View";
33 | import tabHeadingTheme from "./TabHeading";
34 | import iconTheme from "./Icon";
35 | import inputTheme from "./Input";
36 | import swipeRowTheme from "./SwipeRow";
37 | import segmentTheme from "./Segment";
38 | import spinnerTheme from "./Spinner";
39 | import cardItemTheme from "./CardItem";
40 | import listItemTheme from "./ListItem";
41 | import formTheme from "./Form";
42 | import separatorTheme from "./Separator";
43 | import variable from "./../variables/platform";
44 |
45 | export default (variables = variable) => {
46 | const theme = {
47 | variables,
48 | "NativeBase.Left": {
49 | ...leftTheme(variables)
50 | },
51 | "NativeBase.Right": {
52 | ...rightTheme(variables)
53 | },
54 | "NativeBase.Body": {
55 | ...bodyTheme(variables)
56 | },
57 |
58 | "NativeBase.Header": {
59 | ...headerTheme(variables)
60 | },
61 |
62 | "NativeBase.Button": {
63 | ...buttonTheme(variables)
64 | },
65 |
66 | "NativeBase.Title": {
67 | ...titleTheme(variables)
68 | },
69 | "NativeBase.Subtitle": {
70 | ...subtitleTheme(variables)
71 | },
72 |
73 | "NativeBase.InputGroup": {
74 | ...inputGroupTheme(variables)
75 | },
76 |
77 | "NativeBase.Input": {
78 | ...inputTheme(variables)
79 | },
80 |
81 | "NativeBase.Badge": {
82 | ...badgeTheme(variables)
83 | },
84 |
85 | "NativeBase.CheckBox": {
86 | ...checkBoxTheme(variables)
87 | },
88 |
89 | "NativeBase.Radio": {
90 | ...radioTheme(variables)
91 | },
92 |
93 | "NativeBase.Card": {
94 | ...cardTheme()
95 | },
96 |
97 | "NativeBase.CardItem": {
98 | ...cardItemTheme(variables)
99 | },
100 |
101 | "NativeBase.Toast": {
102 | ...toastTheme(variables)
103 | },
104 |
105 | "NativeBase.H1": {
106 | ...h1Theme(variables)
107 | },
108 | "NativeBase.H2": {
109 | ...h2Theme(variables)
110 | },
111 | "NativeBase.H3": {
112 | ...h3Theme(variables)
113 | },
114 | "NativeBase.Form": {
115 | ...formTheme(variables)
116 | },
117 |
118 | "NativeBase.Container": {
119 | ...containerTheme(variables)
120 | },
121 | "NativeBase.Content": {
122 | ...contentTheme(variables)
123 | },
124 |
125 | "NativeBase.Footer": {
126 | ...footerTheme(variables)
127 | },
128 |
129 | "NativeBase.Tabs": {
130 | flex: 1
131 | },
132 |
133 | "NativeBase.FooterTab": {
134 | ...footerTabTheme(variables)
135 | },
136 |
137 | "NativeBase.ListItem": {
138 | ...listItemTheme(variables)
139 | },
140 |
141 | "NativeBase.ListItem1": {
142 | ...listItemTheme(variables)
143 | },
144 |
145 | "NativeBase.Icon": {
146 | ...iconTheme(variables)
147 | },
148 | "NativeBase.IconNB": {
149 | ...iconTheme(variables)
150 | },
151 | "NativeBase.Text": {
152 | ...textTheme(variables)
153 | },
154 | "NativeBase.Spinner": {
155 | ...spinnerTheme(variables)
156 | },
157 |
158 | "NativeBase.Fab": {
159 | ...fabTheme(variables)
160 | },
161 |
162 | "NativeBase.Item": {
163 | ...itemTheme(variables)
164 | },
165 |
166 | "NativeBase.Label": {
167 | ...labelTheme(variables)
168 | },
169 |
170 | "NativeBase.Textarea": {
171 | ...textAreaTheme(variables)
172 | },
173 |
174 | "NativeBase.PickerNB": {
175 | "NativeBase.Button": {
176 | "NativeBase.Text": {}
177 | }
178 | },
179 |
180 | "NativeBase.Tab": {
181 | ...tabTheme(variables)
182 | },
183 |
184 | "NativeBase.Segment": {
185 | ...segmentTheme(variables)
186 | },
187 |
188 | "NativeBase.TabBar": {
189 | ...tabBarTheme(variables)
190 | },
191 | "NativeBase.ViewNB": {
192 | ...viewTheme(variables)
193 | },
194 | "NativeBase.TabHeading": {
195 | ...tabHeadingTheme(variables)
196 | },
197 | "NativeBase.TabContainer": {
198 | ...tabContainerTheme(variables)
199 | },
200 | "NativeBase.Switch": {
201 | ...switchTheme(variables)
202 | },
203 | "NativeBase.Separator": {
204 | ...separatorTheme(variables)
205 | },
206 | "NativeBase.SwipeRow": {
207 | ...swipeRowTheme(variables)
208 | },
209 | "NativeBase.Thumbnail": {
210 | ...thumbnailTheme(variables)
211 | }
212 | };
213 |
214 | const cssifyTheme = (grandparent, parent, parentKey) => {
215 | _.forEach(parent, (style, styleName) => {
216 | // console.log('styleName', styleName);
217 | // console.log('parentKey', parentKey);
218 | if (
219 | styleName.indexOf(".") === 0 &&
220 | parentKey &&
221 | parentKey.indexOf(".") === 0
222 | ) {
223 | if (grandparent) {
224 | if (!grandparent[styleName]) {
225 | grandparent[styleName] = {};
226 | } else {
227 | grandparent[styleName][parentKey] = style;
228 | }
229 | }
230 | }
231 | if (style && typeof style === "object") {
232 | cssifyTheme(parent, style, styleName);
233 | }
234 | });
235 | };
236 |
237 | cssifyTheme(null, theme, null);
238 |
239 | return theme;
240 | };
241 |
--------------------------------------------------------------------------------
/native-base-theme/variables/material.js:
--------------------------------------------------------------------------------
1 | import color from "color";
2 |
3 | import { Platform, Dimensions, PixelRatio } from "react-native";
4 |
5 | const deviceHeight = Dimensions.get("window").height;
6 | const deviceWidth = Dimensions.get("window").width;
7 | const platform = Platform.OS;
8 | const platformStyle = "material";
9 | const isIphoneX =
10 | platform === "ios" && deviceHeight === 812 && deviceWidth === 375;
11 |
12 | export default {
13 | platformStyle,
14 | platform,
15 |
16 | // Android
17 | androidRipple: true,
18 | androidRippleColor: "rgba(256, 256, 256, 0.3)",
19 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)",
20 | btnUppercaseAndroidText: true,
21 |
22 | // Badge
23 | badgeBg: "#ED1727",
24 | badgeColor: "#fff",
25 | badgePadding: platform === "ios" ? 3 : 0,
26 |
27 | // Button
28 | btnFontFamily: platform === "ios" ? "Roboto" : "Roboto_medium",
29 | btnDisabledBg: "#b5b5b5",
30 | buttonPadding: 6,
31 | get btnPrimaryBg() {
32 | return this.brandPrimary;
33 | },
34 | get btnPrimaryColor() {
35 | return this.inverseTextColor;
36 | },
37 | get btnInfoBg() {
38 | return this.brandInfo;
39 | },
40 | get btnInfoColor() {
41 | return this.inverseTextColor;
42 | },
43 | get btnSuccessBg() {
44 | return this.brandSuccess;
45 | },
46 | get btnSuccessColor() {
47 | return this.inverseTextColor;
48 | },
49 | get btnDangerBg() {
50 | return this.brandDanger;
51 | },
52 | get btnDangerColor() {
53 | return this.inverseTextColor;
54 | },
55 | get btnWarningBg() {
56 | return this.brandWarning;
57 | },
58 | get btnWarningColor() {
59 | return this.inverseTextColor;
60 | },
61 | get btnTextSize() {
62 | return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1;
63 | },
64 | get btnTextSizeLarge() {
65 | return this.fontSizeBase * 1.5;
66 | },
67 | get btnTextSizeSmall() {
68 | return this.fontSizeBase * 0.8;
69 | },
70 | get borderRadiusLarge() {
71 | return this.fontSizeBase * 3.8;
72 | },
73 | get iconSizeLarge() {
74 | return this.iconFontSize * 1.5;
75 | },
76 | get iconSizeSmall() {
77 | return this.iconFontSize * 0.6;
78 | },
79 |
80 | // Card
81 | cardDefaultBg: "#fff",
82 | cardBorderColor: "#ccc",
83 |
84 | // CheckBox
85 | CheckboxRadius: 0,
86 | CheckboxBorderWidth: 2,
87 | CheckboxPaddingLeft: 2,
88 | CheckboxPaddingBottom: platform === "ios" ? 0 : 5,
89 | CheckboxIconSize: platform === "ios" ? 18 : 14,
90 | CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
91 | CheckboxFontSize: platform === "ios" ? 21 : 18,
92 | DefaultFontSize: 17,
93 | checkboxBgColor: "#039BE5",
94 | checkboxSize: 20,
95 | checkboxTickColor: "#fff",
96 |
97 | // Color
98 | brandPrimary: "#3F51B5",
99 | brandInfo: "#3F57D3",
100 | brandSuccess: "#5cb85c",
101 | brandDanger: "#d9534f",
102 | brandWarning: "#f0ad4e",
103 | brandDark: "#000",
104 | brandLight: "#f4f4f4",
105 |
106 | // Font
107 | fontFamily: "Roboto",
108 | fontSizeBase: 15,
109 | get fontSizeH1() {
110 | return this.fontSizeBase * 1.8;
111 | },
112 | get fontSizeH2() {
113 | return this.fontSizeBase * 1.6;
114 | },
115 | get fontSizeH3() {
116 | return this.fontSizeBase * 1.4;
117 | },
118 |
119 | // Footer
120 | footerHeight: isIphoneX ? 89 : 55,
121 | footerDefaultBg: "#3F51B5",
122 | footerPaddingBottom: isIphoneX ? 34 : 0,
123 |
124 | // FooterTab
125 | tabBarTextColor: "#fff",
126 | tabBarTextSize: platform === "ios" ? 14 : 11,
127 | activeTab: "#fff",
128 | sTabBarActiveTextColor: "#007aff",
129 | tabBarActiveTextColor: "#fff",
130 | tabActiveBgColor: "#3F51B5",
131 |
132 | // Header
133 | toolbarBtnColor: "#fff",
134 | toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
135 | toolbarHeight: platform === "ios" ? (isIphoneX ? 88 : 64) : 56,
136 | toolbarSearchIconSize: platform === "ios" ? 20 : 23,
137 | toolbarInputColor: "#fff",
138 | searchBarHeight: platform === "ios" ? 30 : 40,
139 | searchBarInputHeight: platform === "ios" ? 30 : 50,
140 | toolbarBtnTextColor: "#fff",
141 | toolbarDefaultBorder: "#3F51B5",
142 | iosStatusbar: "light-content",
143 | get statusBarColor() {
144 | return color(this.toolbarDefaultBg)
145 | .darken(0.2)
146 | .hex();
147 | },
148 | get darkenHeader() {
149 | return color(this.tabBgColor)
150 | .darken(0.03)
151 | .hex();
152 | },
153 |
154 | // Icon
155 | iconFamily: "Ionicons",
156 | iconFontSize: platform === "ios" ? 30 : 28,
157 | iconHeaderSize: platform === "ios" ? 29 : 24,
158 |
159 | // InputGroup
160 | inputFontSize: 17,
161 | inputBorderColor: "#D9D5DC",
162 | inputSuccessBorderColor: "#2b8339",
163 | inputErrorBorderColor: "#ed2f2f",
164 | inputHeightBase: 50,
165 | get inputColor() {
166 | return this.textColor;
167 | },
168 | get inputColorPlaceholder() {
169 | return "#575757";
170 | },
171 |
172 | // Line Height
173 | btnLineHeight: 19,
174 | lineHeightH1: 32,
175 | lineHeightH2: 27,
176 | lineHeightH3: 22,
177 | lineHeight: platform === "ios" ? 20 : 24,
178 |
179 | // List
180 | listBg: "transparent",
181 | listBorderColor: "#c9c9c9",
182 | listDividerBg: "#f4f4f4",
183 | listBtnUnderlayColor: "#DDD",
184 | listItemPadding: platform === "ios" ? 10 : 12,
185 | listNoteColor: "#808080",
186 | listNoteSize: 13,
187 |
188 | // Progress Bar
189 | defaultProgressColor: "#E4202D",
190 | inverseProgressColor: "#1A191B",
191 |
192 | // Radio Button
193 | radioBtnSize: platform === "ios" ? 25 : 23,
194 | radioSelectedColorAndroid: "#5067FF",
195 | radioBtnLineHeight: platform === "ios" ? 29 : 24,
196 | radioColor: this.brandPrimary,
197 |
198 | // Segment
199 | segmentBackgroundColor: "#3F51B5",
200 | segmentActiveBackgroundColor: "#fff",
201 | segmentTextColor: "#fff",
202 | segmentActiveTextColor: "#3F51B5",
203 | segmentBorderColor: "#fff",
204 | segmentBorderColorMain: "#3F51B5",
205 |
206 | // Spinner
207 | defaultSpinnerColor: "#45D56E",
208 | inverseSpinnerColor: "#1A191B",
209 |
210 | // Tab
211 | tabDefaultBg: "#3F51B5",
212 | topTabBarTextColor: "#b3c7f9",
213 | topTabBarActiveTextColor: "#fff",
214 | topTabBarBorderColor: "#fff",
215 | topTabBarActiveBorderColor: "#fff",
216 |
217 | // Tabs
218 | tabBgColor: "#F8F8F8",
219 | tabFontSize: 15,
220 |
221 | // Text
222 | textColor: "#000",
223 | inverseTextColor: "#fff",
224 | noteFontSize: 14,
225 | get defaultTextColor() {
226 | return this.textColor;
227 | },
228 |
229 | // Title
230 | titleFontfamily: platform === "ios" ? "Roboto" : "Roboto_medium",
231 | titleFontSize: 19,
232 | subTitleFontSize: 14,
233 | subtitleColor: "#FFF",
234 | titleFontColor: "#FFF",
235 |
236 | // Other
237 | borderRadiusBase: 2,
238 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
239 | contentPadding: 10,
240 | dropdownLinkColor: "#414142",
241 | inputLineHeight: 24,
242 | deviceWidth,
243 | deviceHeight,
244 | isIphoneX,
245 | inputGroupRoundedBorderRadius: 30
246 | };
247 |
--------------------------------------------------------------------------------
/android/app/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: "com.android.application"
2 |
3 | import com.android.build.OutputFile
4 |
5 | /**
6 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7 | * and bundleReleaseJsAndAssets).
8 | * These basically call `react-native bundle` with the correct arguments during the Android build
9 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10 | * bundle directly from the development server. Below you can see all the possible configurations
11 | * and their defaults. If you decide to add a configuration block, make sure to add it before the
12 | * `apply from: "../../node_modules/react-native/react.gradle"` line.
13 | *
14 | * project.ext.react = [
15 | * // the name of the generated asset file containing your JS bundle
16 | * bundleAssetName: "index.android.bundle",
17 | *
18 | * // the entry file for bundle generation
19 | * entryFile: "index.android.js",
20 | *
21 | * // whether to bundle JS and assets in debug mode
22 | * bundleInDebug: false,
23 | *
24 | * // whether to bundle JS and assets in release mode
25 | * bundleInRelease: true,
26 | *
27 | * // whether to bundle JS and assets in another build variant (if configured).
28 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29 | * // The configuration property can be in the following formats
30 | * // 'bundleIn${productFlavor}${buildType}'
31 | * // 'bundleIn${buildType}'
32 | * // bundleInFreeDebug: true,
33 | * // bundleInPaidRelease: true,
34 | * // bundleInBeta: true,
35 | *
36 | * // whether to disable dev mode in custom build variants (by default only disabled in release)
37 | * // for example: to disable dev mode in the staging build type (if configured)
38 | * devDisabledInStaging: true,
39 | * // The configuration property can be in the following formats
40 | * // 'devDisabledIn${productFlavor}${buildType}'
41 | * // 'devDisabledIn${buildType}'
42 | *
43 | * // the root of your project, i.e. where "package.json" lives
44 | * root: "../../",
45 | *
46 | * // where to put the JS bundle asset in debug mode
47 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
48 | *
49 | * // where to put the JS bundle asset in release mode
50 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release",
51 | *
52 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
53 | * // require('./image.png')), in debug mode
54 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
55 | *
56 | * // where to put drawable resources / React Native assets, e.g. the ones you use via
57 | * // require('./image.png')), in release mode
58 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
59 | *
60 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means
61 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
62 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle
63 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
64 | * // for example, you might want to remove it from here.
65 | * inputExcludes: ["android/**", "ios/**"],
66 | *
67 | * // override which node gets called and with what additional arguments
68 | * nodeExecutableAndArgs: ["node"],
69 | *
70 | * // supply additional arguments to the packager
71 | * extraPackagerArgs: []
72 | * ]
73 | */
74 |
75 | project.ext.react = [
76 | entryFile: "index.js"
77 | ]
78 |
79 | apply from: "../../node_modules/react-native/react.gradle"
80 |
81 | /**
82 | * Set this to true to create two separate APKs instead of one:
83 | * - An APK that only works on ARM devices
84 | * - An APK that only works on x86 devices
85 | * The advantage is the size of the APK is reduced by about 4MB.
86 | * Upload all the APKs to the Play Store and people will download
87 | * the correct one based on the CPU architecture of their device.
88 | */
89 | def enableSeparateBuildPerCPUArchitecture = false
90 |
91 | /**
92 | * Run Proguard to shrink the Java bytecode in release builds.
93 | */
94 | def enableProguardInReleaseBuilds = false
95 |
96 | buildscript {
97 | repositories {
98 | maven { url 'https://maven.fabric.io/public' }
99 | }
100 |
101 | dependencies {
102 | // These docs use an open ended version so that our plugin
103 | // can be updated quickly in response to Android tooling updates
104 |
105 | // We recommend changing it to the latest version from our changelog:
106 | // https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
107 | classpath 'io.fabric.tools:gradle:1.+'
108 | }
109 | }
110 |
111 | apply plugin: 'io.fabric'
112 |
113 | repositories {
114 | maven { url 'https://maven.fabric.io/public' }
115 | }
116 |
117 | android {
118 | compileSdkVersion 23
119 | buildToolsVersion "23.0.1"
120 |
121 | defaultConfig {
122 | applicationId "com.whatsappdownloader"
123 | minSdkVersion 16
124 | targetSdkVersion 22
125 | versionCode 1
126 | versionName "1.0"
127 | ndk {
128 | abiFilters "armeabi-v7a", "x86"
129 | }
130 | }
131 | splits {
132 | abi {
133 | reset()
134 | enable enableSeparateBuildPerCPUArchitecture
135 | universalApk false // If true, also generate a universal APK
136 | include "armeabi-v7a", "x86"
137 | }
138 | }
139 | buildTypes {
140 | release {
141 | minifyEnabled enableProguardInReleaseBuilds
142 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
143 | }
144 | }
145 | // applicationVariants are e.g. debug, release
146 | applicationVariants.all { variant ->
147 | variant.outputs.each { output ->
148 | // For each separate APK per architecture, set a unique version code as described here:
149 | // http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
150 | def versionCodes = ["armeabi-v7a":1, "x86":2]
151 | def abi = output.getFilter(OutputFile.ABI)
152 | if (abi != null) { // null for the universal-debug, universal-release variants
153 | output.versionCodeOverride =
154 | versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
155 | }
156 | }
157 | }
158 | }
159 |
160 | dependencies {
161 | compile project(':react-native-fabric')
162 | compile project(':react-native-tts')
163 | compile project(':react-native-video')
164 | compile project(':react-native-fetch-blob')
165 | compile project(':react-native-vector-icons')
166 | compile fileTree(dir: "libs", include: ["*.jar"])
167 | compile "com.android.support:appcompat-v7:23.0.1"
168 | compile "com.facebook.react:react-native:+" // From node_modules
169 | compile('com.crashlytics.sdk.android:crashlytics:2.9.0@aar') {
170 | transitive = true;
171 | }
172 | }
173 |
174 | // Run this once to be able to run the application with BUCK
175 | // puts all compile dependencies into folder libs for BUCK to use
176 | task copyDownloadableDepsToLibs(type: Copy) {
177 | from configurations.compile
178 | into 'libs'
179 | }
180 |
--------------------------------------------------------------------------------
/native-base-theme/variables/platform.js:
--------------------------------------------------------------------------------
1 | import color from "color";
2 |
3 | import { Platform, Dimensions, PixelRatio } from "react-native";
4 |
5 | const deviceHeight = Dimensions.get("window").height;
6 | const deviceWidth = Dimensions.get("window").width;
7 | const platform = Platform.OS;
8 | const platformStyle = undefined;
9 | const isIphoneX =
10 | platform === "ios" && deviceHeight === 812 && deviceWidth === 375;
11 |
12 | export default {
13 | platformStyle,
14 | platform,
15 |
16 | // Android
17 | androidRipple: true,
18 | androidRippleColor: "rgba(256, 256, 256, 0.3)",
19 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)",
20 | btnUppercaseAndroidText: true,
21 |
22 | // Badge
23 | badgeBg: "#ED1727",
24 | badgeColor: "#fff",
25 | badgePadding: platform === "ios" ? 3 : 0,
26 |
27 | // Button
28 | btnFontFamily: platform === "ios" ? "System" : "Roboto_medium",
29 | btnDisabledBg: "#b5b5b5",
30 | buttonPadding: 6,
31 | get btnPrimaryBg() {
32 | return this.brandPrimary;
33 | },
34 | get btnPrimaryColor() {
35 | return this.inverseTextColor;
36 | },
37 | get btnInfoBg() {
38 | return this.brandInfo;
39 | },
40 | get btnInfoColor() {
41 | return this.inverseTextColor;
42 | },
43 | get btnSuccessBg() {
44 | return this.brandSuccess;
45 | },
46 | get btnSuccessColor() {
47 | return this.inverseTextColor;
48 | },
49 | get btnDangerBg() {
50 | return this.brandDanger;
51 | },
52 | get btnDangerColor() {
53 | return this.inverseTextColor;
54 | },
55 | get btnWarningBg() {
56 | return this.brandWarning;
57 | },
58 | get btnWarningColor() {
59 | return this.inverseTextColor;
60 | },
61 | get btnTextSize() {
62 | return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1;
63 | },
64 | get btnTextSizeLarge() {
65 | return this.fontSizeBase * 1.5;
66 | },
67 | get btnTextSizeSmall() {
68 | return this.fontSizeBase * 0.8;
69 | },
70 | get borderRadiusLarge() {
71 | return this.fontSizeBase * 3.8;
72 | },
73 | get iconSizeLarge() {
74 | return this.iconFontSize * 1.5;
75 | },
76 | get iconSizeSmall() {
77 | return this.iconFontSize * 0.6;
78 | },
79 |
80 | // Card
81 | cardDefaultBg: "#fff",
82 | cardBorderColor: "#ccc",
83 |
84 | // CheckBox
85 | CheckboxRadius: platform === "ios" ? 13 : 0,
86 | CheckboxBorderWidth: platform === "ios" ? 1 : 2,
87 | CheckboxPaddingLeft: platform === "ios" ? 4 : 2,
88 | CheckboxPaddingBottom: platform === "ios" ? 0 : 5,
89 | CheckboxIconSize: platform === "ios" ? 21 : 14,
90 | CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
91 | CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 18,
92 | DefaultFontSize: 17,
93 | checkboxBgColor: "#039BE5",
94 | checkboxSize: 20,
95 | checkboxTickColor: "#fff",
96 |
97 | // Color
98 | brandPrimary: "#007aff",
99 | brandInfo: "#62B1F6",
100 | brandSuccess: "#5cb85c",
101 | brandDanger: "#d9534f",
102 | brandWarning: "#f0ad4e",
103 | brandDark: "#000",
104 | brandLight: "#f4f4f4",
105 |
106 | // Font
107 | fontFamily: platform === "ios" ? "System" : "Roboto",
108 | fontSizeBase: 15,
109 | get fontSizeH1() {
110 | return this.fontSizeBase * 1.8;
111 | },
112 | get fontSizeH2() {
113 | return this.fontSizeBase * 1.6;
114 | },
115 | get fontSizeH3() {
116 | return this.fontSizeBase * 1.4;
117 | },
118 |
119 | // Footer
120 | footerHeight: isIphoneX ? 89 : 55,
121 | footerDefaultBg: platform === "ios" ? "#F8F8F8" : "#4179F7",
122 | footerPaddingBottom: isIphoneX ? 34 : 0,
123 |
124 | // FooterTab
125 | tabBarTextColor: "#2874F0",
126 | tabBarTextSize: platform === "ios" ? 14 : 11,
127 | activeTab: "#fff",
128 | sTabBarActiveTextColor: "#007aff",
129 | tabBarActiveTextColor: "#2874F0",
130 | tabActiveBgColor: "#cde1f9",
131 |
132 | // Header
133 | toolbarBtnColor: platform === "ios" ? "#007aff" : "#fff",
134 | toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
135 | toolbarHeight: platform === "ios" ? (isIphoneX ? 88 : 64) : 56,
136 | toolbarSearchIconSize: platform === "ios" ? 20 : 23,
137 | toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
138 | searchBarHeight: platform === "ios" ? 30 : 40,
139 | searchBarInputHeight: platform === "ios" ? 30 : 50,
140 | toolbarBtnTextColor: "#000",
141 | toolbarDefaultBorder: "#a7a6ab",
142 | iosStatusbar: platform === "ios" ? "dark-content" : "light-content",
143 | get statusBarColor() {
144 | return color(this.toolbarDefaultBg)
145 | .darken(0.2)
146 | .hex();
147 | },
148 | get darkenHeader() {
149 | return color(this.tabBgColor)
150 | .darken(0.03)
151 | .hex();
152 | },
153 |
154 | // Icon
155 | iconFamily: "Ionicons",
156 | iconFontSize: platform === "ios" ? 30 : 28,
157 | iconHeaderSize: platform === "ios" ? 33 : 24,
158 |
159 | // InputGroup
160 | inputFontSize: 17,
161 | inputBorderColor: "#D9D5DC",
162 | inputSuccessBorderColor: "#2b8339",
163 | inputErrorBorderColor: "#ed2f2f",
164 | inputHeightBase: 50,
165 | get inputColor() {
166 | return this.textColor;
167 | },
168 | get inputColorPlaceholder() {
169 | return "#575757";
170 | },
171 |
172 | // Line Height
173 | btnLineHeight: 19,
174 | lineHeightH1: 32,
175 | lineHeightH2: 27,
176 | lineHeightH3: 22,
177 | lineHeight: platform === "ios" ? 20 : 24,
178 |
179 | // List
180 | listBg: "transparent",
181 | listBorderColor: "#c9c9c9",
182 | listDividerBg: "#f4f4f4",
183 | listBtnUnderlayColor: "#DDD",
184 | listItemPadding: platform === "ios" ? 10 : 12,
185 | listNoteColor: "#808080",
186 | listNoteSize: 13,
187 |
188 | // Progress Bar
189 | defaultProgressColor: "#E4202D",
190 | inverseProgressColor: "#1A191B",
191 |
192 | // Radio Button
193 | radioBtnSize: platform === "ios" ? 25 : 23,
194 | radioSelectedColorAndroid: "#3F51B5",
195 | radioBtnLineHeight: platform === "ios" ? 29 : 24,
196 | radioColor: this.brandPrimary,
197 |
198 | // Segment
199 | segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5",
200 | segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff",
201 | segmentTextColor: platform === "ios" ? "#007aff" : "#fff",
202 | segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5",
203 | segmentBorderColor: platform === "ios" ? "#007aff" : "#fff",
204 | segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
205 |
206 | // Spinner
207 | defaultSpinnerColor: "#45D56E",
208 | inverseSpinnerColor: "#1A191B",
209 |
210 | // Tab
211 | tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
212 | topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
213 | topTabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff",
214 | topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff",
215 | topTabBarActiveBorderColor: platform === "ios" ? "#007aff" : "#fff",
216 |
217 | // Tabs
218 | tabBgColor: "#F8F8F8",
219 | tabFontSize: 15,
220 |
221 | // Text
222 | textColor: "#000",
223 | inverseTextColor: "#fff",
224 | noteFontSize: 14,
225 | get defaultTextColor() {
226 | return this.textColor;
227 | },
228 |
229 | // Title
230 | titleFontfamily: platform === "ios" ? "System" : "Roboto_medium",
231 | titleFontSize: platform === "ios" ? 17 : 19,
232 | subTitleFontSize: platform === "ios" ? 12 : 14,
233 | subtitleColor: platform === "ios" ? "#8e8e93" : "#FFF",
234 | titleFontColor: platform === "ios" ? "#000" : "#FFF",
235 |
236 | // Other
237 | borderRadiusBase: platform === "ios" ? 5 : 2,
238 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
239 | contentPadding: 10,
240 | dropdownLinkColor: "#414142",
241 | inputLineHeight: 24,
242 | deviceWidth,
243 | deviceHeight,
244 | isIphoneX,
245 | inputGroupRoundedBorderRadius: 30
246 | };
247 |
--------------------------------------------------------------------------------
/native-base-theme/variables/commonColor.js:
--------------------------------------------------------------------------------
1 | import color from "color";
2 |
3 | import { Platform, Dimensions, PixelRatio } from "react-native";
4 |
5 | const deviceHeight = Dimensions.get("window").height;
6 | const deviceWidth = Dimensions.get("window").width;
7 | const platform = Platform.OS;
8 | const platformStyle = undefined;
9 | const isIphoneX =
10 | platform === "ios" && deviceHeight === 812 && deviceWidth === 375;
11 |
12 | export default {
13 | platformStyle,
14 | platform,
15 |
16 | //Android
17 | androidRipple: true,
18 | androidRippleColor: "rgba(256, 256, 256, 0.3)",
19 | androidRippleColorDark: "rgba(0, 0, 0, 0.15)",
20 | btnUppercaseAndroidText: true,
21 |
22 | // Badge
23 | badgeBg: "#ED1727",
24 | badgeColor: "#fff",
25 | badgePadding: platform === "ios" ? 3 : 0,
26 |
27 | // Button
28 | btnFontFamily: platform === "ios" ? "System" : "Roboto_medium",
29 | btnDisabledBg: "#b5b5b5",
30 | buttonPadding: 6,
31 | get btnPrimaryBg() {
32 | return this.brandPrimary;
33 | },
34 | get btnPrimaryColor() {
35 | return this.inverseTextColor;
36 | },
37 | get btnInfoBg() {
38 | return this.brandInfo;
39 | },
40 | get btnInfoColor() {
41 | return this.inverseTextColor;
42 | },
43 | get btnSuccessBg() {
44 | return this.brandSuccess;
45 | },
46 | get btnSuccessColor() {
47 | return this.inverseTextColor;
48 | },
49 | get btnDangerBg() {
50 | return this.brandDanger;
51 | },
52 | get btnDangerColor() {
53 | return this.inverseTextColor;
54 | },
55 | get btnWarningBg() {
56 | return this.brandWarning;
57 | },
58 | get btnWarningColor() {
59 | return this.inverseTextColor;
60 | },
61 | get btnTextSize() {
62 | return platform === "ios" ? this.fontSizeBase * 1.1 : this.fontSizeBase - 1;
63 | },
64 | get btnTextSizeLarge() {
65 | return this.fontSizeBase * 1.5;
66 | },
67 | get btnTextSizeSmall() {
68 | return this.fontSizeBase * 0.8;
69 | },
70 | get borderRadiusLarge() {
71 | return this.fontSizeBase * 3.8;
72 | },
73 | get iconSizeLarge() {
74 | return this.iconFontSize * 1.5;
75 | },
76 | get iconSizeSmall() {
77 | return this.iconFontSize * 0.6;
78 | },
79 |
80 | // Card
81 | cardDefaultBg: "#fff",
82 | cardBorderColor: "#ccc",
83 |
84 | // CheckBox
85 | CheckboxRadius: platform === "ios" ? 13 : 0,
86 | CheckboxBorderWidth: platform === "ios" ? 1 : 2,
87 | CheckboxPaddingLeft: platform === "ios" ? 4 : 2,
88 | CheckboxPaddingBottom: platform === "ios" ? 0 : 5,
89 | CheckboxIconSize: platform === "ios" ? 21 : 14,
90 | CheckboxIconMarginTop: platform === "ios" ? undefined : 1,
91 | CheckboxFontSize: platform === "ios" ? 23 / 0.9 : 18,
92 | DefaultFontSize: 17,
93 | checkboxBgColor: "#039BE5",
94 | checkboxSize: 20,
95 | checkboxTickColor: "#fff",
96 |
97 | // Color
98 | brandPrimary: platform === "ios" ? "#007aff" : "#3F51B5",
99 | brandInfo: "#62B1F6",
100 | brandSuccess: "#5cb85c",
101 | brandDanger: "#d9534f",
102 | brandWarning: "#f0ad4e",
103 | brandDark: "#000",
104 | brandLight: "#f4f4f4",
105 |
106 | // Font
107 | fontFamily: platform === "ios" ? "System" : "Roboto",
108 | fontSizeBase: 15,
109 | get fontSizeH1() {
110 | return this.fontSizeBase * 1.8;
111 | },
112 | get fontSizeH2() {
113 | return this.fontSizeBase * 1.6;
114 | },
115 | get fontSizeH3() {
116 | return this.fontSizeBase * 1.4;
117 | },
118 |
119 | // Footer
120 | footerHeight: isIphoneX ? 89 : 55,
121 | footerDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
122 | footerPaddingBottom: isIphoneX ? 34 : 0,
123 |
124 | // FooterTab
125 | tabBarTextColor: platform === "ios" ? "#737373" : "#bfc6ea",
126 | tabBarTextSize: platform === "ios" ? 14 : 11,
127 | activeTab: platform === "ios" ? "#007aff" : "#fff",
128 | sTabBarActiveTextColor: "#007aff",
129 | tabBarActiveTextColor: platform === "ios" ? "#2874F0" : "#fff",
130 | tabActiveBgColor: platform === "ios" ? "#cde1f9" : "#3F51B5",
131 |
132 | // Header
133 | toolbarBtnColor: platform === "ios" ? "#007aff" : "#fff",
134 | toolbarDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
135 | toolbarHeight: platform === "ios" ? (isIphoneX ? 88 : 64) : 56,
136 | toolbarSearchIconSize: platform === "ios" ? 20 : 23,
137 | toolbarInputColor: platform === "ios" ? "#CECDD2" : "#fff",
138 | searchBarHeight: platform === "ios" ? 30 : 40,
139 | searchBarInputHeight: platform === "ios" ? 30 : 50,
140 | toolbarBtnTextColor: platform === "ios" ? "#007aff" : "#fff",
141 | iosStatusbar: "dark-content",
142 | toolbarDefaultBorder: platform === "ios" ? "#a7a6ab" : "#3F51B5",
143 | get statusBarColor() {
144 | return color(this.toolbarDefaultBg)
145 | .darken(0.2)
146 | .hex();
147 | },
148 | get darkenHeader() {
149 | return color(this.tabBgColor)
150 | .darken(0.03)
151 | .hex();
152 | },
153 |
154 | // Icon
155 | iconFamily: "Ionicons",
156 | iconFontSize: platform === "ios" ? 30 : 28,
157 | iconHeaderSize: platform === "ios" ? 33 : 24,
158 |
159 | // InputGroup
160 | inputFontSize: 17,
161 | inputBorderColor: "#D9D5DC",
162 | inputSuccessBorderColor: "#2b8339",
163 | inputErrorBorderColor: "#ed2f2f",
164 | inputHeightBase: 50,
165 | get inputColor() {
166 | return this.textColor;
167 | },
168 | get inputColorPlaceholder() {
169 | return "#575757";
170 | },
171 |
172 | // Line Height
173 | btnLineHeight: 19,
174 | lineHeightH1: 32,
175 | lineHeightH2: 27,
176 | lineHeightH3: 22,
177 | lineHeight: platform === "ios" ? 20 : 24,
178 |
179 | // List
180 | listBg: "transparent",
181 | listBorderColor: "#c9c9c9",
182 | listDividerBg: "#f4f4f4",
183 | listBtnUnderlayColor: "#DDD",
184 | listItemPadding: platform === "ios" ? 10 : 12,
185 | listNoteColor: "#808080",
186 | listNoteSize: 13,
187 |
188 | // Progress Bar
189 | defaultProgressColor: "#E4202D",
190 | inverseProgressColor: "#1A191B",
191 |
192 | // Radio Button
193 | radioBtnSize: platform === "ios" ? 25 : 23,
194 | radioSelectedColorAndroid: "#3F51B5",
195 | radioBtnLineHeight: platform === "ios" ? 29 : 24,
196 | radioColor: "#007aff",
197 |
198 | // Segment
199 | segmentBackgroundColor: platform === "ios" ? "#F8F8F8" : "#3F51B5",
200 | segmentActiveBackgroundColor: platform === "ios" ? "#007aff" : "#fff",
201 | segmentTextColor: platform === "ios" ? "#007aff" : "#fff",
202 | segmentActiveTextColor: platform === "ios" ? "#fff" : "#3F51B5",
203 | segmentBorderColor: platform === "ios" ? "#007aff" : "#fff",
204 | segmentBorderColorMain: platform === "ios" ? "#a7a6ab" : "#3F51B5",
205 |
206 | // Spinner
207 | defaultSpinnerColor: "#45D56E",
208 | inverseSpinnerColor: "#1A191B",
209 |
210 | // Tab
211 | tabDefaultBg: platform === "ios" ? "#F8F8F8" : "#3F51B5",
212 | topTabBarTextColor: platform === "ios" ? "#6b6b6b" : "#b3c7f9",
213 | topTabBarActiveTextColor: platform === "ios" ? "#007aff" : "#fff",
214 | topTabBarBorderColor: platform === "ios" ? "#a7a6ab" : "#fff",
215 | topTabBarActiveBorderColor: platform === "ios" ? "#007aff" : "#fff",
216 |
217 | // Tabs
218 | tabBgColor: "#F8F8F8",
219 | tabFontSize: 15,
220 |
221 | // Text
222 | textColor: "#000",
223 | inverseTextColor: "#fff",
224 | noteFontSize: 14,
225 | get defaultTextColor() {
226 | return this.textColor;
227 | },
228 |
229 | // Title
230 | titleFontfamily: platform === "ios" ? "System" : "Roboto_medium",
231 | titleFontSize: platform === "ios" ? 17 : 19,
232 | subTitleFontSize: platform === "ios" ? 12 : 14,
233 | subtitleColor: platform === "ios" ? "#000" : "#fff",
234 | titleFontColor: platform === "ios" ? "#000" : "#fff",
235 |
236 | // Other
237 | borderRadiusBase: platform === "ios" ? 5 : 2,
238 | borderWidth: 1 / PixelRatio.getPixelSizeForLayoutSize(1),
239 | contentPadding: 10,
240 | dropdownLinkColor: "#414142",
241 | inputLineHeight: 24,
242 | deviceWidth,
243 | deviceHeight,
244 | isIphoneX,
245 | inputGroupRoundedBorderRadius: 30
246 | };
247 |
--------------------------------------------------------------------------------
/native-base-theme/components/Button.js:
--------------------------------------------------------------------------------
1 | import variable from './../variables/platform';
2 |
3 | export default (variables = variable) => {
4 | const platformStyle = variables.platformStyle;
5 | const platform = variables.platform;
6 | const darkCommon = {
7 | 'NativeBase.Text': {
8 | color: variables.brandDark,
9 | },
10 | 'NativeBase.Icon': {
11 | color: variables.brandDark,
12 | },
13 | 'NativeBase.IconNB': {
14 | color: variables.brandDark,
15 | }
16 | }
17 | const lightCommon = {
18 | 'NativeBase.Text': {
19 | color: variables.brandLight,
20 | },
21 | 'NativeBase.Icon': {
22 | color: variables.brandLight,
23 | },
24 | 'NativeBase.IconNB': {
25 | color: variables.brandLight,
26 | }
27 | }
28 | const primaryCommon = {
29 | 'NativeBase.Text': {
30 | color: variables.btnPrimaryBg,
31 | },
32 | 'NativeBase.Icon': {
33 | color: variables.btnPrimaryBg,
34 | },
35 | 'NativeBase.IconNB': {
36 | color: variables.btnPrimaryBg,
37 | }
38 | }
39 | const successCommon = {
40 | 'NativeBase.Text': {
41 | color: variables.btnSuccessBg,
42 | },
43 | 'NativeBase.Icon': {
44 | color: variables.btnSuccessBg,
45 | },
46 | 'NativeBase.IconNB': {
47 | color: variables.btnSuccessBg,
48 | }
49 | }
50 | const infoCommon = {
51 | 'NativeBase.Text': {
52 | color: variables.btnInfoBg,
53 | },
54 | 'NativeBase.Icon': {
55 | color: variables.btnInfoBg,
56 | },
57 | 'NativeBase.IconNB': {
58 | color: variables.btnInfoBg,
59 | }
60 | }
61 | const warningCommon = {
62 | 'NativeBase.Text': {
63 | color: variables.btnWarningBg,
64 | },
65 | 'NativeBase.Icon': {
66 | color: variables.btnWarningBg,
67 | },
68 | 'NativeBase.IconNB': {
69 | color: variables.btnWarningBg,
70 | }
71 | }
72 | const dangerCommon = {
73 | 'NativeBase.Text': {
74 | color: variables.btnDangerBg,
75 | },
76 | 'NativeBase.Icon': {
77 | color: variables.btnDangerBg,
78 | },
79 | 'NativeBase.IconNB': {
80 | color: variables.btnDangerBg,
81 | }
82 | }
83 | const buttonTheme = {
84 | '.disabled': {
85 | backgroundColor: variables.btnDisabledBg,
86 | },
87 | '.bordered': {
88 | '.dark': {
89 | ...darkCommon,
90 | backgroundColor: 'transparent',
91 | borderColor: variables.brandDark,
92 | borderWidth: variables.borderWidth * 2,
93 | },
94 | '.light': {
95 | ...lightCommon,
96 | backgroundColor: 'transparent',
97 | borderColor: variables.brandLight,
98 | borderWidth: variables.borderWidth * 2,
99 | },
100 | '.primary': {
101 | ...primaryCommon,
102 | backgroundColor: 'transparent',
103 | borderColor: variables.btnPrimaryBg,
104 | borderWidth: variables.borderWidth * 2,
105 | },
106 | '.success': {
107 | ...successCommon,
108 | backgroundColor: 'transparent',
109 | borderColor: variables.btnSuccessBg,
110 | borderWidth: variables.borderWidth * 2,
111 | },
112 | '.info': {
113 | ...infoCommon,
114 | backgroundColor: 'transparent',
115 | borderColor: variables.btnInfoBg,
116 | borderWidth: variables.borderWidth * 2,
117 | },
118 | '.warning': {
119 | ...warningCommon,
120 | backgroundColor: 'transparent',
121 | borderColor: variables.btnWarningBg,
122 | borderWidth: variables.borderWidth * 2,
123 | },
124 | '.danger': {
125 | ...dangerCommon,
126 | backgroundColor: 'transparent',
127 | borderColor: variables.btnDangerBg,
128 | borderWidth: variables.borderWidth * 2,
129 | },
130 | '.disabled': {
131 | backgroundColor: null,
132 | borderColor: variables.btnDisabledBg,
133 | borderWidth: variables.borderWidth * 2,
134 | 'NativeBase.Text': {
135 | color: variables.btnDisabledBg,
136 | },
137 | },
138 | ...primaryCommon,
139 | borderWidth: variables.borderWidth * 2,
140 | elevation: null,
141 | shadowColor: null,
142 | shadowOffset: null,
143 | shadowOpacity: null,
144 | shadowRadius: null,
145 | backgroundColor: 'transparent',
146 | },
147 |
148 | '.dark': {
149 | '.bordered': {
150 | ...darkCommon,
151 | },
152 | backgroundColor: variables.brandDark,
153 | },
154 | '.light': {
155 | '.transparent': {
156 | ...lightCommon,
157 | backgroundColor: null,
158 | },
159 | '.bordered': {
160 | ...lightCommon,
161 | },
162 | ...darkCommon,
163 | backgroundColor: variables.brandLight,
164 | },
165 |
166 | '.primary': {
167 | '.bordered': {
168 | ...primaryCommon
169 | },
170 | backgroundColor: variables.btnPrimaryBg,
171 | },
172 |
173 | '.success': {
174 | '.bordered': {
175 | ...successCommon,
176 | },
177 | backgroundColor: variables.btnSuccessBg,
178 | },
179 |
180 | '.info': {
181 | '.bordered': {
182 | ...infoCommon
183 | },
184 | backgroundColor: variables.btnInfoBg,
185 | },
186 |
187 | '.warning': {
188 | '.bordered': {
189 | ...warningCommon,
190 | },
191 | backgroundColor: variables.btnWarningBg,
192 | },
193 |
194 | '.danger': {
195 | '.bordered': {
196 | ...dangerCommon,
197 | },
198 | backgroundColor: variables.btnDangerBg,
199 | },
200 |
201 | '.block': {
202 | justifyContent: 'center',
203 | alignSelf: 'stretch',
204 | },
205 |
206 | '.full': {
207 | justifyContent: 'center',
208 | alignSelf: 'stretch',
209 | borderRadius: 0,
210 | },
211 |
212 | '.rounded': {
213 | // paddingHorizontal: variables.buttonPadding + 20,
214 | borderRadius: variables.borderRadiusLarge,
215 | },
216 |
217 | '.transparent': {
218 | backgroundColor: 'transparent',
219 | elevation: 0,
220 | shadowColor: null,
221 | shadowOffset: null,
222 | shadowRadius: null,
223 | shadowOpacity: null,
224 | ...primaryCommon,
225 | '.dark': {
226 | ...darkCommon,
227 | backgroundColor: null,
228 | },
229 | '.danger': {
230 | ...dangerCommon,
231 | backgroundColor: null,
232 | },
233 | '.warning': {
234 | ...warningCommon,
235 | backgroundColor: null,
236 | },
237 | '.info': {
238 | ...infoCommon,
239 | backgroundColor: null,
240 | },
241 | '.primary': {
242 | ...primaryCommon,
243 | backgroundColor: null,
244 | },
245 | '.success': {
246 | ...successCommon,
247 | backgroundColor: null,
248 | },
249 | '.light': {
250 | ...lightCommon,
251 | backgroundColor: null,
252 | },
253 | },
254 |
255 | '.small': {
256 | height: 30,
257 | 'NativeBase.Text': {
258 | fontSize: 14,
259 | },
260 | },
261 |
262 | '.large': {
263 | height: 60,
264 | 'NativeBase.Text': {
265 | fontSize: 22,
266 | lineHeight: 32,
267 | },
268 | },
269 |
270 | '.capitalize': {},
271 |
272 | '.vertical': {
273 | flexDirection: 'column',
274 | height: null,
275 | },
276 |
277 | 'NativeBase.Text': {
278 | fontFamily: variables.btnFontFamily,
279 | marginLeft: 0,
280 | marginRight: 0,
281 | color: variables.inverseTextColor,
282 | fontSize: variables.btnTextSize,
283 | lineHeight: variables.btnLineHeight,
284 | paddingHorizontal: 16,
285 | backgroundColor: 'transparent',
286 | // childPosition: 1
287 | },
288 |
289 | 'NativeBase.Icon': {
290 | color: variables.inverseTextColor,
291 | fontSize: 24,
292 | marginHorizontal: 16,
293 | paddingTop: platform === 'ios' ? 2 : undefined,
294 | },
295 | 'NativeBase.IconNB': {
296 | color: variables.inverseTextColor,
297 | fontSize: 24,
298 | marginHorizontal: 16,
299 | paddingTop: platform === 'ios' ? 2 : undefined,
300 | },
301 |
302 | '.iconLeft': {
303 | 'NativeBase.Text': {
304 | marginLeft: 0,
305 | },
306 | 'NativeBase.IconNB': {
307 | marginRight: 0,
308 | marginLeft: 16,
309 | },
310 | 'NativeBase.Icon': {
311 | marginRight: 0,
312 | marginLeft: 16,
313 | },
314 | },
315 | '.iconRight': {
316 | 'NativeBase.Text': {
317 | marginRight: 0,
318 | },
319 | 'NativeBase.IconNB': {
320 | marginLeft: 0,
321 | marginRight: 16,
322 | },
323 | 'NativeBase.Icon': {
324 | marginLeft: 0,
325 | marginRight: 16,
326 | },
327 | },
328 | '.picker': {
329 | 'NativeBase.Text': {
330 | '.note': {
331 | fontSize: 16,
332 | lineHeight: null,
333 | },
334 | },
335 | },
336 |
337 | paddingVertical: variables.buttonPadding,
338 | // paddingHorizontal: variables.buttonPadding + 10,
339 | backgroundColor: variables.btnPrimaryBg,
340 | borderRadius: variables.borderRadiusBase,
341 | borderColor: variables.btnPrimaryBg,
342 | borderWidth: null,
343 | height: 45,
344 | alignSelf: 'flex-start',
345 | flexDirection: 'row',
346 | elevation: 2,
347 | shadowColor: platformStyle === 'material' ? variables.brandDark : undefined,
348 | shadowOffset:
349 | platformStyle === 'material' ? { width: 0, height: 2 } : undefined,
350 | shadowOpacity: platformStyle === 'material' ? 0.2 : undefined,
351 | shadowRadius: platformStyle === 'material' ? 1.2 : undefined,
352 | alignItems: 'center',
353 | justifyContent: 'space-between',
354 | };
355 | return buttonTheme;
356 | };
357 |
--------------------------------------------------------------------------------
/native-base-theme/components/Header.js:
--------------------------------------------------------------------------------
1 | import { PixelRatio } from "react-native";
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 headerTheme = {
10 | ".span": {
11 | height: 128,
12 | "NativeBase.Left": {
13 | alignSelf: "flex-start",
14 | },
15 | "NativeBase.Body": {
16 | alignSelf: "flex-end",
17 | alignItems: "flex-start",
18 | justifyContent: "center",
19 | paddingBottom: 26,
20 | },
21 | "NativeBase.Right": {
22 | alignSelf: "flex-start",
23 | },
24 | },
25 | ".hasSubtitle": {
26 | "NativeBase.Body": {
27 | "NativeBase.Title": {
28 | fontSize: variables.titleFontSize - 2,
29 | fontFamily: variables.titleFontfamily,
30 | textAlign: "center",
31 | },
32 | "NativeBase.Subtitle": {
33 | fontSize: variables.subTitleFontSize,
34 | fontFamily: variables.titleFontfamily,
35 | color: variables.subtitleColor,
36 | textAlign: "center",
37 | },
38 | },
39 | },
40 | ".noShadow": {
41 | elevation: 0,
42 | shadowColor: null,
43 | shadowOffset: null,
44 | shadowRadius: null,
45 | shadowOpacity: null,
46 | },
47 | ".hasTabs": {
48 | elevation: 0,
49 | shadowColor: null,
50 | shadowOffset: null,
51 | shadowRadius: null,
52 | shadowOpacity: null,
53 | borderBottomWidth: null,
54 | },
55 | ".hasSegment": {
56 | elevation: 0,
57 | shadowColor: null,
58 | shadowOffset: null,
59 | shadowRadius: null,
60 | shadowOpacity: null,
61 | borderBottomWidth: null,
62 | "NativeBase.Left": {
63 | flex: 0.3,
64 | },
65 | "NativeBase.Right": {
66 | flex: 0.3,
67 | },
68 | "NativeBase.Body": {
69 | flex: 1,
70 | "NativeBase.Segment": {
71 | marginRight: 0,
72 | alignSelf: 'center',
73 | "NativeBase.Button": {
74 | paddingLeft: 0,
75 | paddingRight: 0
76 | }
77 | },
78 | },
79 | },
80 | "NativeBase.Button": {
81 | justifyContent: "center",
82 | alignSelf: "center",
83 | alignItems: "center",
84 | ".transparent": {
85 | "NativeBase.Text": {
86 | color: variables.toolbarBtnTextColor,
87 | fontWeight: "600",
88 | },
89 | "NativeBase.Icon": {
90 | color: variables.toolbarBtnColor,
91 | },
92 | "NativeBase.IconNB": {
93 | color: variables.toolbarBtnColor,
94 | },
95 | paddingHorizontal: variables.buttonPadding,
96 | },
97 | paddingHorizontal: 15,
98 | },
99 | ".searchBar": {
100 | "NativeBase.Item": {
101 | "NativeBase.Icon": {
102 | backgroundColor: "transparent",
103 | color: variables.dropdownLinkColor,
104 | fontSize: variables.toolbarSearchIconSize,
105 | alignItems: "center",
106 | marginTop: 2,
107 | paddingRight: 10,
108 | paddingLeft: 10,
109 | },
110 | "NativeBase.IconNB": {
111 | backgroundColor: "transparent",
112 | color: null,
113 | alignSelf: "center",
114 | },
115 | "NativeBase.Input": {
116 | alignSelf: "center",
117 | lineHeight: 24,
118 | height: variables.searchBarInputHeight,
119 | },
120 | alignSelf: "center",
121 | alignItems: "center",
122 | justifyContent: "flex-start",
123 | flex: 1,
124 | height: variables.searchBarHeight,
125 | borderColor: "transparent",
126 | backgroundColor: variables.toolbarInputColor,
127 | },
128 | "NativeBase.Button": {
129 | ".transparent": {
130 | "NativeBase.Text": {
131 | fontWeight: "500",
132 | },
133 | paddingHorizontal: null,
134 | paddingLeft: platform === "ios" ? 10 : null,
135 | },
136 | paddingHorizontal: platform === "ios" ? undefined : null,
137 | width: platform === "ios" ? undefined : 0,
138 | height: platform === "ios" ? undefined : 0,
139 | },
140 | },
141 | ".rounded": {
142 | "NativeBase.Item": {
143 | borderRadius: platform === "ios" && platformStyle !== "material" ? 25 : 3,
144 | },
145 | },
146 | "NativeBase.Left": {
147 | "NativeBase.Button": {
148 | ".hasText": {
149 | marginLeft: -10,
150 | height: 30,
151 | "NativeBase.Icon": {
152 | color: variables.toolbarBtnColor,
153 | fontSize: variables.iconHeaderSize,
154 | marginTop: 2,
155 | marginRight: 5,
156 | marginLeft: 2,
157 | },
158 | "NativeBase.Text": {
159 | color: variables.toolbarBtnTextColor,
160 | fontSize: 17,
161 | marginLeft: 2,
162 | lineHeight: 21,
163 | },
164 | "NativeBase.IconNB": {
165 | color: variables.toolbarBtnColor,
166 | fontSize: variables.iconHeaderSize,
167 | marginTop: 2,
168 | marginRight: 5,
169 | marginLeft: 2,
170 | },
171 | },
172 | ".transparent": {
173 | marginLeft: -3,
174 | "NativeBase.Icon": {
175 | color: variables.toolbarBtnColor,
176 | fontSize: variables.iconHeaderSize,
177 | marginTop: 2,
178 | marginRight: 2,
179 | marginLeft: 2,
180 | },
181 | "NativeBase.IconNB": {
182 | color: variables.toolbarBtnColor,
183 | fontSize: variables.iconHeaderSize,
184 | marginTop: 2,
185 | marginRight: 2,
186 | marginLeft: 2,
187 | },
188 | "NativeBase.Text": {
189 | color: variables.toolbarBtnTextColor,
190 | fontSize: 17,
191 | top: platform === "ios" ? undefined : -1.5,
192 | },
193 | backgroundColor: "transparent",
194 | borderColor: null,
195 | elevation: 0,
196 | shadowColor: null,
197 | shadowOffset: null,
198 | shadowRadius: null,
199 | shadowOpacity: null,
200 | },
201 | "NativeBase.Icon": {
202 | color: variables.toolbarBtnColor,
203 | },
204 | "NativeBase.IconNB": {
205 | color: variables.toolbarBtnColor,
206 | },
207 | alignSelf: null,
208 | paddingHorizontal: variables.buttonPadding,
209 | },
210 | flex: platform === "ios" && platformStyle !== "material" ? 1 : 0.5,
211 | alignSelf: "center",
212 | alignItems: "flex-start",
213 | },
214 | "NativeBase.Body": {
215 | flex: 1,
216 | alignItems: platform === "ios" && platformStyle !== "material" ? "center" : "flex-start",
217 | alignSelf: "center",
218 | "NativeBase.Segment": {
219 | borderWidth: 0,
220 | alignSelf: "flex-end",
221 | marginRight: platform === "ios" ? -40 : -55,
222 | },
223 | "NativeBase.Button": {
224 | alignSelf: "center",
225 | ".transparent": {
226 | backgroundColor: "transparent",
227 | },
228 | "NativeBase.Icon": {
229 | color: variables.toolbarBtnColor,
230 | },
231 | "NativeBase.IconNB": {
232 | color: variables.toolbarBtnColor,
233 | },
234 | "NativeBase.Text": {
235 | color: variables.inverseTextColor,
236 | backgroundColor: "transparent",
237 | },
238 | },
239 | },
240 | "NativeBase.Right": {
241 | "NativeBase.Button": {
242 | ".hasText": {
243 | height: 30,
244 | "NativeBase.Icon": {
245 | color: variables.toolbarBtnColor,
246 | fontSize: variables.iconHeaderSize - 2,
247 | marginTop: 2,
248 | marginRight: 2,
249 | marginLeft: 5,
250 | },
251 | "NativeBase.Text": {
252 | color: variables.toolbarBtnTextColor,
253 | fontSize: 17,
254 | lineHeight: 21,
255 | },
256 | "NativeBase.IconNB": {
257 | color: variables.toolbarBtnColor,
258 | fontSize: variables.iconHeaderSize - 2,
259 | marginTop: 2,
260 | marginRight: 2,
261 | marginLeft: 5,
262 | },
263 | },
264 | ".transparent": {
265 | marginRight: -8,
266 | paddingHorizontal: 15,
267 | borderRadius: 50,
268 | "NativeBase.Icon": {
269 | color: variables.toolbarBtnColor,
270 | fontSize:
271 | platform === "ios" ? variables.iconHeaderSize - 6 : variables.iconHeaderSize - 2,
272 | marginTop: 2,
273 | marginLeft: 2,
274 | marginRight: 2,
275 | },
276 | "NativeBase.IconNB": {
277 | color: variables.toolbarBtnColor,
278 | fontSize:
279 | platform === "ios" ? variables.iconHeaderSize - 6 : variables.iconHeaderSize - 2,
280 | marginTop: 2,
281 | marginLeft: 2,
282 | marginRight: 2,
283 | },
284 | "NativeBase.Text": {
285 | color: variables.toolbarBtnTextColor,
286 | fontSize: 17,
287 | top: platform === "ios" ? undefined : -1.5,
288 | },
289 | backgroundColor: "transparent",
290 | borderColor: null,
291 | elevation: 0,
292 | shadowColor: null,
293 | shadowOffset: null,
294 | shadowRadius: null,
295 | shadowOpacity: null,
296 | },
297 | "NativeBase.Icon": {
298 | color: variables.toolbarBtnColor,
299 | },
300 | "NativeBase.IconNB": {
301 | color: variables.toolbarBtnColor,
302 | },
303 | alignSelf: null,
304 | paddingHorizontal: variables.buttonPadding,
305 | },
306 | flex: 1,
307 | alignSelf: "center",
308 | alignItems: "flex-end",
309 | flexDirection: "row",
310 | justifyContent: "flex-end",
311 | },
312 | backgroundColor: variables.toolbarDefaultBg,
313 | flexDirection: "row",
314 | paddingHorizontal: 10,
315 | justifyContent: "center",
316 | paddingTop: platform === "ios" ? (variables.isIphoneX ? 39 : 15) : 0,
317 | borderBottomWidth: platform === "ios" ? 1 / PixelRatio.getPixelSizeForLayoutSize(1) : 0,
318 | borderBottomColor: variables.toolbarDefaultBorder,
319 | height: variables.toolbarHeight,
320 | elevation: 3,
321 | shadowColor: platformStyle === "material" ? "#000" : undefined,
322 | shadowOffset: platformStyle === "material" ? { width: 0, height: 2 } : undefined,
323 | shadowOpacity: platformStyle === "material" ? 0.2 : undefined,
324 | shadowRadius: platformStyle === "material" ? 1.2 : undefined,
325 | top: 0,
326 | left: 0,
327 | right: 0,
328 | };
329 |
330 | return headerTheme;
331 | };
332 |
--------------------------------------------------------------------------------