From 9f02211d6a3db82894e5c6021a532a27236424b2 Mon Sep 17 00:00:00 2001 From: Brandon Presley Date: Thu, 15 Dec 2022 16:31:35 +1300 Subject: [PATCH] Add basic swipe functionality through videos Still need to work on: 1. Progress meter 2. Pause on tap 3. App icon 4. Dark/light mode detection 5. Height not being centered 6. Slide numbers on the bottom color --- .buckconfig | 6 + .bundle/config | 2 + .eslintrc.js | 16 + .gitignore | 64 + .node-version | 1 + .prettierrc.js | 7 + .ruby-version | 1 + .watchmanconfig | 1 + App.tsx | 49 + Gemfile | 6 + Item.tsx | 34 + __tests__/App-test.tsx | 14 + android/app/_BUCK | 55 + android/app/build.gradle | 322 + android/app/build_defs.bzl | 19 + android/app/debug.keystore | Bin 0 -> 2257 bytes android/app/proguard-rules.pro | 10 + android/app/src/debug/AndroidManifest.xml | 13 + .../java/com/swiper/ReactNativeFlipper.java | 73 + android/app/src/main/AndroidManifest.xml | 26 + .../main/java/com/swiper/MainActivity.java | 48 + .../main/java/com/swiper/MainApplication.java | 90 + .../MainApplicationReactNativeHost.java | 116 + .../components/MainComponentsRegistry.java | 36 + ...ApplicationTurboModuleManagerDelegate.java | 48 + android/app/src/main/jni/CMakeLists.txt | 7 + .../jni/MainApplicationModuleProvider.cpp | 32 + .../main/jni/MainApplicationModuleProvider.h | 16 + ...nApplicationTurboModuleManagerDelegate.cpp | 45 + ...ainApplicationTurboModuleManagerDelegate.h | 38 + .../src/main/jni/MainComponentsRegistry.cpp | 65 + .../app/src/main/jni/MainComponentsRegistry.h | 32 + android/app/src/main/jni/OnLoad.cpp | 11 + .../res/drawable/rn_edit_text_material.xml | 36 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 3056 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 5024 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2096 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2858 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4569 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 7098 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6464 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10676 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9250 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15523 bytes android/app/src/main/res/values/strings.xml | 3 + android/app/src/main/res/values/styles.xml | 9 + android/build.gradle | 52 + android/gradle.properties | 40 + android/gradle/wrapper/gradle-wrapper.jar | Bin 0 -> 59821 bytes .../gradle/wrapper/gradle-wrapper.properties | 5 + android/gradlew | 234 + android/gradlew.bat | 89 + android/settings.gradle | 13 + app.json | 4 + babel.config.js | 3 + constants.ts | 1 + index.js | 9 + ios/.xcode.env | 11 + ios/Podfile | 43 + ios/swiper.xcodeproj/project.pbxproj | 700 ++ .../xcshareddata/xcschemes/swiper.xcscheme | 88 + ios/swiper/AppDelegate.h | 8 + ios/swiper/AppDelegate.mm | 133 + .../AppIcon.appiconset/Contents.json | 53 + ios/swiper/Images.xcassets/Contents.json | 6 + ios/swiper/Info.plist | 55 + ios/swiper/LaunchScreen.storyboard | 47 + ios/swiper/main.m | 10 + ios/swiperTests/Info.plist | 24 + ios/swiperTests/swiperTests.m | 66 + metro.config.js | 17 + package.json | 52 + tsconfig.json | 10 + yarn.lock | 7220 +++++++++++++++++ 74 files changed, 10344 insertions(+) create mode 100644 .buckconfig create mode 100644 .bundle/config create mode 100644 .eslintrc.js create mode 100644 .gitignore create mode 100644 .node-version create mode 100644 .prettierrc.js create mode 100644 .ruby-version create mode 100644 .watchmanconfig create mode 100644 App.tsx create mode 100644 Gemfile create mode 100644 Item.tsx create mode 100644 __tests__/App-test.tsx create mode 100644 android/app/_BUCK create mode 100644 android/app/build.gradle create mode 100644 android/app/build_defs.bzl create mode 100644 android/app/debug.keystore create mode 100644 android/app/proguard-rules.pro create mode 100644 android/app/src/debug/AndroidManifest.xml create mode 100644 android/app/src/debug/java/com/swiper/ReactNativeFlipper.java create mode 100644 android/app/src/main/AndroidManifest.xml create mode 100644 android/app/src/main/java/com/swiper/MainActivity.java create mode 100644 android/app/src/main/java/com/swiper/MainApplication.java create mode 100644 android/app/src/main/java/com/swiper/newarchitecture/MainApplicationReactNativeHost.java create mode 100644 android/app/src/main/java/com/swiper/newarchitecture/components/MainComponentsRegistry.java create mode 100644 android/app/src/main/java/com/swiper/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java create mode 100644 android/app/src/main/jni/CMakeLists.txt create mode 100644 android/app/src/main/jni/MainApplicationModuleProvider.cpp create mode 100644 android/app/src/main/jni/MainApplicationModuleProvider.h create mode 100644 android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp create mode 100644 android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h create mode 100644 android/app/src/main/jni/MainComponentsRegistry.cpp create mode 100644 android/app/src/main/jni/MainComponentsRegistry.h create mode 100644 android/app/src/main/jni/OnLoad.cpp create mode 100644 android/app/src/main/res/drawable/rn_edit_text_material.xml create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 android/app/src/main/res/values/strings.xml create mode 100644 android/app/src/main/res/values/styles.xml create mode 100644 android/build.gradle create mode 100644 android/gradle.properties create mode 100644 android/gradle/wrapper/gradle-wrapper.jar create mode 100644 android/gradle/wrapper/gradle-wrapper.properties create mode 100755 android/gradlew create mode 100644 android/gradlew.bat create mode 100644 android/settings.gradle create mode 100644 app.json create mode 100644 babel.config.js create mode 100644 constants.ts create mode 100644 index.js create mode 100644 ios/.xcode.env create mode 100644 ios/Podfile create mode 100644 ios/swiper.xcodeproj/project.pbxproj create mode 100644 ios/swiper.xcodeproj/xcshareddata/xcschemes/swiper.xcscheme create mode 100644 ios/swiper/AppDelegate.h create mode 100644 ios/swiper/AppDelegate.mm create mode 100644 ios/swiper/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 ios/swiper/Images.xcassets/Contents.json create mode 100644 ios/swiper/Info.plist create mode 100644 ios/swiper/LaunchScreen.storyboard create mode 100644 ios/swiper/main.m create mode 100644 ios/swiperTests/Info.plist create mode 100644 ios/swiperTests/swiperTests.m create mode 100644 metro.config.js create mode 100644 package.json create mode 100644 tsconfig.json create mode 100644 yarn.lock diff --git a/.buckconfig b/.buckconfig new file mode 100644 index 0000000..934256c --- /dev/null +++ b/.buckconfig @@ -0,0 +1,6 @@ + +[android] + target = Google Inc.:Google APIs:23 + +[maven_repositories] + central = https://repo1.maven.org/maven2 diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..848943b --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..dcf0be0 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,16 @@ +module.exports = { + root: true, + extends: '@react-native-community', + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + overrides: [ + { + files: ['*.ts', '*.tsx'], + rules: { + '@typescript-eslint/no-shadow': ['error'], + 'no-shadow': 'off', + 'no-undef': 'off', + }, + }, + ], +}; diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2423126 --- /dev/null +++ b/.gitignore @@ -0,0 +1,64 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +ios/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# BUCK +buck-out/ +\.buckd/ +*.keystore +!debug.keystore + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +/ios/Pods/ +/vendor/bundle/ diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..b6a7d89 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +16 diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..2b54074 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..a603bb5 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.5 diff --git a/.watchmanconfig b/.watchmanconfig new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/App.tsx b/App.tsx new file mode 100644 index 0000000..13cdb2d --- /dev/null +++ b/App.tsx @@ -0,0 +1,49 @@ +import {useState} from 'react'; +import {Button, View} from 'react-native'; +import AppIntroSlider from 'react-native-app-intro-slider'; +import DocumentPicker, { + DocumentPickerResponse, +} from 'react-native-document-picker'; +import {backgroundColor} from './constants'; +import Item from './Item'; + +export default function App() { + const [files, setFiles] = useState([]); + const [slide, setSlide] = useState(0); + + const pick = async () => { + const picked = await DocumentPicker.pickMultiple(); + console.log(`Picked ${picked.length} files.`); + setFiles(picked); + }; + + const renderItem = ({ + item, + index, + }: { + item: DocumentPickerResponse; + index: number; + }) => { + return ; + }; + + const slideChange = (index: number) => { + setSlide(index); + }; + + return ( + + + +