From 62af6a47052180fbfcdfc4308bcf9042df3b45d3 Mon Sep 17 00:00:00 2001 From: Yiheng Date: Fri, 17 Nov 2017 20:25:00 +1100 Subject: [PATCH 01/17] Update Android project --- App.js | 4 +- ...upport_animated_vector_drawable_23_4_0.xml | 14 + ...om_android_support_appcompat_v7_23_4_0.xml | 14 + ...support_support_annotations_23_4_0_jar.xml | 13 + .../com_android_support_support_v4_23_4_0.xml | 15 + ...support_support_vector_drawable_23_4_0.xml | 14 + android/.idea/misc.xml | 2 +- android/.idea/workspace.xml | 373 +++++++++++++++--- android/app/BUCK | 4 +- android/app/build.gradle | 12 +- android/app/release/output.json | 2 +- android/app/src/main/AndroidManifest.xml | 2 +- .../app/src/main/assets/index.android.bundle | 17 +- .../src/main/assets/index.android.bundle.meta | 3 +- src/component/SourceCell.js | 11 +- src/screens/PlayAnime.js | 19 + src/screens/index.js | 3 +- 17 files changed, 432 insertions(+), 90 deletions(-) create mode 100644 android/.idea/libraries/com_android_support_animated_vector_drawable_23_4_0.xml create mode 100644 android/.idea/libraries/com_android_support_appcompat_v7_23_4_0.xml create mode 100644 android/.idea/libraries/com_android_support_support_annotations_23_4_0_jar.xml create mode 100644 android/.idea/libraries/com_android_support_support_v4_23_4_0.xml create mode 100644 android/.idea/libraries/com_android_support_support_vector_drawable_23_4_0.xml create mode 100644 src/screens/PlayAnime.js diff --git a/App.js b/App.js index 55b9313..f35fec2 100644 --- a/App.js +++ b/App.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; import { MainScreen, AnimeDetail, SearchAnime, - WatchAnime, GenreDetail, SubCategory } from './src/screens/'; + WatchAnime, GenreDetail, SubCategory, PlayAnime } from './src/screens/'; import { Button } from 'react-native-elements'; import { NavigationStyles } from './src/Styles'; import { Router, Scene, Actions } from 'react-native-router-flux'; @@ -39,6 +39,8 @@ class App extends Component { titleStyle={titleStyle} navigationBarStyle={searchNavBarStyle}/> + ); diff --git a/android/.idea/libraries/com_android_support_animated_vector_drawable_23_4_0.xml b/android/.idea/libraries/com_android_support_animated_vector_drawable_23_4_0.xml new file mode 100644 index 0000000..63365d9 --- /dev/null +++ b/android/.idea/libraries/com_android_support_animated_vector_drawable_23_4_0.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/com_android_support_appcompat_v7_23_4_0.xml b/android/.idea/libraries/com_android_support_appcompat_v7_23_4_0.xml new file mode 100644 index 0000000..2677447 --- /dev/null +++ b/android/.idea/libraries/com_android_support_appcompat_v7_23_4_0.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/com_android_support_support_annotations_23_4_0_jar.xml b/android/.idea/libraries/com_android_support_support_annotations_23_4_0_jar.xml new file mode 100644 index 0000000..b902411 --- /dev/null +++ b/android/.idea/libraries/com_android_support_support_annotations_23_4_0_jar.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/com_android_support_support_v4_23_4_0.xml b/android/.idea/libraries/com_android_support_support_v4_23_4_0.xml new file mode 100644 index 0000000..a9c37ce --- /dev/null +++ b/android/.idea/libraries/com_android_support_support_v4_23_4_0.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/libraries/com_android_support_support_vector_drawable_23_4_0.xml b/android/.idea/libraries/com_android_support_support_vector_drawable_23_4_0.xml new file mode 100644 index 0000000..b833709 --- /dev/null +++ b/android/.idea/libraries/com_android_support_support_vector_drawable_23_4_0.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index f7fa969..d1817bf 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -24,5 +24,5 @@ - + \ No newline at end of file diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml index 8c06145..4200b92 100644 --- a/android/.idea/workspace.xml +++ b/android/.idea/workspace.xml @@ -2,17 +2,22 @@ - - - + + + + + + + + + + - - - - - + + + - + - - + + + + + + + + + + + + @@ -66,11 +81,21 @@ - + + + + + + + + + + + - + @@ -91,7 +116,10 @@ - + + + + @@ -102,7 +130,13 @@ - + + + + + + + @@ -111,8 +145,8 @@ - - + + @@ -2802,7 +2836,6 @@ - + + @@ -2957,7 +3005,7 @@ - + @@ -3296,7 +3323,7 @@ - + @@ -3304,7 +3331,7 @@ - + @@ -3312,7 +3339,15 @@ - + + + + + + + + + @@ -3320,6 +3355,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3328,27 +3392,32 @@ - + - - + + - + - - + + + + - + + + + @@ -3357,11 +3426,49 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3370,15 +3477,15 @@ - + - - + + - + @@ -3410,5 +3517,151 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/android/app/BUCK b/android/app/BUCK index 749b97d..7a3b1bb 100644 --- a/android/app/BUCK +++ b/android/app/BUCK @@ -45,12 +45,12 @@ android_library( android_build_config( name = "build_config", - package = "com.gogoanime", + package = "com.yihengquan", ) android_resource( name = "res", - package = "com.gogoanime", + package = "com.yihengquan", res = "src/main/res", ) diff --git a/android/app/build.gradle b/android/app/build.gradle index a56cce5..da8ca16 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -94,14 +94,14 @@ def enableSeparateBuildPerCPUArchitecture = false def enableProguardInReleaseBuilds = false android { - compileSdkVersion 23 - buildToolsVersion '26.0.2' + compileSdkVersion 25 + buildToolsVersion '27.0.1' defaultConfig { - applicationId "com.yihengquan" + applicationId "com.yihengquan.gogoanime" minSdkVersion 16 - targetSdkVersion 22 - versionCode 2 + targetSdkVersion 25 + versionCode 3 versionName "1.0" ndk { abiFilters "armeabi-v7a", "x86" @@ -154,7 +154,7 @@ android { dependencies { compile project(':react-native-vector-icons') compile fileTree(dir: "libs", include: ["*.jar"]) - compile "com.android.support:appcompat-v7:23.0.1" + compile "com.android.support:appcompat-v7:23.4.0" compile "com.facebook.react:react-native:+" // From node_modules } diff --git a/android/app/release/output.json b/android/app/release/output.json index e590a9a..1fe053c 100644 --- a/android/app/release/output.json +++ b/android/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":2},"path":"app-release.apk","properties":{"packageId":"com.yihengquan","split":"","minSdkVersion":"16"}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkInfo":{"type":"MAIN","splits":[],"versionCode":3},"path":"app-release.apk","properties":{"packageId":"com.yihengquan.gogoanime","split":"","minSdkVersion":"16"}}] \ No newline at end of file diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index a425fba..1cba491 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -8,7 +8,7 @@ - + 0&&void 0!==arguments[0]?arguments[0]:400,t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if("number"==typeof r)a.vibrate(r);else{if(!Array.isArray(r))throw new Error("Vibration pattern should be a number or array");a.vibrateByPattern(r,t?0:-1)}},cancel:function(){a.cancel()}});e.exports=i},297); __d(function(t,i,o,n){"use strict";var r=i(27),s={vibrate:function(){r("VibrationIOS is not supported on this platform!")}};o.exports=s},298); __d(function(_,t,E,s){"use strict";var O=t(39),R=O.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;E.exports=R.takeSnapshot},299); -__d(function(e,t,n,a){Object.defineProperty(a,"__esModule",{value:!0});var i=t(47),r=babelHelpers.interopRequireDefault(i),l=t(301),o=t(408),c=t(390),u=t(303),S=t(12),s=function(e){function n(){return babelHelpers.classCallCheck(this,n),babelHelpers.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return babelHelpers.inherits(n,e),babelHelpers.createClass(n,[{key:"render",value:function(){return r.default.createElement(u.Router,{sceneStyle:{backgroundColor:"white"}},r.default.createElement(u.Scene,{key:"root",headerTintColor:"white"},r.default.createElement(u.Scene,{key:"MainScreen",component:l.MainScreen,title:"GoGoAnime",initial:!0,titleStyle:y,navigationBarStyle:m,renderRightButton:r.default.createElement(o.Button,{icon:{name:"search",type:"evil-icons",size:"ios"===S.Platform.OS?22:30},buttonStyle:{backgroundColor:"transparent"},onPress:function(){return u.Actions.SearchScreen()}}),renderLeftButton:r.default.createElement(o.Button,{icon:{name:"logo-github",type:"ionicon",size:"ios"===S.Platform.OS?22:30},buttonStyle:{backgroundColor:"transparent"},onPress:function(){if("ios"==S.Platform.OS){var e=t(577);e.open("https://github.com/HenryQuan/React-Native-GoGoAnime")}else S.Linking.openURL("https://github.com/HenryQuan/React-Native-GoGoAnime").catch(function(e){return console.error("An error occurred",e)})}}),backTitle:"Back",initial:!0}),r.default.createElement(u.Scene,{key:"SearchScreen",component:l.SearchAnime,title:"Search",titleStyle:y,navigationBarStyle:p}),r.default.createElement(u.Scene,{key:"GenreDetail",component:l.GenreDetail,title:"GenreDetail",titleStyle:y,navigationBarStyle:p}),r.default.createElement(u.Scene,{key:"WatchAnime",component:l.WatchAnime,title:"WatchAnime",titleStyle:y,navigationBarStyle:p}),r.default.createElement(u.Scene,{key:"AnimeDetail",component:l.AnimeDetail,title:"AnimeDetail",titleStyle:y,navigationBarStyle:p}),r.default.createElement(u.Scene,{key:"SubCategory",component:l.SubCategory,title:"SubCategory",titleStyle:y,navigationBarStyle:p})))}}]),n}(i.Component),y=c.NavigationStyles.titleStyle,m=c.NavigationStyles.mainNavBarStyle,p=c.NavigationStyles.searchNavBarStyle;a.default=s},300); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(302);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(583);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(584);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(585);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})});var a=t(586);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})});var d=t(587);Object.keys(d).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return d[e]}})});var i=t(588);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})});var l=t(589);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return l[e]}})});var b=t(590);Object.keys(b).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return b[e]}})});var _=t(591);Object.keys(_).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return _[e]}})});var j=t(592);Object.keys(j).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return j[e]}})})},301); +__d(function(e,t,n,a){Object.defineProperty(a,"__esModule",{value:!0});var i=t(47),l=babelHelpers.interopRequireDefault(i),r=t(301),o=t(408),c=t(390),u=t(303),y=t(12),S=function(e){function n(){return babelHelpers.classCallCheck(this,n),babelHelpers.possibleConstructorReturn(this,(n.__proto__||Object.getPrototypeOf(n)).apply(this,arguments))}return babelHelpers.inherits(n,e),babelHelpers.createClass(n,[{key:"render",value:function(){return l.default.createElement(u.Router,{sceneStyle:{backgroundColor:"white"}},l.default.createElement(u.Scene,{key:"root",headerTintColor:"white"},l.default.createElement(u.Scene,{key:"MainScreen",component:r.MainScreen,title:"GoGoAnime",initial:!0,titleStyle:m,navigationBarStyle:s,renderRightButton:l.default.createElement(o.Button,{icon:{name:"search",type:"evil-icons",size:"ios"===y.Platform.OS?22:30},buttonStyle:{backgroundColor:"transparent"},onPress:function(){return u.Actions.SearchScreen()}}),renderLeftButton:l.default.createElement(o.Button,{icon:{name:"logo-github",type:"ionicon",size:"ios"===y.Platform.OS?22:30},buttonStyle:{backgroundColor:"transparent"},onPress:function(){if("ios"==y.Platform.OS){var e=t(580);e.open("https://github.com/HenryQuan/React-Native-GoGoAnime")}else y.Linking.openURL("https://github.com/HenryQuan/React-Native-GoGoAnime").catch(function(e){return console.error("An error occurred",e)})}}),backTitle:"Back",initial:!0}),l.default.createElement(u.Scene,{key:"SearchScreen",component:r.SearchAnime,title:"Search",titleStyle:m,navigationBarStyle:p}),l.default.createElement(u.Scene,{key:"GenreDetail",component:r.GenreDetail,title:"GenreDetail",titleStyle:m,navigationBarStyle:p}),l.default.createElement(u.Scene,{key:"WatchAnime",component:r.WatchAnime,title:"WatchAnime",titleStyle:m,navigationBarStyle:p}),l.default.createElement(u.Scene,{key:"AnimeDetail",component:r.AnimeDetail,title:"AnimeDetail",titleStyle:m,navigationBarStyle:p}),l.default.createElement(u.Scene,{key:"SubCategory",component:r.SubCategory,title:"SubCategory",titleStyle:m,navigationBarStyle:p}),l.default.createElement(u.Scene,{key:"PlayAnime",component:r.PlayAnime,title:"PlayAnime",titleStyle:m,navigationBarStyle:p})))}}]),n}(i.Component),m=c.NavigationStyles.titleStyle,s=c.NavigationStyles.mainNavBarStyle,p=c.NavigationStyles.searchNavBarStyle;a.default=S},300); +__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(302);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(583);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(584);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(585);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})});var a=t(586);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})});var d=t(587);Object.keys(d).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return d[e]}})});var i=t(588);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return i[e]}})});var l=t(589);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return l[e]}})});var b=t(590);Object.keys(b).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return b[e]}})});var _=t(591);Object.keys(_).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return _[e]}})});var j=t(592);Object.keys(j).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return j[e]}})});var s=t(593);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return s[e]}})})},301); __d(function(e,t,n,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AnimeDetail=void 0;var l=t(47),o=babelHelpers.interopRequireDefault(l),r=t(303),i=t(388),s=t(582),u=babelHelpers.interopRequireDefault(s),c=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.loadInformation=function(){var e=new u.default(n.link);e.loadInformation().then(function(e){0!=e.length&&(r.Actions.refresh({title:e.status}),n.setState({data:e}))}).catch(function(e){console.error(e)})},n.link=n.props.link,n.state={data:""},n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){this.loadInformation()}},{key:"render",value:function(){return""==this.state.data?o.default.createElement(i.LoadingIndicator,null):o.default.createElement(i.EpisodeList,{data:this.state.data})}}]),t}(l.Component);a.AnimeDetail=c},302); __d(function(e,t,a,u){function r(e){return e&&e.__esModule?e:{default:e}}function l(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a]);return t.default=e,t}Object.defineProperty(u,"__esModule",{value:!0}),u.Overlay=u.Tabs=u.Drawer=u.Stack=u.Lightbox=u.Modal=u.Actions=u.Scene=u.Router=u.Reducer=u.ActionConst=void 0;var o=t(304),d=l(o),n=t(305),f=r(n),c=t(385),i=r(c),s=t(376),_=r(s),v=t(306),b=r(v),y=t(379),M=r(y),O=t(380),p=r(O),A=t(387),R=r(A),S=t(381),h=r(S),w=t(382),g=r(w),j=t(383),k=r(j);u.ActionConst=d,u.Reducer=f.default,u.Router=i.default,u.Scene=_.default,u.Actions=b.default,u.Modal=M.default,u.Lightbox=p.default,u.Stack=R.default,u.Drawer=h.default,u.Tabs=g.default,u.Overlay=k.default},303); __d(function(_,R,E,T){Object.defineProperty(T,"__esModule",{value:!0});T.JUMP="REACT_NATIVE_ROUTER_FLUX_JUMP",T.PUSH="REACT_NATIVE_ROUTER_FLUX_PUSH",T.PUSH_OR_POP="REACT_NATIVE_ROUTER_FLUX_PUSH_OR_POP",T.REPLACE="REACT_NATIVE_ROUTER_FLUX_REPLACE",T.BACK="REACT_NATIVE_ROUTER_FLUX_BACK",T.BACK_ACTION="REACT_NATIVE_ROUTER_FLUX_BACK_ACTION",T.POP_TO="REACT_NATIVE_ROUTER_FLUX_POP_TO",T.REFRESH="REACT_NATIVE_ROUTER_FLUX_REFRESH",T.RESET="REACT_NATIVE_ROUTER_FLUX_RESET",T.FOCUS="REACT_NATIVE_ROUTER_FLUX_FOCUS",T.BLUR="REACT_NATIVE_ROUTER_FLUX_BLUR",T.ANDROID_BACK="REACT_NATIVE_ROUTER_FLUX_ANDROID_BACK"},304); @@ -390,7 +390,7 @@ __d(function(e,t,a,r){function n(e){return e&&e.__esModule?e:{default:e}}Object. __d(function(e,t,n,r){function a(e){return e&&e.__esModule?e:{default:e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function c(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(r,"__esModule",{value:!0});var i,f,s,d=Object.assign||function(e){for(var t=1;t6?s-6:0),u=6;u>",a=a||r,null==n[r]){if(t){var s=null===n[r]?"null":"undefined";return new Error("The "+i+" `"+a+"` is marked as required in `"+o+"`, but its value is `"+s+"`.")}return null}return e.apply(void 0,[n,r,o,i,a].concat(c))})}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e,t){return"symbol"===e||("Symbol"===t["@@toStringTag"]||"function"==typeof Symbol&&t instanceof Symbol)}function a(e){var t="undefined"==typeof e?"undefined":S(e);return Array.isArray(e)?"array":e instanceof RegExp?"object":i(t,e)?"symbol":t}function s(e){var t=a(e);if("object"===t){if(e instanceof Date)return"date";if(e instanceof RegExp)return"regexp"}return t}function c(e,t){return o(function(n,r,o,i,c){return(0,_.untracked)(function(){if(e&&a(n[r])===t.toLowerCase())return null;var i=void 0;switch(t){case"Array":i=_.isObservableArray;break;case"Object":i=_.isObservableObject;break;case"Map":i=_.isObservableMap;break;default:throw new Error("Unexpected mobxType: "+t)}var u=n[r];if(!i(u)){var p=s(u),f=e?" or javascript `"+t.toLowerCase()+"`":"";return new Error("Invalid prop `"+c+"` of type `"+p+"` supplied to `"+o+"`, expected `mobx.Observable"+t+"`"+f+".")}return null})})}function u(e,t){return o(function(n,r,o,i,a){for(var s=arguments.length,u=Array(s>5?s-5:0),p=5;p2&&void 0!==arguments[2]&&arguments[2],r=e[t],o=oe[t],i=r?n===!0?function(){o.apply(this,arguments),r.apply(this,arguments)}:function(){r.apply(this,arguments),o.apply(this,arguments)}:o;e[t]=i}function O(e,t){if(null==e||null==t||"object"!==("undefined"==typeof e?"undefined":S(e))||"object"!==("undefined"==typeof t?"undefined":S(t)))return e!==t;var n=Object.keys(e);if(n.length!==Object.keys(t).length)return!0;for(var r=void 0,o=n.length-1;r=n[o];o--)if(t[r]!==e[r])return!0;return!1}function g(e,t){if("string"==typeof e)throw new Error("Store names should be provided as array");if(Array.isArray(e))return ee||(ee=!0,console.warn('Mobx observer: Using observer to inject stores is deprecated since 4.0. Use `@inject("store1", "store2") @observer ComponentClass` or `inject("store1", "store2")(observer(componentClass))` instead of `@observer(["store1", "store2"]) ComponentClass`')),t?d.apply(null,e)(g(t)):function(t){return g(e,t)};var n=e;if(n.isMobxInjector===!0&&console.warn("Mobx observer: You are trying to use 'observer' on a component that already has 'inject'. Please apply 'observer' before applying 'inject'"),!("function"!=typeof n||n.prototype&&n.prototype.render||n.isReactClass||x.Component.isPrototypeOf(n))){var r,o;return g((o=r=function(e){function t(){return C(this,t),T(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return E(t,e),R(t,[{key:"render",value:function(){return n.call(this,this.props,this.context)}}]),t}(x.Component),r.displayName=n.displayName||n.name,r.contextTypes=n.contextTypes,r.propTypes=n.propTypes,r.defaultProps=n.defaultProps,o))}if(!n)throw new Error("Please pass a valid component to 'observer'");var i=n.prototype||n;return w(i),n.isMobXReactObserver=!0,n}function w(e){m(e,"componentWillMount",!0),["componentDidMount","componentWillUnmount","componentDidUpdate"].forEach(function(t){m(e,t)}),e.shouldComponentUpdate||(e.shouldComponentUpdate=oe.shouldComponentUpdate)}Object.defineProperty(r,"__esModule",{value:!0}),r.inject=r.Provider=r.useStaticRendering=r.trackComponents=r.componentByNodeRegistery=r.renderReporter=r.Observer=r.observer=r.onError=r.PropTypes=r.propTypes=void 0;var _=t(307),x=t(47),j=t(12),k=void 0,P=void 0,S="function"==typeof Symbol&&"symbol"==typeof("function"==typeof Symbol?Symbol.iterator:"@@iterator")?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==("function"==typeof Symbol?Symbol.prototype:"@@prototype")?"symbol":typeof e},C=(function(){function e(e){this.value=e}function t(t){function n(e,t){return new Promise(function(n,o){var s={key:e,arg:t,resolve:n,reject:o,next:null};a?a=a.next=s:(i=a=s,r(e,t))})}function r(n,i){try{var a=t[n](i),s=a.value;s instanceof e?Promise.resolve(s.value).then(function(e){r("next",e)},function(e){r("throw",e)}):o(a.done?"return":"normal",a.value)}catch(e){o("throw",e)}}function o(e,t){switch(e){case"return":i.resolve({value:t,done:!0});break;case"throw":i.reject(t);break;default:i.resolve({value:t,done:!1})}i=i.next,i?r(i.key,i.arg):a=null}var i,a;this._invoke=n,"function"!=typeof t.return&&(this.return=void 0)}return"function"==typeof Symbol&&("function"==typeof Symbol?Symbol.asyncIterator:"@@asyncIterator")&&(t.prototype["function"==typeof Symbol?Symbol.asyncIterator:"@@asyncIterator"]=function(){return this}),t.prototype.next=function(e){return this._invoke("next",e)},t.prototype.throw=function(e){return this._invoke("throw",e)},t.prototype.return=function(e){return this._invoke("return",e)},{wrap:function(e){return function(){return new t(e.apply(this,arguments))}},await:function(t){return new e(t)}}}(),function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}),R=function(){function e(e,t){for(var n=0;n",r=this._reactInternalInstance&&this._reactInternalInstance._rootNodeID,o=!1,i=!1;e.call(this,"props"),e.call(this,"state");var a=this.render.bind(this),s=null,c=!1,u=function(){return s=new _.Reaction(n+"#"+r+".render()",function(){if(!c&&(c=!0,"function"==typeof t.componentWillReact&&t.componentWillReact(),t.__$mobxIsUnmounted!==!0)){var e=!0;try{i=!0,o||x.Component.prototype.forceUpdate.call(t),e=!1}finally{i=!1,e&&s.dispose()}}}),s.reactComponent=t,p.$mobx=s,t.render=p,p()},p=function(){c=!1;var e=void 0,n=void 0;if(s.track(function(){Q&&(t.__$mobRenderStart=Date.now());try{n=_.extras.allowStateChanges(!1,a)}catch(t){e=t}Q&&(t.__$mobRenderEnd=Date.now())}),e)throw re.emit(e),e;return n};this.render=u}},componentWillUnmount:function(){if(Z!==!0&&(this.render.$mobx&&this.render.$mobx.dispose(),this.__$mobxIsUnmounted=!0,Q)){var e=y(this);e&&te&&te.delete(e),ne.emit({event:"destroy",component:this,node:e})}},componentDidMount:function(){Q&&b(this)},componentDidUpdate:function(){Q&&b(this)},shouldComponentUpdate:function(e,t){return Z&&console.warn("[mobx-react] It seems that a re-rendering of a React component is triggered while in static (server-side) mode. Please make sure components are rendered only once server-side."),this.state!==t||O(this.props,e)}},ie=g(function(e){var t=e.children;return t()});ie.displayName="Observer",ie.propTypes={children:function(e,t,n,r,o){if("function"!=typeof e[t])return new Error("Invalid prop `"+o+"` of type `"+S(e[t])+"` supplied to `"+n+"`, expected `function`.")}};var ae,se,ce={children:!0,key:!0,ref:!0},ue=(se=ae=function(e){function t(){return C(this,t),T(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return E(t,e),R(t,[{key:"render",value:function(){return x.Children.only(this.props.children)}},{key:"getChildContext",value:function(){var e={},t=this.context.mobxStores;if(t)for(var n in t)e[n]=t[n];for(var r in this.props)ce[r]||"suppressChangedStoreWarning"===r||(e[r]=this.props[r]);return{mobxStores:e}}},{key:"componentWillReceiveProps",value:function(e){if(Object.keys(e).length!==Object.keys(this.props).length&&console.warn("MobX Provider: The set of provided stores has changed. Please avoid changing stores as the change might not propagate to all children"),!e.suppressChangedStoreWarning)for(var t in e)ce[t]||this.props[t]===e[t]||console.warn("MobX Provider: Provided store '"+t+"' has changed. Please avoid replacing stores as the change might not propagate to all children")}}]),t}(x.Component),ae.contextTypes={mobxStores:z},ae.childContextTypes={mobxStores:z.isRequired},se);if(!x.Component)throw new Error("mobx-react requires React to be available");if(!_.extras)throw new Error("mobx-react requires mobx to be available");"function"==typeof k?_.extras.setReactionScheduler(k):"function"==typeof j.unstable_batchedUpdates&&_.extras.setReactionScheduler(j.unstable_batchedUpdates);var pe=function(e){return re.on(e)};if("object"===("undefined"==typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__?"undefined":S(__MOBX_DEVTOOLS_GLOBAL_HOOK__))){var fe={spy:_.spy,extras:_.extras},le={renderReporter:ne,componentByNodeRegistery:te,trackComponents:h};__MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobxReact(le,fe)}r.propTypes=Y,r.PropTypes=Y,r.onError=pe,r.observer=g,r.Observer=ie,r.renderReporter=ne,r.componentByNodeRegistery=te,r.trackComponents=h,r.useStaticRendering=v,r.Provider=ue,r.inject=d},386); __d(function(e,n,u,t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){return null}},387); -__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(389);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(572);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(574);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(578);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})});var a=t(581);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})})},388); +__d(function(e,t,n,r){Object.defineProperty(r,"__esModule",{value:!0});var u=t(389);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return u[e]}})});var o=t(572);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return o[e]}})});var c=t(574);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return c[e]}})});var f=t(577);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return f[e]}})});var a=t(581);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(r,e,{enumerable:!0,get:function(){return a[e]}})})},388); __d(function(e,t,n,a){Object.defineProperty(a,"__esModule",{value:!0}),a.AnimeList=void 0;var s=t(47),o=babelHelpers.interopRequireDefault(s),r=t(12),i=(t(390),t(391)),l=babelHelpers.interopRequireDefault(i),u=t(407),c=babelHelpers.interopRequireDefault(u),h=t(388),d=function(){var e=r.Dimensions.get("window");return e.height>=e.width},m=function(e){function t(e){babelHelpers.classCallCheck(this,t);var n=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));return n.keyExtractor=function(e){return console.log(e.name+e.link),e.name+e.link},n.renderFooterComponent=function(){return n.state.hasMorePage?o.default.createElement(h.LoadingIndicator,null):null},n.getNumColumns=function(){var e=r.Dimensions.get("window"),t=e.width;if(columns=Math.floor(t/200),columns<2?columns=2:columns>6&&(columns=6),columns!=n.state.columns){var a=t/columns;n.setState({columns:columns,goodWidth:a})}},n.loadAnime=function(){(n.state.hasMorePage||n.state.isRefreshing)&&setTimeout(function(){var e=new l.default(n.state.url,n.state.page);e.loadAnime().then(function(e){0==e.length?n.setState({hasMorePage:!1,isRefreshing:!1}):e.length<20?n.setState({data:n.state.data.concat(e),isRefreshing:!1,hasMorePage:!1}):n.setState({data:n.state.data.concat(e),page:n.state.page+1,isRefreshing:!1})}).catch(function(e){console.error(e),n.setState({isRefreshing:!1})})},500)},n.refreshAnime=function(){n.setState({data:[],page:1,hasMorePage:!0,isRefreshing:!0},function(){n.loadAnime()})},n.state={data:[],page:1,hasMorePage:!0,isRefreshing:!1,url:n.props.AnimeUrl,columns:-1},n}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){this.loadAnime(),this.getNumColumns()}},{key:"render",value:function(){var e=this;return 0==this.state.data.length?o.default.createElement(h.LoadingIndicator,null):o.default.createElement(r.View,{style:{flex:1},onLayout:this.getNumColumns},o.default.createElement(r.FlatList,{data:this.state.data,keyExtractor:this.keyExtractor,key:d()?"portrait"+this.state.columns:"landscape"+this.state.columns,renderItem:function(t){var n=t.item;return o.default.createElement(c.default,{data:n,width:e.state.goodWidth})},onEndReached:this.loadAnime,onEndReachedThreshold:.5,numColumns:this.state.columns,onRefresh:this.refreshAnime,refreshing:this.state.isRefreshing,ListFooterComponent:this.renderFooterComponent}))}}]),t}(o.default.PureComponent);a.AnimeList=m},389); __d(function(e,o,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.NavigationStyles=n.WatchAnimeStyles=n.RecentReleaseStyles=n.MainScreenStyles=n.Colour=void 0;var a=(o(12),n.Colour={GoGoAnimeOrange:"#f5c249",GoGoAnimeBlack:"#1b1b1b",GoGoAnimeBlue:"#03A9F4",GoGoAnimeRed:"#FF6D6B",GoGoAnimeGreen:"#2CCC90"});n.MainScreenStyles={tabBarStyle:{backgroundColor:a.GoGoAnimeOrange},tabStyle:{height:40,backgroundColor:"transparent"},indicatorStyle:{backgroundColor:"white"}},n.RecentReleaseStyles={loadingStyle:{padding:10}},n.WatchAnimeStyles={loadingStyle:{padding:10}},n.NavigationStyles={titleStyle:{width:"90%"},mainNavBarStyle:{backgroundColor:"#1b1b1b",justifyContent:"center",elevation:0},searchNavBarStyle:{backgroundColor:"#1b1b1b"}}},390); __d(function(e,t,r,n){Object.defineProperty(n,"__esModule",{value:!0});var i=t(392),o=function(){function e(t,r){babelHelpers.classCallCheck(this,e),this.url=t,this.page=r}return babelHelpers.createClass(e,[{key:"loadAnime",value:function(){var e=this;return new Promise(function(r,n){fetch(e.url+e.page).then(function(e){return e.text()}).then(function(n){var o=t(393),a=o.parse(n).querySelector(".items");null==a&&r([]);var l=a.childNodes;l[0].rawText.includes("Sorry")&&r([{name:"Anime not found\n>_<",info:"Back",link:"Error",thumbnail:"https://ww3.gogoanime.io/img/icon/logo.png"}]);var u=[],c=l.length;0==c&&r([]);for(var s=0;s1&&void 0!==arguments[1]?arguments[1]:{};s.presentUrl(e,r)}};t.exports=l},577); -__d(function(e,t,a,n){Object.defineProperty(n,"__esModule",{value:!0}),n.EpisodeList=void 0;var r=t(47),o=babelHelpers.interopRequireDefault(r),l=t(12),i=t(408),s=t(579),d=babelHelpers.interopRequireDefault(s),c=t(390),u=t(580),p=babelHelpers.interopRequireDefault(u),f=t(388),m=t(303),h=l.Dimensions.get("window").width/2,g=function(){var e=l.Dimensions.get("screen");return e.height>=e.width},E=l.Platform.OS,y=function(e){function t(e){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));b.call(a);var n=a.props.data;return a.state={name:n.name,type:n.type,typeLink:n.typeLink,genre:n.genre,release:n.release,episode:n.episode,plot:n.plot,image:n.image,id:n.id,ep_start:0,ep_end:99,ascending:!0,hasMorePage:!0,data:[],orientation:g()?"portrait":"landscape"},a}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){this.loadEpisode()}},{key:"render",value:function(){var e=this;return 0==this.state.data.length?o.default.createElement(f.LoadingIndicator,null):o.default.createElement(l.View,{style:{flex:1},onLayout:this.updateView},o.default.createElement(l.FlatList,{data:this.state.data,keyExtractor:this.keyExtractor,numColumns:4,renderItem:function(t){var a=t.item;return o.default.createElement(p.default,{data:a,isLastest:a.number==e.state.episode})},ListFooterComponent:this.renderFooter,ListHeaderComponent:this.renderHeader,onEndReached:this.loadMoreEpisode,onEndReachedThreshold:.5}))}}]),t}(o.default.PureComponent),b=function(){var e=this;this.keyExtractor=function(e){return e.number},this.updateView=function(){var t=g()?"portrait":"landscape";e.state.orientation!=t&&e.setState({orientation:t})},this.loadEpisode=function(){if(e.state.hasMorePage){var t=new d.default(e.state.ep_start,e.state.ep_end,e.state.id,e.state.episode);t.loadEpisode().then(function(t){t.length<100?e.setState({data:e.state.data.concat(t),hasMorePage:!1}):e.setState({data:e.state.data.concat(t)})}).catch(function(e){console.error(e)})}},this.loadMoreEpisode=function(){var t=e.state.episode,a=e.state.ep_start+100,n=e.state.ep_end+100;n>t&&(n=t),e.setState({ep_start:a,ep_end:n},function(){e.loadEpisode()})},this.renderFooter=function(){return e.state.hasMorePage?o.default.createElement(f.LoadingIndicator,null):null},this.renderHeader=function(){return o.default.createElement(i.Card,{title:e.state.name},o.default.createElement(l.View,{style:{flexDirection:"row",height:1.429*h}},o.default.createElement(l.View,{style:{flex:.5}},o.default.createElement(l.Image,{source:{uri:e.state.image},resizeMode:"cover",style:{flex:1}})),o.default.createElement(l.View,{style:{flex:.5,justifyContent:"space-around",padding:4}},o.default.createElement(l.Text,{style:x.centerText},"Genre:\n"+e.state.genre),o.default.createElement(l.Text,{style:x.centerText},"Release:\n"+e.state.release),o.default.createElement(l.Text,{style:x.centerText},"Episode:\n"+e.state.episode),o.default.createElement(l.View,null,o.default.createElement(l.Text,{style:{textAlign:"center"}},"Type:"),o.default.createElement(l.Button,{title:e.state.type.replace(" Anime",""),color:c.Colour.GoGoAnimeGreen,onPress:function(){console.log(e.state.typeLink),m.Actions.SubCategory({title:e.state.type,link:e.state.typeLink+"?page="})}})))),o.default.createElement(l.Text,{style:{padding:4}},e.state.plot),o.default.createElement(l.View,null,o.default.createElement(l.Button,{title:"Google it",color:c.Colour.GoGoAnimeBlue,onPress:function(){var a="https://www.google.com/search?q="+e.state.name.split(" ").join("%20");if("ios"==E){var n=t(577);n.open(a)}else l.Linking.openURL(a).catch(function(e){return console.error("An error occurred",e)})}}),o.default.createElement(l.Text,{style:{textAlign:"center",padding:4}},"* Please consider buying its DVD")))}},x={centerText:{textAlign:"center"}};n.EpisodeList=y},578); -__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var n=t(392),s=function(){function e(t,r,i,n){babelHelpers.classCallCheck(this,e),this.start=t,this.end=r,this.id=i,this.lastest=n}return babelHelpers.createClass(e,[{key:"loadEpisode",value:function(){var e=this;return new Promise(function(r,i){var s=n.GoGoAnime.Episode+e.start+"&ep_end="+e.end+"&id="+e.id;fetch(s).then(function(e){return e.text()}).then(function(i){var s=t(393),a=s.parse(i),l=a.querySelector("#episode_related");if(null==l)return[{link:"Error",number:"??"}];l=l.childNodes;var o=l.length;if(0==o)return[{link:"Error",number:"??"}];for(var u=[],c=0;c=e.width},E=l.Platform.OS,y=function(e){function t(e){babelHelpers.classCallCheck(this,t);var a=babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e));b.call(a);var n=a.props.data;return a.state={name:n.name,type:n.type,typeLink:n.typeLink,genre:n.genre,release:n.release,episode:n.episode,plot:n.plot,image:n.image,id:n.id,ep_start:0,ep_end:99,ascending:!0,hasMorePage:!0,data:[],orientation:g()?"portrait":"landscape"},a}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"componentWillMount",value:function(){this.loadEpisode()}},{key:"render",value:function(){var e=this;return 0==this.state.data.length?o.default.createElement(f.LoadingIndicator,null):o.default.createElement(l.View,{style:{flex:1},onLayout:this.updateView},o.default.createElement(l.FlatList,{data:this.state.data,keyExtractor:this.keyExtractor,numColumns:4,renderItem:function(t){var a=t.item;return o.default.createElement(p.default,{data:a,isLastest:a.number==e.state.episode})},ListFooterComponent:this.renderFooter,ListHeaderComponent:this.renderHeader,onEndReached:this.loadMoreEpisode,onEndReachedThreshold:.5}))}}]),t}(o.default.PureComponent),b=function(){var e=this;this.keyExtractor=function(e){return e.number},this.updateView=function(){var t=g()?"portrait":"landscape";e.state.orientation!=t&&e.setState({orientation:t})},this.loadEpisode=function(){if(e.state.hasMorePage){var t=new d.default(e.state.ep_start,e.state.ep_end,e.state.id,e.state.episode);t.loadEpisode().then(function(t){t.length<100?e.setState({data:e.state.data.concat(t),hasMorePage:!1}):e.setState({data:e.state.data.concat(t)})}).catch(function(e){console.error(e)})}},this.loadMoreEpisode=function(){var t=e.state.episode,a=e.state.ep_start+100,n=e.state.ep_end+100;n>t&&(n=t),e.setState({ep_start:a,ep_end:n},function(){e.loadEpisode()})},this.renderFooter=function(){return e.state.hasMorePage?o.default.createElement(f.LoadingIndicator,null):null},this.renderHeader=function(){return o.default.createElement(i.Card,{title:e.state.name},o.default.createElement(l.View,{style:{flexDirection:"row",height:1.429*h}},o.default.createElement(l.View,{style:{flex:.5}},o.default.createElement(l.Image,{source:{uri:e.state.image},resizeMode:"cover",style:{flex:1}})),o.default.createElement(l.View,{style:{flex:.5,justifyContent:"space-around",padding:4}},o.default.createElement(l.Text,{style:x.centerText},"Genre:\n"+e.state.genre),o.default.createElement(l.Text,{style:x.centerText},"Release:\n"+e.state.release),o.default.createElement(l.Text,{style:x.centerText},"Episode:\n"+e.state.episode),o.default.createElement(l.View,null,o.default.createElement(l.Text,{style:{textAlign:"center"}},"Type:"),o.default.createElement(l.Button,{title:e.state.type.replace(" Anime",""),color:c.Colour.GoGoAnimeGreen,onPress:function(){console.log(e.state.typeLink),m.Actions.SubCategory({title:e.state.type,link:e.state.typeLink+"?page="})}})))),o.default.createElement(l.Text,{style:{padding:4}},e.state.plot),o.default.createElement(l.View,null,o.default.createElement(l.Button,{title:"Google it",color:c.Colour.GoGoAnimeBlue,onPress:function(){var a="https://www.google.com/search?q="+e.state.name.split(" ").join("%20");if("ios"==E){var n=t(580);n.open(a)}else l.Linking.openURL(a).catch(function(e){return console.error("An error occurred",e)})}}),o.default.createElement(l.Text,{style:{textAlign:"center",padding:4}},"* Please consider buying its DVD")))}},x={centerText:{textAlign:"center"}};n.EpisodeList=y},577); +__d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var n=t(392),s=function(){function e(t,r,i,n){babelHelpers.classCallCheck(this,e),this.start=t,this.end=r,this.id=i,this.lastest=n}return babelHelpers.createClass(e,[{key:"loadEpisode",value:function(){var e=this;return new Promise(function(r,i){var s=n.GoGoAnime.Episode+e.start+"&ep_end="+e.end+"&id="+e.id;fetch(s).then(function(e){return e.text()}).then(function(i){var s=t(393),a=s.parse(i),l=a.querySelector("#episode_related");if(null==l)return[{link:"Error",number:"??"}];l=l.childNodes;var o=l.length;if(0==o)return[{link:"Error",number:"??"}];for(var u=[],c=0;c1&&void 0!==arguments[1]?arguments[1]:{};s.presentUrl(e,r)}};t.exports=l},580); __d(function(e,t,n,l){Object.defineProperty(l,"__esModule",{value:!0}),l.LoadingIndicator=void 0;var a=t(47),i=babelHelpers.interopRequireDefault(a),o=t(12),r=t(390),d=function(){return i.default.createElement(o.View,null,i.default.createElement(o.ActivityIndicator,{color:r.Colour.GoGoAnimeOrange,style:c.loadingStyle,size:"large"}),i.default.createElement(o.Text,{style:{textAlign:"center"}},"Loading..."))},c={loadingStyle:{padding:10}};l.LoadingIndicator=d},581); __d(function(e,t,r,i){Object.defineProperty(i,"__esModule",{value:!0});var l=t(392),n=function(){function e(t){babelHelpers.classCallCheck(this,e),this.url=t}return babelHelpers.createClass(e,[{key:"loadInformation",value:function(){var e=this;return new Promise(function(r,i){fetch(e.url).then(function(e){return e.text()}).then(function(e){var i=t(393),n=i.parse(e),a=n.querySelector(".anime_info_body_bg");null==a&&r({});var o=a.childNodes,s=o[3].rawText,u=o[1].attributes.src,c=o[7].childNodes[2].attributes.title,d=l.GoGoAnime.MainURL+o[7].childNodes[2].attributes.href,h="No Information",f=o[9].childNodes[1];null!=f&&(h=f.rawText);var p=o[11].structuredText.replace("Genre: ",""),v=o[13].childNodes[1].rawText,b=o[15].childNodes[1].rawText,_="0",N=n.querySelector("#episode_page");if(null!=N){var m=N.childNodes,_=m[m.length-2].childNodes[1].rawAttrs.split(" ep_end = ")[1];_=_.split("'").join("")}var y="",w=n.querySelector(".movie_id");null!=w&&(y=w.attributes.value);var x={name:s,image:u,type:c,typeLink:d,plot:h,genre:p,release:v,status:b,episode:_,id:y};r(x)}).catch(function(e){i(e)})})}}]),e}();i.default=n},582); __d(function(e,r,t,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Genre=void 0;var n=r(47),s=babelHelpers.interopRequireDefault(n),o=(r(12),r(572)),a=function(e){function r(){return babelHelpers.classCallCheck(this,r),babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return babelHelpers.inherits(r,e),babelHelpers.createClass(r,[{key:"render",value:function(){return s.default.createElement(o.GenreList,null)}}]),r}(n.Component);l.Genre=a},583); @@ -597,5 +597,6 @@ __d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Movie=v __d(function(e,r,t,n){Object.defineProperty(n,"__esModule",{value:!0}),n.GenreDetail=void 0;var l=r(47),i=babelHelpers.interopRequireDefault(l),o=r(388),s=r(392),a=function(e){function r(){return babelHelpers.classCallCheck(this,r),babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return babelHelpers.inherits(r,e),babelHelpers.createClass(r,[{key:"render",value:function(){return i.default.createElement(o.AnimeList,{AnimeUrl:s.GoGoAnime.Genre+this.props.genre})}}]),r}(l.Component);n.GenreDetail=a},590); __d(function(e,r,t,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Popular=void 0;var n=r(47),o=babelHelpers.interopRequireDefault(n),a=r(388),i=r(392),s=function(e){function r(){return babelHelpers.classCallCheck(this,r),babelHelpers.possibleConstructorReturn(this,(r.__proto__||Object.getPrototypeOf(r)).apply(this,arguments))}return babelHelpers.inherits(r,e),babelHelpers.createClass(r,[{key:"render",value:function(){return o.default.createElement(a.AnimeList,{AnimeUrl:i.GoGoAnime.Popular})}}]),r}(n.Component);l.Popular=s},591); __d(function(e,t,r,l){Object.defineProperty(l,"__esModule",{value:!0}),l.SubCategory=void 0;var n=t(47),o=babelHelpers.interopRequireDefault(n),s=t(388),i=(t(392),function(e){function t(){return babelHelpers.classCallCheck(this,t),babelHelpers.possibleConstructorReturn(this,(t.__proto__||Object.getPrototypeOf(t)).apply(this,arguments))}return babelHelpers.inherits(t,e),babelHelpers.createClass(t,[{key:"render",value:function(){return o.default.createElement(s.AnimeList,{AnimeUrl:this.props.link})}}]),t}(n.Component));l.SubCategory=i},592); +__d(function(e,r,t,l){Object.defineProperty(l,"__esModule",{value:!0}),l.Movie=void 0;var o=r(47),a=babelHelpers.interopRequireDefault(o),n=r(12),i=r(303),s=function(e){function r(){var e,t,l,o;babelHelpers.classCallCheck(this,r);for(var a=arguments.length,s=Array(a),c=0;c { console.log(this.link); - var currOS = Platform.OS; - if (currOS == 'ios') { - var Browser = require('react-native-browser'); - Browser.open(this.link); - } else { - Linking.openURL(this.link).catch(err => console.error('An error occurred', err)); - } + Actions.PlayAnime({title: this.source, link: this.link}); } } diff --git a/src/screens/PlayAnime.js b/src/screens/PlayAnime.js new file mode 100644 index 0000000..0fd8ef1 --- /dev/null +++ b/src/screens/PlayAnime.js @@ -0,0 +1,19 @@ +import React, { Component } from 'react'; +import { WebView, Alert } from 'react-native'; +import { Actions } from 'react-native-router-flux'; + +class PlayAnime extends Component { + render() { + return ( + + ); + } + + goBack = () => { + Alert.alert('Error', 'Video could not be played'); + Actions.pop(); + } +} + +export { PlayAnime }; \ No newline at end of file diff --git a/src/screens/index.js b/src/screens/index.js index 73bb93c..3aafddd 100644 --- a/src/screens/index.js +++ b/src/screens/index.js @@ -9,4 +9,5 @@ export * from './WatchAnime'; export * from './Movie'; export * from './GenreDetail'; export * from './Popular'; -export * from './SubCategory'; \ No newline at end of file +export * from './SubCategory'; +export * from './PlayAnime'; \ No newline at end of file From 4a4f0e763e58762608032433e1d4a1c456f36ab0 Mon Sep 17 00:00:00 2001 From: Yiheng Date: Wed, 22 Nov 2017 19:23:21 +0800 Subject: [PATCH 02/17] Video needs to be parsed For VidStream and Estream, I could parse their link and play with vlc for android. For ios, you could use safari. However, for windows, I wonder if video could work for windows --- android/.idea/misc.xml | 2 +- android/.idea/workspace.xml | 183 +++++++----------- android/app/build.gradle | 1 + android/app/src/main/AndroidManifest.xml | 1 - .../java/com/yihengquan/MainApplication.java | 4 +- android/settings.gradle | 2 + ios/GoGoAnime.xcodeproj/project.pbxproj | 18 +- package-lock.json | 14 ++ package.json | 1 + src/component/SourceCell.js | 20 +- src/component/SourceList.js | 2 +- src/screens/PlayAnime.js | 37 +++- 12 files changed, 158 insertions(+), 127 deletions(-) diff --git a/android/.idea/misc.xml b/android/.idea/misc.xml index d1817bf..f7fa969 100644 --- a/android/.idea/misc.xml +++ b/android/.idea/misc.xml @@ -24,5 +24,5 @@ - + \ No newline at end of file diff --git a/android/.idea/workspace.xml b/android/.idea/workspace.xml index 4200b92..1bb96dc 100644 --- a/android/.idea/workspace.xml +++ b/android/.idea/workspace.xml @@ -2,22 +2,7 @@ - - - - - - - - - - - - - - - @@ -3005,7 +2955,7 @@ + - + - @@ -3303,6 +3253,7 @@ + @@ -3315,6 +3266,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -3359,10 +3358,7 @@ - - - - + @@ -3370,15 +3366,7 @@ - - - - - - - - - + @@ -3414,10 +3402,7 @@ - - - - + @@ -3425,15 +3410,7 @@ - - - - - - - - - + @@ -3529,10 +3506,7 @@ - - - - + @@ -3540,15 +3514,7 @@ - - - - - - - - - + @@ -3576,10 +3542,7 @@ - - - - + @@ -3587,15 +3550,7 @@ - - - - - - - - - + @@ -3658,7 +3613,7 @@ - + diff --git a/android/app/build.gradle b/android/app/build.gradle index da8ca16..0006dce 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -152,6 +152,7 @@ android { } dependencies { + compile project(':react-native-video') compile project(':react-native-vector-icons') compile fileTree(dir: "libs", include: ["*.jar"]) compile "com.android.support:appcompat-v7:23.4.0" diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 1cba491..e68d76f 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -9,7 +9,6 @@ - diff --git a/android/app/src/main/java/com/yihengquan/MainApplication.java b/android/app/src/main/java/com/yihengquan/MainApplication.java index 4b73500..6595fef 100644 --- a/android/app/src/main/java/com/yihengquan/MainApplication.java +++ b/android/app/src/main/java/com/yihengquan/MainApplication.java @@ -3,6 +3,7 @@ import android.app.Application; import com.facebook.react.ReactApplication; +import com.brentvatne.react.ReactVideoPackage; import com.oblador.vectoricons.VectorIconsPackage; import com.facebook.react.ReactNativeHost; import com.facebook.react.ReactPackage; @@ -24,7 +25,8 @@ public boolean getUseDeveloperSupport() { protected List getPackages() { return Arrays.asList( new MainReactPackage(), - new VectorIconsPackage() + new ReactVideoPackage(), + new VectorIconsPackage() ); } diff --git a/android/settings.gradle b/android/settings.gradle index b560c62..edbb20c 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,4 +1,6 @@ rootProject.name = 'GoGoAnime' +include ':react-native-video' +project(':react-native-video').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android') include ':react-native-vector-icons' project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android') diff --git a/ios/GoGoAnime.xcodeproj/project.pbxproj b/ios/GoGoAnime.xcodeproj/project.pbxproj index cb232a6..38be824 100644 --- a/ios/GoGoAnime.xcodeproj/project.pbxproj +++ b/ios/GoGoAnime.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302AC1ABCB8CE00DB3ED1 /* libRCTActionSheet.a */; }; 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302BA1ABCB90400DB3ED1 /* libRCTGeolocation.a */; }; @@ -50,6 +49,7 @@ C2099C1B9FDC49EC9029EDEA /* Octicons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 4284B1DDCCBC4511A530A4D3 /* Octicons.ttf */; }; C668A9E9B1E64DE78735147D /* libRNVectorIcons.a in Frameworks */ = {isa = PBXBuildFile; fileRef = BF1B11785B5C42EF8BB0AEE7 /* libRNVectorIcons.a */; }; C6D085B271DF450CB2521F5F /* MaterialCommunityIcons.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 980858C44BBE4C8EAF9A868E /* MaterialCommunityIcons.ttf */; }; + 9EC59BBE29B54A7495202473 /* libRCTVideo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C4BAF0BBE96B4B448E8F3D33 /* libRCTVideo.a */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -362,6 +362,8 @@ B16F116AF18143D1BC99D493 /* Feather.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Feather.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Feather.ttf"; sourceTree = ""; }; BF1B11785B5C42EF8BB0AEE7 /* libRNVectorIcons.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRNVectorIcons.a; sourceTree = ""; }; FBB3E5FACD4741F59AE07D61 /* Entypo.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Entypo.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Entypo.ttf"; sourceTree = ""; }; + 54106843C3994113AEC6CF58 /* RCTVideo.xcodeproj */ = {isa = PBXFileReference; name = "RCTVideo.xcodeproj"; path = "../node_modules/react-native-video/ios/RCTVideo.xcodeproj"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = wrapper.pb-project; explicitFileType = undefined; includeInIndex = 0; }; + C4BAF0BBE96B4B448E8F3D33 /* libRCTVideo.a */ = {isa = PBXFileReference; name = "libRCTVideo.a"; path = "libRCTVideo.a"; sourceTree = ""; fileEncoding = undefined; lastKnownFileType = archive.ar; explicitFileType = undefined; includeInIndex = 0; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -392,6 +394,7 @@ 139FDEF61B0652A700C62182 /* libRCTWebSocket.a in Frameworks */, C668A9E9B1E64DE78735147D /* libRNVectorIcons.a in Frameworks */, A39FB99075E8412C91A885C7 /* libRCTBrowser.a in Frameworks */, + 9EC59BBE29B54A7495202473 /* libRCTVideo.a in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -585,6 +588,7 @@ 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */, A7EB0E4FCF7A4F3C86709758 /* RNVectorIcons.xcodeproj */, 05DA65AF0BA943CEA7071ACC /* RCTBrowser.xcodeproj */, + 54106843C3994113AEC6CF58 /* RCTVideo.xcodeproj */, ); name = Libraries; sourceTree = ""; @@ -1248,6 +1252,7 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = GoGoAnimeTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -1255,6 +1260,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1275,6 +1281,7 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = GoGoAnimeTests/Info.plist; IPHONEOS_DEPLOYMENT_TARGET = 8.0; @@ -1282,6 +1289,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1303,6 +1311,7 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = GoGoAnime/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1328,6 +1337,7 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = GoGoAnime/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; @@ -1359,12 +1369,14 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = "GoGoAnime-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1394,12 +1406,14 @@ "$(inherited)", "$(SRCROOT)/../node_modules/react-native-vector-icons/RNVectorIconsManager", "$(SRCROOT)/../node_modules/react-native-browser/**", + "$(SRCROOT)/../node_modules/react-native-video/ios", ); INFOPLIST_FILE = "GoGoAnime-tvOS/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); OTHER_LDFLAGS = ( "-ObjC", @@ -1429,6 +1443,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GoGoAnime-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -1454,6 +1469,7 @@ LIBRARY_SEARCH_PATHS = ( "$(inherited)", "\"$(SRCROOT)/$(TARGET_NAME)\"", + "\"$(SRCROOT)/$(TARGET_NAME)\"", ); PRODUCT_BUNDLE_IDENTIFIER = "com.facebook.REACT.GoGoAnime-tvOSTests"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/package-lock.json b/package-lock.json index 9f1e8a7..4cb29b0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4704,6 +4704,11 @@ "verror": "1.10.0" } }, + "keymirror": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/keymirror/-/keymirror-0.1.1.tgz", + "integrity": "sha1-kYiJ6hP40KQufFVyUO7nE63JXDU=" + }, "kind-of": { "version": "3.2.2", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", @@ -6208,6 +6213,15 @@ "yargs": "8.0.2" } }, + "react-native-video": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/react-native-video/-/react-native-video-2.0.0.tgz", + "integrity": "sha1-8z+m+35+PJOrV4eUTO/Vi/c1WGc=", + "requires": { + "keymirror": "0.1.1", + "prop-types": "15.6.0" + } + }, "react-navigation": { "version": "1.0.0-beta.19", "resolved": "https://registry.npmjs.org/react-navigation/-/react-navigation-1.0.0-beta.19.tgz", diff --git a/package.json b/package.json index 68712b3..e054950 100644 --- a/package.json +++ b/package.json @@ -16,6 +16,7 @@ "react-native-router-flux": "^4.0.0-beta.22", "react-native-tab-view": "^0.0.70", "react-native-vector-icons": "^4.4.2", + "react-native-video": "^2.0.0", "util": "^0.10.3" }, "devDependencies": { diff --git a/src/component/SourceCell.js b/src/component/SourceCell.js index ed544e1..c4a59ec 100644 --- a/src/component/SourceCell.js +++ b/src/component/SourceCell.js @@ -1,6 +1,6 @@ import React, { Component } from 'react'; -import { View, Button, Platform, Alert } from 'react-native'; -import { Actions } from 'react-native-router-flux'; +import { View, Button, Platform, Alert, Linking } from 'react-native'; +import { Action, Actions } from 'react-native-router-flux'; import { Colour } from '../Styles'; class SourceCell extends React.PureComponent { @@ -22,7 +22,7 @@ class SourceCell extends React.PureComponent { // This is recommened return ( -