├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── drawable │ │ │ │ ├── me.png │ │ │ │ ├── find.png │ │ │ │ ├── main.png │ │ │ │ ├── sale.png │ │ │ │ ├── search.png │ │ │ │ ├── game_icon.png │ │ │ │ ├── encrypt_icon.png │ │ │ │ ├── find_selected.png │ │ │ │ ├── main_selected.png │ │ │ │ ├── me_selected.png │ │ │ │ ├── sale_selected.png │ │ │ │ ├── search_selected.png │ │ │ │ ├── default_head_image.jpg │ │ │ │ ├── ic_image_loading.jpg │ │ │ │ ├── tab_selector_color.xml │ │ │ │ └── main_func_selector.xml │ │ │ ├── drawable-xxxhdpi │ │ │ │ ├── me.png │ │ │ │ ├── back.png │ │ │ │ ├── find.png │ │ │ │ ├── main.png │ │ │ │ ├── sale.png │ │ │ │ ├── share.png │ │ │ │ ├── banner.png │ │ │ │ ├── menu_dm.png │ │ │ │ ├── menu_tv.png │ │ │ │ ├── menu_zy.png │ │ │ │ ├── poster.png │ │ │ │ ├── search.png │ │ │ │ ├── game_icon.png │ │ │ │ ├── menu_film.png │ │ │ │ ├── menu_funny.png │ │ │ │ ├── menu_live.png │ │ │ │ ├── reco_ico.png │ │ │ │ ├── encrypt_icon.png │ │ │ │ ├── home_message.png │ │ │ │ ├── me_selected.png │ │ │ │ ├── refresh_end.png │ │ │ │ ├── search_film.png │ │ │ │ ├── expend_bottom.png │ │ │ │ ├── find_selected.png │ │ │ │ ├── main_selected.png │ │ │ │ ├── sale_selected.png │ │ │ │ ├── search_selected.png │ │ │ │ ├── me_selector.xml │ │ │ │ ├── find_selector.xml │ │ │ │ ├── main_selector.xml │ │ │ │ └── search_selector.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 │ │ │ ├── layout │ │ │ │ ├── irecyclerview_load_more_footer.xml │ │ │ │ ├── irecyclerview_refresh_header.xml │ │ │ │ ├── irecyclerview_load_more_footer_loading_view.xml │ │ │ │ ├── irecyclerview_load_more_footer_error_view.xml │ │ │ │ ├── irecyclerview_load_more_footer_the_end_view.xml │ │ │ │ ├── item_tv_type.xml │ │ │ │ ├── item_main_banner.xml │ │ │ │ ├── item_tv_area.xml │ │ │ │ ├── item_tv_episode.xml │ │ │ │ ├── irecyclerview_load_more_footer_view.xml │ │ │ │ ├── activity_web_play.xml │ │ │ │ ├── fragment_main.xml │ │ │ │ ├── fragment_episode.xml │ │ │ │ ├── fragment_film.xml │ │ │ │ ├── item_main_title.xml │ │ │ │ ├── irecyclerview_refresh_header_view.xml │ │ │ │ ├── activity_film.xml │ │ │ │ ├── item_variety_main.xml │ │ │ │ ├── activity_live.xml │ │ │ │ ├── item_main_movie.xml │ │ │ │ ├── fragment_sale.xml │ │ │ │ ├── item_tv_main.xml │ │ │ │ ├── activity_variety.xml │ │ │ │ ├── fragment_search.xml │ │ │ │ ├── activity_tv.xml │ │ │ │ ├── fragment_me.xml │ │ │ │ ├── activity_main.xml │ │ │ │ └── item_main_fun.xml │ │ │ ├── values │ │ │ │ ├── strings.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── anim │ │ │ │ ├── rotate_up.xml │ │ │ │ └── rotate_down.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ └── values-v21 │ │ │ │ └── styles.xml │ │ ├── jniLibs │ │ │ ├── x86 │ │ │ │ └── liblbs.so │ │ │ └── armeabi │ │ │ │ └── liblbs.so │ │ ├── java │ │ │ └── com │ │ │ │ └── andy │ │ │ │ └── free │ │ │ │ ├── utils │ │ │ │ ├── WebViewJavaScriptFunction.java │ │ │ │ ├── ConstantUtil.java │ │ │ │ ├── GlideRoundTransformUtil.java │ │ │ │ └── ImageLoaderUtils.java │ │ │ │ ├── VarietyDetailActivity.java │ │ │ │ ├── adapter │ │ │ │ ├── TvAreaRecyclerViewAdapter.java │ │ │ │ ├── TvTypeRecyclerViewAdapter.java │ │ │ │ ├── MainViewPagerAdapter.java │ │ │ │ ├── TvDetailFragmentAdapter.java │ │ │ │ ├── EpisodeFragmentAdapter.java │ │ │ │ ├── VarietyRecyclerViewAdapter.java │ │ │ │ ├── TvContentRecyclerViewAdapter.java │ │ │ │ └── FilmFragmentAdapter.java │ │ │ │ ├── fragment │ │ │ │ ├── SaleFragment.java │ │ │ │ ├── EpisodeFragment.java │ │ │ │ ├── MeFragment.java │ │ │ │ ├── SearchFragment.java │ │ │ │ └── MainFragment.java │ │ │ │ ├── service │ │ │ │ └── PreLoadX5Service.java │ │ │ │ ├── app │ │ │ │ └── BaseApplication.java │ │ │ │ ├── widget │ │ │ │ ├── LoadMoreFooterView.java │ │ │ │ ├── ClassicRefreshHeaderView.java │ │ │ │ └── NestedScrollWebView.java │ │ │ │ ├── bean │ │ │ │ ├── Movie.java │ │ │ │ ├── Variety.java │ │ │ │ ├── TvSeries.java │ │ │ │ └── FullMovie.java │ │ │ │ ├── FilmActivity.java │ │ │ │ ├── Jsoup │ │ │ │ ├── IqiyiJsoupThread.java │ │ │ │ ├── TvDetailJsoup.java │ │ │ │ └── VarietyJsoup.java │ │ │ │ ├── x5 │ │ │ │ └── X5WebView.java │ │ │ │ ├── MainActivity.java │ │ │ │ └── LiveActivity.java │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── andy │ │ │ └── free │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── andy │ │ └── free │ │ └── ExampleInstrumentedTest.java ├── libs │ └── tbs_sdk_thirdapp_v3.5.0.1004_43500_sharewithdownload_withoutGame_obfs_20170801_113025.jar ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── app-debug.apk ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── .idea ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── Administrator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── vcs.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── runConfigurations.xml ├── compiler.xml └── gradle.xml ├── .gitignore ├── gradle.properties ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app-debug.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app-debug.apk -------------------------------------------------------------------------------- /app/src/main/res/drawable/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/me.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/liblbs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/jniLibs/x86/liblbs.so -------------------------------------------------------------------------------- /app/src/main/res/drawable/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/find.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/main.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/sale.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/liblbs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/jniLibs/armeabi/liblbs.so -------------------------------------------------------------------------------- /app/src/main/res/drawable/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/me.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/me.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/game_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/game_icon.png -------------------------------------------------------------------------------- /.idea/dictionaries/Administrator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/find.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/find.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/main.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/main.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sale.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/sale.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/encrypt_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/encrypt_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/find_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/find_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/main_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/me_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/me_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/sale_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/sale_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/banner.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_dm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_dm.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_tv.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_zy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_zy.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/poster.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/poster.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/search_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/search_selected.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/game_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/game_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_film.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_funny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_funny.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/menu_live.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/menu_live.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/reco_ico.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/reco_ico.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/default_head_image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/default_head_image.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_image_loading.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable/ic_image_loading.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/encrypt_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/encrypt_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/home_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/home_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/me_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/me_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/refresh_end.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/refresh_end.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/search_film.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/search_film.png -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/expend_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/expend_bottom.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/find_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/find_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/main_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/main_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/sale_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/sale_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/search_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/src/main/res/drawable-xxxhdpi/search_selected.png -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .externalNativeBuild 10 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/libs/tbs_sdk_thirdapp_v3.5.0.1004_43500_sharewithdownload_withoutGame_obfs_20170801_113025.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/elimy/starCinema/HEAD/app/libs/tbs_sdk_thirdapp_v3.5.0.1004_43500_sharewithdownload_withoutGame_obfs_20170801_113025.jar -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/utils/WebViewJavaScriptFunction.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.utils; 2 | 3 | /** 4 | * Created by Administrator on 2017/10/14. 5 | */ 6 | 7 | public interface WebViewJavaScriptFunction { 8 | void onJsFunctionCalled(String tag); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/irecyclerview_load_more_footer.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Dec 28 10:00:20 PST 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_selector_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 星空影院 3 | Settings 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/main_func_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 16dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/irecyclerview_refresh_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/me_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/find_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/main_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/search_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout/irecyclerview_load_more_footer_loading_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/irecyclerview_load_more_footer_error_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/irecyclerview_load_more_footer_the_end_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/anim/rotate_up.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tv_type.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 5 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/test/java/com/andy/free/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.andy.free; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/VarietyDetailActivity.java: -------------------------------------------------------------------------------- 1 | package com.andy.free; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.app.AppCompatActivity; 6 | 7 | /** 8 | * Created by Andy Lau on 2017/11/13. 9 | */ 10 | 11 | public class VarietyDetailActivity extends AppCompatActivity { 12 | 13 | @Override 14 | protected void onCreate(@Nullable Bundle savedInstanceState) { 15 | super.onCreate(savedInstanceState); 16 | 17 | 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/utils/ConstantUtil.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.utils; 2 | 3 | import android.support.annotation.NonNull; 4 | 5 | import java.util.Collection; 6 | import java.util.Map; 7 | import java.util.Set; 8 | 9 | /** 10 | * Created by Administrator on 2017/10/20. 11 | */ 12 | 13 | public class ConstantUtil { 14 | 15 | public static final String BASE_URL="http://api.baiyug.cn/vip/index.php?url="; 16 | public static final String MOVIE_BASE_2345_URL="http://dianying.2345.com/list/"; 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_banner.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #345784 4 | #345784 5 | #345784 6 | #000 7 | #fff 8 | #eeeeee 9 | #ff1744 10 | #515151 11 | #345784 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tv_area.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_tv_episode.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 68 | 69 | 81 | 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/bean/Movie.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.bean; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import java.util.Arrays; 7 | 8 | /** 9 | * Created by Administrator on 2017/10/16. 10 | */ 11 | 12 | public class Movie implements Parcelable { 13 | 14 | 15 | private String name; 16 | private String url; 17 | private String type; 18 | private String score; 19 | private String time; 20 | private String posterUrl; 21 | private Role[] roles; 22 | 23 | @Override 24 | public String toString() { 25 | return "Movie{" + 26 | "name='" + name + '\'' + 27 | ", url='" + url + '\'' + 28 | ", type='" + type + '\'' + 29 | ", score='" + score + '\'' + 30 | ", time='" + time + '\'' + 31 | ", posterUrl='" + posterUrl + '\'' + 32 | ", roles=" + Arrays.toString(roles) + 33 | '}'; 34 | } 35 | 36 | public String getName() { 37 | return name; 38 | } 39 | 40 | public void setName(String name) { 41 | this.name = name; 42 | } 43 | 44 | public String getType() { 45 | return type; 46 | } 47 | 48 | public void setType(String type) { 49 | this.type = type; 50 | } 51 | 52 | public String getUrl() { 53 | return url; 54 | } 55 | 56 | public void setUrl(String url) { 57 | this.url = url; 58 | } 59 | 60 | public String getTime() { 61 | return time; 62 | } 63 | 64 | public void setTime(String time) { 65 | this.time = time; 66 | } 67 | 68 | public String getScore() { 69 | return score; 70 | } 71 | 72 | public void setScore(String score) { 73 | this.score = score; 74 | } 75 | 76 | public String getPosterUrl() { 77 | return posterUrl; 78 | } 79 | 80 | public void setPosterUrl(String posterUrl) { 81 | this.posterUrl = posterUrl; 82 | } 83 | 84 | public Role[] getRoles() { 85 | return roles; 86 | } 87 | 88 | public void setRoles(Role[] roles) { 89 | this.roles = roles; 90 | } 91 | 92 | @Override 93 | public int describeContents() { 94 | return 0; 95 | } 96 | 97 | @Override 98 | public void writeToParcel(Parcel dest, int flags) { 99 | 100 | } 101 | 102 | 103 | public class Role{ 104 | 105 | public Role() {} 106 | 107 | private String name; 108 | private String url; 109 | 110 | @Override 111 | public String toString() { 112 | return "Role{" + 113 | "name='" + name + '\'' + 114 | ", url='" + url + '\'' + 115 | '}'; 116 | } 117 | 118 | public Role(String name, String url) { 119 | this.name = name; 120 | this.url = url; 121 | } 122 | 123 | public String getName() { 124 | return name; 125 | } 126 | 127 | public void setName(String name) { 128 | this.name = name; 129 | } 130 | 131 | public String getUrl() { 132 | return url; 133 | } 134 | 135 | public void setUrl(String url) { 136 | this.url = url; 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/adapter/VarietyRecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.andy.free.R; 13 | import com.andy.free.VarietyActivity; 14 | import com.andy.free.bean.Variety; 15 | import com.andy.free.utils.ImageLoaderUtils; 16 | 17 | import java.util.ArrayList; 18 | import java.util.List; 19 | 20 | /** 21 | * Created by Administrator on 2017/11/13. 22 | */ 23 | public class VarietyRecyclerViewAdapter extends RecyclerView.Adapter { 24 | 25 | private Context context; 26 | private List mVarietyList; 27 | private LayoutInflater inflater; 28 | private OnItemClickListener mOnItemClickListener; 29 | 30 | public VarietyRecyclerViewAdapter(Context context, ArrayList mVarietyList) { 31 | 32 | this.context=context; 33 | this.mVarietyList=mVarietyList; 34 | inflater=LayoutInflater.from(context); 35 | } 36 | 37 | @Override 38 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 39 | return new VarietyViewHolder(inflater.inflate(R.layout.item_variety_main,parent,false)); 40 | } 41 | 42 | @Override 43 | public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { 44 | 45 | VarietyViewHolder varietyViewHolder= (VarietyViewHolder) holder; 46 | 47 | varietyViewHolder.varietyLastTextView.setText(mVarietyList.get(position).getLatestEpisode()); 48 | varietyViewHolder.varietyNameTextView.setText(mVarietyList.get(position).getName()); 49 | varietyViewHolder.varietySimpleDescTextView.setText(mVarietyList.get(position).getSimpleDesc()); 50 | 51 | ImageLoaderUtils.display(context,varietyViewHolder.varietyPoster,mVarietyList.get(position).getPosterUrl()); 52 | 53 | varietyViewHolder.rootLayout.setOnClickListener(new View.OnClickListener() { 54 | @Override 55 | public void onClick(View v) { 56 | mOnItemClickListener.onClick(position,mVarietyList.get(position).getDescUrl()); 57 | } 58 | }); 59 | 60 | } 61 | 62 | @Override 63 | public int getItemCount() { 64 | return mVarietyList.size(); 65 | } 66 | 67 | class VarietyViewHolder extends RecyclerView.ViewHolder { 68 | 69 | private LinearLayout rootLayout; 70 | private ImageView varietyPoster; 71 | private TextView varietyLastTextView; 72 | private TextView varietyNameTextView; 73 | private TextView varietySimpleDescTextView; 74 | 75 | public VarietyViewHolder(View itemView) { 76 | super(itemView); 77 | 78 | rootLayout= (LinearLayout) itemView.findViewById(R.id.variety_root_layout); 79 | varietyPoster= (ImageView) itemView.findViewById(R.id.variety_poster); 80 | varietyLastTextView= (TextView) itemView.findViewById(R.id.tv_last); 81 | varietyNameTextView= (TextView) itemView.findViewById(R.id.variety_name); 82 | varietySimpleDescTextView= (TextView) itemView.findViewById(R.id.variety_simple_desc); 83 | } 84 | } 85 | 86 | public interface OnItemClickListener{ 87 | void onClick(int pos,String descUrl); 88 | } 89 | 90 | public void setOnItemClickListener(OnItemClickListener listener){ 91 | mOnItemClickListener=listener; 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/FilmActivity.java: -------------------------------------------------------------------------------- 1 | package com.andy.free; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.design.widget.TabLayout; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v4.app.FragmentManager; 8 | import android.support.v4.app.FragmentPagerAdapter; 9 | import android.support.v4.view.ViewPager; 10 | import android.support.v7.app.AppCompatActivity; 11 | import android.support.v7.widget.Toolbar; 12 | import android.view.View; 13 | 14 | import com.andy.free.fragment.FilmFragment; 15 | import com.flyco.tablayout.SlidingTabLayout; 16 | 17 | import java.util.ArrayList; 18 | 19 | import butterknife.BindView; 20 | import butterknife.ButterKnife; 21 | import butterknife.Unbinder; 22 | 23 | /** 24 | * Created by Administrator on 2017/10/26. 25 | */ 26 | 27 | public class FilmActivity extends AppCompatActivity implements TabLayout.OnTabSelectedListener { 28 | 29 | private Unbinder mUnbinder; 30 | 31 | private ArrayList fragments=new ArrayList<>(); 32 | private final String[] mTitles={"2345影视","爱奇艺","腾讯视频","优酷视频","PP聚力","哔哩哔哩","芒果TV","华数TV","乐视视频"}; 33 | 34 | private FilmPagerAdapter mPagerAdapter; 35 | 36 | @BindView(R.id.film_toolbar) 37 | Toolbar mToolbar; 38 | @BindView(R.id.filmTab) 39 | SlidingTabLayout mSlidingTabLayout; 40 | @BindView(R.id.film_viewPager) 41 | ViewPager mViewPager; 42 | 43 | @Override 44 | protected void onCreate(@Nullable Bundle savedInstanceState) { 45 | super.onCreate(savedInstanceState); 46 | 47 | setContentView(R.layout.activity_film); 48 | mUnbinder= ButterKnife.bind(this); 49 | 50 | //设置显示toolbar 51 | mToolbar.setTitle("全网电影"); 52 | setSupportActionBar(mToolbar); 53 | 54 | mToolbar.setNavigationIcon(R.drawable.back); 55 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 56 | @Override 57 | public void onClick(View v) { 58 | finish(); 59 | } 60 | }); 61 | 62 | //初始化Fragment 63 | initFragments(); 64 | 65 | mPagerAdapter=new FilmPagerAdapter(getSupportFragmentManager()); 66 | mViewPager.setAdapter(mPagerAdapter); 67 | 68 | 69 | mSlidingTabLayout.setViewPager(mViewPager); 70 | 71 | } 72 | 73 | /* 74 | * 根据titles初始化Fragments 75 | * */ 76 | private void initFragments() { 77 | 78 | for (int i=0;i movieList=new ArrayList(); 26 | private Movie movie; 27 | private Movie.Role[] roles; 28 | private Bundle bundle=new Bundle(); 29 | private String mUrl; 30 | 31 | public IqiyiJsoupThread() {} 32 | 33 | /* 34 | * 构造函数实现handler传递消息到主线程 35 | * */ 36 | public IqiyiJsoupThread(Handler handler,String mUrl) { 37 | 38 | this.mHanler=handler; 39 | this.mUrl=mUrl; 40 | } 41 | 42 | 43 | @Override 44 | public void run() { 45 | 46 | Document doc = null; 47 | try { 48 | doc = Jsoup.connect(mUrl).timeout(260000).get(); 49 | } catch (IOException e) { 50 | e.printStackTrace(); 51 | } 52 | 53 | if (null!=doc) { 54 | Elements lis = doc.select("a.site-piclist_pic_link"); 55 | Elements timeSpans = doc.select("span.icon-vInfo"); 56 | Elements scores = doc.select("span.score"); 57 | Elements rolesInfos = doc.select("div.role_info"); 58 | 59 | 60 | Movie[] movies = new Movie[lis.size()]; 61 | 62 | for (int i = 0; i < lis.size(); i++) { 63 | 64 | movie = new Movie(); 65 | 66 | String link = lis.get(i).attr("href"); 67 | String name = lis.get(i).attr("title"); 68 | String time = timeSpans.get(i).text().trim(); 69 | String s = ""; 70 | try { 71 | s=scores.get(i).text(); 72 | }catch (IndexOutOfBoundsException e){ 73 | Log.d("log",e.toString()); 74 | } 75 | 76 | String posterUrl = lis.get(i).select("img").attr("src"); 77 | 78 | movie.setScore(s); 79 | movie.setName(name); 80 | movie.setUrl(link); 81 | movie.setTime(time); 82 | movie.setType("付费院线"); 83 | movie.setPosterUrl(posterUrl); 84 | 85 | if (i < rolesInfos.size()) { 86 | Elements rolesEm = rolesInfos.get(i).select("a"); 87 | roles = new Movie.Role[rolesEm.size()]; 88 | 89 | for (int j = 0; j < rolesEm.size(); j++) { 90 | 91 | Movie.Role role = movie.new Role(); 92 | String roleHref = rolesEm.get(j).attr("href").trim(); 93 | String roleName = rolesEm.get(j).text().trim(); 94 | 95 | role.setName(roleName); 96 | role.setUrl(roleHref); 97 | 98 | roles[j] = role; 99 | } 100 | movie.setRoles(roles); 101 | } 102 | 103 | movies[i] = movie; 104 | movieList.add(movie); 105 | /* Log.d("Element", "time="+time); 106 | Log.d("Element", "name="+name+",link="+link); 107 | Log.d("Element", "score="+s);*/ 108 | } 109 | } 110 | Message message=new Message(); 111 | message.obj=movieList; 112 | message.what=1; 113 | 114 | mHanler.sendMessage(message); 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/x5/X5WebView.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.x5; 2 | 3 | import android.annotation.SuppressLint; 4 | import android.content.Context; 5 | import android.graphics.Canvas; 6 | import android.graphics.Paint; 7 | import android.os.Build; 8 | import android.util.AttributeSet; 9 | import android.view.View; 10 | import android.widget.TextView; 11 | 12 | import com.tencent.smtt.sdk.QbSdk; 13 | import com.tencent.smtt.sdk.WebSettings; 14 | import com.tencent.smtt.sdk.WebSettings.LayoutAlgorithm; 15 | import com.tencent.smtt.sdk.WebView; 16 | import com.tencent.smtt.sdk.WebViewClient; 17 | 18 | public class X5WebView extends WebView { 19 | 20 | TextView title; 21 | private WebViewClient client = new WebViewClient() { 22 | /** 23 | * 防止加载网页时调起系统浏览器 24 | */ 25 | public boolean shouldOverrideUrlLoading(WebView view, String url) { 26 | view.loadUrl(url); 27 | return true; 28 | } 29 | }; 30 | 31 | @SuppressLint("SetJavaScriptEnabled") 32 | public X5WebView(Context arg0, AttributeSet arg1) { 33 | super(arg0, arg1); 34 | this.setWebViewClient(client); 35 | //this.setWebChromeClient(chromeClient); 36 | // WebStorage webStorage = WebStorage.getInstance(); 37 | initWebViewSettings(); 38 | this.getView().setClickable(true); 39 | } 40 | 41 | private void initWebViewSettings() { 42 | WebSettings webSetting = this.getSettings(); 43 | webSetting.setJavaScriptEnabled(true); 44 | webSetting.setJavaScriptCanOpenWindowsAutomatically(true); 45 | webSetting.setAllowFileAccess(true); 46 | webSetting.setLayoutAlgorithm(LayoutAlgorithm.NARROW_COLUMNS); 47 | webSetting.setSupportZoom(true); 48 | webSetting.setBuiltInZoomControls(true); 49 | webSetting.setUseWideViewPort(true); 50 | webSetting.setSupportMultipleWindows(true); 51 | // webSetting.setLoadWithOverviewMode(true); 52 | webSetting.setAppCacheEnabled(true); 53 | // webSetting.setDatabaseEnabled(true); 54 | webSetting.setDomStorageEnabled(true); 55 | webSetting.setGeolocationEnabled(true); 56 | webSetting.setAppCacheMaxSize(Long.MAX_VALUE); 57 | // webSetting.setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY); 58 | webSetting.setPluginState(WebSettings.PluginState.ON_DEMAND); 59 | // webSetting.setRenderPriority(WebSettings.RenderPriority.HIGH); 60 | webSetting.setCacheMode(WebSettings.LOAD_NO_CACHE); 61 | 62 | // this.getSettingsExtension().setPageCacheCapacity(IX5WebSettings.DEFAULT_CACHE_CAPACITY);//extension 63 | // settings 的设计 64 | } 65 | 66 | @Override 67 | protected boolean drawChild(Canvas canvas, View child, long drawingTime) { 68 | boolean ret = super.drawChild(canvas, child, drawingTime); 69 | canvas.save(); 70 | Paint paint = new Paint(); 71 | paint.setColor(0x7fff0000); 72 | paint.setTextSize(24.f); 73 | paint.setAntiAlias(true); 74 | if (getX5WebViewExtension() != null) { 75 | canvas.drawText(this.getContext().getPackageName() + "-pid:" 76 | + android.os.Process.myPid(), 10, 50, paint); 77 | canvas.drawText( 78 | "X5 Core:" + QbSdk.getTbsVersion(this.getContext()), 10, 79 | 100, paint); 80 | } else { 81 | canvas.drawText(this.getContext().getPackageName() + "-pid:" 82 | + android.os.Process.myPid(), 10, 50, paint); 83 | canvas.drawText("Sys Core", 10, 100, paint); 84 | } 85 | canvas.drawText(Build.MANUFACTURER, 10, 150, paint); 86 | canvas.drawText(Build.MODEL, 10, 200, paint); 87 | canvas.restore(); 88 | return ret; 89 | } 90 | 91 | public X5WebView(Context arg0) { 92 | super(arg0); 93 | setBackgroundColor(85621); 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_tv.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 13 | 16 | 17 | 26 | 27 | 28 | 29 | 30 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 67 | 68 | 69 | 73 | 74 | 75 | 76 | 85 | 86 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_me.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 14 | 22 | 23 | 32 | 33 | 40 | 51 | 52 | 53 | 54 | 64 | 65 | 71 | 77 | 78 | 79 | 88 | 89 | 95 | 101 | 102 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/adapter/TvContentRecyclerViewAdapter.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | import android.widget.LinearLayout; 10 | import android.widget.TextView; 11 | 12 | import com.andy.free.R; 13 | import com.andy.free.TvActivity; 14 | import com.andy.free.bean.TvSeries; 15 | import com.andy.free.utils.ImageLoaderUtils; 16 | 17 | import java.util.ArrayList; 18 | 19 | /** 20 | * Created by Administrator on 2017/11/1. 21 | */ 22 | public class TvContentRecyclerViewAdapter extends RecyclerView.Adapter { 23 | 24 | private Context mContext; 25 | private ArrayList mTvList; 26 | private LayoutInflater inflater; 27 | private OnTvItemClickListener mOnTvItemClickListener; 28 | 29 | public TvContentRecyclerViewAdapter(Context mContext, ArrayList mTvList) { 30 | 31 | this.mContext=mContext; 32 | this.mTvList=mTvList; 33 | inflater=LayoutInflater.from(mContext); 34 | } 35 | 36 | @Override 37 | public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 38 | return new TvViewHolder(inflater.inflate(R.layout.item_tv_main,parent,false)); 39 | } 40 | 41 | @Override 42 | public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { 43 | 44 | TvViewHolder tvViewHolder= (TvViewHolder) holder; 45 | 46 | TvSeries series=mTvList.get(position); 47 | tvViewHolder.tvName.setText(series.getTvName()); 48 | tvViewHolder.tvNumber.setText(series.getTvNumber()); 49 | tvViewHolder.tvScore.setText(series.getScore()); 50 | TvSeries.Actor[] actors = series.getActors(); 51 | 52 | String actorStr=""; 53 | for (int i=0;i fragments; 44 | 45 | private Unbinder mUnbinder; 46 | private MainViewPagerAdapter mainViewPagerAdapter; 47 | 48 | @Override 49 | protected void onCreate(Bundle savedInstanceState) { 50 | super.onCreate(savedInstanceState); 51 | setContentView(R.layout.activity_main); 52 | 53 | mUnbinder= ButterKnife.bind(this); 54 | 55 | initFragment(); 56 | 57 | mainViewPagerAdapter=new MainViewPagerAdapter(getSupportFragmentManager(),fragments); 58 | mViewPager.setAdapter(mainViewPagerAdapter); 59 | mViewPager.addOnPageChangeListener(this); 60 | 61 | mMainRadio.setOnClickListener(this); 62 | mSearchRadio.setOnClickListener(this); 63 | mSaleRadio.setOnClickListener(this); 64 | mMeRadio.setOnClickListener(this); 65 | 66 | } 67 | 68 | private void initFragment() { 69 | fragments=new ArrayList<>(); 70 | MainFragment mainFragment=new MainFragment(); 71 | SearchFragment searchFragment=new SearchFragment(); 72 | SaleFragment saleFragment=new SaleFragment(); 73 | MeFragment meFragment=new MeFragment(); 74 | 75 | fragments.add(mainFragment); 76 | fragments.add(searchFragment); 77 | fragments.add(saleFragment); 78 | fragments.add(meFragment); 79 | 80 | 81 | } 82 | 83 | @Override 84 | protected void onDestroy() { 85 | super.onDestroy(); 86 | mUnbinder.unbind(); 87 | } 88 | 89 | @Override 90 | public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { 91 | 92 | } 93 | 94 | @Override 95 | public void onPageSelected(int position) { 96 | 97 | resetCheckedState(); 98 | 99 | switch (position){ 100 | case 0: 101 | mMainRadio.setChecked(true); 102 | break; 103 | case 1: 104 | mSearchRadio.setChecked(true); 105 | break; 106 | case 2: 107 | mSaleRadio.setChecked(true); 108 | break; 109 | case 3: 110 | mMeRadio.setChecked(true); 111 | break; 112 | default: 113 | break; 114 | } 115 | 116 | } 117 | 118 | private void resetCheckedState() { 119 | mMainRadio.setChecked(false); 120 | mSearchRadio.setChecked(false); 121 | mSaleRadio.setChecked(false); 122 | mMeRadio.setChecked(false); 123 | } 124 | 125 | @Override 126 | public void onPageScrollStateChanged(int state) { 127 | 128 | } 129 | 130 | @Override 131 | public void onClick(View v) { 132 | switch (v.getId()){ 133 | case R.id.radio_main: 134 | mViewPager.setCurrentItem(0); 135 | break; 136 | case R.id.radio_search: 137 | mViewPager.setCurrentItem(1); 138 | 139 | break; 140 | case R.id.radio_sale: 141 | mViewPager.setCurrentItem(2); 142 | 143 | break; 144 | case R.id.radio_me: 145 | mViewPager.setCurrentItem(3); 146 | break; 147 | default: 148 | break; 149 | } 150 | } 151 | } 152 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/bean/Variety.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | 6 | /** 7 | * Created by Andy Lau on 2017/11/13. 8 | */ 9 | public class Variety implements Serializable { 10 | 11 | public Variety() { 12 | } 13 | 14 | private String name; 15 | private String simpleDesc; 16 | private String LatestEpisode; 17 | private String posterUrl; 18 | private String descUrl; 19 | private String type; 20 | private String time; 21 | private String area; 22 | private String hostName; 23 | private ArrayList simpleVarieties; 24 | 25 | @Override 26 | public String toString() { 27 | return "Variety{" + 28 | "name='" + name + '\'' + 29 | ", simpleDesc='" + simpleDesc + '\'' + 30 | ", LatestEpisode='" + LatestEpisode + '\'' + 31 | ", posterUrl='" + posterUrl + '\'' + 32 | ", descUrl='" + descUrl + '\'' + 33 | ", type='" + type + '\'' + 34 | ", time='" + time + '\'' + 35 | ", area='" + area + '\'' + 36 | ", hostName='" + hostName + '\'' + 37 | ", simpleVarieties=" + simpleVarieties + 38 | '}'; 39 | } 40 | 41 | public String getName() { 42 | return name; 43 | } 44 | 45 | public void setName(String name) { 46 | this.name = name; 47 | } 48 | 49 | public String getSimpleDesc() { 50 | return simpleDesc; 51 | } 52 | 53 | public void setSimpleDesc(String simpleDesc) { 54 | this.simpleDesc = simpleDesc; 55 | } 56 | 57 | public String getLatestEpisode() { 58 | return LatestEpisode; 59 | } 60 | 61 | public void setLatestEpisode(String latestEpisode) { 62 | LatestEpisode = latestEpisode; 63 | } 64 | 65 | public String getPosterUrl() { 66 | return posterUrl; 67 | } 68 | 69 | public void setPosterUrl(String posterUrl) { 70 | this.posterUrl = posterUrl; 71 | } 72 | 73 | public String getDescUrl() { 74 | return descUrl; 75 | } 76 | 77 | public void setDescUrl(String descUrl) { 78 | this.descUrl = descUrl; 79 | } 80 | 81 | public String getType() { 82 | return type; 83 | } 84 | 85 | public void setType(String type) { 86 | this.type = type; 87 | } 88 | 89 | public String getTime() { 90 | return time; 91 | } 92 | 93 | public void setTime(String time) { 94 | this.time = time; 95 | } 96 | 97 | public String getArea() { 98 | return area; 99 | } 100 | 101 | public void setArea(String area) { 102 | this.area = area; 103 | } 104 | 105 | public String getHostName() { 106 | return hostName; 107 | } 108 | 109 | public void setHostName(String hostName) { 110 | this.hostName = hostName; 111 | } 112 | 113 | public ArrayList getSimpleVarieties() { 114 | return simpleVarieties; 115 | } 116 | 117 | public void setSimpleVarieties(ArrayList simpleVarieties) { 118 | this.simpleVarieties = simpleVarieties; 119 | } 120 | 121 | class simpleVariety implements Serializable{ 122 | 123 | 124 | public simpleVariety() { 125 | } 126 | 127 | @Override 128 | public String toString() { 129 | return "simpleVariety{" + 130 | "desc='" + desc + '\'' + 131 | ", episodeName='" + episodeName + '\'' + 132 | ", posterUrl='" + posterUrl + '\'' + 133 | ", playUrl='" + playUrl + '\'' + 134 | '}'; 135 | } 136 | 137 | private String desc; 138 | private String episodeName; 139 | private String posterUrl; 140 | private String playUrl; 141 | 142 | public String getDesc() { 143 | return desc; 144 | } 145 | 146 | public void setDesc(String desc) { 147 | this.desc = desc; 148 | } 149 | 150 | public String getEpisodeName() { 151 | return episodeName; 152 | } 153 | 154 | public void setEpisodeName(String episodeName) { 155 | this.episodeName = episodeName; 156 | } 157 | 158 | public String getPosterUrl() { 159 | return posterUrl; 160 | } 161 | 162 | public void setPosterUrl(String posterUrl) { 163 | this.posterUrl = posterUrl; 164 | } 165 | 166 | public String getPlayUrl() { 167 | return playUrl; 168 | } 169 | 170 | public void setPlayUrl(String playUrl) { 171 | this.playUrl = playUrl; 172 | } 173 | } 174 | } 175 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/utils/ImageLoaderUtils.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.utils; 2 | 3 | /** 4 | * Created by Andy Lau on 2017/8/14. 5 | * Description : 图片加载工具类 使用glide框架封装 6 | */ 7 | 8 | import android.content.Context; 9 | import android.widget.ImageView; 10 | 11 | import com.andy.free.R; 12 | import com.bumptech.glide.Glide; 13 | import com.bumptech.glide.load.DecodeFormat; 14 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 15 | 16 | import java.io.File; 17 | 18 | public class ImageLoaderUtils { 19 | /* 20 | * thumbnail(0.5f)//设置播放比例 21 | * diskCacheStrategy(DiskCacheStrategy strategy)设置缓存策略 DiskCacheStrategy.SOURCE|DiskCacheStrategy.RESULT|DiskCacheStrategy.ALL|DiskCacheStrategy.NONE 22 | * priority(Priority priority)//设置优先级 23 | * dontAnimate()//移除所有动画 24 | * animate()//一步加载完成后执行的动画 25 | * placeholder()//设置占位图片 26 | * error()加载错误时显示的图片 27 | * allback(int resourceId)//设置model为空显示的图片,未设置显示error图片 28 | * skipMemoryCache(boolean skip)//设置是否跳过内存缓存,不保证一定不被缓存 29 | * into()设置将被加载的目标资源 30 | * asBitmap()//无论是gif还是普通图片都当做bitmap对待,动图将显示第一帧 31 | * asGif()//把资源当做gifDrawable对待,如果不是则显示error设置的图片 32 | * crossFade()//设置加载动画 33 | * transform()//图片转换 34 | * */ 35 | public static void display(Context context, ImageView imageView, String url, int placeholder, int error) { 36 | if (imageView == null) { 37 | throw new IllegalArgumentException("argument error"); 38 | } 39 | Glide.with(context).load(url).placeholder(placeholder) 40 | .error(error).crossFade().into(imageView); 41 | } 42 | 43 | public static void display(Context context, ImageView imageView, String url) { 44 | if (imageView == null) { 45 | throw new IllegalArgumentException("argument error"); 46 | } 47 | Glide.with(context).load(url) 48 | .diskCacheStrategy(DiskCacheStrategy.ALL) 49 | .centerCrop() 50 | .placeholder(R.drawable.ic_image_loading) 51 | .error(R.drawable.ic_image_loading) 52 | .crossFade().into(imageView); 53 | } 54 | 55 | public static void display(Context context, ImageView imageView, File url) { 56 | if (imageView == null) { 57 | throw new IllegalArgumentException("argument error"); 58 | } 59 | Glide.with(context).load(url) 60 | .diskCacheStrategy(DiskCacheStrategy.ALL) 61 | .centerCrop() 62 | .placeholder(R.drawable.ic_image_loading) 63 | .error(R.drawable.ic_image_loading) 64 | .crossFade().into(imageView); 65 | } 66 | 67 | public static void displaySmallPhoto(Context context, ImageView imageView, String url) { 68 | if (imageView == null) { 69 | throw new IllegalArgumentException("argument error"); 70 | } 71 | Glide.with(context).load(url).asBitmap() 72 | .diskCacheStrategy(DiskCacheStrategy.ALL) 73 | .placeholder(R.drawable.ic_image_loading) 74 | .error(R.drawable.ic_image_loading) 75 | .thumbnail(0.5f) 76 | .into(imageView); 77 | } 78 | 79 | 80 | public static void displayBigPhoto(Context context, ImageView imageView, String url) { 81 | if (imageView == null) { 82 | throw new IllegalArgumentException("argument error"); 83 | } 84 | Glide.with(context).load(url).asBitmap() 85 | .format(DecodeFormat.PREFER_ARGB_8888) 86 | .fitCenter() 87 | .diskCacheStrategy(DiskCacheStrategy.ALL) 88 | .placeholder(R.drawable.ic_image_loading) 89 | .error(R.drawable.ic_image_loading) 90 | .into(imageView); 91 | } 92 | 93 | 94 | public static void display(Context context, ImageView imageView, int url) { 95 | if (imageView == null) { 96 | throw new IllegalArgumentException("argument error"); 97 | } 98 | Glide.with(context).load(url) 99 | .diskCacheStrategy(DiskCacheStrategy.ALL) 100 | .centerCrop() 101 | .placeholder(R.drawable.ic_image_loading) 102 | .error(R.drawable.ic_image_loading) 103 | .crossFade() 104 | .into(imageView); 105 | } 106 | 107 | public static void displayRound(Context context, ImageView imageView, String url) { 108 | if (imageView == null) { 109 | throw new IllegalArgumentException("argument error"); 110 | } 111 | Glide.with(context).load(url) 112 | .diskCacheStrategy(DiskCacheStrategy.ALL) 113 | .error(R.drawable.ic_image_loading) 114 | .centerCrop() 115 | .transform(new GlideRoundTransformUtil(context)).into(imageView); 116 | } 117 | 118 | } 119 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/bean/TvSeries.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.bean; 2 | 3 | import java.io.Serializable; 4 | import java.util.ArrayList; 5 | import java.util.Arrays; 6 | import java.util.Map; 7 | 8 | /** 9 | * Created by Administrator on 2017/11/2. 10 | */ 11 | public class TvSeries implements Serializable { 12 | 13 | private String area; 14 | private String sourceType; 15 | private String tvNumber; 16 | private String tvName; 17 | private String score; 18 | private Actor[] actors; 19 | private String director; 20 | private String tvType; 21 | private String time; 22 | private String alias; 23 | private String desc; 24 | private String posterUrl; 25 | private String descUrl; 26 | private ArrayList> playNumAndUrls; 27 | 28 | @Override 29 | public String toString() { 30 | return "TvSeries{" + 31 | "area='" + area + '\'' + 32 | ", sourceType='" + sourceType + '\'' + 33 | ", tvNumber='" + tvNumber + '\'' + 34 | ", tvName='" + tvName + '\'' + 35 | ", score='" + score + '\'' + 36 | ", actors=" + Arrays.toString(actors) + 37 | ", director='" + director + '\'' + 38 | ", tvType='" + tvType + '\'' + 39 | ", time='" + time + '\'' + 40 | ", alias='" + alias + '\'' + 41 | ", desc='" + desc + '\'' + 42 | ", posterUrl='" + posterUrl + '\'' + 43 | ", descUrl='" + descUrl + '\'' + 44 | ", playNumAndUrls=" + playNumAndUrls + 45 | '}'; 46 | } 47 | 48 | public ArrayList> getPlayNumAndUrls() { 49 | return playNumAndUrls; 50 | } 51 | 52 | public void setPlayNumAndUrls(ArrayList> playNumAndUrls) { 53 | this.playNumAndUrls = playNumAndUrls; 54 | } 55 | 56 | public String getDescUrl(){ 57 | return descUrl; 58 | } 59 | 60 | public void setDescUrl(String descUrl){ 61 | this.descUrl=descUrl; 62 | } 63 | 64 | public String getPosterUrl() { 65 | return posterUrl; 66 | } 67 | 68 | public void setPosterUrl(String posterUrl) { 69 | this.posterUrl = posterUrl; 70 | } 71 | 72 | public String getArea() { 73 | return area; 74 | } 75 | 76 | public void setArea(String area) { 77 | this.area = area; 78 | } 79 | 80 | public String getSourceType() { 81 | return sourceType; 82 | } 83 | 84 | public void setSourceType(String sourceType) { 85 | this.sourceType = sourceType; 86 | } 87 | 88 | public String getTvNumber() { 89 | return tvNumber; 90 | } 91 | 92 | public void setTvNumber(String tvNumber) { 93 | this.tvNumber = tvNumber; 94 | } 95 | 96 | public String getTvName() { 97 | return tvName; 98 | } 99 | 100 | public void setTvName(String tvName) { 101 | this.tvName = tvName; 102 | } 103 | 104 | public String getScore() { 105 | return score; 106 | } 107 | 108 | public void setScore(String score) { 109 | this.score = score; 110 | } 111 | 112 | public Actor[] getActors() { 113 | return actors; 114 | } 115 | 116 | public void setActors(Actor[] actors) { 117 | this.actors = actors; 118 | } 119 | 120 | public String getDirector() { 121 | return director; 122 | } 123 | 124 | public void setDirector(String director) { 125 | this.director = director; 126 | } 127 | 128 | public String getTvType() { 129 | return tvType; 130 | } 131 | 132 | public void setTvType(String tvType) { 133 | this.tvType = tvType; 134 | } 135 | 136 | public String getTime() { 137 | return time; 138 | } 139 | 140 | public void setTime(String time) { 141 | this.time = time; 142 | } 143 | 144 | public String getAlias() { 145 | return alias; 146 | } 147 | 148 | public void setAlias(String alias) { 149 | this.alias = alias; 150 | } 151 | 152 | public String getDesc() { 153 | return desc; 154 | } 155 | 156 | public void setDesc(String desc) { 157 | this.desc = desc; 158 | } 159 | 160 | public class Actor implements Serializable{ 161 | 162 | private String name; 163 | private String url; 164 | 165 | public Actor(String name, String url) { 166 | this.name = name; 167 | this.url = url; 168 | } 169 | 170 | public Actor() { 171 | } 172 | 173 | @Override 174 | public String toString() { 175 | return "Actor{" + 176 | "name='" + name + '\'' + 177 | ", url='" + url + '\'' + 178 | '}'; 179 | } 180 | 181 | public String getName() { 182 | return name; 183 | } 184 | 185 | public void setName(String name) { 186 | this.name = name; 187 | } 188 | 189 | public String getUrl() { 190 | return url; 191 | } 192 | 193 | public void setUrl(String url) { 194 | this.url = url; 195 | } 196 | } 197 | 198 | } 199 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/widget/NestedScrollWebView.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.widget; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.MotionEventCompat; 5 | import android.support.v4.view.NestedScrollingChild; 6 | import android.support.v4.view.NestedScrollingChildHelper; 7 | import android.support.v4.view.ViewCompat; 8 | import android.util.AttributeSet; 9 | import android.view.MotionEvent; 10 | import android.webkit.WebView; 11 | 12 | public class NestedScrollWebView extends WebView implements NestedScrollingChild { 13 | 14 | public static final String TAG = NestedScrollWebView.class.getSimpleName(); 15 | 16 | private int mLastMotionY; 17 | 18 | private final int[] mScrollOffset = new int[2]; 19 | private final int[] mScrollConsumed = new int[2]; 20 | 21 | private int mNestedYOffset; 22 | 23 | private NestedScrollingChildHelper mChildHelper; 24 | 25 | public NestedScrollWebView(Context context) { 26 | super(context); 27 | init(); 28 | } 29 | 30 | public NestedScrollWebView(Context context, AttributeSet attrs) { 31 | super(context, attrs); 32 | init(); 33 | } 34 | 35 | public NestedScrollWebView(Context context, AttributeSet attrs, int defStyleAttr) { 36 | super(context, attrs, defStyleAttr); 37 | init(); 38 | } 39 | 40 | private void init() { 41 | mChildHelper = new NestedScrollingChildHelper(this); 42 | setNestedScrollingEnabled(true); 43 | } 44 | 45 | @Override 46 | public boolean onTouchEvent(MotionEvent event) { 47 | boolean result = false; 48 | 49 | MotionEvent trackedEvent = MotionEvent.obtain(event); 50 | 51 | final int action = MotionEventCompat.getActionMasked(event); 52 | 53 | if (action == MotionEvent.ACTION_DOWN) { 54 | mNestedYOffset = 0; 55 | } 56 | 57 | int y = (int) event.getY(); 58 | 59 | event.offsetLocation(0, mNestedYOffset); 60 | 61 | switch (action) { 62 | case MotionEvent.ACTION_DOWN: 63 | mLastMotionY = y; 64 | startNestedScroll(ViewCompat.SCROLL_AXIS_VERTICAL); 65 | result = super.onTouchEvent(event); 66 | break; 67 | case MotionEvent.ACTION_MOVE: 68 | int deltaY = mLastMotionY - y; 69 | 70 | if (dispatchNestedPreScroll(0, deltaY, mScrollConsumed, mScrollOffset)) { 71 | deltaY -= mScrollConsumed[1]; 72 | trackedEvent.offsetLocation(0, mScrollOffset[1]); 73 | mNestedYOffset += mScrollOffset[1]; 74 | } 75 | 76 | mLastMotionY = y - mScrollOffset[1]; 77 | 78 | int oldY = getScrollY(); 79 | int newScrollY = Math.max(0, oldY + deltaY); 80 | int dyConsumed = newScrollY - oldY; 81 | int dyUnconsumed = deltaY - dyConsumed; 82 | 83 | if (dispatchNestedScroll(0, dyConsumed, 0, dyUnconsumed, mScrollOffset)) { 84 | mLastMotionY -= mScrollOffset[1]; 85 | trackedEvent.offsetLocation(0, mScrollOffset[1]); 86 | mNestedYOffset += mScrollOffset[1]; 87 | } 88 | 89 | result = super.onTouchEvent(trackedEvent); 90 | trackedEvent.recycle(); 91 | break; 92 | case MotionEvent.ACTION_POINTER_DOWN: 93 | case MotionEvent.ACTION_UP: 94 | case MotionEvent.ACTION_CANCEL: 95 | stopNestedScroll(); 96 | result = super.onTouchEvent(event); 97 | break; 98 | } 99 | return result; 100 | } 101 | 102 | // NestedScrollingChild 103 | 104 | @Override 105 | public void setNestedScrollingEnabled(boolean enabled) { 106 | mChildHelper.setNestedScrollingEnabled(enabled); 107 | } 108 | 109 | @Override 110 | public boolean isNestedScrollingEnabled() { 111 | return mChildHelper.isNestedScrollingEnabled(); 112 | } 113 | 114 | @Override 115 | public boolean startNestedScroll(int axes) { 116 | return mChildHelper.startNestedScroll(axes); 117 | } 118 | 119 | @Override 120 | public void stopNestedScroll() { 121 | mChildHelper.stopNestedScroll(); 122 | } 123 | 124 | @Override 125 | public boolean hasNestedScrollingParent() { 126 | return mChildHelper.hasNestedScrollingParent(); 127 | } 128 | 129 | @Override 130 | public boolean dispatchNestedScroll(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow) { 131 | return mChildHelper.dispatchNestedScroll(dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed, offsetInWindow); 132 | } 133 | 134 | @Override 135 | public boolean dispatchNestedPreScroll(int dx, int dy, int[] consumed, int[] offsetInWindow) { 136 | return mChildHelper.dispatchNestedPreScroll(dx, dy, consumed, offsetInWindow); 137 | } 138 | 139 | @Override 140 | public boolean dispatchNestedFling(float velocityX, float velocityY, boolean consumed) { 141 | return mChildHelper.dispatchNestedFling(velocityX, velocityY, consumed); 142 | } 143 | 144 | @Override 145 | public boolean dispatchNestedPreFling(float velocityX, float velocityY) { 146 | return mChildHelper.dispatchNestedPreFling(velocityX, velocityY); 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/bean/FullMovie.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.bean; 2 | 3 | import android.os.Parcel; 4 | import android.os.Parcelable; 5 | 6 | import java.io.Serializable; 7 | import java.util.ArrayList; 8 | import java.util.Arrays; 9 | import java.util.Map; 10 | 11 | /** 12 | * Created by Administrator on 2017/10/28. 13 | */ 14 | 15 | public class FullMovie implements Serializable { 16 | 17 | //名字 18 | private String name; 19 | //类型 20 | private String type; 21 | //地区 22 | private String area; 23 | //年代 24 | private String year; 25 | //付费状态 26 | private String payState; 27 | //主演 28 | public Actors[] actors; 29 | //评分 30 | private String score; 31 | //播放链接 32 | private ArrayList> urls; 33 | //海报url 34 | private String posterUrl; 35 | //描述 36 | private String desc; 37 | //时长 38 | private String time; 39 | //2345细节链接 40 | private String descUrl; 41 | 42 | public String getDescUrl(){ 43 | return descUrl; 44 | } 45 | 46 | public void setDescUrl(String descUrl){ 47 | this.descUrl=descUrl; 48 | } 49 | 50 | public String getTime(){ 51 | return time; 52 | } 53 | 54 | public void setTime(String time){ 55 | this.time=time; 56 | } 57 | 58 | public String getDesc() { 59 | return desc; 60 | } 61 | 62 | public void setDesc(String desc) { 63 | this.desc = desc; 64 | } 65 | 66 | public String getName() { 67 | return name; 68 | } 69 | 70 | public void setName(String name) { 71 | this.name = name; 72 | } 73 | 74 | public String getType() { 75 | return type; 76 | } 77 | 78 | public void setType(String type) { 79 | this.type = type; 80 | } 81 | 82 | public String getArea() { 83 | return area; 84 | } 85 | 86 | public void setArea(String area) { 87 | this.area = area; 88 | } 89 | 90 | public String getYear() { 91 | return year; 92 | } 93 | 94 | public void setYear(String year) { 95 | this.year = year; 96 | } 97 | 98 | public String getPayState() { 99 | return payState; 100 | } 101 | 102 | public void setPayState(String payState) { 103 | this.payState = payState; 104 | } 105 | 106 | public Actors[] getActors() { 107 | return actors; 108 | } 109 | 110 | public void setActors(Actors[] actors) { 111 | this.actors = actors; 112 | } 113 | 114 | public String getScore() { 115 | return score; 116 | } 117 | 118 | public void setScore(String score) { 119 | this.score = score; 120 | } 121 | 122 | public ArrayList> getUrls() { 123 | return urls; 124 | } 125 | 126 | public void setUrls(ArrayList> urls) { 127 | this.urls = urls; 128 | } 129 | 130 | public String getPosterUrl() { 131 | return posterUrl; 132 | } 133 | 134 | public void setPosterUrl(String posterUrl) { 135 | this.posterUrl = posterUrl; 136 | } 137 | 138 | public FullMovie(String name, String type, String area, String year, String payState, Actors[] 139 | actors, String score, ArrayList> urls, String posterUrl,String desc,String time,String descUrl) { 140 | this.name = name; 141 | this.type = type; 142 | this.area = area; 143 | this.year = year; 144 | this.payState = payState; 145 | this.actors = actors; 146 | this.score = score; 147 | this.urls = urls; 148 | this.posterUrl = posterUrl; 149 | this.desc=desc; 150 | this.time=time; 151 | this.descUrl=descUrl; 152 | } 153 | 154 | public FullMovie() { 155 | } 156 | 157 | @Override 158 | public String toString() { 159 | return "FullMovie{" + 160 | "name='" + name + '\'' + 161 | ", type='" + type + '\'' + 162 | ", area='" + area + '\'' + 163 | ", year='" + year + '\'' + 164 | ", payState='" + payState + '\'' + 165 | ", actors=" + Arrays.toString(actors) + 166 | ", score='" + score + '\'' + 167 | ", urls=" + urls + 168 | ", posterUrl='" + posterUrl + '\'' + 169 | ", desc='" + desc + '\'' + 170 | ", time='" + time + '\'' + 171 | ", descUrl='" + descUrl + '\'' + 172 | '}'; 173 | } 174 | 175 | public class Actors implements Serializable { 176 | 177 | private String name; 178 | private String personPageUrl; 179 | 180 | public Actors() { 181 | } 182 | 183 | public Actors(String name, String personPageUrl) { 184 | this.name = name; 185 | this.personPageUrl = personPageUrl; 186 | } 187 | 188 | public String getName() { 189 | return name; 190 | } 191 | 192 | public void setName(String name) { 193 | this.name = name; 194 | } 195 | 196 | public String getPersonPageUrl() { 197 | return personPageUrl; 198 | } 199 | 200 | public void setPersonPageUrl(String personPageUrl) { 201 | this.personPageUrl = personPageUrl; 202 | } 203 | 204 | @Override 205 | public String toString() { 206 | return "Actors{" + 207 | "name='" + name + '\'' + 208 | ", personPageUrl='" + personPageUrl + '\'' + 209 | '}'; 210 | } 211 | } 212 | 213 | } 214 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # Attempt to set APP_HOME 46 | # Resolve links: $0 may be a link 47 | PRG="$0" 48 | # Need this for relative symlinks. 49 | while [ -h "$PRG" ] ; do 50 | ls=`ls -ld "$PRG"` 51 | link=`expr "$ls" : '.*-> \(.*\)$'` 52 | if expr "$link" : '/.*' > /dev/null; then 53 | PRG="$link" 54 | else 55 | PRG=`dirname "$PRG"`"/$link" 56 | fi 57 | done 58 | SAVED="`pwd`" 59 | cd "`dirname \"$PRG\"`/" >/dev/null 60 | APP_HOME="`pwd -P`" 61 | cd "$SAVED" >/dev/null 62 | 63 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 64 | 65 | # Determine the Java command to use to start the JVM. 66 | if [ -n "$JAVA_HOME" ] ; then 67 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 68 | # IBM's JDK on AIX uses strange locations for the executables 69 | JAVACMD="$JAVA_HOME/jre/sh/java" 70 | else 71 | JAVACMD="$JAVA_HOME/bin/java" 72 | fi 73 | if [ ! -x "$JAVACMD" ] ; then 74 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 75 | 76 | Please set the JAVA_HOME variable in your environment to match the 77 | location of your Java installation." 78 | fi 79 | else 80 | JAVACMD="java" 81 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 82 | 83 | Please set the JAVA_HOME variable in your environment to match the 84 | location of your Java installation." 85 | fi 86 | 87 | # Increase the maximum file descriptors if we can. 88 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 89 | MAX_FD_LIMIT=`ulimit -H -n` 90 | if [ $? -eq 0 ] ; then 91 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 92 | MAX_FD="$MAX_FD_LIMIT" 93 | fi 94 | ulimit -n $MAX_FD 95 | if [ $? -ne 0 ] ; then 96 | warn "Could not set maximum file descriptor limit: $MAX_FD" 97 | fi 98 | else 99 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 100 | fi 101 | fi 102 | 103 | # For Darwin, add options to specify how the application appears in the dock 104 | if $darwin; then 105 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 106 | fi 107 | 108 | # For Cygwin, switch paths to Windows format before running java 109 | if $cygwin ; then 110 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 111 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 112 | JAVACMD=`cygpath --unix "$JAVACMD"` 113 | 114 | # We build the pattern for arguments to be converted via cygpath 115 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 116 | SEP="" 117 | for dir in $ROOTDIRSRAW ; do 118 | ROOTDIRS="$ROOTDIRS$SEP$dir" 119 | SEP="|" 120 | done 121 | OURCYGPATTERN="(^($ROOTDIRS))" 122 | # Add a user-defined pattern to the cygpath arguments 123 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 124 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 125 | fi 126 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 127 | i=0 128 | for arg in "$@" ; do 129 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 130 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 131 | 132 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 133 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 134 | else 135 | eval `echo args$i`="\"$arg\"" 136 | fi 137 | i=$((i+1)) 138 | done 139 | case $i in 140 | (0) set -- ;; 141 | (1) set -- "$args0" ;; 142 | (2) set -- "$args0" "$args1" ;; 143 | (3) set -- "$args0" "$args1" "$args2" ;; 144 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 145 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 146 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 147 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 148 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 149 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 150 | esac 151 | fi 152 | 153 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 154 | function splitJvmOpts() { 155 | JVM_OPTS=("$@") 156 | } 157 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 158 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 159 | 160 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 161 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/Jsoup/TvDetailJsoup.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.Jsoup; 2 | 3 | import android.os.Handler; 4 | import android.os.Message; 5 | import android.util.Log; 6 | 7 | import com.andy.free.bean.TvSeries; 8 | 9 | import org.jsoup.Jsoup; 10 | import org.jsoup.nodes.Document; 11 | import org.jsoup.nodes.Element; 12 | import org.jsoup.select.Elements; 13 | 14 | import java.io.IOException; 15 | import java.net.URLEncoder; 16 | import java.util.ArrayList; 17 | import java.util.HashMap; 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | /** 22 | * Created by Administrator on 2017/11/9. 23 | */ 24 | 25 | public class TvDetailJsoup { 26 | 27 | private TvSeries series=new TvSeries(); 28 | 29 | private String detailUrl; 30 | private Handler mHandler; 31 | private boolean suc; 32 | private requestEndListener mRequestEndListener; 33 | 34 | public TvDetailJsoup() { 35 | } 36 | 37 | public TvDetailJsoup(String detailUrl) { 38 | this.detailUrl = detailUrl; 39 | 40 | mHandler=new Handler(){ 41 | @Override 42 | public void handleMessage(Message msg) { 43 | super.handleMessage(msg); 44 | if (msg.what==0){ 45 | suc=false; 46 | } 47 | 48 | mRequestEndListener.onRequestEnd(msg.obj,suc); 49 | } 50 | }; 51 | } 52 | 53 | /* 54 | * 启动下载线程 55 | * */ 56 | public void start(){ 57 | new LoadThread().start(); 58 | } 59 | 60 | private class LoadThread extends Thread{ 61 | 62 | @Override 63 | public void run() { 64 | super.run(); 65 | 66 | grabTvDetail(); 67 | 68 | Message message=new Message(); 69 | message.what=1; 70 | message.obj=series; 71 | mHandler.sendMessage(message); 72 | } 73 | 74 | private void grabTvDetail(){ 75 | 76 | Log.d("grabTvDetail",detailUrl); 77 | 78 | Document doc=getRequestAddHeader(detailUrl); 79 | if (null!=doc){ 80 | 81 | ArrayList> seriesMap=new ArrayList<>(); 82 | Elements serials=doc.select("div.playNumList").select("a"); 83 | 84 | int j=0; 85 | 86 | for (int i=0;i map=new HashMap<>(); 90 | map.put(j,url); 91 | seriesMap.add(map); 92 | j=j+1; 93 | } 94 | series.setPlayNumAndUrls(seriesMap); 95 | 96 | 97 | series.setTvName(doc.select("div.tit").select("a").attr("title")); 98 | 99 | series.setPosterUrl("http:"+doc.select("div.posterCon").select("img").attr("src")); 100 | 101 | series.setScore(doc.select("em.emScore").text()); 102 | 103 | Elements textDesLis=doc.select("ul.txtList").select("li"); 104 | 105 | Elements actorAs=textDesLis.get(0).select("a"); 106 | Elements actorEms=textDesLis.get(0).select("em"); 107 | 108 | TvSeries.Actor[] actors=new TvSeries.Actor[actorAs.size()+actorEms.size()-2]; 109 | for (int i=0;i 2 | 7 | 8 | 14 | 15 | 22 | 23 | 27 | 28 | 35 | 45 | 54 | 55 | 56 | 57 | 58 | 59 | 65 | 66 | 72 | 73 | 74 | 75 | 85 | 86 | 99 | 100 | 112 | 113 | 125 | 137 | 138 | 139 | 140 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/adapter/FilmFragmentAdapter.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.support.v7.widget.RecyclerView.Adapter; 6 | import android.util.Log; 7 | import android.view.LayoutInflater; 8 | import android.view.View; 9 | import android.view.ViewGroup; 10 | import android.widget.ImageView; 11 | import android.widget.LinearLayout; 12 | import android.widget.TextView; 13 | 14 | import com.andy.free.R; 15 | import com.andy.free.bean.FullMovie; 16 | import com.andy.free.bean.Movie; 17 | import com.andy.free.utils.ImageLoaderUtils; 18 | 19 | import java.util.ArrayList; 20 | import java.util.List; 21 | 22 | /** 23 | * Created by Andy Lau on 2017/10/26. 24 | */ 25 | public class FilmFragmentAdapter extends RecyclerView.Adapter { 26 | 27 | 28 | private Context mContext; 29 | private ArrayList mList; 30 | private LayoutInflater mInflater; 31 | private MainRecyclerViewAdapter.onFilmItemClickListener mOnFilmItemClickListener; 32 | private Movie mMovie; 33 | private FullMovie mFullMovie; 34 | 35 | public FilmFragmentAdapter(Context mContext, ArrayList mList) { 36 | this.mContext = mContext; 37 | this.mList = mList; 38 | mInflater=LayoutInflater.from(mContext); 39 | } 40 | 41 | @Override 42 | public FilmItemViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 43 | return new FilmItemViewHolder(mInflater.inflate(R.layout.item_main_movie,parent,false)); 44 | } 45 | 46 | @Override 47 | public void onBindViewHolder(RecyclerView.ViewHolder holder, final int position) { 48 | FilmItemViewHolder filmItemViewHolder= (FilmItemViewHolder) holder; 49 | 50 | //Log.d("onBindViewHolder","position="+position); 51 | 52 | String filmTime=""; 53 | String filmPosterUrl=""; 54 | String filmName=""; 55 | String playUrl=""; 56 | 57 | 58 | if (mList.get(position) instanceof Movie){ 59 | 60 | mMovie= (Movie) mList.get(position); 61 | 62 | filmTime=mMovie.getTime(); 63 | filmPosterUrl=mMovie.getPosterUrl(); 64 | filmName=mMovie.getName(); 65 | playUrl=mMovie.getUrl(); 66 | Movie.Role[] filmActors=mMovie.getRoles(); 67 | 68 | if (null!=filmActors) { 69 | String actor = ""; 70 | for (int i = 0; i < filmActors.length; i++) { 71 | 72 | if (i == 0) { 73 | actor = filmActors[i].getName(); 74 | }else { 75 | actor = actor + "|" + filmActors[i].getName(); 76 | } 77 | 78 | filmItemViewHolder.filmActor.setText(actor); 79 | } 80 | } 81 | }else { 82 | 83 | mFullMovie= (FullMovie) mList.get(position); 84 | filmTime=mFullMovie.getScore(); 85 | filmName=mFullMovie.getName(); 86 | filmPosterUrl=mFullMovie.getPosterUrl(); 87 | 88 | if (null==mFullMovie.getDescUrl()){ 89 | playUrl=mFullMovie.getUrls().get(0).get("tencentUrl"); 90 | }else { 91 | playUrl=mFullMovie.getDescUrl(); 92 | } 93 | 94 | FullMovie.Actors[] movieActors=mFullMovie.getActors(); 95 | 96 | if (null!=movieActors) { 97 | String actor = ""; 98 | for (int i = 0; i < movieActors.length; i++) { 99 | 100 | if (i == 0) { 101 | actor = movieActors[i].getName(); 102 | }else { 103 | actor = actor + "|" + movieActors[i].getName(); 104 | } 105 | 106 | filmItemViewHolder.filmActor.setText(actor); 107 | } 108 | } 109 | } 110 | 111 | if (null==filmTime||filmTime.equals("")){ 112 | filmTime="00:00"; 113 | } 114 | 115 | filmItemViewHolder.filmTime.setText(filmTime); 116 | filmItemViewHolder.filmName.setText(filmName); 117 | 118 | ImageLoaderUtils.display(mContext,filmItemViewHolder.filmPoster,filmPosterUrl); 119 | 120 | //Log.d("onBindViewHolder","filmPosterUrl="+filmPosterUrl); 121 | 122 | final String finalPlayUrl = playUrl; 123 | filmItemViewHolder.movieRootLayout.setOnClickListener(new View.OnClickListener() { 124 | @Override 125 | public void onClick(View v) { 126 | 127 | mOnFilmItemClickListener.onItemClick(position, finalPlayUrl); 128 | } 129 | }); 130 | 131 | } 132 | 133 | @Override 134 | public int getItemCount() { 135 | return mList.size(); 136 | } 137 | 138 | /* 139 | * 电影item的viewHolder 140 | * */ 141 | private class FilmItemViewHolder extends RecyclerView.ViewHolder { 142 | 143 | private ImageView filmPoster; 144 | private TextView filmTime; 145 | private TextView filmName; 146 | private TextView filmActor; 147 | private LinearLayout movieRootLayout; 148 | 149 | public FilmItemViewHolder(View itemView) { 150 | super(itemView); 151 | 152 | filmPoster= (ImageView) itemView.findViewById(R.id.film_poster); 153 | filmName= (TextView) itemView.findViewById(R.id.film_name); 154 | filmActor= (TextView) itemView.findViewById(R.id.film_actor); 155 | filmTime= (TextView) itemView.findViewById(R.id.film_time); 156 | movieRootLayout= (LinearLayout) itemView.findViewById(R.id.movie_root_layout); 157 | } 158 | } 159 | 160 | public interface onFilmItemClickListener{ 161 | void onItemClick(int position,String playUrl); 162 | } 163 | 164 | public void setOnFilmItemClickListener(MainRecyclerViewAdapter.onFilmItemClickListener listener){ 165 | this.mOnFilmItemClickListener=listener; 166 | } 167 | } 168 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/Jsoup/VarietyJsoup.java: -------------------------------------------------------------------------------- 1 | package com.andy.free.Jsoup; 2 | 3 | import android.os.Handler; 4 | import android.os.Message; 5 | import android.util.Log; 6 | 7 | import com.andy.free.bean.Variety; 8 | 9 | import org.jsoup.Jsoup; 10 | import org.jsoup.nodes.Document; 11 | import org.jsoup.select.Elements; 12 | 13 | import java.io.IOException; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | /** 18 | * Created by Administrator on 2017/11/13. 19 | */ 20 | 21 | public class VarietyJsoup { 22 | 23 | private String varietyAreaKey; 24 | private int pageNum; 25 | 26 | private List varietyList=new ArrayList<>(); 27 | private Handler mHandler; 28 | private boolean suc; 29 | private requestEndListener mRequestEndListener; 30 | 31 | public VarietyJsoup() { 32 | } 33 | 34 | public VarietyJsoup(String varietyAreaKey, int pageNum) { 35 | this.varietyAreaKey = varietyAreaKey; 36 | this.pageNum = pageNum; 37 | 38 | mHandler=new Handler(){ 39 | @Override 40 | public void handleMessage(Message msg) { 41 | super.handleMessage(msg); 42 | if (msg.what==0){ 43 | suc=false; 44 | } 45 | 46 | mRequestEndListener.onRequestEnd(msg.obj,suc); 47 | } 48 | }; 49 | } 50 | 51 | /* 52 | * 启动下载线程 53 | * */ 54 | public void start(){ 55 | new LoadThread().start(); 56 | } 57 | 58 | 59 | private class LoadThread extends Thread{ 60 | 61 | @Override 62 | public void run() { 63 | super.run(); 64 | 65 | grabVariety(); 66 | 67 | Message message=new Message(); 68 | message.what=1; 69 | message.obj=varietyList; 70 | mHandler.sendMessage(message); 71 | } 72 | } 73 | 74 | /* 75 | * 2345抓取综艺 76 | * */ 77 | private void grabVariety() { 78 | 79 | //http://kan.2345.com/zongyi/l/ 80 | //http://kan.2345.com/zongyi/ldqdalu/ 81 | //http://kan.2345.com/zongyi/ldqgangtai/ 82 | //http://kan.2345.com/zongyi/ldqrihan/ 83 | //http://kan.2345.com/zongyi/ldqoumei/ 84 | //http://kan.2345.com/zongyi/lpxdefault/2/ 85 | //http://kan.2345.com/zongyi/ldqgangtai/pxdefault/2/ 86 | String url=""; 87 | if (pageNum==1){ 88 | url="http://kan.2345.com/zongyi/l"+varietyAreaKey; 89 | }else { 90 | url="http://kan.2345.com/zongyi/l"+varietyAreaKey+"/pxdefault/"+pageNum; 91 | } 92 | 93 | Document doc=getRequestAddHeader(url); 94 | 95 | if (null!=doc) { 96 | 97 | Elements lis=doc.select("ul.v_picTxt").select("li"); 98 | for (int i=0;i mList=new ArrayList<>(); 48 | private MainRecyclerViewAdapter mMainAdapter; 49 | 50 | private Boolean isGet=true; 51 | private String url = "http://list.iqiyi.com/www/1/------27815----2---4-1-1-iqiyi--.html"; 52 | private int pageNum=1; 53 | private Handler handler=null; 54 | 55 | public MainFragment() { 56 | 57 | handler = new Handler() { 58 | @Override 59 | public void handleMessage(Message msg) { 60 | super.handleMessage(msg); 61 | 62 | List movies = (List) msg.obj; 63 | mList.addAll(movies); 64 | 65 | for (int i = 0; i < movies.size(); i++) { 66 | Log.d("Element", "movie=" + movies.get(i).toString()); 67 | } 68 | mMainAdapter.notifyDataSetChanged(); 69 | } 70 | }; 71 | } 72 | 73 | @Override 74 | public void onCreate(@Nullable Bundle savedInstanceState) { 75 | super.onCreate(savedInstanceState); 76 | 77 | 78 | } 79 | 80 | @Nullable 81 | @Override 82 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 83 | 84 | View view = inflater.inflate(R.layout.fragment_main, null); 85 | 86 | mIRecyclerView = (IRecyclerView) view.findViewById(R.id.main_IRecyclerView); 87 | 88 | //通过线程获取数据 89 | if (mList.size()==0&&isGet){ 90 | 91 | url="http://list.iqiyi.com/www/1/------27815----2---4-1-"+pageNum+"-iqiyi--.html"; 92 | IqiyiJsoupThread thread = new IqiyiJsoupThread(handler,url); 93 | thread.start(); 94 | isGet=false; 95 | } 96 | 97 | initIRecyclerView(); 98 | 99 | return view; 100 | } 101 | 102 | private void initIRecyclerView() { 103 | 104 | mMainAdapter=new MainRecyclerViewAdapter(getContext(),mList); 105 | mIRecyclerView.setIAdapter(mMainAdapter); 106 | 107 | GridLayoutManager manager=new GridLayoutManager(getActivity(),3, LinearLayoutManager.VERTICAL,false); 108 | 109 | //设置item跨度 110 | manager.setSpanSizeLookup(new GridLayoutManager.SpanSizeLookup() { 111 | @Override 112 | public int getSpanSize(int position) { 113 | if (position==2||position==3||position==4||position==(mList.size()+5)){ 114 | return 3; 115 | } 116 | return 1; 117 | } 118 | }); 119 | 120 | mIRecyclerView.setLayoutManager(manager); 121 | mIRecyclerView.setOnRefreshListener(this); 122 | 123 | mMainAdapter.setOnFilmItemClickListener(new MainRecyclerViewAdapter.onFilmItemClickListener() { 124 | @Override 125 | public void onItemClick(int position, String playUrl) { 126 | 127 | String trueUrl= ConstantUtil.BASE_URL+playUrl; 128 | 129 | //TbsVideo.openVideo(getActivity(),trueUrl); 130 | 131 | Intent intent=new Intent(getActivity(), X5PlayWebActivity.class); 132 | intent.putExtra("trueUrl",trueUrl); 133 | startActivity(intent); 134 | } 135 | }); 136 | 137 | mMainAdapter.setOnFuncItemClickListener(new MainRecyclerViewAdapter.onFuncItemClickListener() { 138 | @Override 139 | public void onItemClick(int position) { 140 | 141 | //Toast.makeText(getActivity(),position+"",Toast.LENGTH_SHORT).show(); 142 | switch (position){ 143 | case 0: 144 | Intent filmIntent=new Intent(getActivity(), FilmActivity.class); 145 | startActivity(filmIntent); 146 | break; 147 | case 1: 148 | Intent tvIntent=new Intent(getActivity(), TvActivity.class); 149 | startActivity(tvIntent); 150 | break; 151 | case 2: 152 | Intent intent=new Intent(getActivity(), LiveActivity.class); 153 | startActivity(intent); 154 | break; 155 | case 3: 156 | Intent varietyIntent=new Intent(getActivity(), VarietyActivity.class); 157 | startActivity(varietyIntent); 158 | break; 159 | default: 160 | break; 161 | } 162 | } 163 | }); 164 | } 165 | 166 | @Override 167 | public void onRefresh() { 168 | mIRecyclerView.setRefreshing(true); 169 | 170 | pageNum=pageNum+1; 171 | 172 | url="http://list.iqiyi.com/www/1/------27815----2---4-"+pageNum+"-1-iqiyi--.html"; 173 | 174 | Log.d("url",url); 175 | IqiyiJsoupThread thread = new IqiyiJsoupThread(handler,url); 176 | thread.start(); 177 | 178 | mIRecyclerView.setRefreshing(false); 179 | 180 | } 181 | } 182 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_fun.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 21 | 22 | 30 | 31 | 38 | 39 | 45 | 51 | 59 | 60 | 66 | 72 | 80 | 81 | 82 | 83 | 89 | 95 | 101 | 109 | 110 | 116 | 122 | 130 | 131 | 137 | 138 | 144 | 152 | 153 | 154 | 155 | -------------------------------------------------------------------------------- /app/src/main/java/com/andy/free/LiveActivity.java: -------------------------------------------------------------------------------- 1 | package com.andy.free; 2 | 3 | import android.app.ProgressDialog; 4 | import android.graphics.Bitmap; 5 | import android.os.Build; 6 | import android.os.Bundle; 7 | import android.support.annotation.Nullable; 8 | import android.support.v7.app.AppCompatActivity; 9 | import android.support.v7.widget.Toolbar; 10 | import android.util.Log; 11 | import android.view.KeyEvent; 12 | import android.view.View; 13 | import android.view.WindowManager; 14 | import android.webkit.WebChromeClient; 15 | import android.webkit.WebResourceError; 16 | import android.webkit.WebResourceRequest; 17 | import android.webkit.WebSettings; 18 | import android.webkit.WebView; 19 | import android.webkit.WebViewClient; 20 | import android.widget.ImageView; 21 | import android.widget.Toast; 22 | 23 | import com.andy.free.widget.NestedScrollWebView; 24 | 25 | import butterknife.BindView; 26 | import butterknife.ButterKnife; 27 | import butterknife.Unbinder; 28 | import cn.pedant.SweetAlert.SweetAlertDialog; 29 | 30 | /** 31 | * Created by Administrator on 2017/9/27. 32 | */ 33 | 34 | public class LiveActivity extends AppCompatActivity implements View.OnClickListener { 35 | 36 | @BindView(R.id.live_toolbar) 37 | Toolbar mToolbar; 38 | 39 | @BindView(R.id.live_webView) 40 | NestedScrollWebView mWebView; 41 | 42 | @BindView(R.id.share_icon) 43 | ImageView shareBtn; 44 | 45 | Unbinder mUnbinder; 46 | 47 | private ProgressDialog mProgressDlg; 48 | private SweetAlertDialog sweetAlertDialog; 49 | 50 | @Override 51 | protected void onCreate(@Nullable Bundle savedInstanceState) { 52 | super.onCreate(savedInstanceState); 53 | 54 | setContentView(R.layout.activity_live); 55 | mUnbinder=ButterKnife.bind(this); 56 | 57 | //mToolbar= (Toolbar) findViewById(R.id.live_toolbar); 58 | mToolbar.setTitle("直播"); 59 | setSupportActionBar(mToolbar); 60 | getSupportActionBar().setDisplayHomeAsUpEnabled(true); 61 | mToolbar.setNavigationOnClickListener(new View.OnClickListener() { 62 | @Override 63 | public void onClick(View v) { 64 | onBackPressed(); 65 | } 66 | }); 67 | 68 | mProgressDlg = new ProgressDialog(this); 69 | 70 | sweetAlertDialog=new SweetAlertDialog(this, SweetAlertDialog.PROGRESS_TYPE) 71 | .setTitleText("正在努力加载中..."); 72 | sweetAlertDialog.setCancelable(true); 73 | setWebView(); 74 | 75 | shareBtn.setOnClickListener(this); 76 | } 77 | 78 | private void setWebView() { 79 | 80 | final String url="http://live.bianxianmao.com/redirect.htm?appKey=70e6374729e743118af31c3d6bb1828d&appType=app&appEntrance=1"; 81 | 82 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_HARDWARE_ACCELERATED); 83 | 84 | WebSettings webSettings=mWebView.getSettings(); 85 | webSettings.setJavaScriptEnabled(true); 86 | mWebView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY); 87 | webSettings.setLayoutAlgorithm(WebSettings.LayoutAlgorithm.NARROW_COLUMNS); 88 | webSettings.setSupportMultipleWindows(false); 89 | webSettings.setDefaultTextEncodingName("UTF-8"); 90 | webSettings.setRenderPriority(WebSettings.RenderPriority.HIGH); 91 | 92 | int i = Build.VERSION.SDK_INT; 93 | try { 94 | webSettings.setAllowFileAccess(true); 95 | if (i>= 5) { 96 | webSettings.setDatabaseEnabled(true); 97 | webSettings.setGeolocationEnabled(true); 98 | } 99 | 100 | if (i>= 7) { 101 | webSettings.setAppCacheEnabled(true); 102 | webSettings.setDomStorageEnabled(true); 103 | webSettings.setUseWideViewPort(true); 104 | webSettings.setLoadWithOverviewMode(true); 105 | } 106 | if (i>= 8) { 107 | webSettings.setPluginState(WebSettings.PluginState.ON); 108 | } 109 | webSettings.setBuiltInZoomControls(false); 110 | webSettings.setSupportZoom(false); 111 | webSettings.setAppCachePath(this.getCacheDir().getAbsolutePath()); 112 | } catch (Exception e) { 113 | } 114 | 115 | mWebView.loadUrl(url); 116 | mWebView.setWebViewClient(new WebViewClient(){ 117 | @Override 118 | public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) { 119 | 120 | view.loadUrl(url); 121 | return true; 122 | 123 | } 124 | 125 | @Override 126 | public void onPageStarted(WebView view, String url, Bitmap favicon) { 127 | super.onPageStarted(view, url, favicon); 128 | 129 | if (!sweetAlertDialog.isShowing()){ 130 | sweetAlertDialog.show(); 131 | } 132 | 133 | } 134 | 135 | @Override 136 | public void onPageFinished(WebView view, String url) { 137 | super.onPageFinished(view, url); 138 | if (sweetAlertDialog.isShowing()){ 139 | sweetAlertDialog.dismiss(); 140 | } 141 | } 142 | 143 | @Override 144 | public void onReceivedError(WebView view, WebResourceRequest request, WebResourceError error) { 145 | super.onReceivedError(view, request, error); 146 | 147 | if (sweetAlertDialog.isShowing()){ 148 | sweetAlertDialog.dismiss(); 149 | } 150 | } 151 | }); 152 | 153 | mWebView.setWebChromeClient(new WebChromeClient(){ 154 | @Override 155 | public void onProgressChanged(WebView view, int newProgress) { 156 | super.onProgressChanged(view, newProgress); 157 | 158 | if (newProgress<=90){ 159 | //sweetAlertDialog.setProgress(newProgress); 160 | }else { 161 | sweetAlertDialog.dismiss(); 162 | } 163 | } 164 | }); 165 | } 166 | 167 | @Override 168 | public boolean onKeyDown(int keyCode, KeyEvent event) { 169 | 170 | if ((keyCode==event.KEYCODE_BACK)&&mWebView.canGoBack()){ 171 | 172 | mWebView.goBack(); 173 | 174 | return true; 175 | } 176 | 177 | return super.onKeyDown(keyCode, event); 178 | 179 | } 180 | 181 | /* 182 | * 分享按钮点击事件监听 183 | * */ 184 | @Override 185 | public void onClick(View v) { 186 | switch (v.getId()){ 187 | case R.id.share_icon: 188 | 189 | /* final ShareDialog dialog=new ShareDialog(mContext,R.style.Theme_share_dialog); 190 | dialog.show(); 191 | dialog.setShareItemClickListener(new ShareDialog.OnShareItemClickListener() { 192 | @Override 193 | public void onItemClick(View view) { 194 | 195 | switch (view.getId()){ 196 | case R.id.btn_share_cancel: 197 | dialog.dismiss(); 198 | break; 199 | default: 200 | Toast.makeText(mContext,"暂时不支持分享!",Toast.LENGTH_LONG).show(); 201 | break; 202 | } 203 | } 204 | });*/ 205 | break; 206 | default: 207 | break; 208 | } 209 | } 210 | } 211 | --------------------------------------------------------------------------------