├── .gitignore
├── AniLab.iml
├── DEV
├── banner.png
├── header.psd
├── nexus5-detail-file.png
├── nexus5-detail-info.png
├── nexus5-main-menu_open.png
├── nexus5-main.png
├── nexus7-land-detail-info.png
├── nexus7-land-main-menu.png
├── nexus7-land-main.png
├── phone-detail-file-en.png
├── phone-detail-file-uk.png
├── phone-detail-file.png
├── phone-detail-info-en.png
├── phone-detail-info-uk.png
├── phone-detail-info.png
├── phone-main-menu-en.png
├── phone-main-menu-uk.png
├── phone-main-menu.png
├── phone-main.png
└── service icons.psd
├── README.md
├── _config.yml
├── anilab-android.iml
├── app
├── .gitignore
├── app.iml
├── build.gradle
├── fabric.properties
├── google-services.json
├── proguard-acra.pro
├── proguard-butterknife.pro
├── proguard-crashlytics.pro
├── proguard-glide.pro
├── proguard-google-analytics.pro
├── proguard-google-play-services.pro
├── proguard-gson.pro
├── proguard-parse.pro
├── proguard-project-test.pro
├── proguard-rules.pro
├── proguard-rx-java.pro
├── proguard-square-leakcanary.pro
├── proguard-square-okhttp.pro
├── proguard-square-otto.pro
├── proguard-square-picasso.pro
├── proguard-square-retrofit.pro
├── proguard-support-design.pro
├── proguard-support-v7-appcompat.pro
├── proguard-support-v7-cardview.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── xpyct
│ │ └── apps
│ │ └── anilab
│ │ └── ApplicationTest.java
│ └── main
│ ├── AndroidManifest.xml
│ ├── ic_launcher-web-114x114.png
│ ├── ic_launcher-web-128x128.png
│ ├── ic_launcher-web-32x32.png
│ ├── ic_launcher-web-64x64.png
│ ├── ic_launcher-web.png
│ ├── java
│ └── com
│ │ └── xpyct
│ │ └── apps
│ │ └── anilab
│ │ ├── AniLabApplication.java
│ │ ├── activities
│ │ ├── AbstractActivity.java
│ │ ├── DetailActivity.java
│ │ ├── MainActivity.java
│ │ ├── PreferenceActivity.java
│ │ ├── ScreenshotsActivity.java
│ │ ├── SearchResultActivity.java
│ │ └── VideoPlayerActivity.java
│ │ ├── adapters
│ │ ├── CommentAdapter.java
│ │ ├── FileAdapter.java
│ │ └── MovieAdapter.java
│ │ ├── fragments
│ │ ├── ChangelogDialogFragment.java
│ │ ├── DetailCommentsFragment.java
│ │ ├── DetailDescriptionFragment.java
│ │ ├── DetailFileFragment.java
│ │ └── MoviesFragment.java
│ │ ├── managers
│ │ ├── AppSuggestionProvider.java
│ │ ├── CircleTransform.java
│ │ ├── GlideConfiguration.java
│ │ ├── MediaIntents.java
│ │ ├── Utils.java
│ │ ├── other
│ │ │ └── LoaderDroidPublicAPI.java
│ │ └── updater
│ │ │ ├── CustomTagHandler.java
│ │ │ ├── DownloadApkTask.java
│ │ │ ├── IWVersionManager.java
│ │ │ ├── OnReceiveListener.java
│ │ │ └── WVersionManager.java
│ │ ├── models
│ │ ├── Comment.java
│ │ ├── Comments.java
│ │ ├── File.java
│ │ ├── Images.java
│ │ ├── Info.java
│ │ ├── InfoItem.java
│ │ ├── Movie.java
│ │ ├── MovieFull.java
│ │ ├── MovieList.java
│ │ ├── ParseLink.java
│ │ ├── VideoService.java
│ │ ├── myvi
│ │ │ ├── MyviFile.java
│ │ │ ├── Playlist.java
│ │ │ ├── SprutoData.java
│ │ │ └── Video.java
│ │ ├── orm
│ │ │ ├── Favorites.java
│ │ │ └── Watched.java
│ │ └── vk
│ │ │ └── VkFile.java
│ │ ├── network
│ │ ├── AnilabApi.java
│ │ ├── ApiConstants.java
│ │ ├── MyviApi.java
│ │ └── VkApi.java
│ │ ├── services
│ │ ├── MyFirebaseInstanceIdService.java
│ │ └── MyFirebaseMessagingService.java
│ │ └── views
│ │ ├── CustomAnimatorListener.java
│ │ ├── EndlessRecyclerOnScrollListener.java
│ │ ├── OnItemClickListener.java
│ │ ├── RecyclerInsetsDecoration.java
│ │ └── ScreenshotsViewPager.java
│ └── res
│ ├── anim
│ ├── fade_in.xml
│ ├── fade_out.xml
│ ├── slide_fade_in_right.xml
│ ├── slide_fade_out_right.xml
│ ├── slide_in_right.xml
│ └── slide_out_right.xml
│ ├── drawable-hdpi-v11
│ └── ic_notice.png
│ ├── drawable-hdpi-v9
│ └── ic_notice.png
│ ├── drawable-hdpi
│ ├── ic_favorite_white_24dp.png
│ ├── ic_more_vert_white_24dp.png
│ └── ic_notice.png
│ ├── drawable-mdpi-v11
│ └── ic_notice.png
│ ├── drawable-mdpi-v9
│ └── ic_notice.png
│ ├── drawable-mdpi
│ ├── ic_favorite_white_24dp.png
│ ├── ic_more_vert_white_24dp.png
│ └── ic_notice.png
│ ├── drawable-xhdpi-v11
│ └── ic_notice.png
│ ├── drawable-xhdpi-v9
│ └── ic_notice.png
│ ├── drawable-xhdpi
│ ├── ic_favorite_white_24dp.png
│ ├── ic_more_vert_white_24dp.png
│ └── ic_notice.png
│ ├── drawable-xxhdpi-v11
│ └── ic_notice.png
│ ├── drawable-xxhdpi-v9
│ └── ic_notice.png
│ ├── drawable-xxhdpi
│ ├── ic_favorite_white_24dp.png
│ ├── ic_more_vert_white_24dp.png
│ └── ic_notice.png
│ ├── drawable
│ ├── circle.xml
│ ├── header.jpg
│ ├── profile_anidub.png
│ ├── profile_animeland.png
│ ├── profile_animelend.png
│ ├── profile_animespirit.png
│ └── profile_anistar.png
│ ├── layout-v14
│ ├── changelogrow.xml
│ └── changelogrowheader.xml
│ ├── layout
│ ├── activity_detail.xml
│ ├── activity_main.xml
│ ├── activity_screenshots.xml
│ ├── activity_search_result.xml
│ ├── activity_videoplayer.xml
│ ├── changelog_fragment_dialog.xml
│ ├── changelogrow.xml
│ ├── changelogrowheader.xml
│ ├── drawer_header.xml
│ ├── fragment_detail_comments.xml
│ ├── fragment_detail_comments_item.xml
│ ├── fragment_detail_description.xml
│ ├── fragment_detail_files.xml
│ ├── fragment_detail_files_item.xml
│ ├── fragment_movies.xml
│ ├── fragment_movies_item.xml
│ ├── preference_activity_custom.xml
│ └── toolbar.xml
│ ├── menu
│ ├── menu_detail.xml
│ ├── menu_files.xml
│ ├── menu_main.xml
│ ├── menu_movies.xml
│ └── menu_screenshots.xml
│ ├── mipmap-hdpi
│ └── ic_launcher.png
│ ├── mipmap-mdpi
│ └── ic_launcher.png
│ ├── mipmap-xhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxhdpi
│ └── ic_launcher.png
│ ├── mipmap-xxxhdpi
│ └── ic_launcher.png
│ ├── raw
│ └── changelog.xml
│ ├── values-ru
│ └── strings.xml
│ ├── values-sw600dp-land
│ └── dimens.xml
│ ├── values-uk
│ └── strings.xml
│ ├── values-v21
│ ├── dimens.xml
│ └── styles.xml
│ ├── values-w820dp
│ └── dimens.xml
│ ├── values
│ ├── arrays.xml
│ ├── colors.xml
│ ├── dimens.xml
│ ├── integers.xml
│ ├── strings.xml
│ └── styles.xml
│ └── xml
│ ├── preferences.xml
│ └── searchable.xml
├── build.gradle
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | .gradle
2 | /local.properties
3 | .idea
4 | .DS_Store
5 | /build
6 | /captures
7 | *.apk
8 |
--------------------------------------------------------------------------------
/AniLab.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/DEV/banner.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/banner.png
--------------------------------------------------------------------------------
/DEV/header.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/header.psd
--------------------------------------------------------------------------------
/DEV/nexus5-detail-file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus5-detail-file.png
--------------------------------------------------------------------------------
/DEV/nexus5-detail-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus5-detail-info.png
--------------------------------------------------------------------------------
/DEV/nexus5-main-menu_open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus5-main-menu_open.png
--------------------------------------------------------------------------------
/DEV/nexus5-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus5-main.png
--------------------------------------------------------------------------------
/DEV/nexus7-land-detail-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus7-land-detail-info.png
--------------------------------------------------------------------------------
/DEV/nexus7-land-main-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus7-land-main-menu.png
--------------------------------------------------------------------------------
/DEV/nexus7-land-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/nexus7-land-main.png
--------------------------------------------------------------------------------
/DEV/phone-detail-file-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-file-en.png
--------------------------------------------------------------------------------
/DEV/phone-detail-file-uk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-file-uk.png
--------------------------------------------------------------------------------
/DEV/phone-detail-file.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-file.png
--------------------------------------------------------------------------------
/DEV/phone-detail-info-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-info-en.png
--------------------------------------------------------------------------------
/DEV/phone-detail-info-uk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-info-uk.png
--------------------------------------------------------------------------------
/DEV/phone-detail-info.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-detail-info.png
--------------------------------------------------------------------------------
/DEV/phone-main-menu-en.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-main-menu-en.png
--------------------------------------------------------------------------------
/DEV/phone-main-menu-uk.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-main-menu-uk.png
--------------------------------------------------------------------------------
/DEV/phone-main-menu.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-main-menu.png
--------------------------------------------------------------------------------
/DEV/phone-main.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/phone-main.png
--------------------------------------------------------------------------------
/DEV/service icons.psd:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/DEV/service icons.psd
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Anilab Online
2 |
3 | Просмотр и скачивание аниме по жанрам, даберам и годам. [Тема на форуме](http://4pda.ru/forum/index.php?showtopic=681235)
4 |
5 | * Позволяет просматривать или скачивать аниме с сервисов AniStar, AniDub, AnimeSpirit
6 | * Просмотр аниме с vk, 24video, sibnet, kivvi, myvi, moonwalk, anidub, youtube, rutube (только при наличии их приложения)
7 | * Фильтрация по годам, жанрам и даберам
8 | * Возможность получение и скачивание по прямой ссылке(если это является возможным).
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-minimal
--------------------------------------------------------------------------------
/anilab-android.iml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/app/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app/build.gradle:
--------------------------------------------------------------------------------
1 | buildscript {
2 | repositories {
3 | maven { url 'https://maven.fabric.io/public' }
4 | }
5 |
6 | dependencies {
7 | classpath 'io.fabric.tools:gradle:1.21.6'
8 | }
9 | }
10 | apply plugin: 'com.android.application'
11 | apply plugin: 'io.fabric'
12 |
13 | repositories {
14 | maven { url "http://dl.bintray.com/drummer-aidan/maven" } //com.afollestad:easyvideoplayer
15 | maven { url 'https://maven.fabric.io/public' }
16 | maven { url "https://jitpack.io" }
17 | }
18 |
19 |
20 | android {
21 | compileSdkVersion 24
22 | buildToolsVersion "24"
23 |
24 | defaultConfig {
25 | applicationId "com.xpyct.apps.anilab"
26 | try {
27 | minSdkVersion Integer.parseInt(ANDROID_BUILD_MIN_SDK_VERSION)
28 | targetSdkVersion Integer.parseInt(ANDROID_BUILD_TARGET_SDK_VERSION)
29 | versionCode Integer.parseInt(VERSION_CODE)
30 | versionName VERSION_NAME
31 | }
32 | catch (ignored) {
33 | throw new InvalidUserDataException("You should define ANDROID_BUILD_MIN_SDK_VERSION,ANDROID_BUILD_TARGET_SDK_VERSION,VERSION_CODE and VERSION_NAME in gradle.properties.")
34 | }
35 | }
36 | signingConfigs {
37 | release {
38 | storeFile file("anilab_keystore.jks")
39 | storePassword KEYSTORE_PASS
40 | keyAlias KEYSTORE_ALIAS
41 | keyPassword KEYSTORE_PASS
42 | }
43 | }
44 |
45 | buildTypes {
46 | debug {
47 | debuggable true
48 | minifyEnabled false
49 |
50 | //applicationIdSuffix ".debug"
51 | }
52 | release {
53 | signingConfig signingConfigs.release
54 | debuggable false
55 | minifyEnabled true
56 |
57 | proguardFile 'proguard-support-v7-cardview.pro'
58 | proguardFile 'proguard-support-v7-appcompat.pro'
59 | proguardFile 'proguard-support-design.pro'
60 | proguardFile 'proguard-butterknife.pro'
61 | proguardFile 'proguard-google-analytics.pro'
62 | proguardFile 'proguard-google-play-services.pro'
63 | proguardFile 'proguard-gson.pro'
64 | proguardFile 'proguard-parse.pro'
65 | proguardFile 'proguard-glide.pro'
66 | proguardFile 'proguard-rx-java.pro'
67 | proguardFile 'proguard-square-okhttp.pro'
68 | proguardFile 'proguard-square-otto.pro'
69 | proguardFile 'proguard-square-retrofit.pro'
70 | proguardFile 'proguard-square-leakcanary.pro'
71 | proguardFile 'proguard-rules.pro'
72 | proguardFile getDefaultProguardFile('proguard-android.txt')
73 | testProguardFile 'proguard-project-test.pro'
74 | }
75 | }
76 | lintOptions {
77 | checkReleaseBuilds false
78 | abortOnError false
79 | disable 'InvalidPackage'
80 | }
81 | /*dexOptions {
82 | jumboMode = true
83 | }*/
84 | }
85 |
86 | dependencies {
87 | compile fileTree(dir: 'libs', include: ['*.jar'])
88 | compile 'com.android.support:appcompat-v7:24.1.1'
89 | compile 'com.android.support:design:24.1.1'
90 | compile 'com.android.support:support-v4:24.1.1'
91 | compile 'com.android.support:cardview-v7:24.1.1'
92 | compile 'com.android.support:recyclerview-v7:24.1.1'
93 |
94 | compile 'com.squareup.okhttp:okhttp:2.7.0'
95 | compile 'com.squareup.okhttp:okhttp-urlconnection:2.7.0'
96 | compile 'com.squareup.retrofit:retrofit:1.9.0'
97 |
98 | compile 'com.github.bumptech.glide:okhttp-integration:1.3.1'
99 | compile 'com.github.bumptech.glide:glide:3.7.0'
100 | compile 'com.github.chrisbanes:PhotoView:1.2.6'
101 |
102 | compile 'com.jakewharton:butterknife:7.0.1'
103 | compile 'com.flaviofaria:kenburnsview:1.0.7'
104 | compile 'com.github.xiprox.errorview:library:2.2.0'
105 | compile 'com.afollestad.material-dialogs:core:0.8.6.1'
106 | compile 'com.afollestad.material-dialogs:commons:0.8.6.1'
107 |
108 | compile 'io.reactivex:rxandroid:0.25.0'
109 | compile 'com.github.gabrielemariotti.changeloglib:changelog:2.1.0'
110 |
111 | compile 'com.github.satyan:sugar:b16e65326a' //compile 'com.github.satyan:sugar:1.5'
112 |
113 | compile('com.mikepenz:materialdrawer:5.3.2@aar') {
114 | transitive = true
115 | }
116 | compile 'com.mikepenz:fontawesome-typeface:4.6.0.1@aar'
117 |
118 | compile('com.crashlytics.sdk.android:crashlytics:2.6.0@aar') {
119 | transitive = true;
120 | }
121 |
122 | compile 'com.google.firebase:firebase-analytics:9.0.0'
123 | compile 'com.google.firebase:firebase-messaging:9.0.0'
124 |
125 | compile 'com.afollestad:easyvideoplayer:0.2.9'
126 | }
127 |
128 | apply plugin: 'com.google.gms.google-services'
129 |
--------------------------------------------------------------------------------
/app/fabric.properties:
--------------------------------------------------------------------------------
1 | #Contains API Secret used to validate your application. Commit to internal source control; avoid making secret public.
2 | #Thu Jul 23 23:39:34 EEST 2015
3 | apiSecret=2201b2db2de3d3fef3e419fbc1f23e13ce73e7d7e028c1f284c4eb8e511872b5
4 |
--------------------------------------------------------------------------------
/app/google-services.json:
--------------------------------------------------------------------------------
1 | {}
2 |
--------------------------------------------------------------------------------
/app/proguard-acra.pro:
--------------------------------------------------------------------------------
1 | ## ACRA 4.5.0 specific rules ##
2 |
3 | # we need line numbers in our stack traces otherwise they are pretty useless
4 | -renamesourcefileattribute SourceFile
5 | -keepattributes SourceFile,LineNumberTable
6 |
7 | # ACRA needs "annotations" so add this...
8 | -keepattributes *Annotation*
9 |
10 | # keep this class so that logging will show 'ACRA' and not a obfuscated name like 'a'.
11 | # Note: if you are removing log messages elsewhere in this file then this isn't necessary
12 | -keep class org.acra.ACRA {
13 | *;
14 | }
15 |
16 | # keep this around for some enums that ACRA needs
17 | -keep class org.acra.ReportingInteractionMode {
18 | *;
19 | }
20 |
21 | -keepnames class org.acra.sender.HttpSender$** {
22 | *;
23 | }
24 |
25 | -keepnames class org.acra.ReportField {
26 | *;
27 | }
28 |
29 | # keep this otherwise it is removed by ProGuard
30 | -keep public class org.acra.ErrorReporter {
31 | public void addCustomData(java.lang.String,java.lang.String);
32 | public void putCustomData(java.lang.String,java.lang.String);
33 | public void removeCustomData(java.lang.String);
34 | }
35 |
36 | # keep this otherwise it is removed by ProGuard
37 | -keep public class org.acra.ErrorReporter {
38 | public void handleSilentException(java.lang.Throwable);
39 | }
40 |
41 | # Keep the support library
42 | -keep class org.acra.** { *; }
43 | -keep interface org.acra.** { *; }
--------------------------------------------------------------------------------
/app/proguard-butterknife.pro:
--------------------------------------------------------------------------------
1 | # Butterknife 7.x spesific rules #
2 | # https://github.com/JakeWharton/butterknife/ #
3 | -keep class butterknife.** { *; }
4 | -dontwarn butterknife.internal.**
5 | -keep class **$$ViewInjector { *; }
6 | -keep class **$$ViewBinder { *; }
7 | -keepclasseswithmembernames class * {
8 | @butterknife.* ;
9 | }
10 |
11 | -keepclasseswithmembernames class * {
12 | @butterknife.* ;
13 | }
--------------------------------------------------------------------------------
/app/proguard-crashlytics.pro:
--------------------------------------------------------------------------------
1 | # Crashlytics 1.+
2 | -keep class com.crashlytics.** { *; }
3 | -dontwarn com.crashlytics.**
4 | -keepattributes SourceFile,LineNumberTable
--------------------------------------------------------------------------------
/app/proguard-glide.pro:
--------------------------------------------------------------------------------
1 | # Glide specific rules #
2 | # https://github.com/bumptech/glide
3 |
4 | -keep public class * implements com.bumptech.glide.module.GlideModule
5 | -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
6 | **[] $VALUES;
7 | public *;
8 | }
9 | -keep public class * implements com.bumptech.glide.module.GlideModule
--------------------------------------------------------------------------------
/app/proguard-google-analytics.pro:
--------------------------------------------------------------------------------
1 | ## Google Analytics 3.0 specific rules ##
2 |
3 | -keep class com.google.analytics.** { *; }
4 |
5 | -keep public class com.google.android.gms.**
6 | -dontwarn com.google.android.gms.**
--------------------------------------------------------------------------------
/app/proguard-google-play-services.pro:
--------------------------------------------------------------------------------
1 | ## Google Play Services 4.3.23 specific rules ##
2 | ## https://developer.android.com/google/play-services/setup.html#Proguard ##
3 |
4 | -keep class * extends java.util.ListResourceBundle {
5 | protected Object[][] getContents();
6 | }
7 |
8 | -keep public class com.google.android.gms.common.internal.safeparcel.SafeParcelable {
9 | public static final *** NULL;
10 | }
11 |
12 | -keepnames @com.google.android.gms.common.annotation.KeepName class *
13 | -keepclassmembernames class * {
14 | @com.google.android.gms.common.annotation.KeepName *;
15 | }
16 |
17 | -keepnames class * implements android.os.Parcelable {
18 | public static final ** CREATOR;
19 | }
--------------------------------------------------------------------------------
/app/proguard-gson.pro:
--------------------------------------------------------------------------------
1 | ## GSON 2.2.4 specific rules ##
2 |
3 | # Gson uses generic type information stored in a class file when working with fields. Proguard
4 | # removes such information by default, so configure it to keep all of it.
5 | -keepattributes Signature
6 |
7 | # For using GSON @Expose annotation
8 | -keepattributes *Annotation*
9 |
10 | -keepattributes EnclosingMethod
11 |
12 | # Gson specific classes
13 | -keep class sun.misc.Unsafe { *; }
14 | -keep class com.google.gson.stream.** { *; }
--------------------------------------------------------------------------------
/app/proguard-parse.pro:
--------------------------------------------------------------------------------
1 | # Parse
2 | -dontwarn com.parse.**
3 | -keep class com.parse.** { *; }
--------------------------------------------------------------------------------
/app/proguard-project-test.pro:
--------------------------------------------------------------------------------
1 | # Proguard rules run against the test module (split since Gradle plugin v 1.1.0)
2 | -dontobfuscate
3 | -ignorewarnings
4 |
5 | # Specific classes that common test libs warn about
6 | -dontwarn java.beans.**
7 | -dontwarn javax.lang.model.element.Modifier
8 | -dontwarn org.apache.tools.ant.**
9 | -dontwarn org.assertj.core.internal.cglib.asm.util.TraceClassVisitor
10 | -dontwarn org.easymock.**
11 | -dontwarn org.jmock.core.**
12 | -dontwarn org.w3c.dom.bootstrap.**
13 | -dontwarn sun.misc.Unsafe
14 | -dontwarn sun.reflect.**
--------------------------------------------------------------------------------
/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 /home/xpyct/Android/Sdk/tools/proguard/proguard-android.txt
4 | # You can edit the include path and order by changing the proguardFiles
5 | # directive in build.gradle.
6 | #
7 | # For more details, see
8 | # http://developer.android.com/guide/developing/tools/proguard.html
9 |
10 | # Add any project specific keep options here:
11 |
12 | # If your project uses WebView with JS, uncomment the following
13 | # and specify the fully qualified class name to the JavaScript interface
14 | # class:
15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16 | # public *;
17 | #}
18 |
19 | ## --------------- Start Project specifics --------------- ##
20 | -useuniqueclassmembernames
21 | -keepattributes SourceFile,LineNumberTable
22 |
23 | # Keep the BuildConfig
24 | -keep class com.xpyct.apps.anilab.BuildConfig { *; }
25 |
26 | # Keep the support library
27 | -keep class android.support.v4.** { *; }
28 | -keep interface android.support.v4.** { *; }
29 |
30 | # Application classes that will be serialized/deserialized over Gson
31 | # or have been blown up by ProGuard in the past
32 | -keep public class * implements com.bumptech.glide.module.GlideModule
33 |
34 | # Ignore warnings: https://github.com/square/okhttp/wiki/FAQs
35 | -dontwarn com.squareup.okhttp.internal.huc.**
36 | # Ignore warnings: https://github.com/square/retrofit/issues/435
37 | -dontwarn com.google.appengine.api.urlfetch.**
38 |
39 | -dontwarn javax.annotation.**
40 | -dontwarn javax.inject.**
41 | -dontwarn sun.misc.Unsafe
42 |
43 | # Keep the pojos used by GSON or Jackson
44 | -keep class com.xpyct.apps.anilab.models.** { *; }
45 |
46 | # about libraries
47 | -keep class .R
48 | -keep class **.R$* {
49 | ;
50 | }
51 |
52 | ## ---------------- End Project specifics ---------------- ##
53 |
--------------------------------------------------------------------------------
/app/proguard-rx-java.pro:
--------------------------------------------------------------------------------
1 | # RxJava 0.21
2 |
3 | -keep class rx.schedulers.Schedulers {
4 | public static ;
5 | }
6 | -keep class rx.schedulers.ImmediateScheduler {
7 | public ;
8 | }
9 | -keep class rx.schedulers.TestScheduler {
10 | public ;
11 | }
12 | -keep class rx.schedulers.Schedulers {
13 | public static ** test();
14 | }
15 |
16 | #RxAndroid
17 | -keep class rx.operators.OperationReplay* {
18 | *;
19 | }
20 | -keep class rx.Observer* {
21 | *;
22 | }
--------------------------------------------------------------------------------
/app/proguard-square-leakcanary.pro:
--------------------------------------------------------------------------------
1 | # Squareup LeakCanary
2 | # https://github.com/square/leakcanary/issues/132
3 | -keep class org.eclipse.mat.** { *; }
4 | -keep class com.squareup.leakcanary.** { *; }
--------------------------------------------------------------------------------
/app/proguard-square-okhttp.pro:
--------------------------------------------------------------------------------
1 | # OkHttp
2 | -keepattributes Signature
3 | -keepattributes *Annotation*
4 | -keep class com.squareup.okhttp.** { *; }
5 | -keep interface com.squareup.okhttp.** { *; }
6 | -dontwarn com.squareup.okhttp.**
--------------------------------------------------------------------------------
/app/proguard-square-otto.pro:
--------------------------------------------------------------------------------
1 | ## Square Otto specific rules ##
2 | ## https://square.github.io/otto/ ##
3 |
4 | -keepclassmembers class ** {
5 | @com.squareup.otto.Subscribe public *;
6 | @com.squareup.otto.Produce public *;
7 | }
--------------------------------------------------------------------------------
/app/proguard-square-picasso.pro:
--------------------------------------------------------------------------------
1 | ## Square Picasso specific rules ##
2 | ## https://square.github.io/picasso/ ##
3 |
4 | -dontwarn com.squareup.okhttp.**
--------------------------------------------------------------------------------
/app/proguard-square-retrofit.pro:
--------------------------------------------------------------------------------
1 | -keep class com.squareup.okhttp.** { *; }
2 | -keep interface com.squareup.okhttp.** { *; }
3 | -dontwarn com.squareup.okhttp.**
4 |
5 | -dontwarn rx.**
6 | -dontwarn retrofit.**
7 | -dontwarn okio.**
8 | -keep class retrofit.** { *; }
9 | -keepclasseswithmembers class * {
10 | @retrofit.http.* ;
11 | }
--------------------------------------------------------------------------------
/app/proguard-support-design.pro:
--------------------------------------------------------------------------------
1 | # http://stackoverflow.com/questions/30768094/android-design-support-library-proguard-rules
2 | -dontwarn android.support.design.**
3 | -keep class android.support.design.** { *; }
4 | -keep interface android.support.design.** { *; }
5 | -keep public class android.support.design.R$* { *; }
6 |
7 | -keep public class * extends android.support.design.widget.CoordinatorLayout$Behavior {
8 | public (android.content.Context, android.util.AttributeSet);
9 | }
--------------------------------------------------------------------------------
/app/proguard-support-v7-appcompat.pro:
--------------------------------------------------------------------------------
1 | -keep public class android.support.v7.widget.** { *; }
2 | -keep public class android.support.v7.internal.widget.** { *; }
3 | -keep public class android.support.v7.internal.view.menu.** { *; }
4 |
5 | -keep public class * extends android.support.v4.view.ActionProvider {
6 | public (android.content.Context);
7 | }
--------------------------------------------------------------------------------
/app/proguard-support-v7-cardview.pro:
--------------------------------------------------------------------------------
1 | # http://stackoverflow.com/questions/29679177/cardview-shadow-not-appearing-in-lollipop-after-obfuscate-with-proguard/29698051
2 | -keep class android.support.v7.widget.RoundRectDrawable { *; }
--------------------------------------------------------------------------------
/app/src/androidTest/java/com/xpyct/apps/anilab/ApplicationTest.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab;
2 |
3 | import android.app.Application;
4 | import android.test.ApplicationTestCase;
5 |
6 | /**
7 | * Testing Fundamentals
8 | */
9 | public class ApplicationTest extends ApplicationTestCase {
10 | public ApplicationTest() {
11 | super(Application.class);
12 | }
13 | }
--------------------------------------------------------------------------------
/app/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
22 |
23 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
38 |
39 |
40 |
43 |
49 |
50 |
51 |
52 |
55 |
56 |
59 |
65 |
68 |
69 |
72 |
76 |
77 |
80 |
83 |
84 |
88 |
91 |
92 |
93 |
96 |
97 |
100 |
103 |
106 |
109 |
110 |
113 |
114 |
117 |
120 |
123 |
126 |
129 |
130 |
133 |
134 |
137 |
138 |
139 |
140 |
141 |
142 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web-114x114.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/app/src/main/ic_launcher-web-114x114.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web-128x128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/app/src/main/ic_launcher-web-128x128.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web-32x32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/app/src/main/ic_launcher-web-32x32.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web-64x64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/app/src/main/ic_launcher-web-64x64.png
--------------------------------------------------------------------------------
/app/src/main/ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/XpycT/anilab-android/5ee0f9412abab2bcb29f3e5b2cc599412e695538/app/src/main/ic_launcher-web.png
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/AniLabApplication.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab;
2 |
3 | import android.app.Application;
4 | import android.content.Context;
5 | import android.content.SharedPreferences;
6 | import android.graphics.drawable.Drawable;
7 | import android.net.Uri;
8 | import android.preference.PreferenceManager;
9 | import android.widget.ImageView;
10 |
11 | import com.bumptech.glide.Glide;
12 | import com.crashlytics.android.Crashlytics;
13 | import com.mikepenz.iconics.IconicsDrawable;
14 | import com.mikepenz.materialdrawer.util.AbstractDrawerImageLoader;
15 | import com.mikepenz.materialdrawer.util.DrawerImageLoader;
16 | import com.mikepenz.materialdrawer.util.DrawerUIUtils;
17 | import com.orm.SugarContext;
18 |
19 | import io.fabric.sdk.android.Fabric;
20 |
21 | public class AniLabApplication extends Application {
22 | private static Context context;
23 |
24 | public static final String THEME_LIGHT = "2";
25 | public static final String THEME_DARK = "1";
26 |
27 | private static AniLabApplication INSTANCE = null;
28 |
29 | private SharedPreferences prefs;
30 |
31 | public static Context getContext() {
32 | return context;
33 | }
34 |
35 |
36 | public int getThemeStyleResID() {
37 | int theme = R.style.AppTheme_Dark;
38 | String color = prefs.getString("theme", THEME_DARK);
39 | switch (color) {
40 | case THEME_DARK:
41 | theme = R.style.AppTheme_Dark;
42 | break;
43 | case THEME_LIGHT:
44 | theme = R.style.AppTheme_Light;
45 | break;
46 | }
47 |
48 | return theme;
49 | }
50 |
51 | @Override
52 | public void onCreate() {
53 | super.onCreate();
54 | Fabric.with(this, new Crashlytics());
55 | SugarContext.init(this);
56 |
57 | context = getApplicationContext();
58 | prefs = PreferenceManager.getDefaultSharedPreferences(this);
59 | setTheme(getThemeStyleResID());
60 |
61 | //initialize and create the image loader logic
62 | DrawerImageLoader.init(new AbstractDrawerImageLoader() {
63 | @Override
64 | public void set(ImageView imageView, Uri uri, Drawable placeholder) {
65 | Glide.with(imageView.getContext()).load(uri).placeholder(placeholder).into(imageView);
66 | }
67 |
68 | @Override
69 | public void cancel(ImageView imageView) {
70 | Glide.clear(imageView);
71 | }
72 |
73 | @Override
74 | public Drawable placeholder(Context ctx, String tag) {
75 | //define different placeholders for different imageView targets
76 | //default tags are accessible via the DrawerImageLoader.Tags
77 | //custom ones can be checked via string. see the CustomUrlBasePrimaryDrawerItem LINE 111
78 | if (DrawerImageLoader.Tags.PROFILE.name().equals(tag)) {
79 | return DrawerUIUtils.getPlaceHolder(ctx);
80 | } else if (DrawerImageLoader.Tags.ACCOUNT_HEADER.name().equals(tag)) {
81 | return new IconicsDrawable(ctx).iconText(" ").backgroundColorRes(com.mikepenz.materialdrawer.R.color.primary).sizeDp(56);
82 | } else if ("customUrlItem".equals(tag)) {
83 | return new IconicsDrawable(ctx).iconText(" ").backgroundColorRes(R.color.md_red_500).sizeDp(56);
84 | }
85 |
86 | //we use the default one for
87 | //DrawerImageLoader.Tags.PROFILE_DRAWER_ITEM.name()
88 |
89 | return super.placeholder(ctx, tag);
90 | }
91 | });
92 | }
93 |
94 |
95 |
96 | public AniLabApplication() {
97 | INSTANCE = this;
98 | }
99 |
100 | public static AniLabApplication getInstance() {
101 | if (INSTANCE == null) {
102 | INSTANCE = new AniLabApplication();
103 |
104 | }
105 | return INSTANCE;
106 | }
107 |
108 | @Override
109 | protected void attachBaseContext(Context base) {
110 | super.attachBaseContext(base);
111 | }
112 |
113 | @Override
114 | public void onTerminate() {
115 | super.onTerminate();
116 | SugarContext.terminate();
117 | }
118 | }
119 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/activities/AbstractActivity.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.activities;
2 |
3 | import android.content.Intent;
4 | import android.content.SharedPreferences;
5 | import android.os.Build;
6 | import android.os.Bundle;
7 | import android.preference.PreferenceManager;
8 | import android.support.v7.app.AppCompatActivity;
9 | import android.util.Log;
10 | import android.view.WindowManager;
11 |
12 | import com.google.firebase.analytics.FirebaseAnalytics;
13 | import com.xpyct.apps.anilab.AniLabApplication;
14 | import com.xpyct.apps.anilab.R;
15 | import com.xpyct.apps.anilab.managers.Utils;
16 |
17 | public class AbstractActivity extends AppCompatActivity {
18 |
19 | public static final String KEEP_SCREEN = "keep_screen";
20 | SharedPreferences pref;
21 | FirebaseAnalytics mFirebaseAnalytics;
22 |
23 | @Override
24 | protected void onCreate(Bundle savedInstanceState) {
25 | setTheme(AniLabApplication.getInstance().getThemeStyleResID());
26 | super.onCreate(savedInstanceState);
27 | mFirebaseAnalytics = FirebaseAnalytics.getInstance(this);
28 | pref = PreferenceManager.getDefaultSharedPreferences(this);
29 | initKeepScreenOn();
30 | Utils.checkForUpdates(this,true);
31 | }
32 |
33 | /**
34 | * Keep screen On or Off
35 | */
36 | private void initKeepScreenOn() {
37 | if (pref.getBoolean(KEEP_SCREEN, false)) {
38 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
39 | } else {
40 | getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
41 | }
42 | }
43 |
44 | @Override
45 | protected void onStart() {
46 | super.onStart();
47 | }
48 |
49 | @Override
50 | protected void onResume() {
51 | initKeepScreenOn();
52 | super.onResume();
53 | }
54 | @Override
55 | protected void onDestroy() {
56 | super.onDestroy();
57 | }
58 |
59 | // Backwards compatible recreate().
60 | @Override
61 | public void recreate()
62 | {
63 | if (Build.VERSION.SDK_INT >= 11)
64 | {
65 | super.recreate();
66 | }
67 | else
68 | {
69 | startActivity(getIntent());
70 | finish();
71 | }
72 | }
73 |
74 | @Override
75 | protected void onActivityResult(int requestCode, int resultCode, Intent data) { }
76 |
77 |
78 | }
79 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/activities/ScreenshotsActivity.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.activities;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.support.annotation.NonNull;
6 | import android.support.v4.view.PagerAdapter;
7 | import android.support.v4.view.ViewPager;
8 | import android.view.Menu;
9 | import android.view.MenuItem;
10 | import android.view.View;
11 | import android.view.ViewGroup;
12 | import android.view.ViewGroup.LayoutParams;
13 | import android.view.Window;
14 | import android.view.WindowManager;
15 |
16 | import com.bumptech.glide.Glide;
17 | import com.xpyct.apps.anilab.R;
18 | import com.xpyct.apps.anilab.models.Movie;
19 | import com.xpyct.apps.anilab.views.ScreenshotsViewPager;
20 |
21 | import butterknife.Bind;
22 | import butterknife.ButterKnife;
23 | import uk.co.senab.photoview.PhotoView;
24 |
25 | public class ScreenshotsActivity extends AbstractActivity {
26 |
27 | private static final String ISLOCKED_ARG = "isLocked";
28 | public static final String INDEX = "index";
29 | public static final String SELECTED_MOVIE = "selected_movie";
30 |
31 | @Bind(R.id.view_pager)
32 | ViewPager mViewPager;
33 |
34 | Movie movie = null;
35 | int index;
36 |
37 | @Override
38 | protected void onCreate(Bundle savedInstanceState) {
39 | requestWindowFeature(Window.FEATURE_NO_TITLE);
40 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
41 | WindowManager.LayoutParams.FLAG_FULLSCREEN);
42 | super.onCreate(savedInstanceState);
43 | setContentView(R.layout.activity_screenshots);
44 | ButterKnife.bind(this);
45 |
46 | Intent intent = getIntent();
47 | movie = (Movie) intent.getSerializableExtra(SELECTED_MOVIE);
48 | index = intent.getIntExtra(INDEX, 0);
49 |
50 | setContentView(mViewPager);
51 | mViewPager.setAdapter(new SamplePagerAdapter(movie));
52 | mViewPager.setCurrentItem(index);
53 | if (savedInstanceState != null) {
54 | boolean isLocked = savedInstanceState.getBoolean(ISLOCKED_ARG, false);
55 | ((ScreenshotsViewPager) mViewPager).setLocked(isLocked);
56 | }
57 | }
58 |
59 | @Override
60 | public boolean onCreateOptionsMenu(Menu menu) {
61 | // Inflate the menu; this adds items to the action bar if it is present.
62 | getMenuInflater().inflate(R.menu.menu_screenshots, menu);
63 | return true;
64 | }
65 |
66 | @Override
67 | public boolean onOptionsItemSelected(MenuItem item) {
68 | // Handle action bar item clicks here. The action bar will
69 | // automatically handle clicks on the Home/Up button, so long
70 | // as you specify a parent activity in AndroidManifest.xml.
71 | int id = item.getItemId();
72 |
73 | //noinspection SimplifiableIfStatement
74 | if (id == R.id.action_settings) {
75 | return true;
76 | }
77 |
78 | return super.onOptionsItemSelected(item);
79 | }
80 |
81 | private boolean isViewPagerActive() {
82 | return (mViewPager != null && mViewPager instanceof ScreenshotsViewPager);
83 | }
84 |
85 | @Override
86 | protected void onSaveInstanceState(@NonNull Bundle outState) {
87 | if (isViewPagerActive()) {
88 | outState.putBoolean(ISLOCKED_ARG, ((ScreenshotsViewPager) mViewPager).isLocked());
89 | }
90 | super.onSaveInstanceState(outState);
91 | }
92 |
93 | static class SamplePagerAdapter extends PagerAdapter {
94 |
95 | private Movie mMovie;
96 |
97 | public SamplePagerAdapter(Movie movie) {
98 | this.mMovie = movie;
99 | }
100 |
101 | @Override
102 | public int getCount() {
103 | return mMovie.getInfo().getScreenshots().toArray().length;
104 | }
105 |
106 | @Override
107 | public View instantiateItem(ViewGroup container, int position) {
108 | PhotoView photoView = new PhotoView(container.getContext());
109 | Glide.with(container.getContext()).load(mMovie.getInfo().getScreenshots().get(position).getOriginal()).asBitmap().into(photoView);
110 | //photoView.setImageResource(sDrawables[position]);
111 |
112 | // Now just add PhotoView to ViewPager and return it
113 | container.addView(photoView, LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT);
114 |
115 | return photoView;
116 | }
117 |
118 | @Override
119 | public void destroyItem(ViewGroup container, int position, Object object) {
120 | container.removeView((View) object);
121 | }
122 |
123 | @Override
124 | public boolean isViewFromObject(View view, Object object) {
125 | return view == object;
126 | }
127 |
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/activities/VideoPlayerActivity.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.activities;
2 |
3 |
4 | import android.net.Uri;
5 | import android.os.Bundle;
6 | import android.util.Log;
7 | import android.widget.Toast;
8 |
9 | import com.afollestad.easyvideoplayer.EasyVideoCallback;
10 | import com.afollestad.easyvideoplayer.EasyVideoPlayer;
11 | import com.afollestad.materialdialogs.MaterialDialog;
12 | import com.xpyct.apps.anilab.R;
13 |
14 | import butterknife.Bind;
15 | import butterknife.ButterKnife;
16 |
17 | public class VideoPlayerActivity extends AbstractActivity implements EasyVideoCallback {
18 |
19 | public static final String TITLE = "title";
20 | public static final String URI = "uri";
21 |
22 | @Bind(R.id.player)
23 | EasyVideoPlayer player;
24 |
25 | private String mTitle;
26 | private String mUri;
27 |
28 | @Override
29 | protected void onCreate(Bundle savedInstanceState) {
30 | super.onCreate(savedInstanceState);
31 | setContentView(R.layout.activity_videoplayer);
32 | ButterKnife.bind(this);
33 |
34 | assert player != null;
35 |
36 | mTitle = getIntent().getStringExtra(TITLE);
37 | mUri = getIntent().getStringExtra(URI);
38 |
39 | initInstances();
40 | }
41 |
42 | private void initInstances() {
43 | player.setCallback(this);
44 |
45 | // To play files, you can use Uri.fromFile(new File("..."))
46 | player.setSource(Uri.parse(mUri));
47 | setTitle(mTitle);
48 | player.setBottomLabelText(mTitle);
49 | }
50 |
51 | @Override
52 | protected void onPause() {
53 | super.onPause();
54 | player.pause();
55 | }
56 |
57 | @Override
58 | public void onStarted(EasyVideoPlayer player) {
59 |
60 | }
61 |
62 | @Override
63 | public void onPaused(EasyVideoPlayer player) {
64 |
65 | }
66 |
67 | @Override
68 | public void onPreparing(EasyVideoPlayer player) {
69 | Log.d("EVP-Sample", "onPreparing()");
70 | }
71 |
72 | @Override
73 | public void onPrepared(EasyVideoPlayer player) {
74 | Log.d("EVP-Sample", "onPrepared()");
75 | }
76 |
77 | @Override
78 | public void onBuffering(int percent) {
79 | Log.d("EVP-Sample", "onBuffering(): " + percent + "%");
80 | }
81 |
82 | @Override
83 | public void onError(EasyVideoPlayer player, Exception e) {
84 | Log.d("EVP-Sample", "onError(): " + e.getMessage());
85 | new MaterialDialog.Builder(this)
86 | .title(R.string.error)
87 | .content(e.getMessage())
88 | .positiveText(android.R.string.ok)
89 | .show();
90 | }
91 |
92 | @Override
93 | public void onCompletion(EasyVideoPlayer player) {
94 | Log.d("EVP-Sample", "onCompletion()");
95 | }
96 |
97 | @Override
98 | public void onRetry(EasyVideoPlayer player, Uri source) {
99 | Toast.makeText(this, "Retry", Toast.LENGTH_SHORT).show();
100 | }
101 |
102 | @Override
103 | public void onSubmit(EasyVideoPlayer player, Uri source) {
104 | Toast.makeText(this, "Submit", Toast.LENGTH_SHORT).show();
105 | }
106 | }
107 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/adapters/CommentAdapter.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.adapters;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.text.Html;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageView;
10 | import android.widget.TextView;
11 |
12 | import com.bumptech.glide.Glide;
13 | import com.bumptech.glide.load.engine.DiskCacheStrategy;
14 | import com.xpyct.apps.anilab.R;
15 | import com.xpyct.apps.anilab.managers.CircleTransform;
16 | import com.xpyct.apps.anilab.models.Comment;
17 |
18 | import java.util.ArrayList;
19 |
20 |
21 | public class CommentAdapter extends RecyclerView.Adapter {
22 |
23 | private Context mContext;
24 | private ArrayList mComments;
25 |
26 | public CommentAdapter() {
27 | mComments = new ArrayList<>();
28 | }
29 |
30 | public CommentAdapter(ArrayList comments) {
31 | this.mComments = comments;
32 | }
33 |
34 | public void updateData(ArrayList comments) {
35 | this.mComments = comments;
36 |
37 | notifyDataSetChanged();
38 | }
39 |
40 | @Override
41 | public CommentsViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
42 | View rowView = LayoutInflater.from(parent.getContext())
43 | .inflate(R.layout.fragment_detail_comments_item, parent, false);
44 | //set the mContext
45 | this.mContext = parent.getContext();
46 | return new CommentsViewHolder(rowView);
47 | }
48 |
49 | @Override
50 | public void onBindViewHolder(CommentsViewHolder holder, int position) {
51 | final Comment currentComment = mComments.get(position);
52 | holder.commentAuthor.setText(currentComment.getAuthor());
53 | holder.commentDate.setText(currentComment.getDate());
54 | holder.commentContent.setText(Html.fromHtml(currentComment.getBody()));
55 | holder.commentAvatar.setImageBitmap(null);
56 |
57 | String avatarImage = mComments.get(position).getAvatar();
58 |
59 | Glide.clear(holder.commentAvatar);
60 |
61 | if (!avatarImage.trim().isEmpty()) {
62 |
63 | Glide.with(mContext)
64 | .load(avatarImage)
65 | .crossFade()
66 | .thumbnail(0.5f)
67 | .transform(new CircleTransform(mContext))
68 | .diskCacheStrategy(DiskCacheStrategy.ALL).into(holder.commentAvatar);
69 | }
70 | }
71 |
72 | public ArrayList getComments() {
73 | return mComments;
74 | }
75 |
76 | @Override
77 | public int getItemCount() {
78 | return mComments.size();
79 | }
80 | }
81 |
82 | class CommentsViewHolder extends RecyclerView.ViewHolder {
83 | protected final ImageView commentAvatar;
84 | protected final TextView commentAuthor;
85 | protected final TextView commentContent;
86 | protected final TextView commentDate;
87 |
88 | public CommentsViewHolder(View itemView) {
89 |
90 | super(itemView);
91 |
92 | commentAvatar = (ImageView) itemView.findViewById(R.id.comment_avatar);
93 | commentAuthor = (TextView) itemView.findViewById(R.id.comment_author);
94 | commentContent = (TextView) itemView.findViewById(R.id.comment_content);
95 | commentDate = (TextView) itemView.findViewById(R.id.comment_date);
96 |
97 | }
98 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/adapters/FileAdapter.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.adapters;
2 |
3 | import android.content.Context;
4 | import android.support.v7.widget.RecyclerView;
5 | import android.text.TextUtils;
6 | import android.view.LayoutInflater;
7 | import android.view.View;
8 | import android.view.ViewGroup;
9 | import android.widget.ImageButton;
10 | import android.widget.ImageView;
11 | import android.widget.TextView;
12 |
13 | import com.mikepenz.fontawesome_typeface_library.FontAwesome;
14 | import com.mikepenz.iconics.IconicsDrawable;
15 | import com.xpyct.apps.anilab.R;
16 | import com.xpyct.apps.anilab.models.File;
17 | import com.xpyct.apps.anilab.models.orm.Watched;
18 | import com.xpyct.apps.anilab.views.OnItemClickListener;
19 |
20 | import java.util.ArrayList;
21 | import java.util.List;
22 |
23 |
24 | public class FileAdapter extends RecyclerView.Adapter {
25 |
26 | private Context mContext;
27 | private ArrayList> mFiles;
28 | private String mMovieId;
29 | private String mApiServiceName;
30 |
31 | private OnItemClickListener onItemClickListener;
32 |
33 |
34 | public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
35 | this.onItemClickListener = onItemClickListener;
36 | }
37 |
38 | public FileAdapter() {
39 | mFiles = new ArrayList<>();
40 | }
41 |
42 | public FileAdapter(String movieId, String apiServiceName) {
43 | mFiles = new ArrayList<>();
44 | mMovieId = movieId;
45 | mApiServiceName = apiServiceName;
46 | }
47 |
48 | public FileAdapter(ArrayList> files) {
49 | this.mFiles = files;
50 | }
51 |
52 | public void updateData(ArrayList> files) {
53 | this.mFiles = files;
54 |
55 | notifyDataSetChanged();
56 | }
57 |
58 | @Override
59 | public FilesViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
60 | View rowView = LayoutInflater.from(parent.getContext())
61 | .inflate(R.layout.fragment_detail_files_item, parent, false);
62 | //set the mContext
63 | this.mContext = parent.getContext();
64 |
65 | return new FilesViewHolder(rowView, onItemClickListener);
66 | }
67 |
68 | @Override
69 | public void onBindViewHolder(FilesViewHolder holder, final int position) {
70 | final File currentFile = mFiles.get(position).get(0);
71 | holder.fileTitle.setText(currentFile.getPart());
72 | List services = new ArrayList<>();
73 | for (File item : mFiles.get(position)) {
74 | services.add(item.getService());
75 | }
76 | holder.fileStatus.setText(TextUtils.join(", ", services));
77 | holder.fileTitle.setOnClickListener(new View.OnClickListener() {
78 | @Override
79 | public void onClick(View v) {
80 | onItemClickListener.onClick(v, position);
81 | }
82 | });
83 | holder.fileStatus.setOnClickListener(new View.OnClickListener() {
84 | @Override
85 | public void onClick(View v) {
86 | onItemClickListener.onClick(v, position);
87 | }
88 | });
89 | holder.fileImage.setOnClickListener(new View.OnClickListener() {
90 | @Override
91 | public void onClick(View v) {
92 | onItemClickListener.onClick(v, position);
93 | }
94 | });
95 | holder.fileContextMenu.setOnClickListener(new View.OnClickListener() {
96 | @Override
97 | public void onClick(View v) {
98 | onItemClickListener.onClick(v, position);
99 | }
100 | });
101 |
102 | FontAwesome.Icon icon = FontAwesome.Icon.faw_play_circle_o;
103 | long count = Watched.count(Watched.class, "movie_id = ? and service = ? and part = ?", new String[]{mMovieId, mApiServiceName, currentFile.getPart()});
104 | if (count > 0) {
105 | icon = FontAwesome.Icon.faw_circle;
106 | }
107 | holder.fileImage.setImageDrawable(new IconicsDrawable(mContext, icon).sizeDp(48).colorRes(R.color.accent));
108 | holder.fileContextMenu.setImageDrawable(new IconicsDrawable(mContext, FontAwesome.Icon.faw_ellipsis_v).sizeDp(24).paddingDp(4).colorRes(R.color.secondary_text));
109 | }
110 |
111 | public ArrayList> getFiles() {
112 | return mFiles;
113 | }
114 |
115 | @Override
116 | public int getItemCount() {
117 | return mFiles.size();
118 | }
119 | }
120 |
121 | class FilesViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
122 | protected final TextView fileTitle;
123 | protected final TextView fileStatus;
124 | protected final ImageView fileImage;
125 | protected final ImageButton fileContextMenu;
126 |
127 | private final OnItemClickListener onItemClickListener;
128 |
129 | public FilesViewHolder(View itemView, OnItemClickListener onItemClickListener) {
130 | super(itemView);
131 | this.onItemClickListener = onItemClickListener;
132 |
133 | fileTitle = (TextView) itemView.findViewById(R.id.title);
134 | fileStatus = (TextView) itemView.findViewById(R.id.status);
135 | fileImage = (ImageView) itemView.findViewById(R.id.file_image);
136 | fileContextMenu = (ImageButton) itemView.findViewById(R.id.file_context_menu);
137 |
138 | }
139 |
140 | @Override
141 | public void onClick(View v) {
142 | onItemClickListener.onClick(v, getPosition());
143 | }
144 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/fragments/ChangelogDialogFragment.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.fragments;
2 |
3 | import android.app.Dialog;
4 | import android.app.DialogFragment;
5 | import android.content.Context;
6 | import android.os.Bundle;
7 | import android.view.LayoutInflater;
8 |
9 | import com.afollestad.materialdialogs.MaterialDialog;
10 | import com.afollestad.materialdialogs.Theme;
11 | import com.xpyct.apps.anilab.R;
12 |
13 | import it.gmariotti.changelibs.library.view.ChangeLogRecyclerView;
14 |
15 | /**
16 | * anilab-android
17 | * Created by XpycT on 14.07.2015.
18 | */
19 | public class ChangelogDialogFragment extends DialogFragment {
20 |
21 | public ChangelogDialogFragment() {
22 | }
23 |
24 | @Override
25 | public Dialog onCreateDialog(Bundle savedInstanceState) {
26 | LayoutInflater layoutInflater = (LayoutInflater) getActivity().getSystemService(
27 | Context.LAYOUT_INFLATER_SERVICE);
28 | ChangeLogRecyclerView chgList = (ChangeLogRecyclerView) layoutInflater.inflate(R.layout.changelog_fragment_dialog, null);
29 |
30 | return new MaterialDialog.Builder(getActivity())
31 | .title(R.string.changelog)
32 | .theme(Theme.DARK)
33 | .customView(chgList, false)
34 | .positiveText(R.string.close)
35 | .show();
36 |
37 | }
38 |
39 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/fragments/DetailCommentsFragment.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.fragments;
2 |
3 |
4 | import android.content.SharedPreferences;
5 | import android.os.Bundle;
6 | import android.preference.PreferenceManager;
7 | import android.support.v4.app.Fragment;
8 | import android.support.v4.widget.SwipeRefreshLayout;
9 | import android.support.v7.widget.LinearLayoutManager;
10 | import android.support.v7.widget.RecyclerView;
11 | import android.view.LayoutInflater;
12 | import android.view.View;
13 | import android.view.ViewGroup;
14 | import android.widget.ProgressBar;
15 | import android.widget.TextView;
16 |
17 | import com.xpyct.apps.anilab.R;
18 | import com.xpyct.apps.anilab.adapters.CommentAdapter;
19 | import com.xpyct.apps.anilab.managers.Utils;
20 | import com.xpyct.apps.anilab.models.Comment;
21 | import com.xpyct.apps.anilab.models.Comments;
22 | import com.xpyct.apps.anilab.models.Movie;
23 | import com.xpyct.apps.anilab.network.AnilabApi;
24 |
25 | import java.util.ArrayList;
26 |
27 | import butterknife.Bind;
28 | import butterknife.ButterKnife;
29 | import retrofit.RetrofitError;
30 | import rx.Observer;
31 | import rx.android.app.AppObservable;
32 | import rx.android.schedulers.AndroidSchedulers;
33 | import rx.schedulers.Schedulers;
34 |
35 | public class DetailCommentsFragment extends Fragment implements SwipeRefreshLayout.OnRefreshListener {
36 | private static final String SELECTED_MOVIE = "selected_movie";
37 | public static final String API_SERVICE = "api_service";
38 |
39 | private SharedPreferences pref;
40 | private Movie mMovie;
41 | private long apiService;
42 |
43 | private Comments mComments;
44 | private CommentAdapter mCommentAdapter;
45 |
46 | private AnilabApi mApi = AnilabApi.getInstance();
47 |
48 | @Bind(R.id.fragment_comments_recycler)
49 | RecyclerView mCommentRecycler;
50 | @Bind(R.id.fragment_comments_progress)
51 | ProgressBar mCommentProgress;
52 | @Bind(R.id.fragment_comments_empty_view)
53 | TextView mEmptyView;
54 |
55 | /**
56 | * Use this factory method to create a new instance of
57 | * this fragment using the provided parameters.
58 | *
59 | * @param movie movie.
60 | * @return A new instance of fragment DetailCommentsFragment.
61 | */
62 | public static DetailCommentsFragment newInstance(Movie movie, long api) {
63 | DetailCommentsFragment fragment = new DetailCommentsFragment();
64 | Bundle args = new Bundle();
65 | args.putSerializable(SELECTED_MOVIE, movie);
66 | args.putLong(API_SERVICE, api);
67 | fragment.setArguments(args);
68 | return fragment;
69 | }
70 |
71 | public DetailCommentsFragment() {
72 | // Required empty public constructor
73 | }
74 |
75 | @Override
76 | public void onCreate(Bundle savedInstanceState) {
77 | setHasOptionsMenu(true);
78 | pref = PreferenceManager.getDefaultSharedPreferences(DetailCommentsFragment.this.getActivity());
79 | if (getArguments() != null) {
80 | mMovie = (Movie) getArguments().getSerializable(SELECTED_MOVIE);
81 | apiService = getArguments().getLong(API_SERVICE, 2);
82 | }
83 |
84 | super.onCreate(savedInstanceState);
85 | }
86 |
87 | @Override
88 | public View onCreateView(LayoutInflater inflater, ViewGroup container,
89 | Bundle savedInstanceState) {
90 | // Inflate the layout for this fragment
91 | final View rootView = inflater.inflate(R.layout.fragment_detail_comments, container, false);
92 | ButterKnife.bind(this, rootView);
93 |
94 | mCommentAdapter = new CommentAdapter();
95 |
96 | RecyclerView.LayoutManager layoutManager = new LinearLayoutManager(getActivity());
97 | mCommentRecycler.setLayoutManager(layoutManager);
98 | mCommentRecycler.setHasFixedSize(true);
99 | mCommentRecycler.setAdapter(mCommentAdapter);
100 |
101 | getComments();
102 |
103 | return rootView;
104 | }
105 |
106 | private void getComments() {
107 | AppObservable.bindSupportFragment(this, mApi.fetchComments(Utils.getApiServiceName(apiService), Integer.parseInt(mMovie.getMovieId())))
108 | .cache().subscribeOn(Schedulers.newThread())
109 | .observeOn(AndroidSchedulers.mainThread())
110 | .subscribe(observer);
111 | }
112 |
113 | private Observer observer = new Observer() {
114 | @Override
115 | public void onNext(final Comments comments) {
116 | mComments = comments;
117 | updateAdapter(mComments.getList());
118 | }
119 |
120 | @Override
121 | public void onCompleted() {
122 | // Dismiss loading dialog
123 | showCommentsList();
124 | }
125 |
126 | @Override
127 | public void onError(final Throwable error) {
128 | checkRetrofitOnError(error);
129 | }
130 | };
131 |
132 | private void showCommentsList() {
133 | mCommentProgress.setVisibility(View.GONE);
134 | mCommentRecycler.setVisibility(View.VISIBLE);
135 | }
136 |
137 | private void hideCommentsList() {
138 | mCommentProgress.setVisibility(View.VISIBLE);
139 | mCommentRecycler.setVisibility(View.GONE);
140 | }
141 |
142 | /**
143 | * Reset Movie Adapter, reset scroll
144 | *
145 | * @param comments ArrayList movies
146 | */
147 | private void updateAdapter(ArrayList comments) {
148 | mCommentAdapter.updateData(comments);
149 |
150 | if (mCommentAdapter.getItemCount() == 0) mCommentRecycler.scrollToPosition(0);
151 | checkForEmptyMovieData();
152 | }
153 |
154 | /**
155 | * Check for empty data, and show error label
156 | */
157 | private void checkForEmptyMovieData() {
158 | if (mCommentAdapter.getItemCount() == 0) {
159 | mCommentRecycler.setVisibility(View.GONE);
160 | mEmptyView.setVisibility(View.VISIBLE);
161 | } else {
162 | mCommentRecycler.setVisibility(View.VISIBLE);
163 | mEmptyView.setVisibility(View.GONE);
164 | }
165 | }
166 |
167 | /**
168 | * Retrofit error checker
169 | *
170 | * @param error
171 | */
172 | private void checkRetrofitOnError(Throwable error) {
173 | if (error instanceof RetrofitError) {
174 | }
175 | mCommentProgress.setVisibility(View.GONE);
176 | mCommentRecycler.setVisibility(View.GONE);
177 | mEmptyView.setVisibility(View.VISIBLE);
178 | }
179 |
180 |
181 | @Override
182 | public void onRefresh() {
183 | hideCommentsList();
184 | getComments();
185 | }
186 | }
187 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/AppSuggestionProvider.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers;
2 |
3 | import android.content.SearchRecentSuggestionsProvider;
4 |
5 | /**
6 | * anilab-android
7 | * Created by XpycT on 30.07.2015.
8 | */
9 | public class AppSuggestionProvider extends SearchRecentSuggestionsProvider {
10 | public final static String AUTHORITY = "com.xpyct.apps.anilab.managers.AppSuggestionProvider";
11 | public final static int MODE = DATABASE_MODE_QUERIES;
12 |
13 | public AppSuggestionProvider() {
14 | setupSuggestions(AUTHORITY, MODE);
15 | }
16 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/CircleTransform.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers;
2 |
3 | import android.content.Context;
4 | import android.graphics.Bitmap;
5 |
6 | import com.bumptech.glide.load.engine.bitmap_recycle.BitmapPool;
7 | import com.bumptech.glide.load.resource.bitmap.BitmapTransformation;
8 |
9 | /**
10 | * anilab-android
11 | * Created by XpycT on 19.07.2015.
12 | */
13 | public class CircleTransform extends BitmapTransformation {
14 | public CircleTransform(Context context) {
15 | super(context);
16 | }
17 |
18 | @Override
19 | protected Bitmap transform(BitmapPool pool, Bitmap source, int outWidth, int outHeight) {
20 | return Utils.getCircularBitmapImage(source);
21 | }
22 |
23 | @Override
24 | public String getId() {
25 | return "Glide_Circle_Transformation";
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/GlideConfiguration.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers;
2 |
3 | import android.content.Context;
4 |
5 | import com.bumptech.glide.Glide;
6 | import com.bumptech.glide.GlideBuilder;
7 | import com.bumptech.glide.load.DecodeFormat;
8 | import com.bumptech.glide.module.GlideModule;
9 |
10 | public class GlideConfiguration implements GlideModule {
11 |
12 | @Override
13 | public void applyOptions(Context context, GlideBuilder builder) {
14 | // Apply options to the builder here.
15 | builder.setDecodeFormat(DecodeFormat.PREFER_ARGB_8888);
16 | }
17 |
18 | @Override
19 | public void registerComponents(Context context, Glide glide) {
20 | // register ModelLoaders here.
21 | }
22 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/other/LoaderDroidPublicAPI.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers.other;
2 |
3 | import android.content.Context;
4 | import android.content.pm.PackageInfo;
5 | import android.content.pm.PackageManager;
6 | import android.net.Uri;
7 | import android.util.Log;
8 |
9 | /**
10 | * anilab-android
11 | * Created by XpycT on 08.08.2015.
12 | */
13 | public class LoaderDroidPublicAPI {
14 | public static final String ACTION_ADD_LOADING = "org.zloy.android.downloader.action.ADD_LOADING";
15 | public static final Uri LOADER_DROID_MARKET_URI = Uri.parse("https://play.google.com/store/apps/details?id=org.zloy.android.downloader");
16 | public static final String LOADER_DROID_PACKAGE = "org.zloy.android.downloader";
17 |
18 | public static int getLoaderDroidVersion(Context paramContext)
19 | {
20 | PackageInfo packageInfo;
21 | try {
22 | packageInfo = paramContext.getPackageManager().getPackageInfo(LOADER_DROID_PACKAGE, 0);
23 | //Log.v("LoaderDroid", "Version Name: " + packageInfo.versionName + " Version Code: " + String.valueOf(packageInfo.versionCode));
24 | return packageInfo.versionCode;
25 | } catch (PackageManager.NameNotFoundException e) {
26 | //e.printStackTrace();
27 | }
28 | return 0;
29 | }
30 |
31 | public static boolean isLoaderDroidRequireUpdate(Context paramContext)
32 | {
33 | int i = getLoaderDroidVersion(paramContext);
34 | return (i > 0) && (i < 44);
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/updater/CustomTagHandler.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers.updater;
2 |
3 | import android.text.Editable;
4 | import android.text.Html.TagHandler;
5 |
6 | import org.xml.sax.XMLReader;
7 |
8 | public class CustomTagHandler implements TagHandler {
9 |
10 | @Override
11 | public void handleTag(boolean opening, String tag, Editable output,
12 | XMLReader xmlReader) {
13 | // you may add more tag handler which are not supported by android here
14 | if ("li".equals(tag)) {
15 | if (opening) {
16 | output.append(" \u2022 ");
17 | } else {
18 | output.append("\n");
19 | }
20 | }
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/updater/DownloadApkTask.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers.updater;
2 |
3 | import android.app.ProgressDialog;
4 | import android.content.Context;
5 | import android.os.AsyncTask;
6 | import android.os.PowerManager;
7 | import android.widget.Toast;
8 |
9 | import java.io.File;
10 | import java.io.FileOutputStream;
11 | import java.io.IOException;
12 | import java.io.InputStream;
13 | import java.io.OutputStream;
14 | import java.net.HttpURLConnection;
15 | import java.net.URL;
16 |
17 |
18 | public class DownloadApkTask extends AsyncTask {
19 |
20 | private Context context;
21 | private PowerManager.WakeLock mWakeLock;
22 | private ProgressDialog mProgressDialog;
23 | private boolean success = false;
24 | private String filePath = "";
25 | private DownloadTaskListener listener;
26 |
27 | public DownloadApkTask(Context context) {
28 | this.context = context;
29 | }
30 |
31 | public DownloadApkTask(Context context, ProgressDialog dialog) {
32 | this.context = context;
33 | this.mProgressDialog = dialog;
34 | }
35 |
36 | @Override
37 | protected String doInBackground(String... sUrl) {
38 | InputStream input = null;
39 | OutputStream output = null;
40 | HttpURLConnection connection = null;
41 | String filePath = null;
42 | try {
43 | URL url = new URL(sUrl[0]);
44 | connection = (HttpURLConnection) url.openConnection();
45 | connection.connect();
46 |
47 | // expect HTTP 200 OK, so we don't mistakenly save error report
48 | // instead of the file
49 | if (connection.getResponseCode() != HttpURLConnection.HTTP_OK) {
50 | return "Server returned HTTP " + connection.getResponseCode() + " " + connection.getResponseMessage();
51 | }
52 |
53 | // this will be useful to display download percentage
54 | // might be -1: server did not report the length
55 | int fileLength = connection.getContentLength();
56 |
57 | // download the file
58 | input = connection.getInputStream();
59 | File tmpFile = new File(context.getExternalCacheDir(), "anilab-latest.apk");
60 | if (tmpFile.exists()) {
61 | tmpFile.delete();
62 | }
63 | filePath = tmpFile.getAbsolutePath();
64 | output = new FileOutputStream(tmpFile);
65 |
66 | byte data[] = new byte[4096];
67 | long total = 0;
68 | int count;
69 | while ((count = input.read(data)) != -1) {
70 | // allow canceling with back button
71 | if (isCancelled()) {
72 | input.close();
73 | return null;
74 | }
75 | total += count;
76 | // publishing the progress....
77 | if (fileLength > 0) // only if total length is known
78 | publishProgress((int) (total * 100 / fileLength));
79 | output.write(data, 0, count);
80 | }
81 |
82 | this.filePath = filePath;
83 | } catch (Exception e) {
84 | return e.toString();
85 | } finally {
86 | try {
87 | if (output != null)
88 | output.close();
89 | if (input != null)
90 | input.close();
91 | } catch (IOException ignored) {
92 | }
93 |
94 | if (connection != null)
95 | connection.disconnect();
96 | }
97 | return null;
98 | }
99 |
100 | @Override
101 | protected void onPreExecute() {
102 | super.onPreExecute();
103 | // take CPU lock to prevent CPU from going off if the user
104 | // presses the power button during download
105 | PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
106 | mWakeLock = pm.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, getClass().getName());
107 | mWakeLock.acquire();
108 | if (mProgressDialog != null)
109 | mProgressDialog.show();
110 | }
111 |
112 | @Override
113 | protected void onProgressUpdate(Integer... progress) {
114 | super.onProgressUpdate(progress);
115 | // if we get here, length is known, now set indeterminate to false
116 | if (mProgressDialog != null) {
117 | mProgressDialog.setIndeterminate(false);
118 | mProgressDialog.setMax(100);
119 | mProgressDialog.setProgress(progress[0]);
120 | }
121 | }
122 |
123 | @Override
124 | protected void onPostExecute(String result) {
125 | mWakeLock.release();
126 | if (mProgressDialog != null)
127 | mProgressDialog.dismiss();
128 | if (result != null)
129 | Toast.makeText(context, "Download error: " + result, Toast.LENGTH_LONG).show();
130 | else {
131 | success = true;
132 | if (this.listener != null)
133 | listener.downloadComplete(this);
134 | else
135 | Toast.makeText(context, "File downloaded at : " + this.filePath, Toast.LENGTH_LONG).show();
136 |
137 | }
138 | }
139 |
140 |
141 | public void setListener(DownloadTaskListener listener) {
142 | this.listener = listener;
143 | }
144 |
145 | public boolean isSuccess() {
146 | return success;
147 | }
148 |
149 | public String getFilePath() {
150 | return this.filePath;
151 | }
152 |
153 | public interface DownloadTaskListener {
154 | public void downloadComplete(DownloadApkTask task);
155 | }
156 | }
157 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/updater/IWVersionManager.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers.updater;
2 |
3 | import android.graphics.drawable.Drawable;
4 |
5 | public interface IWVersionManager {
6 |
7 | /**
8 | * @return Label of update now button
9 | */
10 | public String getUpdateNowLabel();
11 |
12 |
13 | /**
14 | * @param updateNowLabel Set the label for update now button
15 | */
16 | public void setUpdateNowLabel(String updateNowLabel);
17 |
18 | /**
19 | * @return label of remind me later button
20 | */
21 | public String getRemindMeLaterLabel();
22 |
23 | /**
24 | * @param remindMeLaterLabel Set label of remind me later button
25 | */
26 | public void setRemindMeLaterLabel(String remindMeLaterLabel);
27 |
28 | /**
29 | * @return label of ignore this version button
30 | */
31 | public String getIgnoreThisVersionLabel();
32 |
33 | /**
34 | * @param ignoreThisVersionLabel Set label of ignore this version button
35 | */
36 | public void setIgnoreThisVersionLabel(String ignoreThisVersionLabel);
37 |
38 | /**
39 | * @param icon Set drawable of icon in dialog
40 | */
41 | public void setIcon(Drawable icon);
42 |
43 | /**
44 | * @param title Set title of dialog
45 | */
46 | public void setTitle(String title);
47 |
48 | /**
49 | * @param message Set message of dialog
50 | */
51 | public void setMessage(String message);
52 |
53 | /**
54 | * @return message of dialog
55 | */
56 | public String getMessage();
57 |
58 | /**
59 | * @return title of dialog
60 | */
61 | public String getTitle();
62 |
63 | /**
64 | * @return drawable of icon
65 | */
66 | public Drawable getIcon();
67 |
68 | /**
69 | * @return url to execute when update now button clicked. Default value is the link in google play based on app package name.
70 | */
71 | public String getUpdateUrl();
72 |
73 | /**
74 | * @param updateUrl Set url to execute when update now button clicked
75 | */
76 | public void setUpdateUrl(String updateUrl);
77 |
78 | /**
79 | * @return url which should return update content in json format
80 | */
81 | public String getVersionContentUrl();
82 |
83 | /**
84 | * @param versionContentUrl Set the update content url
85 | */
86 | public void setVersionContentUrl(String versionContentUrl);
87 |
88 | /**
89 | * @param minutes Set reminder time in minutes when remind me later button clicked
90 | */
91 | public void setReminderTimer(int minutes);
92 |
93 | /**
94 | * @return reminder timer in minutes
95 | */
96 | public int getReminderTimer();
97 |
98 | /**
99 | * @return current version code
100 | */
101 | public int getCurrentVersionCode();
102 |
103 | /**
104 | * @return version code which will be ignored
105 | */
106 | public int getIgnoreVersionCode();
107 |
108 | /**
109 | * @return CustomTagHandler object
110 | */
111 | public CustomTagHandler getCustomTagHandler();
112 |
113 | /**
114 | * @param customTagHandler Set your own custom tag handler
115 | */
116 | public void setCustomTagHandler(CustomTagHandler customTagHandler);
117 |
118 | /**
119 | * @param OnReceiveListener Set your own callback listener when receiving response from server
120 | */
121 | public void setOnReceiveListener(OnReceiveListener listener);
122 |
123 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/managers/updater/OnReceiveListener.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.managers.updater;
2 |
3 | public interface OnReceiveListener {
4 |
5 | /**
6 | * @param status response code from HTTP request
7 | * @param result response data from HTTP request
8 | * @return return true to show default library dialog
9 | */
10 | boolean onReceive(int status, String result);
11 | }
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/Comment.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import java.io.Serializable;
7 |
8 | public class Comment implements Serializable {
9 | @SerializedName("comment_id")
10 | @Expose
11 | private String commentId;
12 | @Expose
13 | private String date;
14 | @Expose
15 | private String author;
16 | @Expose
17 | private String body;
18 | @Expose
19 | private String avatar;
20 |
21 | /**
22 | * @return The commentId
23 | */
24 | public String getCommentId() {
25 | return commentId;
26 | }
27 |
28 | /**
29 | * @param commentId The comment_id
30 | */
31 | public void setCommentId(String commentId) {
32 | this.commentId = commentId;
33 | }
34 |
35 | /**
36 | * @return The date
37 | */
38 | public String getDate() {
39 | return date;
40 | }
41 |
42 | /**
43 | * @param date The date
44 | */
45 | public void setDate(String date) {
46 | this.date = date;
47 | }
48 |
49 | /**
50 | * @return The author
51 | */
52 | public String getAuthor() {
53 | return author;
54 | }
55 |
56 | /**
57 | * @param author The author
58 | */
59 | public void setAuthor(String author) {
60 | this.author = author;
61 | }
62 |
63 | /**
64 | * @return The body
65 | */
66 | public String getBody() {
67 | return body;
68 | }
69 |
70 | /**
71 | * @param body The body
72 | */
73 | public void setBody(String body) {
74 | this.body = body;
75 | }
76 |
77 | /**
78 | * @return The avatar
79 | */
80 | public String getAvatar() {
81 | return avatar;
82 | }
83 |
84 | /**
85 | * @param avatar The avatar
86 | */
87 | public void setAvatar(String avatar) {
88 | this.avatar = avatar;
89 | }
90 |
91 | }
92 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/Comments.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | import java.io.Serializable;
6 | import java.util.ArrayList;
7 |
8 | /**
9 | * anilab-android
10 | * Created by XpycT on 09.07.2015.
11 | */
12 | public class Comments implements Serializable {
13 | @Expose
14 | private String status;
15 | @Expose
16 | private String count;
17 | @Expose
18 | private ArrayList list = new ArrayList<>();
19 |
20 | /**
21 | * @return The status
22 | */
23 | public String getStatus() {
24 | return status;
25 | }
26 |
27 | /**
28 | * @param status The status
29 | */
30 | public void setStatus(String status) {
31 | this.status = status;
32 | }
33 |
34 | /**
35 | * @return The count
36 | */
37 | public String getCount() {
38 | return count;
39 | }
40 |
41 | /**
42 | * @param count The count
43 | */
44 | public void setCount(String count) {
45 | this.count = count;
46 | }
47 |
48 | /**
49 | * @return The list
50 | */
51 | public ArrayList getList() {
52 | return list;
53 | }
54 |
55 | /**
56 | * @param list The list
57 | */
58 | public void setList(ArrayList list) {
59 | this.list = list;
60 | }
61 |
62 | }
63 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/File.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import java.io.Serializable;
7 |
8 | /**
9 | * anilab-android
10 | * Created by XpycT on 20.07.2015.
11 | */
12 | public class File implements Serializable {
13 | @Expose
14 | private String service;
15 | @Expose
16 | private String part;
17 | @SerializedName("original_link")
18 | @Expose
19 | private String originalLink;
20 | @SerializedName("download_link")
21 | @Expose
22 | private String downloadLink;
23 |
24 | public String getService() {
25 | return service;
26 | }
27 |
28 | public void setService(String service) {
29 | this.service = service;
30 | }
31 |
32 | public String getPart() {
33 | return part;
34 | }
35 |
36 | public void setPart(String part) {
37 | this.part = part;
38 | }
39 |
40 | public String getOriginalLink() {
41 | return originalLink;
42 | }
43 |
44 | public void setOriginalLink(String originalLink) {
45 | this.originalLink = originalLink;
46 | }
47 |
48 | public String getDownloadLink() {
49 | return downloadLink;
50 | }
51 |
52 | public void setDownloadLink(String downloadLink) {
53 | this.downloadLink = downloadLink;
54 | }
55 | }
56 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/Images.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | import java.io.Serializable;
6 |
7 | /**
8 | * anilab-android
9 | * Created by XpycT on 09.07.2015.
10 | */
11 | public class Images implements Serializable {
12 | @Expose
13 | private String thumbnail;
14 | @Expose
15 | private String original;
16 |
17 | /**
18 | * @return The thumbnail
19 | */
20 | public String getThumbnail() {
21 | return thumbnail;
22 | }
23 |
24 | /**
25 | * @param thumbnail The thumbnail
26 | */
27 | public void setThumbnail(String thumbnail) {
28 | this.thumbnail = thumbnail;
29 | }
30 |
31 | /**
32 | * @return The original
33 | */
34 | public String getOriginal() {
35 | return original;
36 | }
37 |
38 | /**
39 | * @param original The original
40 | */
41 | public void setOriginal(String original) {
42 | this.original = original;
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/Info.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import java.io.Serializable;
7 | import java.util.ArrayList;
8 | import java.util.List;
9 |
10 | /**
11 | * anilab-android
12 | * Created by XpycT on 09.07.2015.
13 | */
14 | public class Info implements Serializable {
15 | @SerializedName("published_at")
16 | @Expose
17 | private String publishedAt;
18 | @Expose
19 | private Images images;
20 | @Expose
21 | private String year;
22 | @Expose
23 | private String production;
24 | @Expose
25 | private List genres = new ArrayList();
26 | @Expose
27 | private String type;
28 | @Expose
29 | private String series;
30 | @Expose
31 | private String aired;
32 | @Expose
33 | private List producers = new ArrayList();
34 | @Expose
35 | private List authors = new ArrayList();
36 | @Expose
37 | private List scenarist = new ArrayList();
38 | @Expose
39 | private List postscoring = new ArrayList();
40 | @Expose
41 | private String studio;
42 | @Expose
43 | private Boolean online;
44 | @Expose
45 | private Boolean torrent;
46 | @Expose
47 | private Comments comments;
48 | @Expose
49 | private List screenshots;
50 |
51 | /**
52 | * @return The publishedAt
53 | */
54 | public String getPublishedAt() {
55 | return publishedAt;
56 | }
57 |
58 | /**
59 | * @param publishedAt The published_at
60 | */
61 | public void setPublishedAt(String publishedAt) {
62 | this.publishedAt = publishedAt;
63 | }
64 |
65 | /**
66 | * @return The images
67 | */
68 | public Images getImages() {
69 | return images;
70 | }
71 |
72 | /**
73 | * @param images The images
74 | */
75 | public void setImages(Images images) {
76 | this.images = images;
77 | }
78 |
79 | /**
80 | * @return The year
81 | */
82 | public String getYear() {
83 | return year;
84 | }
85 |
86 | /**
87 | * @param year The year
88 | */
89 | public void setYear(String year) {
90 | this.year = year;
91 | }
92 |
93 | /**
94 | * @return The production
95 | */
96 | public String getProduction() {
97 | return production;
98 | }
99 |
100 | /**
101 | * @param production The production
102 | */
103 | public void setProduction(String production) {
104 | this.production = production;
105 | }
106 |
107 | /**
108 | * @return The genres
109 | */
110 | public List getGenres() {
111 | return genres;
112 | }
113 |
114 | /**
115 | * @param genres The genres
116 | */
117 | public void setGenres(List genres) {
118 | this.genres = genres;
119 | }
120 |
121 | /**
122 | * @return The type
123 | */
124 | public String getType() {
125 | return type;
126 | }
127 |
128 | /**
129 | * @param type The type
130 | */
131 | public void setType(String type) {
132 | this.type = type;
133 | }
134 |
135 | /**
136 | * @return The series
137 | */
138 | public String getSeries() {
139 | return series;
140 | }
141 |
142 | /**
143 | * @param series The series
144 | */
145 | public void setSeries(String series) {
146 | this.series = series;
147 | }
148 |
149 | /**
150 | * @return The aired
151 | */
152 | public String getAired() {
153 | return aired;
154 | }
155 |
156 | /**
157 | * @param aired The aired
158 | */
159 | public void setAired(String aired) {
160 | this.aired = aired;
161 | }
162 |
163 | /**
164 | * @return The producers
165 | */
166 | public List getProducers() {
167 | return producers;
168 | }
169 |
170 | /**
171 | * @param producers The producers
172 | */
173 | public void setProducers(List producers) {
174 | this.producers = producers;
175 | }
176 |
177 | /**
178 | * @return The authors
179 | */
180 | public List getAuthors() {
181 | return authors;
182 | }
183 |
184 | /**
185 | * @param authors The authors
186 | */
187 | public void setAuthors(List authors) {
188 | this.authors = authors;
189 | }
190 |
191 | /**
192 | * @return The scenarist
193 | */
194 | public List getScenarist() {
195 | return scenarist;
196 | }
197 |
198 | /**
199 | * @param scenarist The scenarist
200 | */
201 | public void setScenarist(List scenarist) {
202 | this.scenarist = scenarist;
203 | }
204 |
205 | /**
206 | * @return The postscoring
207 | */
208 | public List getPostscoring() {
209 | return postscoring;
210 | }
211 |
212 | /**
213 | * @param postscoring The postscoring
214 | */
215 | public void setPostscoring(List postscoring) {
216 | this.postscoring = postscoring;
217 | }
218 |
219 | /**
220 | * @return The studio
221 | */
222 | public String getStudio() {
223 | return studio;
224 | }
225 |
226 | /**
227 | * @param studio The studio
228 | */
229 | public void setStudio(String studio) {
230 | this.studio = studio;
231 | }
232 |
233 | /**
234 | * @return The online
235 | */
236 | public Boolean getOnline() {
237 | return online;
238 | }
239 |
240 | /**
241 | * @param online The online
242 | */
243 | public void setOnline(Boolean online) {
244 | this.online = online;
245 | }
246 |
247 | /**
248 | * @return The torrent
249 | */
250 | public Boolean getTorrent() {
251 | return torrent;
252 | }
253 |
254 | /**
255 | * @param torrent The torrent
256 | */
257 | public void setTorrent(Boolean torrent) {
258 | this.torrent = torrent;
259 | }
260 |
261 | /**
262 | * @return The comments
263 | */
264 | public Comments getComments() {
265 | return comments;
266 | }
267 |
268 | /**
269 | * @param comments The comments
270 | */
271 | public void setComments(Comments comments) {
272 | this.comments = comments;
273 | }
274 |
275 | /**
276 | * @return
277 | */
278 | public List getScreenshots() {
279 | return screenshots;
280 | }
281 |
282 | /**
283 | * @param screenshots
284 | */
285 | public void setScreenshots(List screenshots) {
286 | this.screenshots = screenshots;
287 | }
288 | }
289 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/InfoItem.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | /**
4 | * anilab-android
5 | * Created by XpycT on 16.07.2015.
6 | */
7 | public class InfoItem {
8 |
9 | private String title;
10 | private String value;
11 |
12 | public InfoItem(String title, String value) {
13 | this.title = title;
14 | this.value = value;
15 | }
16 |
17 | public String getTitle() {
18 | return title;
19 | }
20 |
21 | public void setTitle(String title) {
22 | this.title = title;
23 | }
24 |
25 | public String getValue() {
26 | return value;
27 | }
28 |
29 | public void setValue(String value) {
30 | this.value = value;
31 | }
32 |
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/Movie.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import android.os.Parcel;
4 | import android.os.Parcelable;
5 |
6 | import com.google.gson.annotations.Expose;
7 | import com.google.gson.annotations.SerializedName;
8 |
9 | import java.io.Serializable;
10 |
11 | public class Movie implements Serializable, Parcelable {
12 |
13 | @SerializedName("movie_id")
14 | @Expose
15 | private String movieId;
16 | @SerializedName("updated_at")
17 | @Expose
18 | private String updatedAt;
19 | @SerializedName("created_at")
20 | @Expose
21 | private String createdAt;
22 | @Expose
23 | private Integer id;
24 | @Expose
25 | private String title;
26 | @Expose
27 | private Info info;
28 | @Expose
29 | private String description;
30 |
31 | private boolean commonFavorite;
32 | private long movieService;
33 |
34 | public long getMovieService() {
35 | return movieService;
36 | }
37 |
38 | public void setMovieService(long movieService) {
39 | this.movieService = movieService;
40 | }
41 |
42 | public boolean isCommonFavorite() {
43 | return commonFavorite;
44 | }
45 |
46 | public void setCommonFavorite(boolean commonFavorite) {
47 | this.commonFavorite = commonFavorite;
48 | }
49 |
50 | /**
51 | * @return The movieId
52 | */
53 | public String getMovieId() {
54 | return movieId;
55 | }
56 |
57 | /**
58 | * @param movieId The movie_id
59 | */
60 | public void setMovieId(String movieId) {
61 | this.movieId = movieId;
62 | }
63 |
64 | /**
65 | * @return The updatedAt
66 | */
67 | public String getUpdatedAt() {
68 | return updatedAt;
69 | }
70 |
71 | /**
72 | * @param updatedAt The updated_at
73 | */
74 | public void setUpdatedAt(String updatedAt) {
75 | this.updatedAt = updatedAt;
76 | }
77 |
78 | /**
79 | * @return The createdAt
80 | */
81 | public String getCreatedAt() {
82 | return createdAt;
83 | }
84 |
85 | /**
86 | * @param createdAt The created_at
87 | */
88 | public void setCreatedAt(String createdAt) {
89 | this.createdAt = createdAt;
90 | }
91 |
92 | /**
93 | * @return The id
94 | */
95 | public Integer getId() {
96 | return id;
97 | }
98 |
99 | /**
100 | * @param id The id
101 | */
102 | public void setId(Integer id) {
103 | this.id = id;
104 | }
105 |
106 | /**
107 | * @return The title
108 | */
109 | public String getTitle() {
110 | return title;
111 | }
112 |
113 | /**
114 | * @param title The title
115 | */
116 | public void setTitle(String title) {
117 | this.title = title;
118 | }
119 |
120 | /**
121 | * @return The info
122 | */
123 | public Info getInfo() {
124 | return info;
125 | }
126 |
127 | /**
128 | * @param info The info
129 | */
130 | public void setInfo(Info info) {
131 | this.info = info;
132 | }
133 |
134 | /**
135 | * @return The description
136 | */
137 | public String getDescription() {
138 | return description;
139 | }
140 |
141 | /**
142 | * @param description The description
143 | */
144 | public void setDescription(String description) {
145 | this.description = description;
146 | }
147 |
148 | public Movie() {
149 | }
150 |
151 |
152 | @Override
153 | public int describeContents() {
154 | return 0;
155 | }
156 |
157 | @Override
158 | public void writeToParcel(Parcel dest, int flags) {
159 | dest.writeString(this.movieId);
160 | dest.writeString(this.updatedAt);
161 | dest.writeString(this.createdAt);
162 | dest.writeValue(this.id);
163 | dest.writeString(this.title);
164 | dest.writeSerializable(this.info);
165 | dest.writeString(this.description);
166 | dest.writeByte(commonFavorite ? (byte) 1 : (byte) 0);
167 | }
168 |
169 | protected Movie(Parcel in) {
170 | this.movieId = in.readString();
171 | this.updatedAt = in.readString();
172 | this.createdAt = in.readString();
173 | this.id = (Integer) in.readValue(Integer.class.getClassLoader());
174 | this.title = in.readString();
175 | this.info = (Info) in.readSerializable();
176 | this.description = in.readString();
177 | this.commonFavorite = in.readByte() != 0;
178 | }
179 |
180 | public static final Creator CREATOR = new Creator() {
181 | public Movie createFromParcel(Parcel source) {
182 | return new Movie(source);
183 | }
184 |
185 | public Movie[] newArray(int size) {
186 | return new Movie[size];
187 | }
188 | };
189 | }
190 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/MovieFull.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | public class MovieFull {
6 | @Expose
7 | private String status;
8 | @Expose
9 | private Movie movie = new Movie();
10 |
11 | /**
12 | * Get status
13 | *
14 | * @return The status
15 | */
16 | public String getStatus() {
17 | return status;
18 | }
19 |
20 | /**
21 | * Set status
22 | *
23 | * @param status The status
24 | */
25 | public void setStatus(String status) {
26 | this.status = status;
27 | }
28 |
29 | /**
30 | * Get movie
31 | *
32 | * @return The movie
33 | */
34 | public Movie getMovie() {
35 | return movie;
36 | }
37 |
38 | /**
39 | * Set movie
40 | *
41 | * @param movie The movie
42 | */
43 | public void setMovie(Movie movie) {
44 | this.movie = movie;
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/MovieList.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | import java.util.ArrayList;
6 |
7 | public class MovieList {
8 | @Expose
9 | private String status;
10 | @Expose
11 | private Integer page;
12 | @Expose
13 | private ArrayList movies = new ArrayList<>();
14 |
15 | /**
16 | * Get status
17 | *
18 | * @return The status
19 | */
20 | public String getStatus() {
21 | return status;
22 | }
23 |
24 | /**
25 | * Set status
26 | *
27 | * @param status The status
28 | */
29 | public void setStatus(String status) {
30 | this.status = status;
31 | }
32 |
33 | /**
34 | * Get page number
35 | *
36 | * @return The page
37 | */
38 | public Integer getPage() {
39 | return page;
40 | }
41 |
42 | /**
43 | * Set page number
44 | *
45 | * @param page The page
46 | */
47 | public void setPage(Integer page) {
48 | this.page = page;
49 | }
50 |
51 | /**
52 | * Get movies list
53 | *
54 | * @return The movies
55 | */
56 | public ArrayList getMovies() {
57 | return movies;
58 | }
59 |
60 | /**
61 | * Set movies list
62 | *
63 | * @param movies The movies
64 | */
65 | public void setMovies(ArrayList movies) {
66 | this.movies = movies;
67 | }
68 | }
69 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/ParseLink.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | import com.google.gson.annotations.Expose;
4 | import com.google.gson.annotations.SerializedName;
5 |
6 | import java.io.Serializable;
7 | import java.util.ArrayList;
8 |
9 | /**
10 | * anilab-android
11 | * Created by XpycT on 09.07.2015.
12 | */
13 | public class ParseLink implements Serializable {
14 | @SerializedName("original_link")
15 | @Expose
16 | private String originalLink;
17 | @SerializedName("download_link")
18 | @Expose
19 | private String downloadLink;
20 |
21 | public String getOriginalLink() {
22 | return originalLink;
23 | }
24 |
25 | public void setOriginalLink(String originalLink) {
26 | this.originalLink = originalLink;
27 | }
28 |
29 | public String getDownloadLink() {
30 | return downloadLink;
31 | }
32 |
33 | public void setDownloadLink(String downloadLink) {
34 | this.downloadLink = downloadLink;
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/VideoService.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models;
2 |
3 | /**
4 | * anilab-android
5 | * Created by XpycT on 22.07.2015.
6 | */
7 | public class VideoService {
8 |
9 | private String key;
10 | private String value;
11 | private String original_url;
12 | private String download_url;
13 |
14 | public VideoService(String key, String value, String original_url, String download_url) {
15 | this.key = key;
16 | this.value = value;
17 | this.original_url = original_url;
18 | this.download_url = download_url;
19 | }
20 |
21 | public String getKey() {
22 | return key;
23 | }
24 |
25 | public void setKey(String key) {
26 | this.key = key;
27 | }
28 |
29 | public String getValue() {
30 | return value;
31 | }
32 |
33 | public void setValue(String value) {
34 | this.value = value;
35 | }
36 |
37 | public String getOriginal_url() {
38 | return original_url;
39 | }
40 |
41 | public void setOriginal_url(String original_url) {
42 | this.original_url = original_url;
43 | }
44 |
45 | public String getDownload_url() {
46 | return download_url;
47 | }
48 |
49 | public void setDownload_url(String download_url) {
50 | this.download_url = download_url;
51 | }
52 | }
53 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/myvi/MyviFile.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models.myvi;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | /**
6 | * anilab-android
7 | * Created by XpycT on 16.08.2015.
8 | */
9 | public class MyviFile {
10 | @Expose
11 | private SprutoData sprutoData;
12 |
13 | /**
14 | *
15 | * @return
16 | * The sprutoData
17 | */
18 | public SprutoData getSprutoData() {
19 | return sprutoData;
20 | }
21 |
22 | /**
23 | *
24 | * @param sprutoData
25 | * The sprutoData
26 | */
27 | public void setSprutoData(SprutoData sprutoData) {
28 | this.sprutoData = sprutoData;
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/app/src/main/java/com/xpyct/apps/anilab/models/myvi/Playlist.java:
--------------------------------------------------------------------------------
1 | package com.xpyct.apps.anilab.models.myvi;
2 |
3 | import com.google.gson.annotations.Expose;
4 |
5 | import java.util.ArrayList;
6 | import java.util.List;
7 |
8 | /**
9 | * anilab-android
10 | * Created by XpycT on 16.08.2015.
11 | */
12 | public class Playlist {
13 | @Expose
14 | private Integer duration;
15 | @Expose
16 | private String embedHtml;
17 | @Expose
18 | private String link;
19 | @Expose
20 | private String posterUrl;
21 | @Expose
22 | private String title;
23 | @Expose
24 | private List