├── .buckconfig ├── .bundle └── config ├── .env ├── .env.example ├── .eslintrc.js ├── .flowconfig ├── .gitignore ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── Gemfile ├── Gemfile.lock ├── android ├── app │ ├── BUCK │ ├── build.gradle │ ├── build_defs.bzl │ ├── debug.keystore │ ├── proguard-rules.pro │ └── src │ │ ├── debug │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── podcastapp │ │ │ └── ReactNativeFlipper.java │ │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ ├── index.android │ │ └── index.android.bundle │ │ ├── java │ │ └── com │ │ │ └── podcastapp │ │ │ ├── MainActivity.java │ │ │ └── MainApplication.java │ │ └── res │ │ ├── drawable │ │ └── rn_edit_text_material.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ └── values │ │ ├── strings.xml │ │ └── styles.xml ├── build.gradle ├── gradle.properties ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios ├── Podfile ├── podcastApp.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── podcastApp.xcscheme ├── podcastApp │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ ├── Info.plist │ ├── LaunchScreen.storyboard │ └── main.m └── podcastAppTests │ ├── Info.plist │ └── podcastAppTests.m ├── metro.config.js ├── package.json ├── rn-cli.config.js ├── src ├── App │ ├── App.spec.tsx │ └── App.tsx ├── TypesAndInterfaces │ └── AppTypes.ts ├── assets │ └── icons │ │ ├── arrow-clockwise.png │ │ ├── arrow-clockwise.svg │ │ ├── arrow-counter-clockwise.png │ │ ├── arrow-counter-clockwise.svg │ │ ├── rotateCCW.png │ │ ├── rotateCW.png │ │ └── sleep.png ├── components │ ├── Button.tsx │ ├── Comment.tsx │ ├── DiscoverItem.tsx │ ├── DiscoverItemPlus.tsx │ ├── MiniPlayer.tsx │ ├── MyComment.tsx │ ├── NewItem.tsx │ ├── NewReleaseItem.tsx │ ├── PodcastDetailItem.tsx │ ├── SearchBox.tsx │ └── __tests__ │ │ └── StyledText-test.js ├── hooks │ └── useDebounce.js ├── modules │ ├── appPlayer.ts │ ├── service.ts │ ├── tailwind.ts │ └── validation.ts ├── providers │ ├── EpisodeCommentProvider.tsx │ ├── PodcastDetailProvider.tsx │ └── UserProvider.tsx ├── rn-cli.config.js ├── screens │ ├── Player │ │ ├── MediaPlayerModalScreen.tsx │ │ └── component │ │ │ ├── CommentTapView.tsx │ │ │ └── PlayerTabView.tsx │ ├── RootStackPrams.ts │ ├── auth │ │ ├── EditModalScreen.tsx │ │ ├── LoginModalScreen.tsx │ │ ├── SettingModalScreen.tsx │ │ ├── SignupModalScreen.tsx │ │ └── index.tsx │ ├── episode │ │ ├── EpisodeComment.tsx │ │ ├── PodcastDetail.tsx │ │ ├── Popular.tsx │ │ └── Trending.tsx │ └── main │ │ ├── Discover.tsx │ │ ├── Download.tsx │ │ ├── MainBottomTabParams.ts │ │ ├── New.tsx │ │ ├── Podcast.tsx │ │ ├── Profile.tsx │ │ ├── Welcome.tsx │ │ └── index.tsx ├── tailwind.config.js ├── types.tsx └── typings.d.ts ├── tsconfig.json └── yarn.lock /.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /.env: -------------------------------------------------------------------------------- 1 | API_ACCOUNT=https://auth-dot-podcast-309201.uc.r.appspot.com/account/ 2 | API_HOSTING=https://podcast-309201.uc.r.appspot.com/v1/ 3 | API_TOKEN=https://auth-dot-podcast-309201.uc.r.appspot.com/token/ 4 | -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | API_HOSTING= 2 | API_ACCOUNT= 3 | API_TOKEN= -------------------------------------------------------------------------------- /.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | }; 5 | -------------------------------------------------------------------------------- /.flowconfig: -------------------------------------------------------------------------------- 1 | [ignore] 2 | ; We fork some components by platform 3 | .*/*[.]android.js 4 | 5 | ; Ignore "BUCK" generated dirs 6 | /\.buckd/ 7 | 8 | ; Ignore polyfills 9 | node_modules/react-native/Libraries/polyfills/.* 10 | 11 | ; Flow doesn't support platforms 12 | .*/Libraries/Utilities/LoadingView.js 13 | 14 | [untyped] 15 | .*/node_modules/@react-native-community/cli/.*/.* 16 | 17 | [include] 18 | 19 | [libs] 20 | node_modules/react-native/interface.js 21 | node_modules/react-native/flow/ 22 | 23 | [options] 24 | emoji=true 25 | 26 | exact_by_default=true 27 | 28 | format.bracket_spacing=false 29 | 30 | module.file_ext=.js 31 | module.file_ext=.json 32 | module.file_ext=.ios.js 33 | 34 | munge_underscores=true 35 | 36 | module.name_mapper='^react-native/\(.*\)$' -> '/node_modules/react-native/\1' 37 | module.name_mapper='^@?[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '/node_modules/react-native/Libraries/Image/RelativeImageStub' 38 | 39 | suppress_type=$FlowIssue 40 | suppress_type=$FlowFixMe 41 | suppress_type=$FlowFixMeProps 42 | suppress_type=$FlowFixMeState 43 | 44 | [lints] 45 | sketchy-null-number=warn 46 | sketchy-null-mixed=warn 47 | sketchy-number=warn 48 | untyped-type-import=warn 49 | nonstrict-import=warn 50 | deprecated-type=warn 51 | unsafe-getters-setters=warn 52 | unnecessary-invariant=warn 53 | signature-verification-failure=warn 54 | 55 | [strict] 56 | deprecated-type 57 | nonstrict-import 58 | sketchy-null 59 | unclear-type 60 | unsafe-getters-setters 61 | untyped-import 62 | untyped-type-import 63 | 64 | [version] 65 | ^0.162.0 66 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | *.hprof 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 | !debug.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # CocoaPods 60 | /ios/Pods/ 61 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | endOfLine: 'auto', 8 | }; 9 | -------------------------------------------------------------------------------- /.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.4 2 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | # You may use http://rbenv.org/ or https://rvm.io/ to install and use this version 4 | ruby '2.7.4' 5 | 6 | gem 'cocoapods', '~> 1.11', '>= 1.11.2' 7 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | CFPropertyList (3.0.5) 5 | rexml 6 | activesupport (6.1.4.4) 7 | concurrent-ruby (~> 1.0, >= 1.0.2) 8 | i18n (>= 1.6, < 2) 9 | minitest (>= 5.1) 10 | tzinfo (~> 2.0) 11 | zeitwerk (~> 2.3) 12 | addressable (2.8.0) 13 | public_suffix (>= 2.0.2, < 5.0) 14 | algoliasearch (1.27.5) 15 | httpclient (~> 2.8, >= 2.8.3) 16 | json (>= 1.5.1) 17 | atomos (0.1.3) 18 | claide (1.1.0) 19 | cocoapods (1.11.2) 20 | addressable (~> 2.8) 21 | claide (>= 1.0.2, < 2.0) 22 | cocoapods-core (= 1.11.2) 23 | cocoapods-deintegrate (>= 1.0.3, < 2.0) 24 | cocoapods-downloader (>= 1.4.0, < 2.0) 25 | cocoapods-plugins (>= 1.0.0, < 2.0) 26 | cocoapods-search (>= 1.0.0, < 2.0) 27 | cocoapods-trunk (>= 1.4.0, < 2.0) 28 | cocoapods-try (>= 1.1.0, < 2.0) 29 | colored2 (~> 3.1) 30 | escape (~> 0.0.4) 31 | fourflusher (>= 2.3.0, < 3.0) 32 | gh_inspector (~> 1.0) 33 | molinillo (~> 0.8.0) 34 | nap (~> 1.0) 35 | ruby-macho (>= 1.0, < 3.0) 36 | xcodeproj (>= 1.21.0, < 2.0) 37 | cocoapods-core (1.11.2) 38 | activesupport (>= 5.0, < 7) 39 | addressable (~> 2.8) 40 | algoliasearch (~> 1.0) 41 | concurrent-ruby (~> 1.1) 42 | fuzzy_match (~> 2.0.4) 43 | nap (~> 1.0) 44 | netrc (~> 0.11) 45 | public_suffix (~> 4.0) 46 | typhoeus (~> 1.0) 47 | cocoapods-deintegrate (1.0.5) 48 | cocoapods-downloader (1.5.1) 49 | cocoapods-plugins (1.0.0) 50 | nap 51 | cocoapods-search (1.0.1) 52 | cocoapods-trunk (1.6.0) 53 | nap (>= 0.8, < 2.0) 54 | netrc (~> 0.11) 55 | cocoapods-try (1.2.0) 56 | colored2 (3.1.2) 57 | concurrent-ruby (1.1.9) 58 | escape (0.0.4) 59 | ethon (0.15.0) 60 | ffi (>= 1.15.0) 61 | ffi (1.15.5) 62 | fourflusher (2.3.1) 63 | fuzzy_match (2.0.4) 64 | gh_inspector (1.1.3) 65 | httpclient (2.8.3) 66 | i18n (1.9.1) 67 | concurrent-ruby (~> 1.0) 68 | json (2.6.1) 69 | minitest (5.15.0) 70 | molinillo (0.8.0) 71 | nanaimo (0.3.0) 72 | nap (1.1.0) 73 | netrc (0.11.0) 74 | public_suffix (4.0.6) 75 | rexml (3.2.5) 76 | ruby-macho (2.5.1) 77 | typhoeus (1.4.0) 78 | ethon (>= 0.9.0) 79 | tzinfo (2.0.4) 80 | concurrent-ruby (~> 1.0) 81 | xcodeproj (1.21.0) 82 | CFPropertyList (>= 2.3.3, < 4.0) 83 | atomos (~> 0.1.3) 84 | claide (>= 1.0.2, < 2.0) 85 | colored2 (~> 3.1) 86 | nanaimo (~> 0.3.0) 87 | rexml (~> 3.2.4) 88 | zeitwerk (2.5.4) 89 | 90 | PLATFORMS 91 | ruby 92 | 93 | DEPENDENCIES 94 | cocoapods (~> 1.11, >= 1.11.2) 95 | 96 | RUBY VERSION 97 | ruby 2.7.4p191 98 | 99 | BUNDLED WITH 100 | 2.2.27 101 | -------------------------------------------------------------------------------- /android/app/BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.podcastapp", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.podcastapp", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /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. If none specified and 19 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 20 | * // default. Can be overridden with ENTRY_FILE environment variable. 21 | * entryFile: "index.android.js", 22 | * 23 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 24 | * bundleCommand: "ram-bundle", 25 | * 26 | * // whether to bundle JS and assets in debug mode 27 | * bundleInDebug: false, 28 | * 29 | * // whether to bundle JS and assets in release mode 30 | * bundleInRelease: true, 31 | * 32 | * // whether to bundle JS and assets in another build variant (if configured). 33 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 34 | * // The configuration property can be in the following formats 35 | * // 'bundleIn${productFlavor}${buildType}' 36 | * // 'bundleIn${buildType}' 37 | * // bundleInFreeDebug: true, 38 | * // bundleInPaidRelease: true, 39 | * // bundleInBeta: true, 40 | * 41 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 42 | * // for example: to disable dev mode in the staging build type (if configured) 43 | * devDisabledInStaging: true, 44 | * // The configuration property can be in the following formats 45 | * // 'devDisabledIn${productFlavor}${buildType}' 46 | * // 'devDisabledIn${buildType}' 47 | * 48 | * // the root of your project, i.e. where "package.json" lives 49 | * root: "../../", 50 | * 51 | * // where to put the JS bundle asset in debug mode 52 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 53 | * 54 | * // where to put the JS bundle asset in release mode 55 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 56 | * 57 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 58 | * // require('./image.png')), in debug mode 59 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 60 | * 61 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 62 | * // require('./image.png')), in release mode 63 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 64 | * 65 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 66 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 67 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 68 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 69 | * // for example, you might want to remove it from here. 70 | * inputExcludes: ["android/**", "ios/**"], 71 | * 72 | * // override which node gets called and with what additional arguments 73 | * nodeExecutableAndArgs: ["node"], 74 | * 75 | * // supply additional arguments to the packager 76 | * extraPackagerArgs: [] 77 | * ] 78 | */ 79 | 80 | project.ext.react = [ 81 | enableHermes: false, // clean and rebuild if changing 82 | ] 83 | 84 | apply from: "../../node_modules/react-native/react.gradle" 85 | 86 | /** 87 | * Set this to true to create two separate APKs instead of one: 88 | * - An APK that only works on ARM devices 89 | * - An APK that only works on x86 devices 90 | * The advantage is the size of the APK is reduced by about 4MB. 91 | * Upload all the APKs to the Play Store and people will download 92 | * the correct one based on the CPU architecture of their device. 93 | */ 94 | def enableSeparateBuildPerCPUArchitecture = false 95 | 96 | /** 97 | * Run Proguard to shrink the Java bytecode in release builds. 98 | */ 99 | def enableProguardInReleaseBuilds = false 100 | 101 | /** 102 | * The preferred build flavor of JavaScriptCore. 103 | * 104 | * For example, to use the international variant, you can use: 105 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 106 | * 107 | * The international variant includes ICU i18n library and necessary data 108 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 109 | * give correct results when using with locales other than en-US. Note that 110 | * this variant is about 6MiB larger per architecture than default. 111 | */ 112 | def jscFlavor = 'org.webkit:android-jsc:+' 113 | 114 | /** 115 | * Whether to enable the Hermes VM. 116 | * 117 | * This should be set on project.ext.react and that value will be read here. If it is not set 118 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 119 | * and the benefits of using Hermes will therefore be sharply reduced. 120 | */ 121 | def enableHermes = project.ext.react.get("enableHermes", false); 122 | 123 | /** 124 | * Architectures to build native code for in debug. 125 | */ 126 | def nativeArchitectures = project.getProperties().get("reactNativeDebugArchitectures") 127 | 128 | android { 129 | ndkVersion rootProject.ext.ndkVersion 130 | 131 | compileSdkVersion rootProject.ext.compileSdkVersion 132 | 133 | defaultConfig { 134 | applicationId "com.podcastapp" 135 | minSdkVersion rootProject.ext.minSdkVersion 136 | targetSdkVersion rootProject.ext.targetSdkVersion 137 | versionCode 1 138 | versionName "1.0" 139 | } 140 | splits { 141 | abi { 142 | reset() 143 | enable enableSeparateBuildPerCPUArchitecture 144 | universalApk false // If true, also generate a universal APK 145 | include "armeabi-v7a", "x86", "arm64-v8a", "x86_64" 146 | } 147 | } 148 | signingConfigs { 149 | // debug { 150 | // storeFile file('debug.keystore') 151 | // storePassword 'android' 152 | // keyAlias 'androiddebugkey' 153 | // keyPassword 'android' 154 | // } 155 | 156 | release { 157 | storeFile file('your_key_name.keystore') 158 | storePassword 'podcast' 159 | keyAlias 'your_key_alias' 160 | keyPassword 'podcast' 161 | } 162 | } 163 | 164 | buildTypes { 165 | debug { 166 | signingConfig signingConfigs.debug 167 | if (nativeArchitectures) { 168 | ndk { 169 | abiFilters nativeArchitectures.split(',') 170 | } 171 | } 172 | } 173 | release { 174 | // Caution! In production, you need to generate your own keystore file. 175 | // see https://reactnative.dev/docs/signed-apk-android. 176 | signingConfig signingConfigs.debug 177 | minifyEnabled enableProguardInReleaseBuilds 178 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 179 | signingConfig signingConfigs.release 180 | } 181 | } 182 | 183 | // applicationVariants are e.g. debug, release 184 | applicationVariants.all { variant -> 185 | variant.outputs.each { output -> 186 | // For each separate APK per architecture, set a unique version code as described here: 187 | // https://developer.android.com/studio/build/configure-apk-splits.html 188 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 189 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 190 | def abi = output.getFilter(OutputFile.ABI) 191 | if (abi != null) { // null for the universal-debug, universal-release variants 192 | output.versionCodeOverride = 193 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 194 | } 195 | 196 | } 197 | } 198 | } 199 | 200 | dependencies { 201 | implementation fileTree(dir: "libs", include: ["*.jar"]) 202 | //noinspection GradleDynamicVersion 203 | implementation "com.facebook.react:react-native:+" // From node_modules 204 | 205 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 206 | 207 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 208 | exclude group:'com.facebook.fbjni' 209 | } 210 | 211 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 212 | exclude group:'com.facebook.flipper' 213 | exclude group:'com.squareup.okhttp3', module:'okhttp' 214 | } 215 | 216 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 217 | exclude group:'com.facebook.flipper' 218 | } 219 | 220 | if (enableHermes) { 221 | def hermesPath = "../../node_modules/hermes-engine/android/"; 222 | debugImplementation files(hermesPath + "hermes-debug.aar") 223 | releaseImplementation files(hermesPath + "hermes-release.aar") 224 | } else { 225 | implementation jscFlavor 226 | } 227 | } 228 | 229 | // Run this once to be able to run the application with BUCK 230 | // puts all compile dependencies into folder libs for BUCK to use 231 | task copyDownloadableDepsToLibs(type: Copy) { 232 | from configurations.implementation 233 | into 'libs' 234 | } 235 | 236 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 237 | -------------------------------------------------------------------------------- /android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/debug.keystore -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /android/app/src/debug/java/com/podcastapp/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Facebook, Inc. and its affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.podcastapp; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceManager; 23 | import com.facebook.react.bridge.ReactContext; 24 | import com.facebook.react.modules.network.NetworkingModule; 25 | import okhttp3.OkHttpClient; 26 | 27 | public class ReactNativeFlipper { 28 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 29 | if (FlipperUtils.shouldEnableFlipper(context)) { 30 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 31 | 32 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 33 | client.addPlugin(new ReactFlipperPlugin()); 34 | client.addPlugin(new DatabasesFlipperPlugin(context)); 35 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 36 | client.addPlugin(CrashReporterPlugin.getInstance()); 37 | 38 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 39 | NetworkingModule.setCustomClientBuilder( 40 | new NetworkingModule.CustomClientBuilder() { 41 | @Override 42 | public void apply(OkHttpClient.Builder builder) { 43 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 44 | } 45 | }); 46 | client.addPlugin(networkFlipperPlugin); 47 | client.start(); 48 | 49 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 50 | // Hence we run if after all native modules have been initialized 51 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 52 | if (reactContext == null) { 53 | reactInstanceManager.addReactInstanceEventListener( 54 | new ReactInstanceManager.ReactInstanceEventListener() { 55 | @Override 56 | public void onReactContextInitialized(ReactContext reactContext) { 57 | reactInstanceManager.removeReactInstanceEventListener(this); 58 | reactContext.runOnNativeModulesQueueThread( 59 | new Runnable() { 60 | @Override 61 | public void run() { 62 | client.addPlugin(new FrescoFlipperPlugin()); 63 | } 64 | }); 65 | } 66 | }); 67 | } else { 68 | client.addPlugin(new FrescoFlipperPlugin()); 69 | } 70 | } 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 13 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/podcastapp/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.podcastapp; 2 | 3 | import com.facebook.react.ReactActivity; 4 | 5 | public class MainActivity extends ReactActivity { 6 | 7 | /** 8 | * Returns the name of the main component registered from JavaScript. This is used to schedule 9 | * rendering of the component. 10 | */ 11 | @Override 12 | protected String getMainComponentName() { 13 | return "podcastApp"; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /android/app/src/main/java/com/podcastapp/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.podcastapp; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.horcrux.svg.SvgPackage; 8 | import com.guichaguri.trackplayer.TrackPlayer; 9 | import com.rnfs.RNFSPackage; 10 | import com.facebook.react.ReactInstanceManager; 11 | import com.facebook.react.ReactNativeHost; 12 | import com.facebook.react.ReactPackage; 13 | import com.facebook.soloader.SoLoader; 14 | import java.lang.reflect.InvocationTargetException; 15 | import java.util.List; 16 | 17 | public class MainApplication extends Application implements ReactApplication { 18 | 19 | private final ReactNativeHost mReactNativeHost = 20 | new ReactNativeHost(this) { 21 | @Override 22 | public boolean getUseDeveloperSupport() { 23 | return BuildConfig.DEBUG; 24 | } 25 | 26 | @Override 27 | protected List getPackages() { 28 | @SuppressWarnings("UnnecessaryLocalVariable") 29 | List packages = new PackageList(this).getPackages(); 30 | // Packages that cannot be autolinked yet can be added manually here, for example: 31 | // packages.add(new MyReactNativePackage()); 32 | return packages; 33 | } 34 | 35 | @Override 36 | protected String getJSMainModuleName() { 37 | return "index"; 38 | } 39 | }; 40 | 41 | @Override 42 | public ReactNativeHost getReactNativeHost() { 43 | return mReactNativeHost; 44 | } 45 | 46 | @Override 47 | public void onCreate() { 48 | super.onCreate(); 49 | SoLoader.init(this, /* native exopackage */ false); 50 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 51 | } 52 | 53 | /** 54 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 55 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 56 | * 57 | * @param context 58 | * @param reactInstanceManager 59 | */ 60 | private static void initializeFlipper( 61 | Context context, ReactInstanceManager reactInstanceManager) { 62 | if (BuildConfig.DEBUG) { 63 | try { 64 | /* 65 | We use reflection here to pick up the class that initializes Flipper, 66 | since Flipper library is not available in release mode 67 | */ 68 | Class aClass = Class.forName("com.podcastapp.ReactNativeFlipper"); 69 | aClass 70 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 71 | .invoke(null, context, reactInstanceManager); 72 | } catch (ClassNotFoundException e) { 73 | e.printStackTrace(); 74 | } catch (NoSuchMethodException e) { 75 | e.printStackTrace(); 76 | } catch (IllegalAccessException e) { 77 | e.printStackTrace(); 78 | } catch (InvocationTargetException e) { 79 | e.printStackTrace(); 80 | } 81 | } 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | podcastApp 3 | 4 | -------------------------------------------------------------------------------- /android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "30.0.2" 6 | minSdkVersion = 21 7 | compileSdkVersion = 30 8 | targetSdkVersion = 30 9 | ndkVersion = "21.4.7075529" 10 | } 11 | repositories { 12 | google() 13 | mavenCentral() 14 | // jcenter() 15 | } 16 | dependencies { 17 | classpath("com.android.tools.build:gradle:4.2.2") 18 | // NOTE: Do not place your application dependencies here; they belong 19 | // in the individual module build.gradle files 20 | } 21 | } 22 | 23 | allprojects { 24 | repositories { 25 | mavenLocal() 26 | maven { 27 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 28 | url("$rootDir/../node_modules/react-native/android") 29 | } 30 | maven { 31 | // Android JSC is installed from npm 32 | url("$rootDir/../node_modules/jsc-android/dist") 33 | } 34 | 35 | google() 36 | jcenter() 37 | maven { url 'https://www.jitpack.io' } 38 | maven { url 'https://repo1.maven.org/maven2' } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /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: -Xmx1024m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.99.0 29 | -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /android/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | # 4 | # Copyright 2015 the original author or authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | ## 21 | ## Gradle start up script for UN*X 22 | ## 23 | ############################################################################## 24 | 25 | # Attempt to set APP_HOME 26 | # Resolve links: $0 may be a link 27 | PRG="$0" 28 | # Need this for relative symlinks. 29 | while [ -h "$PRG" ] ; do 30 | ls=`ls -ld "$PRG"` 31 | link=`expr "$ls" : '.*-> \(.*\)$'` 32 | if expr "$link" : '/.*' > /dev/null; then 33 | PRG="$link" 34 | else 35 | PRG=`dirname "$PRG"`"/$link" 36 | fi 37 | done 38 | SAVED="`pwd`" 39 | cd "`dirname \"$PRG\"`/" >/dev/null 40 | APP_HOME="`pwd -P`" 41 | cd "$SAVED" >/dev/null 42 | 43 | APP_NAME="Gradle" 44 | APP_BASE_NAME=`basename "$0"` 45 | 46 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 47 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 48 | 49 | # Use the maximum available, or set MAX_FD != -1 to use that value. 50 | MAX_FD="maximum" 51 | 52 | warn () { 53 | echo "$*" 54 | } 55 | 56 | die () { 57 | echo 58 | echo "$*" 59 | echo 60 | exit 1 61 | } 62 | 63 | # OS specific support (must be 'true' or 'false'). 64 | cygwin=false 65 | msys=false 66 | darwin=false 67 | nonstop=false 68 | case "`uname`" in 69 | CYGWIN* ) 70 | cygwin=true 71 | ;; 72 | Darwin* ) 73 | darwin=true 74 | ;; 75 | MINGW* ) 76 | msys=true 77 | ;; 78 | NONSTOP* ) 79 | nonstop=true 80 | ;; 81 | esac 82 | 83 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 84 | 85 | 86 | # Determine the Java command to use to start the JVM. 87 | if [ -n "$JAVA_HOME" ] ; then 88 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 89 | # IBM's JDK on AIX uses strange locations for the executables 90 | JAVACMD="$JAVA_HOME/jre/sh/java" 91 | else 92 | JAVACMD="$JAVA_HOME/bin/java" 93 | fi 94 | if [ ! -x "$JAVACMD" ] ; then 95 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 96 | 97 | Please set the JAVA_HOME variable in your environment to match the 98 | location of your Java installation." 99 | fi 100 | else 101 | JAVACMD="java" 102 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 103 | 104 | Please set the JAVA_HOME variable in your environment to match the 105 | location of your Java installation." 106 | fi 107 | 108 | # Increase the maximum file descriptors if we can. 109 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 110 | MAX_FD_LIMIT=`ulimit -H -n` 111 | if [ $? -eq 0 ] ; then 112 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 113 | MAX_FD="$MAX_FD_LIMIT" 114 | fi 115 | ulimit -n $MAX_FD 116 | if [ $? -ne 0 ] ; then 117 | warn "Could not set maximum file descriptor limit: $MAX_FD" 118 | fi 119 | else 120 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 121 | fi 122 | fi 123 | 124 | # For Darwin, add options to specify how the application appears in the dock 125 | if $darwin; then 126 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 127 | fi 128 | 129 | # For Cygwin or MSYS, switch paths to Windows format before running java 130 | if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then 131 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 132 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 133 | 134 | JAVACMD=`cygpath --unix "$JAVACMD"` 135 | 136 | # We build the pattern for arguments to be converted via cygpath 137 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 138 | SEP="" 139 | for dir in $ROOTDIRSRAW ; do 140 | ROOTDIRS="$ROOTDIRS$SEP$dir" 141 | SEP="|" 142 | done 143 | OURCYGPATTERN="(^($ROOTDIRS))" 144 | # Add a user-defined pattern to the cygpath arguments 145 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 146 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 147 | fi 148 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 149 | i=0 150 | for arg in "$@" ; do 151 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 152 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 153 | 154 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 155 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 156 | else 157 | eval `echo args$i`="\"$arg\"" 158 | fi 159 | i=`expr $i + 1` 160 | done 161 | case $i in 162 | 0) set -- ;; 163 | 1) set -- "$args0" ;; 164 | 2) set -- "$args0" "$args1" ;; 165 | 3) set -- "$args0" "$args1" "$args2" ;; 166 | 4) set -- "$args0" "$args1" "$args2" "$args3" ;; 167 | 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 168 | 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 169 | 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 170 | 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 171 | 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 172 | esac 173 | fi 174 | 175 | # Escape application args 176 | save () { 177 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 178 | echo " " 179 | } 180 | APP_ARGS=`save "$@"` 181 | 182 | # Collect all arguments for the java command, following the shell quoting and substitution rules 183 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 184 | 185 | exec "$JAVACMD" "$@" 186 | -------------------------------------------------------------------------------- /android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'podcastApp' 2 | include ':react-native-svg' 3 | project(':react-native-svg').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-svg/android') 4 | include ':react-native-track-player' 5 | project(':react-native-track-player').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-track-player/android') 6 | include ':react-native-fs' 7 | project(':react-native-fs').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-fs/android') 8 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 9 | include ':app' 10 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "podcastApp", 3 | "displayName": "podcastApp" 4 | } -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: [ 4 | [ 5 | 'module:react-native-dotenv', 6 | { 7 | moduleName: '@env', 8 | path: '.env', 9 | blacklist: null, 10 | whitelist: null, 11 | safe: false, 12 | allowUndefined: true, 13 | }, 14 | ], 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native'; 6 | import App from './src/App/App'; 7 | import { name as appName } from './app.json'; 8 | import 'react-native-gesture-handler'; 9 | import TrackPlayer from 'react-native-track-player'; 10 | import service from './src/modules/service.ts'; 11 | 12 | AppRegistry.registerComponent(appName, () => App); 13 | TrackPlayer.registerPlaybackService(() => service); 14 | // TrackPlayer.registerPlaybackService(() => 15 | // require('./src/screens/Player/service.ts'), 16 | // ); 17 | -------------------------------------------------------------------------------- /ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '11.0' 5 | 6 | target 'podcastApp' do 7 | config = use_native_modules! 8 | 9 | use_react_native!( 10 | :path => config[:reactNativePath], 11 | # to enable hermes on iOS, change `false` to `true` and then install pods 12 | :hermes_enabled => false 13 | ) 14 | 15 | pod 'RNFS', :path => '../node_modules/react-native-fs' 16 | 17 | pod 'react-native-track-player', :path => '../node_modules/react-native-track-player' 18 | 19 | pod 'RNSVG', :path => '../node_modules/react-native-svg' 20 | 21 | target 'podcastAppTests' do 22 | inherit! :complete 23 | # Pods for testing 24 | end 25 | 26 | # Enables Flipper. 27 | # 28 | # Note that if you have use_frameworks! enabled, Flipper will not work and 29 | # you should disable the next line. 30 | use_flipper!() 31 | 32 | post_install do |installer| 33 | react_native_post_install(installer) 34 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 35 | end 36 | end 37 | -------------------------------------------------------------------------------- /ios/podcastApp.xcodeproj/xcshareddata/xcschemes/podcastApp.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /ios/podcastApp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /ios/podcastApp/AppDelegate.m: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #ifdef FB_SONARKIT_ENABLED 8 | #import 9 | #import 10 | #import 11 | #import 12 | #import 13 | #import 14 | 15 | static void InitializeFlipper(UIApplication *application) { 16 | FlipperClient *client = [FlipperClient sharedClient]; 17 | SKDescriptorMapper *layoutDescriptorMapper = [[SKDescriptorMapper alloc] initWithDefaults]; 18 | [client addPlugin:[[FlipperKitLayoutPlugin alloc] initWithRootNode:application withDescriptorMapper:layoutDescriptorMapper]]; 19 | [client addPlugin:[[FKUserDefaultsPlugin alloc] initWithSuiteName:nil]]; 20 | [client addPlugin:[FlipperKitReactPlugin new]]; 21 | [client addPlugin:[[FlipperKitNetworkPlugin alloc] initWithNetworkAdapter:[SKIOSNetworkAdapter new]]]; 22 | [client start]; 23 | } 24 | #endif 25 | 26 | @implementation AppDelegate 27 | 28 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 29 | { 30 | #ifdef FB_SONARKIT_ENABLED 31 | InitializeFlipper(application); 32 | #endif 33 | 34 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 35 | RCTRootView *rootView = [[RCTRootView alloc] initWithBridge:bridge 36 | moduleName:@"podcastApp" 37 | initialProperties:nil]; 38 | 39 | if (@available(iOS 13.0, *)) { 40 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 41 | } else { 42 | rootView.backgroundColor = [UIColor whiteColor]; 43 | } 44 | 45 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 46 | UIViewController *rootViewController = [UIViewController new]; 47 | rootViewController.view = rootView; 48 | self.window.rootViewController = rootViewController; 49 | [self.window makeKeyAndVisible]; 50 | return YES; 51 | } 52 | 53 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 54 | { 55 | #if DEBUG 56 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil]; 57 | #else 58 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 59 | #endif 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /ios/podcastApp/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 | } -------------------------------------------------------------------------------- /ios/podcastApp/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /ios/podcastApp/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | podcastApp 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /ios/podcastApp/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /ios/podcastApp/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char * argv[]) { 6 | @autoreleasepool { 7 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /ios/podcastAppTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /ios/podcastAppTests/podcastAppTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface podcastAppTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation podcastAppTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL(^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction(^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 38 | if (level >= RCTLogLevelError) { 39 | redboxError = message; 40 | } 41 | }); 42 | #endif 43 | 44 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 45 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 46 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | 48 | foundElement = [self findSubviewInView:vc.view matching:^BOOL(UIView *view) { 49 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 50 | return YES; 51 | } 52 | return NO; 53 | }]; 54 | } 55 | 56 | #ifdef DEBUG 57 | RCTSetLogFunction(RCTDefaultLogFunction); 58 | #endif 59 | 60 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 61 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 62 | } 63 | 64 | 65 | @end 66 | -------------------------------------------------------------------------------- /metro.config.js: -------------------------------------------------------------------------------- 1 | // /** 2 | // // * Metro configuration for React Native 3 | // // * https://github.com/facebook/react-native 4 | // // * 5 | // // * @format 6 | // // */ 7 | 8 | // // module.exports = { 9 | // // transformer: { 10 | // // getTransformOptions: async () => ({ 11 | // // transform: { 12 | // // experimentalImportSupport: false, 13 | // // inlineRequires: true, 14 | // // }, 15 | // // }), 16 | // // }, 17 | // // }; 18 | // const {getDefaultConfig} = require('metro-config'); 19 | // module.exports = (async () => { 20 | // const { 21 | // resolver: {sourceExts, assetExts}, 22 | // } = await getDefaultConfig(); 23 | // return { 24 | // transformer: { 25 | // // getTransformOptions: async () => ({ 26 | // // transform: { 27 | // // experimentalImportSupport: false, 28 | // // inlineRequires: true, 29 | // // }, 30 | // // }), 31 | // babelTransformerPath: require.resolve('react-native-svg-transformer'), 32 | // }, 33 | // resolver: { 34 | // assetExts: assetExts.filter(ext => ext !== 'svg'), 35 | // sourceExts: [...sourceExts, 'svg'], 36 | // }, 37 | // }; 38 | // })(); 39 | const {getDefaultConfig} = require('metro-config'); 40 | 41 | module.exports = (async () => { 42 | const { 43 | resolver: {sourceExts, assetExts}, 44 | } = await getDefaultConfig(); 45 | return { 46 | transformer: { 47 | babelTransformerPath: require.resolve('react-native-svg-transformer'), 48 | }, 49 | resolver: { 50 | assetExts: assetExts.filter(ext => ext !== 'svg'), 51 | sourceExts: [...sourceExts, 'svg'], 52 | }, 53 | }; 54 | })(); 55 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "podcastApp", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "npx react-native run-android", 7 | "ios": "npx react-native run-ios", 8 | "start": "npx react-native start", 9 | "test": "jest", 10 | "lint": "eslint .", 11 | "postversion": "react-native-version", 12 | "tsc": "tsc", 13 | "clean": "rimraf build", 14 | "build": "yarn run clean && yarn run tsc --", 15 | "watch": "yarn run build -- -w", 16 | "watchAndRunAndroid": "concurrently \"yarn run watch\" \"yarn run android\"", 17 | "buildRunAndroid": "yarn run build && yarn run watchAndRunAndroid ", 18 | "watchAndRunIOS": "concurrently \"yarn run watch\" \"yarn run ios\"", 19 | "buildRunIOS": "yarn run build && yarn run watchAndRunIOS ", 20 | "watchAndStart": "concurrently \"yarn run watch\" \"yarn run start\"", 21 | "buildAndStart": "yarn run build && yarn run watchAndStart" 22 | }, 23 | "dependencies": { 24 | "@react-native-async-storage/async-storage": "^1.16.1", 25 | "@react-native-community/cli": "^7.0.1", 26 | "@react-native-community/masked-view": "^0.1.11", 27 | "@react-native-community/slider": "^4.2.0", 28 | "@react-navigation/bottom-tabs": "^6.2.0", 29 | "@react-navigation/native": "^6.0.8", 30 | "@react-navigation/native-stack": "^6.5.0", 31 | "@react-navigation/stack": "^6.1.1", 32 | "axios": "^0.26.0", 33 | "native-base": "^3.3.6", 34 | "react": "17.0.2", 35 | "react-native": "^0.67.2", 36 | "react-native-dotenv": "^3.3.1", 37 | "react-native-fs": "^2.18.0", 38 | "react-native-gesture-handler": "^2.2.0", 39 | "react-native-heroicons": "^2.0.2", 40 | "react-native-pager-view": "^5.4.11", 41 | "react-native-raw-bottom-sheet": "^2.2.0", 42 | "react-native-reanimated": "^2.4.1", 43 | "react-native-safe-area-context": "^3.3.2", 44 | "react-native-screens": "^3.11.1", 45 | "react-native-svg": "^12.1.1", 46 | "react-native-svg-transformer": "^1.0.0", 47 | "react-native-tab-view": "^3.1.1", 48 | "react-native-toast-message": "^2.1.1", 49 | "react-native-track-player": "^2.0.1", 50 | "react-native-windows": "^0.67.1", 51 | "twrnc": "^3.0.2" 52 | }, 53 | "devDependencies": { 54 | "@babel/core": "^7.12.9", 55 | "@babel/runtime": "^7.12.5", 56 | "@react-native-community/eslint-config": "^2.0.0", 57 | "@types/jest": "^27.4.0", 58 | "@types/prop-types": "^15.7.4", 59 | "@types/react": "^17.0.39", 60 | "@types/react-dom": "^17.0.11", 61 | "@types/react-native": "^0.66.15", 62 | "@types/react-test-renderer": "^17.0.1", 63 | "babel-jest": "^26.6.3", 64 | "concurrently": "^7.0.0", 65 | "eslint": "7.14.0", 66 | "jest": "^26.6.3", 67 | "metro-react-native-babel-preset": "^0.66.2", 68 | "react-test-renderer": "17.0.2", 69 | "rimraf": "^3.0.2", 70 | "ts-jest": "^27.1.3", 71 | "typescript": "^4.5.5" 72 | }, 73 | "jest": { 74 | "preset": "react-native" 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /rn-cli.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | getTransformModulePath() { 3 | return require.resolve('react-native-svg-transformer'); 4 | }, 5 | getSourceExts() { 6 | return ['js', 'ts', 'jsx', 'svgx']; 7 | }, 8 | }; 9 | -------------------------------------------------------------------------------- /src/App/App.spec.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import 'react-native'; 6 | import React from 'react'; 7 | import App from './App'; 8 | 9 | // Note: test renderer must be required after react-native. 10 | import renderer from 'react-test-renderer'; 11 | 12 | it('renders correctly', () => { 13 | renderer.create(); 14 | }); 15 | -------------------------------------------------------------------------------- /src/App/App.tsx: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | import { NavigationContainer } from '@react-navigation/native'; 3 | import { createStackNavigator } from '@react-navigation/stack'; 4 | import MainScreen from '../screens/main'; 5 | import AuthScreen from '../screens/auth'; 6 | import { RootStackParamList } from '../screens/RootStackPrams'; 7 | import 'react-native-gesture-handler'; 8 | import PodcastProvider from '../providers/PodcastDetailProvider'; 9 | import UserProvider from '../providers/UserProvider'; 10 | import EpisodeProvider from '../providers/EpisodeCommentProvider'; 11 | import LoginModalScreen from '../screens/auth/LoginModalScreen'; 12 | import SignupModalScreen from '../screens/auth/SignupModalScreen'; 13 | import Trending from '../screens/episode/Trending'; 14 | import Popular from '../screens/episode/Popular'; 15 | import PodcastDetail from '../screens/episode/PodcastDetail'; 16 | import EpisodeComment from '../screens/episode/EpisodeComment'; 17 | import EditModalScreen from '../screens/auth/EditModalScreen'; 18 | import SettingModalScreen from '../screens/auth/SettingModalScreen'; 19 | import MediaPlayerModalScreen from '../screens/Player/MediaPlayerModalScreen'; 20 | import { initializePlayer } from '../modules/appPlayer'; 21 | 22 | const Stack = createStackNavigator(); 23 | 24 | export default function App() { 25 | useEffect(() => { 26 | initializePlayer(); 27 | }, []); 28 | 29 | return ( 30 | 31 | 32 | 33 | 34 | 35 | 42 | 43 | 52 | 61 | 69 | 77 | 86 | 95 | 102 | 111 | 118 | 119 | {/* */} 120 | 121 | 122 | 123 | 124 | ); 125 | } 126 | -------------------------------------------------------------------------------- /src/TypesAndInterfaces/AppTypes.ts: -------------------------------------------------------------------------------- 1 | export type React$Node = JSX.Element | null; 2 | -------------------------------------------------------------------------------- /src/assets/icons/arrow-clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/src/assets/icons/arrow-clockwise.png -------------------------------------------------------------------------------- /src/assets/icons/arrow-clockwise.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/arrow-counter-clockwise.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/src/assets/icons/arrow-counter-clockwise.png -------------------------------------------------------------------------------- /src/assets/icons/arrow-counter-clockwise.svg: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/assets/icons/rotateCCW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/src/assets/icons/rotateCCW.png -------------------------------------------------------------------------------- /src/assets/icons/rotateCW.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/src/assets/icons/rotateCW.png -------------------------------------------------------------------------------- /src/assets/icons/sleep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3solution/podcastApp-React-Native-Typescript/04b09423f11553d77c7c5a106fe14e7503dd432a/src/assets/icons/sleep.png -------------------------------------------------------------------------------- /src/components/Button.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {TouchableOpacity, View, Text, ActivityIndicator} from 'react-native'; 3 | import tw from '../modules/tailwind'; 4 | 5 | type Props = { 6 | label: string; 7 | action: Function; 8 | isPending?: boolean; 9 | type?: 'primary' | 'secondary' | 'thirdly'; 10 | }; 11 | 12 | const Button: React.FC = ({ 13 | label, 14 | action, 15 | isPending = false, 16 | type = 'primary', 17 | }) => { 18 | return ( 19 | action()} disabled={isPending}> 20 | 33 | {isPending ? ( 34 | 35 | ) : ( 36 | {label} 37 | )} 38 | 39 | 40 | ); 41 | }; 42 | 43 | export default Button; 44 | -------------------------------------------------------------------------------- /src/components/Comment.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View, Text, TouchableOpacity} from 'react-native'; 3 | import { 4 | ArrowSmDownIcon, 5 | ArrowSmUpIcon, 6 | DotsVerticalIcon, 7 | ReplyIcon, 8 | } from 'react-native-heroicons/solid'; 9 | import tw from '../modules/tailwind'; 10 | 11 | type Props = { 12 | // url?: string; 13 | name?: string; 14 | text?: string; 15 | time?: string; 16 | follow?: number; 17 | actionReply?: Function; 18 | actionUp: Function; 19 | actionDown: Function; 20 | }; 21 | 22 | const Comment: React.FC = ({ 23 | // url, 24 | name, 25 | text, 26 | follow = 0, 27 | actionReply, 28 | actionUp, 29 | actionDown, 30 | }) => { 31 | return ( 32 | 33 | 34 | {/* */} 40 | {name} 41 | 42 | 43 | {text} 44 | 45 | 50 | {actionReply && ( 51 | actionReply()}> 52 | 57 | 58 | )} 59 | actionUp()}> 60 | 65 | 66 | {follow} 67 | actionDown()}> 68 | 73 | 74 | 75 | 76 | ); 77 | }; 78 | 79 | export default Comment; 80 | -------------------------------------------------------------------------------- /src/components/DiscoverItem.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Image, View, Text} from 'react-native'; 3 | import tw from '../modules/tailwind'; 4 | 5 | type Props = { 6 | image: string; 7 | title: string; 8 | author: string; 9 | }; 10 | const DiscoverItem: React.FC = ({image, title, author}) => { 11 | return ( 12 | 13 | 14 | 20 | 21 | 22 | 26 | {title} 27 | 28 | 32 | {author} 33 | 34 | 35 | 36 | ); 37 | }; 38 | 39 | export default DiscoverItem; 40 | -------------------------------------------------------------------------------- /src/components/DiscoverItemPlus.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {View} from 'react-native'; 3 | import {PlusIcon} from 'react-native-heroicons/solid'; 4 | import tw from 'twrnc'; 5 | 6 | type Props = { 7 | image: string; 8 | title: string; 9 | author: string; 10 | }; 11 | // const DiscoverItemPlus: React.FC = ({image, title, author}) => { 12 | const DiscoverItemPlus: React.FC = ({}) => { 13 | return ( 14 | 15 | 20 | 21 | ); 22 | }; 23 | 24 | export default DiscoverItemPlus; 25 | -------------------------------------------------------------------------------- /src/components/MiniPlayer.tsx: -------------------------------------------------------------------------------- 1 | import { useNavigation, useRoute } from '@react-navigation/native'; 2 | import { StackNavigationProp } from '@react-navigation/stack'; 3 | import React, { useContext, useEffect } from 'react'; 4 | import { 5 | View, 6 | Image, 7 | Text, 8 | ActivityIndicator, 9 | Pressable, 10 | TouchableOpacity, 11 | } from 'react-native'; 12 | import { PauseIcon, PlayIcon } from 'react-native-heroicons/outline'; 13 | import TrackPlayer from 'react-native-track-player'; 14 | import { RootStackParamList } from '../screens/RootStackPrams'; 15 | import tw from '../modules/tailwind'; 16 | import { EpisodeContext } from '../providers/EpisodeCommentProvider'; 17 | 18 | type authScreenProp = StackNavigationProp< 19 | RootStackParamList, 20 | 'MediaPlayerModalScreen' 21 | >; 22 | type Props = { 23 | position: boolean; 24 | }; 25 | const MiniPlayer: React.FC = ({ position }) => { 26 | const navigation = useNavigation(); 27 | 28 | const { 29 | miniPlayer, 30 | setMiniPlayer, 31 | playData, 32 | isPlaying, 33 | setIsPlaying, 34 | miniPlayerPosition, 35 | setMiniPlayerPosition, 36 | } = useContext(EpisodeContext); 37 | 38 | useEffect(() => { 39 | setMiniPlayerPosition(false); 40 | // eslint-disable-next-line react-hooks/exhaustive-deps 41 | }, []); 42 | 43 | function RenderIcon() { 44 | if (isPlaying === 'buffering') { 45 | return ; 46 | } else if (isPlaying === 'pause') { 47 | return ; 48 | } else if (isPlaying === 'play') { 49 | return ; 50 | } 51 | return null; 52 | } 53 | 54 | const onButtonPressed = async () => { 55 | if (isPlaying === 'pause') { 56 | setIsPlaying('play'); 57 | TrackPlayer.play(); 58 | } else if (isPlaying === 'play') { 59 | setIsPlaying('pause'); 60 | TrackPlayer.pause(); 61 | } 62 | console.log('Button clicked'); 63 | let newPosition = await TrackPlayer.getPosition(); 64 | console.log(newPosition); 65 | }; 66 | 67 | const goPlayer = () => { 68 | setMiniPlayer(false); 69 | navigation.navigate('MediaPlayerModalScreen'); 70 | }; 71 | useEffect(() => { 72 | TrackPlayer.pause(); 73 | }, []); 74 | 75 | return ( 76 | <> 77 | {miniPlayer === true && ( 78 | 82 | 84 | { 86 | goPlayer(); 87 | }}> 88 | 89 | 96 | 97 | 101 | {playData?.title} 102 | 103 | 104 | 105 | 106 | { 109 | onButtonPressed(); 110 | }}> 111 | 112 | 113 | 114 | 115 | )} 116 | 117 | ); 118 | }; 119 | 120 | export default MiniPlayer; 121 | -------------------------------------------------------------------------------- /src/components/MyComment.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {TouchableOpacity, Text, View} from 'react-native'; 3 | import {ChatAltIcon} from 'react-native-heroicons/solid'; 4 | import tw from '../modules/tailwind'; 5 | 6 | type Props = { 7 | name?: string; 8 | title?: string; 9 | vote?: number; 10 | time?: string; 11 | description?: string; 12 | action: Function; 13 | }; 14 | 15 | const MyComment: React.FC = ({ 16 | name, 17 | title, 18 | vote, 19 | description, 20 | action, 21 | }) => { 22 | return ( 23 | 25 | 26 | 27 | {name} 28 | 29 | commented on 30 | 31 | action()}> 32 | 33 | 37 | {title} 38 | 39 | 40 | 41 | 42 | 43 | {name} 44 | 45 | {vote} vote{' '} 46 | 47 | 48 | {description} 49 | 50 | ); 51 | }; 52 | 53 | export default MyComment; 54 | -------------------------------------------------------------------------------- /src/components/NewItem.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Image, View, Text} from 'react-native'; 3 | import {PlayIcon} from 'react-native-heroicons/outline'; 4 | import tw from 'twrnc'; 5 | 6 | type Props = { 7 | image: string; 8 | title: string; 9 | author: string; 10 | }; 11 | const NewItem: React.FC = ({image, title, author}) => { 12 | return ( 13 | 14 | 15 | 16 | 22 | 23 | 24 | 28 | {title} 29 | 30 | 34 | {author} 35 | 36 | 37 | 38 | 39 | 44 | 45 | 46 | ); 47 | }; 48 | 49 | export default NewItem; 50 | -------------------------------------------------------------------------------- /src/components/NewReleaseItem.tsx: -------------------------------------------------------------------------------- 1 | // import React from 'react'; 2 | // import { Image, View, Text } from 'react-native'; 3 | // import { PlayIcon } from 'react-native-heroicons/outline'; 4 | // import tw from 'twrnc'; 5 | 6 | // type Props = { 7 | // image: string, 8 | // title: string, 9 | // author: string, 10 | // }; 11 | // const NewReleaseItem: React.FC = ({image, title, author}) => { 12 | // return ( 13 | // 14 | // 15 | // 16 | // 22 | // 23 | // 24 | // {title} 25 | // {author} 26 | // 27 | // 28 | // 29 | // 30 | // 31 | // 32 | // ); 33 | // }; 34 | 35 | // export default NewReleaseItem; 36 | import React from 'react'; 37 | import {Image, View, Text} from 'react-native'; 38 | import tw from 'twrnc'; 39 | 40 | type Props = { 41 | image: string; 42 | title: string; 43 | description: string; 44 | }; 45 | const NewReleaseItem: React.FC = ({image, title, description}) => { 46 | return ( 47 | 48 | 49 | 55 | 56 | 57 | 61 | {title} 62 | 63 | 67 | {description} 68 | 69 | 70 | 71 | ); 72 | }; 73 | 74 | export default NewReleaseItem; 75 | -------------------------------------------------------------------------------- /src/components/PodcastDetailItem.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, Text } from 'react-native'; 3 | import tw from '../modules/tailwind'; 4 | 5 | type Props = { 6 | date: string; 7 | episode: number; 8 | title: string; 9 | }; 10 | const PodcastDetailItem: React.FC = ({ date, episode, title }) => { 11 | return ( 12 | 13 | 14 | 18 | {date} 19 | 20 | 21 | 22 | 26 | EP{episode} 27 | {title} 28 | 29 | 30 | 31 | ); 32 | }; 33 | 34 | export default PodcastDetailItem; 35 | -------------------------------------------------------------------------------- /src/components/SearchBox.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { View, TextInput } from 'react-native'; 3 | import { SearchIcon } from 'react-native-heroicons/solid'; 4 | import tw from '../modules/tailwind'; 5 | 6 | type Props = { 7 | value: string; 8 | onChange: (text: string) => void; 9 | type: string; 10 | placeholder?: string; 11 | }; 12 | 13 | const SearchBox: React.FC = ({ 14 | placeholder = '', 15 | value, 16 | type = 'small', 17 | onChange, 18 | }) => { 19 | return type === 'big' ? ( 20 | 24 | 25 | onChange(text)} 31 | /> 32 | 33 | ) : ( 34 | 36 | 37 | onChange(text)} 43 | /> 44 | 45 | ); 46 | }; 47 | 48 | export default SearchBox; 49 | -------------------------------------------------------------------------------- /src/components/__tests__/StyledText-test.js: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import renderer from 'react-test-renderer'; 3 | 4 | import {MonoText} from '../StyledText'; 5 | 6 | // eslint-disable-next-line quotes 7 | it(`renders correctly`, () => { 8 | const tree = renderer.create(Snapshot test!).toJSON(); 9 | 10 | expect(tree).toMatchSnapshot(); 11 | }); 12 | -------------------------------------------------------------------------------- /src/hooks/useDebounce.js: -------------------------------------------------------------------------------- 1 | import { useState, useEffect } from 'react'; 2 | 3 | export default function useDebounce(value, delay) { 4 | const [debouncedValue, setDebouncedValue] = useState(value); 5 | 6 | useEffect( 7 | () => { 8 | const handler = setTimeout(() => { 9 | setDebouncedValue(value); 10 | }, delay); 11 | 12 | return () => { 13 | clearTimeout(handler); 14 | }; 15 | }, 16 | [value, delay] 17 | ); 18 | 19 | return debouncedValue; 20 | } -------------------------------------------------------------------------------- /src/modules/appPlayer.ts: -------------------------------------------------------------------------------- 1 | import TrackPlayer, { Capability } from 'react-native-track-player'; 2 | 3 | export const initializePlayer = async () => { 4 | try { 5 | TrackPlayer.updateOptions({ 6 | stopWithApp: true, 7 | capabilities: [ 8 | Capability.Play, 9 | Capability.Pause, 10 | Capability.SeekTo, 11 | Capability.JumpForward, 12 | Capability.JumpBackward, 13 | ], 14 | compactCapabilities: [ 15 | Capability.Play, 16 | Capability.Pause, 17 | Capability.JumpForward, 18 | Capability.JumpBackward, 19 | Capability.SeekTo, 20 | ], 21 | }); 22 | await TrackPlayer.setupPlayer(); 23 | } catch (e) { 24 | console.log(e); 25 | // to-do handle error 26 | } 27 | }; 28 | 29 | export const secondsToHHMMSS = (seconds: number | string) => { 30 | // credits - https://stackoverflow.com/a/37096512 31 | seconds = Number(seconds); 32 | const h = Math.floor(seconds / 3600); 33 | const m = Math.floor((seconds % 3600) / 60); 34 | const s = Math.floor((seconds % 3600) % 60); 35 | 36 | const hrs = h > 0 ? (h < 10 ? `0${h}:` : `${h}:`) : ''; 37 | const mins = m > 0 ? (m < 10 ? `0${m}:` : `${m}:`) : '00:'; 38 | const scnds = s > 0 ? (s < 10 ? `0${s}` : s) : '00'; 39 | return `${hrs}${mins}${scnds}`; 40 | }; 41 | -------------------------------------------------------------------------------- /src/modules/service.ts: -------------------------------------------------------------------------------- 1 | import TrackPlayer, { Event } from 'react-native-track-player'; 2 | 3 | export default async function service() { 4 | console.log('service'); 5 | TrackPlayer.addEventListener(Event.RemotePlay, () => { 6 | console.log('play'); 7 | TrackPlayer.play(); 8 | }); 9 | 10 | TrackPlayer.addEventListener(Event.RemotePause, () => { 11 | console.log('pause'); 12 | TrackPlayer.pause(); 13 | }); 14 | 15 | TrackPlayer.addEventListener(Event.RemoteJumpForward, async () => { 16 | console.log('Forward'); 17 | let newPosition = await TrackPlayer.getPosition(); 18 | let duration = await TrackPlayer.getDuration(); 19 | newPosition += 10; 20 | if (newPosition > duration) { 21 | newPosition = duration; 22 | } 23 | TrackPlayer.seekTo(newPosition); 24 | }); 25 | 26 | TrackPlayer.addEventListener(Event.RemoteJumpBackward, async () => { 27 | console.log('backword'); 28 | let newPosition = await TrackPlayer.getPosition(); 29 | newPosition -= 10; 30 | if (newPosition < 0) { 31 | newPosition = 0; 32 | } 33 | TrackPlayer.seekTo(newPosition); 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /src/modules/tailwind.ts: -------------------------------------------------------------------------------- 1 | import {create} from 'twrnc'; 2 | 3 | // create the customized version... 4 | const tw = create(require('../tailwind.config')); 5 | 6 | // ... and then this becomes the main function your app uses 7 | export default tw; 8 | -------------------------------------------------------------------------------- /src/modules/validation.ts: -------------------------------------------------------------------------------- 1 | export const emailValidation = (email: string) => 2 | String(email) 3 | .toLowerCase() 4 | .match( 5 | /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/, 6 | ); 7 | -------------------------------------------------------------------------------- /src/providers/EpisodeCommentProvider.tsx: -------------------------------------------------------------------------------- 1 | import AsyncStorage from '@react-native-async-storage/async-storage'; 2 | // import {Video} from 'expo-av'; 3 | import React, { 4 | createContext, 5 | // RefObject, 6 | useEffect, 7 | // useRef, 8 | useState, 9 | } from 'react'; 10 | 11 | type Props = { 12 | children: React.ReactNode; 13 | }; 14 | type playbackInstanceInfo = { 15 | rate: number; 16 | position: number; 17 | duration: number; 18 | state: string; 19 | }; 20 | 21 | type EpisodeContextType = { 22 | episodeDetail: string; 23 | setEpisodeDetail: React.Dispatch>; 24 | mediaData: string; 25 | setMediaData: React.Dispatch>; 26 | miniPlayer: boolean; 27 | setMiniPlayer: React.Dispatch>; 28 | playData: any; 29 | setPlayData: React.Dispatch>; 30 | sleepVisiblity: boolean; 31 | setSleepVisiblity: React.Dispatch>; 32 | timeCounter: number; 33 | setTimeCounter: React.Dispatch>; 34 | isPlaying: string; 35 | setIsPlaying: React.Dispatch>; 36 | miniPlayerPosition: boolean; 37 | setMiniPlayerPosition: React.Dispatch>; 38 | move: boolean; 39 | setMove: React.Dispatch>; 40 | // playbackInstance: RefObject