Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Subtitles #97

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 33 additions & 41 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
{
"parser": "babel-eslint",
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.*?.json"
},
"extends": [
"standard",
"standard-react",
"airbnb",
"plugin:jest/recommended"
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"eslint:recommended"
],
"plugins": [
"@typescript-eslint",
"babel",
"react",
"promise",
"jsx-a11y",
"jest"
],
"root": true,
Expand Down Expand Up @@ -79,7 +84,6 @@
"react/no-unused-prop-types": [0],
"react/prefer-es6-class": [2, "always"],
"react/prefer-stateless-function": [2],
"react/prop-types": [2],
"react/react-in-jsx-scope": [2],
"react/require-optimization": [1],
"react/require-render-return": [2],
Expand Down Expand Up @@ -108,38 +112,26 @@
}],
"react/sort-prop-types": [0],
"react/style-prop-object": [2],

// React JSX Rules
"react/jsx-boolean-value": [0],
"react/jsx-closing-bracket-location": [0],
"react/jsx-curly-brace-presence": [2, { "props": "always", "children": "never" }],
"react/jsx-curly-spacing": [2],
"react/jsx-equals-spacing": [2],
"react/jsx-filename-extension": [2, { "extensions": [".js"] }],
"react/jsx-first-prop-new-line": [2, "multiline-multiprop"],
"react/jsx-handler-names": [2],
"react/jsx-indent": [2, 2],
"react/jsx-indent-props": [0, 2],
"react/jsx-key": [2],
"react/jsx-no-bind": [1],
"react/jsx-no-comment-textnodes": [2],
"react/jsx-no-duplicate-props": [2],
"react/jsx-no-literals": [0],
"react/jsx-no-target-blank": [2],
"react/jsx-no-undef": [2],
"react/jsx-pascal-case": [2],
"react/jsx-space-before-closing": [2],
"react/jsx-uses-react": [2],
"react/jsx-uses-vars": [2],
"react/jsx-wrap-multilines": [2],

// a11y Rules
"jsx-a11y/img-has-alt": [0],
"jsx-a11y/img-redundant-alt": [2],
"jsx-a11y/aria-role": [2],
"jsx-a11y/no-access-key": [2],
"jsx-a11y/href-no-hash": "off",
"react/jsx-one-expression-per-line": 0

}
},
"overrides": [
{
"files": [
"**/*.spec.js",
"**/*.spec.jsx",
"**/*.spec.ts",
"**/*.spec.tsx"
],
"env": {
"jest": true
}
},
{
"files": [
"*.tsx"
],
"rules": {
"@typescript-eslint/no-unused-vars": "off"
}
}
]
}
13 changes: 1 addition & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,7 @@

---

## Projects

Popcorn Time consists of several projects, each doing it's own part.

| Project | Description |
| ---------------------------- | -------------------------------------------------------- |
| [`@pct-org/getting-started`] | Explains how to get started with this setup |
| [`@pct-org/graphql-api`] | Serves the data to the clients from the MongoDB database |
| [`@pct-org/scraper`] | Scrapes everything and saves it to MongoDB database |
| [`@pct-org/mongo-models`] | Models used for MongoDB and GraphQL object types |
| [`@pct-org/native-app`] | React Native App |
| [`@pct-org/updater`] | Updater that automatically updates the projects |
This app runs on the [Popcorn ENV](https://github.com/pct-org/popcorn-env) setup.

## Installation

Expand Down
15 changes: 9 additions & 6 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ project.ext.react = [
enableHermes: true
]

def enableHermes = project.ext.react.get("enableHermes", false)

apply from: "../../node_modules/react-native/react.gradle"
apply from: "$rootDir/buildsystem/helpers.gradle"

Expand Down Expand Up @@ -128,18 +130,19 @@ dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])

implementation "com.google.android.gms:play-services-cast-framework:$rootProject.ext.castFrameworkVersion"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.2.0-alpha01'
implementation 'com.facebook.react:react-native:+'
implementation 'com.butterproject:vlc-android-sdk:3.0.10'
implementation 'org.videolan.android:libvlc-all:3.2.6'

implementation 'androidx.tvprovider:tvprovider:1.0.0'

if (useIntlJsc) {
implementation 'org.webkit:android-jsc-intl:+'

if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/"
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation 'org.webkit:android-jsc:+'
implementation jscFlavor
}
}

Expand Down
3 changes: 3 additions & 0 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,6 @@
# Hermes
-keep class com.facebook.hermes.unicode.** { *; }
-keep class com.facebook.jni.** { *; }

# VLC
-keep class org.videolan.libvlc.** { *; }
76 changes: 42 additions & 34 deletions android/app/src/main/java/com/popcorn/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,46 @@

public class MainActivity extends GoogleCastActivity {

@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashTheme);
super.onCreate(savedInstanceState);
}

/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "popcorn";
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);

this.sendBroadcast(intent);
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
@Override
protected void onCreate(Bundle savedInstanceState) {
SplashScreen.show(this, R.style.SplashTheme);

super.onCreate(savedInstanceState);
}

@Override
protected void onPause() {
SplashScreen.hide(this);

super.onPause();
}

/**
* Returns the name of the main component registered from JavaScript.
* This is used to schedule rendering of the component.
*/
@Override
protected String getMainComponentName() {
return "popcorn";
}

@Override
public void onConfigurationChanged(Configuration newConfig) {
super.onConfigurationChanged(newConfig);

Intent intent = new Intent("onConfigurationChanged");
intent.putExtra("newConfig", newConfig);

this.sendBroadcast(intent);
}

@Override
protected ReactActivityDelegate createReactActivityDelegate() {
return new ReactActivityDelegate(this, getMainComponentName()) {
@Override
protected ReactRootView createRootView() {
return new RNGestureHandlerEnabledRootView(MainActivity.this);
}
};
}
}
Loading