├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── encodings.xml ├── gradle.xml ├── markdown-navigator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── LICENSE ├── README.md ├── app ├── .gitignore ├── app-release.apk ├── build.gradle ├── libs │ └── pldroid-player-1.5.0.jar ├── proguard-rules.pro ├── src │ ├── androidTest │ │ └── java │ │ │ └── com │ │ │ └── king │ │ │ └── tv │ │ │ └── ExampleInstrumentedTest.java │ ├── main │ │ ├── AndroidManifest.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── king │ │ │ │ └── tv │ │ │ │ ├── App.java │ │ │ │ ├── Constants.java │ │ │ │ ├── MainActivity.java │ │ │ │ ├── bean │ │ │ │ ├── AppStart.java │ │ │ │ ├── Banner.java │ │ │ │ ├── EnterRoom.java │ │ │ │ ├── LiveCategory.java │ │ │ │ ├── LiveInfo.java │ │ │ │ ├── LiveListResult.java │ │ │ │ ├── P.java │ │ │ │ ├── Rank.java │ │ │ │ ├── Recommend.java │ │ │ │ ├── Room.java │ │ │ │ ├── RoomLine.java │ │ │ │ ├── SearchRequestBody.java │ │ │ │ ├── SearchResult.java │ │ │ │ └── StreamSrc.java │ │ │ │ ├── dao │ │ │ │ └── greendao │ │ │ │ │ ├── DaoMaster.java │ │ │ │ │ ├── DaoSession.java │ │ │ │ │ ├── LiveCategoryDao.java │ │ │ │ │ └── LiveInfoDao.java │ │ │ │ ├── di │ │ │ │ ├── component │ │ │ │ │ ├── AppComponent.java │ │ │ │ │ └── HomeComponent.java │ │ │ │ ├── module │ │ │ │ │ ├── AppModule.java │ │ │ │ │ ├── CateroyModule.java │ │ │ │ │ └── LiveListModule.java │ │ │ │ └── scope │ │ │ │ │ ├── ActivityScope.java │ │ │ │ │ └── FragmentScope.java │ │ │ │ ├── http │ │ │ │ ├── APIRetrofit.java │ │ │ │ ├── APIService.java │ │ │ │ └── converter │ │ │ │ │ ├── GsonConverterFactory.java │ │ │ │ │ ├── GsonRequestBodyConverter.java │ │ │ │ │ └── GsonResponseBodyConverter.java │ │ │ │ ├── mvp │ │ │ │ ├── activity │ │ │ │ │ ├── ContentActivity.java │ │ │ │ │ ├── RoomActivity.java │ │ │ │ │ └── WelcomeActivity.java │ │ │ │ ├── adapter │ │ │ │ │ ├── EasyLiveAdapter.java │ │ │ │ │ ├── RecommendAdapter.java │ │ │ │ │ └── RecommendChildAdapter.java │ │ │ │ ├── base │ │ │ │ │ ├── BaseActivity.java │ │ │ │ │ ├── BaseFragment.java │ │ │ │ │ ├── BasePresenter.java │ │ │ │ │ ├── BaseView.java │ │ │ │ │ └── PureActivity.java │ │ │ │ ├── fragment │ │ │ │ │ ├── AboutFragment.java │ │ │ │ │ ├── AnchorInfoFragment.java │ │ │ │ │ ├── ChatFragment.java │ │ │ │ │ ├── FollowFragment.java │ │ │ │ │ ├── FullRoomFragment.java │ │ │ │ │ ├── HomeFragment.java │ │ │ │ │ ├── LiveFragment.java │ │ │ │ │ ├── LiveListFragment.java │ │ │ │ │ ├── LoginFragment.java │ │ │ │ │ ├── MineFragment.java │ │ │ │ │ ├── RankFragment.java │ │ │ │ │ ├── RecommendFragment.java │ │ │ │ │ ├── RoomFragment.java │ │ │ │ │ ├── SearchFragment.java │ │ │ │ │ ├── SimpleFragment.java │ │ │ │ │ ├── VideoFragment.java │ │ │ │ │ └── WebFragment.java │ │ │ │ ├── presenter │ │ │ │ │ ├── CategoryPresenter.java │ │ │ │ │ ├── ChatPresenter.java │ │ │ │ │ ├── LiveListPresenter.java │ │ │ │ │ ├── RecommendPresenter.java │ │ │ │ │ └── RoomPresenter.java │ │ │ │ └── view │ │ │ │ │ ├── ICategoryView.java │ │ │ │ │ ├── IChatView.java │ │ │ │ │ ├── ILiveListView.java │ │ │ │ │ ├── IRecommendView.java │ │ │ │ │ └── IRoomView.java │ │ │ │ ├── thread │ │ │ │ └── ThreadPoolManager.java │ │ │ │ ├── util │ │ │ │ ├── DecimalFormatUtil.java │ │ │ │ └── DensityUtil.java │ │ │ │ └── view │ │ │ │ └── ScollAwareFABBehavior.java │ │ ├── jnilibs │ │ │ ├── armeabi-v7a │ │ │ │ └── libpldroidplayer.so │ │ │ └── armeabi │ │ │ │ └── libpldroidplayer.so │ │ └── res │ │ │ ├── anim │ │ │ ├── fab_behavior_in.xml │ │ │ └── fab_behavior_out.xml │ │ │ ├── color │ │ │ └── tab_text_color.xml │ │ │ ├── drawable-xxhdpi │ │ │ ├── btn_close.png │ │ │ ├── btn_close_pressed.png │ │ │ ├── btn_conversation.png │ │ │ ├── btn_gift.png │ │ │ ├── btn_gift_pressed.png │ │ │ ├── btn_home_fenlei_more_normal.png │ │ │ ├── btn_home_fenlei_more_selected.png │ │ │ ├── btn_input.png │ │ │ ├── btn_input_pressed.png │ │ │ ├── btn_message.png │ │ │ ├── btn_message_pressed.png │ │ │ ├── btn_nav_close.png │ │ │ ├── btn_nav_close_click.png │ │ │ ├── btn_share.png │ │ │ ├── btn_share_pressed.png │ │ │ ├── btn_tabbar_guanzhu_normal.png │ │ │ ├── btn_tabbar_guanzhu_selected.png │ │ │ ├── btn_tabbar_home_normal.png │ │ │ ├── btn_tabbar_home_selected.png │ │ │ ├── btn_tabbar_wode_normal.png │ │ │ ├── btn_tabbar_wode_selected.png │ │ │ ├── btn_tabbar_zhibo_normal.png │ │ │ ├── btn_tabbar_zhibo_selected.png │ │ │ ├── default_recommend_icon.png │ │ │ ├── follow_lives_not_login.png │ │ │ ├── ic_back.png │ │ │ ├── ic_back_dark.png │ │ │ ├── ic_dot_normal.png │ │ │ ├── ic_dot_pressed.png │ │ │ ├── ic_history_islive.png │ │ │ ├── ic_hor_room_ban_send_danmu.png │ │ │ ├── ic_hor_room_ban_send_danmu_pressed.png │ │ │ ├── ic_mine_push_start.png │ │ │ ├── ic_tips_no_data.png │ │ │ ├── ic_tips_no_network.png │ │ │ ├── ic_top_message.png │ │ │ ├── ic_top_search.png │ │ │ ├── ic_triangle.png │ │ │ ├── ic_triangle_hor.png │ │ │ ├── ic_zhibojian_shu_back_normal.png │ │ │ ├── ic_zhibojian_shu_back_pressed.png │ │ │ ├── ic_zhibojian_shu_liwu.png │ │ │ ├── ic_zhibojian_shu_quanping_normal.png │ │ │ ├── ic_zhibojian_shu_quanping_pressed.png │ │ │ ├── icon_locationg.png │ │ │ ├── img_dm_xttz.png │ │ │ ├── img_zhibojian_shu_zhubo_gerenziliao.png │ │ │ ├── img_zhibojian_shu_zhubo_tg.png │ │ │ ├── mine_chat_message.png │ │ │ ├── mine_contribution.png │ │ │ ├── mine_default_avatar.png │ │ │ ├── mine_edit_profile.png │ │ │ ├── mine_game.png │ │ │ ├── mine_level.png │ │ │ ├── mine_niubi.png │ │ │ ├── mine_red_background.png │ │ │ ├── mine_seed.png │ │ │ ├── mine_setting.png │ │ │ ├── mine_starlight.png │ │ │ ├── mine_task.png │ │ │ ├── mine_watch.png │ │ │ ├── pic_portrait.png │ │ │ ├── quanmin_logo.png │ │ │ ├── res_contribution_header_avatar_bg.png │ │ │ ├── share_qq_on.png │ │ │ ├── share_sina.png │ │ │ └── share_weixin.png │ │ │ ├── drawable │ │ │ ├── btn_back_selector.xml │ │ │ ├── btn_close_selector.xml │ │ │ ├── btn_gift_selector.xml │ │ │ ├── btn_home_fenlei_more.xml │ │ │ ├── btn_input_selector.xml │ │ │ ├── btn_login_bg_normal.xml │ │ │ ├── btn_login_bg_pressed.xml │ │ │ ├── btn_login_selector.xml │ │ │ ├── btn_message_selector.xml │ │ │ ├── btn_nav_close_selector.xml │ │ │ ├── btn_share_selector.xml │ │ │ ├── btn_tabbar_guanzhu_selector.xml │ │ │ ├── btn_tabbar_home_selector.xml │ │ │ ├── btn_tabbar_wode_selector.xml │ │ │ ├── btn_tabbar_zhibo_selector.xml │ │ │ ├── btn_zhibojian_back_selector.xml │ │ │ ├── btn_zhibojian_fenxiang_selector.xml │ │ │ ├── btn_zhibojian_quanping_selector.xml │ │ │ ├── follow_login_btn_bg.xml │ │ │ ├── follow_login_btn_bg_pressed.xml │ │ │ ├── follow_login_btn_bg_selector.xml │ │ │ ├── full_room_avatar_bg.xml │ │ │ ├── ic_hor_room_ban_send_danmu_selector.xml │ │ │ ├── me_login_btn_bg.xml │ │ │ ├── progress_bar.xml │ │ │ ├── room_bottom_chat_bg.xml │ │ │ ├── room_chat_edit_bg.xml │ │ │ ├── room_tips_bg.xml │ │ │ ├── search_edit_bg.xml │ │ │ └── tab_text_color.xml │ │ │ ├── layout │ │ │ ├── activity_main.xml │ │ │ ├── activity_welcome.xml │ │ │ ├── banner.xml │ │ │ ├── bottom_tab_bar.xml │ │ │ ├── content.xml │ │ │ ├── cover.xml │ │ │ ├── fragment_about.xml │ │ │ ├── fragment_anchor.xml │ │ │ ├── fragment_chat.xml │ │ │ ├── fragment_content.xml │ │ │ ├── fragment_follow.xml │ │ │ ├── fragment_full_room.xml │ │ │ ├── fragment_home.xml │ │ │ ├── fragment_live.xml │ │ │ ├── fragment_live_list.xml │ │ │ ├── fragment_login.xml │ │ │ ├── fragment_mine.xml │ │ │ ├── fragment_rank.xml │ │ │ ├── fragment_recommend.xml │ │ │ ├── fragment_room.xml │ │ │ ├── fragment_search.xml │ │ │ ├── fragment_video.xml │ │ │ ├── fragment_webwiew.xml │ │ │ ├── layout_empty.xml │ │ │ ├── layout_error.xml │ │ │ ├── line_h.xml │ │ │ ├── line_h_mine.xml │ │ │ ├── line_h_mine_space.xml │ │ │ ├── list_live_item.xml │ │ │ ├── list_remmend_item.xml │ │ │ ├── load_more.xml │ │ │ ├── progress_bar.xml │ │ │ ├── room_bottom_chat_bar.xml │ │ │ ├── top_back_title_bar.xml │ │ │ ├── top_text_title_bar.xml │ │ │ └── top_title_bar.xml │ │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_text_follow.png │ │ │ ├── ic_text_followed.png │ │ │ ├── ic_zhibojian_shu_back_normal.png │ │ │ ├── ic_zhibojian_shu_back_pressed.png │ │ │ ├── ic_zhibojian_shu_concernxxhdpi.png │ │ │ ├── ic_zhibojian_shu_emoji_click.png │ │ │ ├── ic_zhibojian_shu_fenxiang_normal.png │ │ │ ├── ic_zhibojian_shu_fenxiang_pressed.png │ │ │ ├── ic_zhibojian_shu_jp_click.png │ │ │ ├── ic_zhibojian_shu_quanping_normal.png │ │ │ ├── ic_zhibojian_shu_quanping_pressed.png │ │ │ ├── live_default.png │ │ │ └── viewer.png │ │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ │ ├── values-v21 │ │ │ └── dimens.xml │ │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ │ └── values │ │ │ ├── colors.xml │ │ │ ├── dimens.xml │ │ │ ├── strings.xml │ │ │ └── styles.xml │ └── test │ │ └── java │ │ └── com │ │ └── king │ │ └── tv │ │ └── ExampleUnitTest.java └── tinker-support.gradle ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── pictures ├── QR_KingTV.png ├── gif.gif ├── live.png ├── recommend.png └── room.png └── settings.gradle /.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/compiler.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/encodings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | -------------------------------------------------------------------------------- /.idea/markdown-navigator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 33 | 34 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | -------------------------------------------------------------------------------- /.idea/markdown-navigator/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 19 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | Android 39 | 40 | 41 | Android > Lint > Correctness 42 | 43 | 44 | Java 45 | 46 | 47 | Java language level migration aidsJava 48 | 49 | 50 | 51 | 52 | Android 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 74 | 75 | 76 | 77 | 78 | 1.8 79 | 80 | 85 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Jenly Yu 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | # KingTV 3 | 4 | [![Download](https://img.shields.io/badge/download-APK-brightgreen?logo=github)](https://raw.githubusercontent.com/jenly1314/KingTV/master/app/app-release.apk) 5 | [![API](https://img.shields.io/badge/API-15%2B-brightgreen?logo=android)](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) 6 | [![License](https://img.shields.io/github/license/jenly1314/KingTV?logo=open-source-initiative)](https://opensource.org/licenses/mit) 7 | 8 | 9 | 本App 采用 MVP + RXJava + Retrofit + OKHttp + Material Design + Dagger2 + Base + Glide + GreenDao构建,高仿全民直播Android App,欢迎大家Star或Fork。 10 | 11 | ## 效果展示 12 | 13 | ![Image](pictures/gif.gif) 14 | 15 | > 录制的gif效果有点不清晰,你可以直接 [下载App](https://raw.githubusercontent.com/jenly1314/KingTV/master/app/app-release.apk) 体验效果。 16 | 17 | 18 | 19 | ## 版本记录 20 | 21 | #### 2017-5-10 v1.2 22 | * 新增搜索功能 23 | * 集成[NeverCrash](https://github.com/jenly1314/NeverCrash) 24 | 25 | #### 2017-5-3 v1.1 26 | * 新增Showing类型竖屏播放支持 27 | * 优化播放的流地址逻辑 28 | 29 | #### 2017-3-23 v1.0 30 | * 初始化版本,完成主要核心功能 31 | 32 | ## 声明 33 | - 本项目纯属个人作品,是高仿全民直播Android App 3.0.1版本,仅供技术参考,请维护全民直播平台的合法权益,禁止用于一切商业用途。如有疑问请联系作者,谢谢合作。 34 | 35 | 36 | --- 37 | 38 | ![footer](https://jenly1314.github.io/page/footer.svg) 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/app-release.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/app-release.apk -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'org.greenrobot.greendao' 3 | apply plugin: 'com.neenbedankt.android-apt' 4 | apply from: 'tinker-support.gradle' 5 | 6 | android { 7 | signingConfigs { 8 | config { 9 | 10 | //加载资源 11 | Properties properties = new Properties() 12 | InputStream inputStream = project.rootProject.file('local.properties').newDataInputStream() ; 13 | properties.load( inputStream ) 14 | 15 | //读取文件 16 | def storeFileDir = properties.getProperty('storeFile.file') 17 | storeFile file( storeFileDir ) 18 | 19 | //读取字段 20 | def key_keyAlias = properties.getProperty( 'keyAlias' ) 21 | def key_keyPassword = properties.getProperty( 'keyPassword' ) ; 22 | def key_storePassword = properties.getProperty( 'storePassword' ) ; 23 | 24 | keyAlias key_keyAlias 25 | keyPassword key_keyPassword 26 | storePassword key_storePassword 27 | } 28 | } 29 | compileSdkVersion 24 30 | buildToolsVersion "24.0.2" 31 | defaultConfig { 32 | applicationId "com.king.tv" 33 | minSdkVersion 15 34 | targetSdkVersion 24 35 | versionCode 3 36 | versionName "1.2" 37 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 38 | 39 | ndk { 40 | // 设置支持的SO库架构 41 | abiFilters 'armeabi', 'armeabi-v7a'//, 'x86', 'x86_64', 'arm64-v8a' 42 | } 43 | } 44 | buildTypes { 45 | release { 46 | minifyEnabled false 47 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 48 | signingConfig signingConfigs.config 49 | } 50 | } 51 | } 52 | 53 | greendao{ 54 | schemaVersion 2 55 | targetGenDir 'src/main/java' 56 | daoPackage 'com.king.tv.dao.greendao' 57 | } 58 | 59 | dependencies { 60 | compile fileTree(include: ['*.jar'], dir: 'libs') 61 | androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { 62 | exclude group: 'com.android.support', module: 'support-annotations' 63 | }) 64 | compile 'com.android.support:appcompat-v7:24.1.1' 65 | compile 'com.android.support:design:24.2.+' 66 | compile 'com.android.support:cardview-v7:24.1.+' 67 | testCompile 'junit:junit:4.12' 68 | compile 'com.hannesdorfmann.mosby:mvp:2.0.1' 69 | compile 'com.hannesdorfmann.mosby:viewstate:2.0.1' 70 | compile 'com.squareup.retrofit2:retrofit:2.1.0' 71 | compile 'com.squareup.retrofit2:converter-gson:2.1.0' 72 | compile 'com.squareup.retrofit2:adapter-rxjava:2.1.0' 73 | compile 'io.reactivex:rxandroid:1.2.1' 74 | compile 'io.reactivex:rxjava:1.1.6' 75 | compile 'com.jude:easyrecyclerview:4.3.7' 76 | compile 'jp.wasabeef:glide-transformations:2.0.1' 77 | compile 'com.jakewharton:butterknife:8.5.1' 78 | apt 'com.jakewharton:butterknife-compiler:8.5.1' 79 | // annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' 80 | compile 'com.google.dagger:dagger:2.9' 81 | // annotationProcessor 'com.google.dagger:dagger-compiler:2.9' 82 | apt 'com.google.dagger:dagger-compiler:2.9' 83 | provided 'org.glassfish:javax.annotation:10.0-b28' 84 | compile 'org.greenrobot:greendao:3.2.0' 85 | provided 'org.greenrobot:greendao-generator:3.2.0' 86 | compile 'de.hdodenhof:circleimageview:2.1.0' 87 | compile 'com.king.base:base:2.0' 88 | compile 'com.king.view:flutteringlayout:1.1.0' 89 | compile 'com.king.thread:nevercrash:1.0.0' 90 | compile 'com.bigkoo:convenientbanner:2.0.5' 91 | compile 'com.qiniu:happy-dns:0.2.+' 92 | //optional, help to generate the final applicatio 93 | 94 | // provided('com.tencent.tinker:tinker-android-anno:1.7.7') 95 | 96 | //tinker's main Android lib 97 | 98 | // compile 'com.tencent.tinker:tinker-android-lib:1.7.7' 99 | // 多dex配置 100 | compile 'com.android.support:multidex:1.0.1' 101 | //sdk 102 | compile 'com.tencent.bugly:crashreport_upgrade:latest.release' 103 | //ndk 104 | compile 'com.tencent.bugly:nativecrashreport:latest.release' 105 | 106 | } 107 | 108 | -------------------------------------------------------------------------------- /app/libs/pldroid-player-1.5.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/libs/pldroid-player-1.5.0.jar -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in D:\Android\SDK/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -optimizationpasses 5 19 | -dontusemixedcaseclassnames 20 | -dontskipnonpubliclibraryclasses 21 | -dontpreverify 22 | -verbose 23 | -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* 24 | 25 | 26 | -keep public class * extends android.app.Activity 27 | -keep public class * extends android.app.Application 28 | -keep public class * extends android.app.Service 29 | -keep public class * extends android.content.BroadcastReceiver 30 | -keep public class * extends android.content.ContentProvider 31 | -keep public class * extends android.app.backup.BackupAgentHelper 32 | -keep public class * extends android.preference.Preference 33 | -keep public class * extends android.view.View 34 | -keep public class com.android.vending.licensing.ILicensingService 35 | -keep class android.support.** {*;} 36 | -keep public class * extends android.os.IInterface 37 | 38 | -keepclasseswithmembernames class * { 39 | native ; 40 | } 41 | 42 | -keepclasseswithmembers class * { 43 | public (android.content.Context, android.util.AttributeSet); 44 | } 45 | 46 | -keepclasseswithmembers class * { 47 | public (android.content.Context, android.util.AttributeSet, int); 48 | } 49 | 50 | -keepclassmembers class * extends android.app.Activity { 51 | public void *(android.view.View); 52 | } 53 | 54 | -keep public class * extends android.view.View { 55 | public (android.content.Context); 56 | public (android.content.Context, android.util.AttributeSet); 57 | public (android.content.Context, android.util.AttributeSet, int); 58 | public void set*(...); 59 | } 60 | 61 | -keepclassmembers enum * { 62 | public static **[] values(); 63 | public static ** valueOf(java.lang.String); 64 | } 65 | 66 | -keep class * implements android.os.Parcelable { 67 | public static final android.os.Parcelable$Creator *; 68 | } 69 | 70 | -keepnames class * implements java.io.Serializable 71 | 72 | -keepclassmembers class * implements java.io.Serializable { 73 | static final long serialVersionUID; 74 | private static final java.io.ObjectStreamField[] serialPersistentFields; 75 | !static !transient ; 76 | private void writeObject(java.io.ObjectOutputStream); 77 | private void readObject(java.io.ObjectInputStream); 78 | java.lang.Object writeReplace(); 79 | java.lang.Object readResolve(); 80 | } 81 | 82 | -keepattributes *Annotation* 83 | -keepattributes Exceptions,InnerClasses,Signature 84 | -keepattributes SourceFile,LineNumberTable 85 | 86 | -keep class **.R$* { *; } 87 | 88 | -dontwarn android.support.v4.** 89 | -keep class android.support.v4.** { *; } 90 | -keep interface android.support.v4.** { *; } 91 | -keep public class * extends android.support.v4.** 92 | -keep public class * extends android.app.Fragment 93 | 94 | -dontwarn com.android.support.** 95 | -keep class com.android.support.** { *; } 96 | 97 | -dontwarn de.greenrobot.event.** 98 | -keep class de.greenrobot.event.** { *; } 99 | -keepclassmembers class ** { 100 | public void onEvent*(**); 101 | void onEvent*(**); 102 | } 103 | 104 | -dontwarn com.hannesdorfmann.** 105 | -keep class com.hannesdorfmann.**{*;} 106 | 107 | -dontwarn com.squareup.** 108 | -keep class com.squareup.**{*;} 109 | 110 | -dontwarn io.reactivex.** 111 | -keep class io.reactivex.**{*;} 112 | 113 | -dontwarn com.jude.** 114 | -keep class com.jude.**{*;} 115 | 116 | -dontwarn com.jakewharton.** 117 | -keep class com.jakewharton.**{*;} 118 | 119 | -dontwarn jp.wasabeef.** 120 | -keep class jp.wasabeef.**{*;} 121 | 122 | -dontwarn com.google.** 123 | -keep class com.google.**{*;} 124 | 125 | -dontwarn de.hdodenhof.** 126 | -keep class de.hdodenhof.**{*;} 127 | 128 | -dontwarn org.greenrobot.** 129 | -keep class org.greenrobot.**{*;} 130 | 131 | -dontwarn com.bigkoo.** 132 | -keep class com.bigkoo.**{*;} 133 | 134 | -dontwarn com.qiniu.** 135 | -keep class com.qiniu.**{*;} 136 | 137 | -dontwarn com.king.base.** 138 | -keep class com.king.base.**{*;} 139 | 140 | -dontwarn com.tencent.bugly.** 141 | -keep public class com.tencent.bugly.**{*;} 142 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/king/tv/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.king.tv; 2 | 3 | import android.content.Context; 4 | import android.support.test.InstrumentationRegistry; 5 | import android.support.test.runner.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.king.show", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 35 | 38 | 41 | 42 | 43 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/App.java: -------------------------------------------------------------------------------- 1 | package com.king.tv; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import android.support.multidex.MultiDex; 6 | 7 | import com.king.base.util.LogUtils; 8 | import com.king.thread.nevercrash.NeverCrash; 9 | import com.king.tv.dao.greendao.DaoMaster; 10 | import com.king.tv.dao.greendao.DaoSession; 11 | import com.king.tv.di.component.AppComponent; 12 | import com.king.tv.di.component.DaggerAppComponent; 13 | import com.king.tv.di.module.AppModule; 14 | import com.tencent.bugly.Bugly; 15 | import com.tencent.bugly.beta.Beta; 16 | import com.tencent.bugly.crashreport.CrashReport; 17 | 18 | /** 19 | * @author Jenly Jenly 20 | * @since 2017/2/13 21 | */ 22 | 23 | public class App extends Application { 24 | 25 | private static final String BUGLY_ID = "28aeafeef1"; 26 | 27 | private DaoMaster.DevOpenHelper mHelper; 28 | 29 | private DaoSession mDaoSession; 30 | 31 | private AppComponent mAppComponent; 32 | 33 | 34 | @Override 35 | protected void attachBaseContext(Context base) { 36 | super.attachBaseContext(base); 37 | 38 | MultiDex.install(base); 39 | Beta.installTinker(); 40 | } 41 | 42 | @Override 43 | public void onCreate() { 44 | super.onCreate(); 45 | initDatabase(); 46 | // 调试时,将第三个参数改为true 47 | Bugly.init(this,BUGLY_ID,false); 48 | mAppComponent = DaggerAppComponent.builder().appModule(new AppModule(this,Constants.BASE_URL)).build(); 49 | 50 | NeverCrash.init(new NeverCrash.CrashHandler() { 51 | @Override 52 | public void uncaughtException(Thread t, Throwable e) { 53 | CrashReport.postCatchedException(e); 54 | } 55 | }); 56 | } 57 | 58 | 59 | 60 | public void initDatabase(){ 61 | mHelper = new DaoMaster.DevOpenHelper(this,"tv-db",null); 62 | 63 | DaoMaster daoMaster = new DaoMaster(mHelper.getWritableDatabase()); 64 | 65 | mDaoSession = daoMaster.newSession(); 66 | } 67 | 68 | public AppComponent getAppCommponent(){ 69 | return mAppComponent; 70 | } 71 | 72 | public DaoSession getDaoSession(){ 73 | return mDaoSession; 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/Constants.java: -------------------------------------------------------------------------------- 1 | package com.king.tv; 2 | 3 | /** 4 | * @author Jenly Jenly 5 | * @since 2017/3/8 6 | */ 7 | 8 | public final class Constants { 9 | 10 | 11 | public static final String BASE_URL = "http://www.quanmin.tv/"; 12 | 13 | public static final String KEY_FRAGMENT = "key_fragment"; 14 | 15 | public static final String KEY_TITLE = "key_title"; 16 | 17 | public static final String KEY_IS_TAB_LIVE = "key_is_tab_live"; 18 | 19 | public static final String KEY_UID = "key_uid"; 20 | 21 | public static final String KEY_SLUG = "key_slug"; 22 | 23 | public static final String KEY_URL = "key_url"; 24 | 25 | public static final String KEY_COVER = "key_cover"; 26 | 27 | /** 28 | * showing 29 | */ 30 | public static final String SHOWING = "showing"; 31 | 32 | 33 | //----------------------------------------- 34 | 35 | 36 | public static final int ROOM_FRAGMENT = 0X01; 37 | public static final int LIVE_FRAGMENT = 0X02; 38 | public static final int WEB_FRAGMENT = 0X03; 39 | public static final int LOGIN_FRAGMENT = 0X04; 40 | public static final int ABOUT_FRAGMENT = 0X05; 41 | public static final int FULL_ROOM_FRAGMENT = 0X06; 42 | public static final int SEARCH_FRAGMENT = 0X07; 43 | 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/bean/LiveCategory.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.bean; 2 | 3 | import org.greenrobot.greendao.annotation.Entity; 4 | import org.greenrobot.greendao.annotation.Id; 5 | import org.greenrobot.greendao.annotation.Generated; 6 | 7 | /** 8 | * @author Jenly Jenly 9 | * @since 2017/2/20 10 | */ 11 | 12 | @Entity 13 | public class LiveCategory { 14 | 15 | 16 | /** 17 | * id : 29 18 | * name : Showing 19 | * is_default : 1 20 | * sort : 999 21 | * icon_gray : http://uimg.quanmin.tv/1480649956/53ef5.png 22 | * icon_red : http://uimg.quanmin.tv/1480649951/4b823.png 23 | * icon_image : http://uimg.quanmin.tv/1480649936/10414.png 24 | * slug : showing 25 | * type : 2 26 | * screen : 1 27 | */ 28 | 29 | @Id 30 | private long id; 31 | private String name; 32 | private int is_default; 33 | private int sort; 34 | private String icon_gray; 35 | private String icon_red; 36 | private String icon_image; 37 | private String slug; 38 | private int type; 39 | private int screen; 40 | 41 | @Generated(hash = 760358639) 42 | public LiveCategory(long id, String name, int is_default, int sort, 43 | String icon_gray, String icon_red, String icon_image, String slug, 44 | int type, int screen) { 45 | this.id = id; 46 | this.name = name; 47 | this.is_default = is_default; 48 | this.sort = sort; 49 | this.icon_gray = icon_gray; 50 | this.icon_red = icon_red; 51 | this.icon_image = icon_image; 52 | this.slug = slug; 53 | this.type = type; 54 | this.screen = screen; 55 | } 56 | 57 | @Generated(hash = 547755947) 58 | public LiveCategory() { 59 | } 60 | 61 | public long getId() { 62 | return id; 63 | } 64 | 65 | public void setId(int id) { 66 | this.id = id; 67 | } 68 | 69 | public String getName() { 70 | return name; 71 | } 72 | 73 | public void setName(String name) { 74 | this.name = name; 75 | } 76 | 77 | public int getIs_default() { 78 | return is_default; 79 | } 80 | 81 | public void setIs_default(int is_default) { 82 | this.is_default = is_default; 83 | } 84 | 85 | public int getSort() { 86 | return sort; 87 | } 88 | 89 | public void setSort(int sort) { 90 | this.sort = sort; 91 | } 92 | 93 | public String getIcon_gray() { 94 | return icon_gray; 95 | } 96 | 97 | public void setIcon_gray(String icon_gray) { 98 | this.icon_gray = icon_gray; 99 | } 100 | 101 | public String getIcon_red() { 102 | return icon_red; 103 | } 104 | 105 | public void setIcon_red(String icon_red) { 106 | this.icon_red = icon_red; 107 | } 108 | 109 | public String getIcon_image() { 110 | return icon_image; 111 | } 112 | 113 | public void setIcon_image(String icon_image) { 114 | this.icon_image = icon_image; 115 | } 116 | 117 | public String getSlug() { 118 | return slug; 119 | } 120 | 121 | public void setSlug(String slug) { 122 | this.slug = slug; 123 | } 124 | 125 | public int getType() { 126 | return type; 127 | } 128 | 129 | public void setType(int type) { 130 | this.type = type; 131 | } 132 | 133 | public int getScreen() { 134 | return screen; 135 | } 136 | 137 | public void setScreen(int screen) { 138 | this.screen = screen; 139 | } 140 | 141 | 142 | @Override 143 | public String toString() { 144 | return "LiveCategory{" + 145 | "id=" + id + 146 | ", name='" + name + '\'' + 147 | ", is_default=" + is_default + 148 | ", sort=" + sort + 149 | ", icon_gray='" + icon_gray + '\'' + 150 | ", icon_red='" + icon_red + '\'' + 151 | ", icon_image='" + icon_image + '\'' + 152 | ", slug='" + slug + '\'' + 153 | ", type=" + type + 154 | ", screen=" + screen + 155 | '}'; 156 | } 157 | 158 | public void setId(long id) { 159 | this.id = id; 160 | } 161 | 162 | 163 | } 164 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/bean/P.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.bean; 2 | 3 | import com.king.base.util.LogUtils; 4 | 5 | /** 6 | * @author Jenly Jenly 7 | * @since 2017/5/9 8 | */ 9 | 10 | public class P { 11 | 12 | public static final int DEFAULT_SIZE = 10; 13 | 14 | private int page; 15 | 16 | private String key; 17 | 18 | private int categoryId; 19 | 20 | private int size = DEFAULT_SIZE; 21 | 22 | public P() { 23 | 24 | } 25 | 26 | public P(int page, String key) { 27 | this.page = page; 28 | this.key = key; 29 | } 30 | 31 | public P(int page, String key, int size) { 32 | this.page = page; 33 | this.key = key; 34 | this.size = size; 35 | LogUtils.d(toString()); 36 | } 37 | 38 | public P(int page, String key, int categoryId, int size) { 39 | this.page = page; 40 | this.key = key; 41 | this.categoryId = categoryId; 42 | this.size = size; 43 | } 44 | 45 | public int getPage() { 46 | return page; 47 | } 48 | 49 | public void setPage(int page) { 50 | this.page = page; 51 | } 52 | 53 | public String getKey() { 54 | return key; 55 | } 56 | 57 | public void setKey(String key) { 58 | this.key = key; 59 | } 60 | 61 | public int getCategoryId() { 62 | return categoryId; 63 | } 64 | 65 | public void setCategoryId(int categoryId) { 66 | this.categoryId = categoryId; 67 | } 68 | 69 | public int getSize() { 70 | return size; 71 | } 72 | 73 | public void setSize(int size) { 74 | this.size = size; 75 | } 76 | 77 | @Override 78 | public String toString() { 79 | return "P{" + 80 | "page=" + page + 81 | ", key='" + key + '\'' + 82 | ", categoryId=" + categoryId + 83 | ", size=" + size + 84 | '}'; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/bean/Rank.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.bean; 2 | 3 | /** 4 | * @author Jenly Jenly 5 | * @since 2017/3/7 6 | */ 7 | 8 | public class Rank { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/bean/SearchRequestBody.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.bean; 2 | 3 | /** 4 | * @author Jenly Jenly 5 | * @since 2017/5/10 6 | */ 7 | 8 | public class SearchRequestBody { 9 | 10 | private String v = "3.0.1"; 11 | 12 | private String os = "1"; 13 | 14 | private String ver = "4"; 15 | 16 | private P p; 17 | 18 | public static SearchRequestBody getInstance(P p){ 19 | return new SearchRequestBody(p); 20 | } 21 | 22 | public SearchRequestBody() { 23 | 24 | } 25 | 26 | public SearchRequestBody(P p) { 27 | this.p = p; 28 | } 29 | 30 | public String getV() { 31 | return v; 32 | } 33 | 34 | public void setV(String v) { 35 | this.v = v; 36 | } 37 | 38 | public String getOs() { 39 | return os; 40 | } 41 | 42 | public void setOs(String os) { 43 | this.os = os; 44 | } 45 | 46 | public String getVer() { 47 | return ver; 48 | } 49 | 50 | public void setVer(String ver) { 51 | this.ver = ver; 52 | } 53 | 54 | public P getP() { 55 | return p; 56 | } 57 | 58 | public void setP(P p) { 59 | this.p = p; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/bean/StreamSrc.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.bean; 2 | 3 | /** 4 | * @author Jenly Jenly 5 | * @since 2017/3/7 6 | * 7 | */ 8 | 9 | 10 | public class StreamSrc { 11 | private String name; 12 | private String src; 13 | 14 | public String getName() { 15 | return name; 16 | } 17 | 18 | public void setName(String name) { 19 | this.name = name; 20 | } 21 | 22 | public String getSrc() { 23 | return src; 24 | } 25 | 26 | public void setSrc(String src) { 27 | this.src = src; 28 | } 29 | 30 | @Override 31 | public String toString() { 32 | return "StreamSrc{" + 33 | "name='" + name + '\'' + 34 | ", src='" + src + '\'' + 35 | '}'; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/dao/greendao/DaoMaster.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.dao.greendao; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteDatabase.CursorFactory; 6 | import android.util.Log; 7 | 8 | import org.greenrobot.greendao.AbstractDaoMaster; 9 | import org.greenrobot.greendao.database.StandardDatabase; 10 | import org.greenrobot.greendao.database.Database; 11 | import org.greenrobot.greendao.database.DatabaseOpenHelper; 12 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 13 | 14 | 15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 16 | /** 17 | * Master of DAO (schema version 2): knows all DAOs. 18 | */ 19 | public class DaoMaster extends AbstractDaoMaster { 20 | public static final int SCHEMA_VERSION = 2; 21 | 22 | /** Creates underlying database table using DAOs. */ 23 | public static void createAllTables(Database db, boolean ifNotExists) { 24 | LiveCategoryDao.createTable(db, ifNotExists); 25 | } 26 | 27 | /** Drops underlying database table using DAOs. */ 28 | public static void dropAllTables(Database db, boolean ifExists) { 29 | LiveCategoryDao.dropTable(db, ifExists); 30 | } 31 | 32 | /** 33 | * WARNING: Drops all table on Upgrade! Use only during development. 34 | * Convenience method using a {@link DevOpenHelper}. 35 | */ 36 | public static DaoSession newDevSession(Context context, String name) { 37 | Database db = new DevOpenHelper(context, name).getWritableDb(); 38 | DaoMaster daoMaster = new DaoMaster(db); 39 | return daoMaster.newSession(); 40 | } 41 | 42 | public DaoMaster(SQLiteDatabase db) { 43 | this(new StandardDatabase(db)); 44 | } 45 | 46 | public DaoMaster(Database db) { 47 | super(db, SCHEMA_VERSION); 48 | registerDaoClass(LiveCategoryDao.class); 49 | } 50 | 51 | public DaoSession newSession() { 52 | return new DaoSession(db, IdentityScopeType.Session, daoConfigMap); 53 | } 54 | 55 | public DaoSession newSession(IdentityScopeType type) { 56 | return new DaoSession(db, type, daoConfigMap); 57 | } 58 | 59 | /** 60 | * Calls {@link #createAllTables(Database, boolean)} in {@link #onCreate(Database)} - 61 | */ 62 | public static abstract class OpenHelper extends DatabaseOpenHelper { 63 | public OpenHelper(Context context, String name) { 64 | super(context, name, SCHEMA_VERSION); 65 | } 66 | 67 | public OpenHelper(Context context, String name, CursorFactory factory) { 68 | super(context, name, factory, SCHEMA_VERSION); 69 | } 70 | 71 | @Override 72 | public void onCreate(Database db) { 73 | Log.i("greenDAO", "Creating tables for schema version " + SCHEMA_VERSION); 74 | createAllTables(db, false); 75 | } 76 | } 77 | 78 | /** WARNING: Drops all table on Upgrade! Use only during development. */ 79 | public static class DevOpenHelper extends OpenHelper { 80 | public DevOpenHelper(Context context, String name) { 81 | super(context, name); 82 | } 83 | 84 | public DevOpenHelper(Context context, String name, CursorFactory factory) { 85 | super(context, name, factory); 86 | } 87 | 88 | @Override 89 | public void onUpgrade(Database db, int oldVersion, int newVersion) { 90 | Log.i("greenDAO", "Upgrading schema from version " + oldVersion + " to " + newVersion + " by dropping all tables"); 91 | dropAllTables(db, true); 92 | onCreate(db); 93 | } 94 | } 95 | 96 | } 97 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/dao/greendao/DaoSession.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.dao.greendao; 2 | 3 | import java.util.Map; 4 | 5 | import org.greenrobot.greendao.AbstractDao; 6 | import org.greenrobot.greendao.AbstractDaoSession; 7 | import org.greenrobot.greendao.database.Database; 8 | import org.greenrobot.greendao.identityscope.IdentityScopeType; 9 | import org.greenrobot.greendao.internal.DaoConfig; 10 | 11 | import com.king.tv.bean.LiveCategory; 12 | 13 | import com.king.tv.dao.greendao.LiveCategoryDao; 14 | 15 | // THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT. 16 | 17 | /** 18 | * {@inheritDoc} 19 | * 20 | * @see org.greenrobot.greendao.AbstractDaoSession 21 | */ 22 | public class DaoSession extends AbstractDaoSession { 23 | 24 | private final DaoConfig liveCategoryDaoConfig; 25 | 26 | private final LiveCategoryDao liveCategoryDao; 27 | 28 | public DaoSession(Database db, IdentityScopeType type, Map>, DaoConfig> 29 | daoConfigMap) { 30 | super(db); 31 | 32 | liveCategoryDaoConfig = daoConfigMap.get(LiveCategoryDao.class).clone(); 33 | liveCategoryDaoConfig.initIdentityScope(type); 34 | 35 | liveCategoryDao = new LiveCategoryDao(liveCategoryDaoConfig, this); 36 | 37 | registerDao(LiveCategory.class, liveCategoryDao); 38 | } 39 | 40 | public void clear() { 41 | liveCategoryDaoConfig.clearIdentityScope(); 42 | } 43 | 44 | public LiveCategoryDao getLiveCategoryDao() { 45 | return liveCategoryDao; 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/component/AppComponent.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.component; 2 | 3 | import android.content.Context; 4 | 5 | import com.king.tv.App; 6 | import com.king.tv.http.APIService; 7 | import com.king.tv.di.module.AppModule; 8 | 9 | import javax.inject.Singleton; 10 | 11 | import dagger.Component; 12 | import okhttp3.OkHttpClient; 13 | import retrofit2.Retrofit; 14 | 15 | /** 16 | * @author Jenly Jenly 17 | * @since 2017/2/24 18 | */ 19 | @Singleton 20 | @Component(modules= AppModule.class) 21 | public interface AppComponent { 22 | 23 | void inject(App app); 24 | 25 | Context getContext(); 26 | 27 | Retrofit getRetrofit(); 28 | 29 | OkHttpClient getOkHttpClient(); 30 | 31 | APIService getAPIService(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/component/HomeComponent.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.component; 2 | 3 | import com.king.tv.di.scope.FragmentScope; 4 | import com.king.tv.di.module.CateroyModule; 5 | import com.king.tv.di.module.LiveListModule; 6 | import com.king.tv.mvp.fragment.HomeFragment; 7 | import com.king.tv.mvp.fragment.LiveListFragment; 8 | import com.king.tv.mvp.presenter.CategoryPresenter; 9 | import com.king.tv.mvp.presenter.LiveListPresenter; 10 | 11 | import dagger.Component; 12 | 13 | 14 | /** 15 | * @author Jenly Jenly 16 | * @since 2017/3/2 17 | */ 18 | @FragmentScope 19 | @Component(modules = {CateroyModule.class,LiveListModule.class},dependencies = AppComponent.class) 20 | public interface HomeComponent { 21 | 22 | void inject(HomeFragment homeFragment); 23 | void inject(LiveListFragment liveListFragment); 24 | 25 | CategoryPresenter getCateroyPresenter(); 26 | 27 | LiveListPresenter getLiveListPresenter(); 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/module/AppModule.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.module; 2 | 3 | import android.content.Context; 4 | 5 | import com.king.tv.App; 6 | import com.king.tv.http.APIService; 7 | 8 | import java.util.concurrent.TimeUnit; 9 | 10 | import javax.inject.Singleton; 11 | 12 | import dagger.Module; 13 | import dagger.Provides; 14 | import okhttp3.OkHttpClient; 15 | import retrofit2.Retrofit; 16 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 17 | import retrofit2.converter.gson.GsonConverterFactory; 18 | 19 | /** 20 | * @author Jenly Jenly 21 | * @since 2017/2/24 22 | */ 23 | @Module 24 | public class AppModule { 25 | /** 26 | * 默认超时时间 单位/秒 27 | */ 28 | private static final int DEFAULT_TIME_OUT = 10; 29 | 30 | private Context context; 31 | 32 | private String baseUrl; 33 | 34 | public AppModule(App context,String baseUrl){ 35 | this.context = context; 36 | this.baseUrl = baseUrl; 37 | } 38 | 39 | @Provides 40 | @Singleton 41 | public Context provideContext(){ 42 | return context; 43 | } 44 | 45 | @Provides 46 | @Singleton 47 | public Retrofit provideRetrofit() { 48 | return new Retrofit.Builder() 49 | .baseUrl(baseUrl) 50 | .addConverterFactory(GsonConverterFactory.create()) 51 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 52 | .client(provideOkHttpClient()) 53 | .build(); 54 | } 55 | 56 | @Provides 57 | @Singleton 58 | public OkHttpClient provideOkHttpClient(){ 59 | 60 | return new OkHttpClient.Builder() 61 | .connectTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 62 | .readTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 63 | .writeTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 64 | .build(); 65 | } 66 | 67 | @Provides 68 | @Singleton 69 | public APIService provideAPIService(){ 70 | return provideRetrofit().create(APIService.class); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/module/CateroyModule.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.module; 2 | 3 | import com.king.tv.App; 4 | import com.king.tv.di.scope.FragmentScope; 5 | import com.king.tv.mvp.presenter.CategoryPresenter; 6 | 7 | import dagger.Module; 8 | import dagger.Provides; 9 | 10 | /** 11 | * @author Jenly Jenly 12 | * @since 2017/3/2 13 | */ 14 | 15 | @Module 16 | public class CateroyModule { 17 | 18 | private App app; 19 | 20 | public CateroyModule(App app){ 21 | this.app = app; 22 | } 23 | 24 | 25 | @FragmentScope 26 | @Provides 27 | public CategoryPresenter provideCateroyPresenter(){ 28 | return new CategoryPresenter(app); 29 | } 30 | 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/module/LiveListModule.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.module; 2 | 3 | import com.king.tv.App; 4 | import com.king.tv.di.scope.FragmentScope; 5 | import com.king.tv.mvp.presenter.LiveListPresenter; 6 | 7 | import dagger.Module; 8 | import dagger.Provides; 9 | 10 | /** 11 | * @author Jenly Jenly 12 | * @since 2017/3/3 13 | */ 14 | 15 | @Module 16 | public class LiveListModule { 17 | 18 | private App app; 19 | 20 | public LiveListModule(App app){ 21 | this.app = app; 22 | } 23 | 24 | @FragmentScope 25 | @Provides 26 | public LiveListPresenter provideLiveListPresenter(){ 27 | return new LiveListPresenter(app); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/scope/ActivityScope.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.scope; 2 | 3 | import javax.inject.Scope; 4 | 5 | /** 6 | * @author Jenly Jenly 7 | * @since 2017/3/3 8 | */ 9 | 10 | @Scope 11 | public @interface ActivityScope { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/di/scope/FragmentScope.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.di.scope; 2 | 3 | import javax.inject.Scope; 4 | 5 | /** 6 | * @author Jenly Jenly 7 | * @since 2017/3/3 8 | */ 9 | 10 | @Scope 11 | public @interface FragmentScope { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/http/APIRetrofit.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.http; 2 | 3 | import com.king.tv.Constants; 4 | 5 | import java.util.concurrent.TimeUnit; 6 | 7 | import okhttp3.OkHttpClient; 8 | import retrofit2.Retrofit; 9 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 10 | import retrofit2.converter.gson.GsonConverterFactory; 11 | 12 | /** 13 | * @author Jenly Jenly 14 | * @since 2017/2/13 15 | */ 16 | 17 | public class APIRetrofit { 18 | 19 | /** 20 | * 默认超时时间 单位/秒 21 | */ 22 | private static final int DEFAULT_TIME_OUT = 10; 23 | 24 | private static Retrofit sRetrofit; 25 | 26 | private static OkHttpClient sOKHttpClient; 27 | 28 | public static APIService getAPIService(){ 29 | return getInstance().create(APIService.class); 30 | } 31 | 32 | public static Retrofit getInstance(){ 33 | if(sRetrofit== null){ 34 | synchronized (APIRetrofit.class){ 35 | if(sRetrofit == null){ 36 | 37 | sRetrofit = new Retrofit.Builder() 38 | .baseUrl(Constants.BASE_URL) 39 | .addConverterFactory(GsonConverterFactory.create()) 40 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 41 | .client(getsOKHttpClient()) 42 | .build(); 43 | 44 | } 45 | } 46 | } 47 | 48 | return sRetrofit; 49 | } 50 | 51 | 52 | public static OkHttpClient getsOKHttpClient(){ 53 | if(sOKHttpClient == null){ 54 | synchronized (APIRetrofit.class){ 55 | 56 | if(sOKHttpClient == null){ 57 | sOKHttpClient = new OkHttpClient.Builder() 58 | .connectTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 59 | .readTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 60 | .writeTimeout(DEFAULT_TIME_OUT, TimeUnit.SECONDS) 61 | .build(); 62 | } 63 | } 64 | } 65 | 66 | return sOKHttpClient; 67 | } 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/http/APIService.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.http; 2 | 3 | import com.king.tv.bean.AppStart; 4 | import com.king.tv.bean.LiveCategory; 5 | import com.king.tv.bean.LiveListResult; 6 | import com.king.tv.bean.P; 7 | import com.king.tv.bean.Recommend; 8 | import com.king.tv.bean.Room; 9 | import com.king.tv.bean.SearchRequestBody; 10 | import com.king.tv.bean.SearchResult; 11 | 12 | import org.json.JSONArray; 13 | import org.json.JSONObject; 14 | 15 | import java.util.List; 16 | import java.util.Map; 17 | 18 | import retrofit2.Callback; 19 | import retrofit2.http.Body; 20 | import retrofit2.http.Field; 21 | import retrofit2.http.FieldMap; 22 | import retrofit2.http.GET; 23 | import retrofit2.http.Header; 24 | import retrofit2.http.Headers; 25 | import retrofit2.http.POST; 26 | import retrofit2.http.Path; 27 | import retrofit2.http.Query; 28 | import retrofit2.http.QueryMap; 29 | import rx.Observable; 30 | 31 | /** 32 | * @author Jenly Jenly 33 | * @since 2017/2/13 34 | */ 35 | 36 | public interface APIService { 37 | 38 | /** 39 | * 获取App启动页信息 40 | * @return 41 | */ 42 | @GET("json/page/app-data/info.json?v=3.0.1&os=1&ver=4") 43 | Observable getAppStartInfo(); 44 | 45 | /** 46 | * 获取分类列表 47 | * @return 48 | * 49 | * categories/list.json 50 | */ 51 | @GET("json/app/index/category/info-android.json?v=3.0.1&os=1&ver=4") 52 | Observable> getAllCategories(); 53 | 54 | /** 55 | * 获取推荐列表 56 | * @return 57 | */ 58 | @GET("json/app/index/recommend/list-android.json?v=3.0.1&os=1&ver=4") 59 | Observable getRecommend(); 60 | 61 | /** 62 | * 获取直播列表 63 | * @return 64 | */ 65 | @GET("json/play/list.json?v=3.0.1&os=1&ver=4") 66 | Observable getLiveListResult(); 67 | 68 | 69 | @GET("json/categories/{slug}/list.json?v=3.0.1&os=1&ver=4") 70 | Observable getLiveListResultByCategories(@Path("slug") String slug); 71 | 72 | /** 73 | * 进入房间 74 | * @param uid 75 | * @return 76 | */ 77 | @GET("json/rooms/{uid}/info.json?v=3.0.1&os=1&ver=4") 78 | Observable enterRoom(@Path("uid")String uid); 79 | 80 | /** 81 | * 搜索 82 | * @param searchRequestBody 83 | * @return 84 | */ 85 | @POST("site/search") 86 | Observable search(@Body SearchRequestBody searchRequestBody); 87 | 88 | } 89 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/http/converter/GsonConverterFactory.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.http.converter; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.reflect.TypeToken; 6 | 7 | import java.lang.annotation.Annotation; 8 | import java.lang.reflect.Type; 9 | 10 | import okhttp3.RequestBody; 11 | import okhttp3.ResponseBody; 12 | import retrofit2.Converter; 13 | import retrofit2.Retrofit; 14 | 15 | 16 | public final class GsonConverterFactory extends Converter.Factory { 17 | 18 | 19 | public static GsonConverterFactory create() { 20 | return create(new Gson()); 21 | } 22 | 23 | public static GsonConverterFactory create(Gson gson) { 24 | return new GsonConverterFactory(gson); 25 | } 26 | 27 | private final Gson gson; 28 | 29 | private GsonConverterFactory(Gson gson) { 30 | if (gson == null) throw new NullPointerException("gson == null"); 31 | this.gson = gson; 32 | } 33 | 34 | @Override 35 | public Converter responseBodyConverter(Type type, Annotation[] annotations, 36 | Retrofit retrofit) { 37 | TypeAdapter adapter = gson.getAdapter(TypeToken.get(type)); 38 | return new GsonResponseBodyConverter<>(gson, adapter); 39 | } 40 | 41 | @Override 42 | public Converter requestBodyConverter(Type type, 43 | Annotation[] parameterAnnotations, Annotation[] methodAnnotations, Retrofit retrofit) { 44 | TypeAdapter adapter = gson.getAdapter(TypeToken.get(type)); 45 | return new GsonRequestBodyConverter<>(gson, adapter); 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/http/converter/GsonRequestBodyConverter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.http.converter; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.stream.JsonWriter; 6 | 7 | import java.io.IOException; 8 | import java.io.OutputStreamWriter; 9 | import java.io.Writer; 10 | import java.nio.charset.Charset; 11 | 12 | import okhttp3.MediaType; 13 | import okhttp3.RequestBody; 14 | import okio.Buffer; 15 | import retrofit2.Converter; 16 | 17 | final class GsonRequestBodyConverter implements Converter { 18 | private static final MediaType MEDIA_TYPE = MediaType.parse("application/json; charset=UTF-8"); 19 | private static final Charset UTF_8 = Charset.forName("UTF-8"); 20 | 21 | private final Gson gson; 22 | private final TypeAdapter adapter; 23 | 24 | GsonRequestBodyConverter(Gson gson, TypeAdapter adapter) { 25 | this.gson = gson; 26 | this.adapter = adapter; 27 | } 28 | 29 | @Override public RequestBody convert(T value) throws IOException { 30 | Buffer buffer = new Buffer(); 31 | Writer writer = new OutputStreamWriter(buffer.outputStream(), UTF_8); 32 | JsonWriter jsonWriter = gson.newJsonWriter(writer); 33 | adapter.write(jsonWriter, value); 34 | jsonWriter.close(); 35 | return RequestBody.create(MEDIA_TYPE, buffer.readByteString()); 36 | } 37 | 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/http/converter/GsonResponseBodyConverter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.http.converter; 2 | 3 | import com.google.gson.Gson; 4 | import com.google.gson.TypeAdapter; 5 | import com.google.gson.stream.JsonReader; 6 | 7 | import java.io.IOException; 8 | import okhttp3.ResponseBody; 9 | import retrofit2.Converter; 10 | 11 | public final class GsonResponseBodyConverter implements Converter { 12 | 13 | private final Gson gson; 14 | private final TypeAdapter adapter; 15 | 16 | GsonResponseBodyConverter(Gson gson, TypeAdapter adapter) { 17 | this.gson = gson; 18 | this.adapter = adapter; 19 | } 20 | 21 | @Override public T convert(ResponseBody value) throws IOException { 22 | 23 | JsonReader jsonReader = gson.newJsonReader(value.charStream()); 24 | try { 25 | return adapter.read(jsonReader); 26 | } finally { 27 | value.close(); 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/activity/ContentActivity.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.activity; 2 | 3 | import android.content.Intent; 4 | import android.os.Bundle; 5 | import android.support.annotation.IdRes; 6 | import android.support.v4.app.Fragment; 7 | import android.support.v7.app.AppCompatActivity; 8 | 9 | import com.king.base.util.LogUtils; 10 | import com.king.tv.Constants; 11 | import com.king.tv.R; 12 | import com.king.tv.mvp.fragment.AboutFragment; 13 | import com.king.tv.mvp.fragment.FullRoomFragment; 14 | import com.king.tv.mvp.fragment.LiveFragment; 15 | import com.king.tv.mvp.fragment.LoginFragment; 16 | import com.king.tv.mvp.fragment.RoomFragment; 17 | import com.king.tv.mvp.fragment.SearchFragment; 18 | import com.king.tv.mvp.fragment.WebFragment; 19 | 20 | /** 21 | * @author Jenly Jenly 22 | * @since 2017/2/20 23 | */ 24 | 25 | public class ContentActivity extends AppCompatActivity { 26 | 27 | @Override 28 | public void onCreate(Bundle savedInstanceState) { 29 | super.onCreate(savedInstanceState); 30 | setContentView(R.layout.content); 31 | 32 | swichFragment(getIntent()); 33 | } 34 | 35 | public void swichFragment(Intent intent){ 36 | 37 | int fragmentKey = intent.getIntExtra(Constants.KEY_FRAGMENT,0); 38 | switch (fragmentKey){ 39 | case Constants.ROOM_FRAGMENT: 40 | replaceFragment(RoomFragment.newInstance(intent.getStringExtra(Constants.KEY_UID))); 41 | break; 42 | case Constants.LIVE_FRAGMENT: { 43 | String title = intent.getStringExtra(Constants.KEY_TITLE); 44 | String slug = intent.getStringExtra(Constants.KEY_SLUG); 45 | boolean isTabLive = intent.getBooleanExtra(Constants.KEY_IS_TAB_LIVE, false); 46 | replaceFragment(LiveFragment.newInstance(title, slug, isTabLive)); 47 | break; 48 | }case Constants.WEB_FRAGMENT: { 49 | String title = intent.getStringExtra(Constants.KEY_TITLE); 50 | String url = intent.getStringExtra(Constants.KEY_URL); 51 | replaceFragment(WebFragment.newInstance(url, title)); 52 | break; 53 | }case Constants.LOGIN_FRAGMENT: 54 | replaceFragment(LoginFragment.newInstance()); 55 | break; 56 | case Constants.ABOUT_FRAGMENT: 57 | replaceFragment(AboutFragment.newInstance()); 58 | break; 59 | case Constants.FULL_ROOM_FRAGMENT: 60 | String uid = intent.getStringExtra(Constants.KEY_UID); 61 | String cover = intent.getStringExtra(Constants.KEY_COVER); 62 | replaceFragment(FullRoomFragment.newInstance(uid,cover)); 63 | break; 64 | case Constants.SEARCH_FRAGMENT: 65 | replaceFragment(SearchFragment.newInstance()); 66 | break; 67 | default: 68 | LogUtils.d("Not found fragment:" + Integer.toHexString(fragmentKey)); 69 | break; 70 | } 71 | } 72 | 73 | 74 | public void replaceFragment(Fragment fragmnet){ 75 | replaceFragment(R.id.fragmentContent,fragmnet); 76 | } 77 | 78 | public void replaceFragment(@IdRes int id, Fragment fragment) { 79 | 80 | getSupportFragmentManager().beginTransaction().replace(id, fragment).commit(); 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/activity/RoomActivity.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.activity; 2 | 3 | import android.content.res.Configuration; 4 | import android.os.Build; 5 | import android.os.Bundle; 6 | import android.support.annotation.Nullable; 7 | import android.view.View; 8 | import android.view.WindowManager; 9 | 10 | import com.king.tv.Constants; 11 | import com.king.tv.R; 12 | import com.king.tv.mvp.base.PureActivity; 13 | import com.king.tv.mvp.fragment.RoomFragment; 14 | 15 | /** 16 | * @author Jenly Jenly 17 | * @since 2017/3/8 18 | */ 19 | 20 | public class RoomActivity extends PureActivity { 21 | 22 | private RoomFragment roomFragment; 23 | 24 | @Override 25 | protected void onCreate(@Nullable Bundle savedInstanceState) { 26 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { 27 | View decorView = getWindow().getDecorView(); 28 | decorView.setSystemUiVisibility( 29 | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION 30 | // | View.SYSTEM_UI_FLAG_FULLSCREEN 31 | | View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY); 32 | } 33 | getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); 34 | 35 | super.onCreate(savedInstanceState); 36 | } 37 | 38 | 39 | @Override 40 | public int getRootViewId() { 41 | return R.layout.content; 42 | } 43 | 44 | @Override 45 | public void initUI() { 46 | roomFragment = RoomFragment.newInstance(getIntent().getStringExtra(Constants.KEY_UID)); 47 | replaceFragment(roomFragment); 48 | } 49 | 50 | // 51 | // @Override 52 | // public void onConfigurationChanged(Configuration newConfig) { 53 | // super.onConfigurationChanged(newConfig); 54 | // roomFragment.onConfigurationChanged(newConfig); 55 | // } 56 | } 57 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/activity/WelcomeActivity.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.activity; 2 | 3 | import android.view.animation.Animation; 4 | 5 | import com.king.base.SplashActivity; 6 | import com.king.tv.MainActivity; 7 | import com.king.tv.R; 8 | 9 | /** 10 | * @author Jenly Jenly 11 | * @since 2017/3/15 12 | */ 13 | 14 | public class WelcomeActivity extends SplashActivity { 15 | @Override 16 | public int getContentViewId() { 17 | return R.layout.activity_welcome; 18 | } 19 | 20 | @Override 21 | public Animation.AnimationListener getAnimationListener() { 22 | return new Animation.AnimationListener() { 23 | @Override 24 | public void onAnimationStart(Animation animation) { 25 | 26 | } 27 | 28 | @Override 29 | public void onAnimationEnd(Animation animation) { 30 | startActivityFinish(MainActivity.class); 31 | } 32 | 33 | @Override 34 | public void onAnimationRepeat(Animation animation) { 35 | 36 | } 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/adapter/EasyLiveAdapter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.LayoutRes; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.bumptech.glide.Glide; 11 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 12 | import com.jude.easyrecyclerview.adapter.BaseViewHolder; 13 | import com.jude.easyrecyclerview.adapter.RecyclerArrayAdapter; 14 | import com.king.tv.R; 15 | import com.king.tv.bean.LiveInfo; 16 | 17 | import java.util.List; 18 | 19 | /** 20 | * @author Jenly Jenly 21 | * @since 2017/3/3 22 | */ 23 | 24 | public class EasyLiveAdapter extends RecyclerArrayAdapter { 25 | 26 | private boolean isShowStatus; 27 | 28 | public EasyLiveAdapter(Context context, List objects,boolean isShowStatus) { 29 | super(context, objects); 30 | this.isShowStatus = isShowStatus; 31 | } 32 | 33 | @Override 34 | public BaseViewHolder OnCreateViewHolder(ViewGroup parent, int viewType) { 35 | return new LiveViewHolder(parent); 36 | } 37 | 38 | public class LiveViewHolder extends BaseViewHolder{ 39 | 40 | 41 | ImageView iv; 42 | TextView tvTitle; 43 | TextView tvStatus; 44 | TextView tvName; 45 | TextView tvViewer; 46 | 47 | 48 | public LiveViewHolder(ViewGroup parent) { 49 | super(parent,R.layout.list_live_item); 50 | 51 | iv = $(R.id.iv); 52 | tvTitle = $(R.id.tvTitle); 53 | tvStatus = $(R.id.tvStatus); 54 | tvName = $(R.id.tvName); 55 | tvViewer = $(R.id.tvViewer); 56 | } 57 | 58 | @Override 59 | public void setData(LiveInfo data) { 60 | super.setData(data); 61 | 62 | Glide.with(getContext()).load(data.getThumb()).placeholder(R.mipmap.live_default).error(R.mipmap.live_default).crossFade().centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(iv); 63 | 64 | tvTitle.setText(data.getTitle()); 65 | tvName.setText(data.getNick()); 66 | tvViewer.setText(data.getViews()); 67 | 68 | if(isShowStatus){ 69 | if(data.getPlay_status()){ 70 | tvStatus.setVisibility(View.VISIBLE); 71 | }else{ 72 | tvStatus.setVisibility(View.GONE); 73 | } 74 | } 75 | 76 | } 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/adapter/RecommendChildAdapter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.adapter; 2 | 3 | import android.content.Context; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.widget.ImageView; 7 | 8 | import com.bumptech.glide.Glide; 9 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 10 | import com.king.base.adapter.ViewHolderRecyclerAdapter; 11 | import com.king.base.adapter.holder.ViewHolder; 12 | import com.king.tv.R; 13 | import com.king.tv.bean.Recommend; 14 | 15 | import java.util.List; 16 | 17 | /** 18 | * @author Jenly Jenly 19 | * @since 2017/3/17 20 | */ 21 | 22 | public class RecommendChildAdapter extends ViewHolderRecyclerAdapter { 23 | 24 | 25 | 26 | public RecommendChildAdapter(Context context, List listData) { 27 | super(context, listData); 28 | } 29 | 30 | @Override 31 | public View buildConvertView(LayoutInflater layoutInflater, int viewType) { 32 | return inflate(R.layout.list_live_item); 33 | } 34 | 35 | @Override 36 | public void bindViewDatas(ViewHolder holder, Recommend.RoomBean.ListBean data, int position) { 37 | ImageView iv = holder.getView(R.id.iv); 38 | Glide.with(context).load(data.getThumb()).placeholder(R.mipmap.live_default).error(R.mipmap.live_default).crossFade().centerCrop().diskCacheStrategy(DiskCacheStrategy.SOURCE).into(iv); 39 | 40 | holder.setText(R.id.tvTitle,data.getTitle()); 41 | holder.setText(R.id.tvName,data.getNick()); 42 | holder.setText(R.id.tvViewer,data.getViews()); 43 | 44 | } 45 | 46 | 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.LayoutRes; 5 | 6 | import com.hannesdorfmann.mosby.mvp.MvpActivity; 7 | import com.hannesdorfmann.mosby.mvp.MvpPresenter; 8 | import com.hannesdorfmann.mosby.mvp.MvpView; 9 | import com.king.tv.App; 10 | 11 | import java.util.List; 12 | 13 | import butterknife.ButterKnife; 14 | 15 | /** 16 | * @author Jenly Jenly 17 | * @since 2017/2/20 18 | */ 19 | 20 | public abstract class BaseActivity> extends MvpActivity { 21 | 22 | @Override 23 | protected void onCreate(Bundle savedInstanceState) { 24 | super.onCreate(savedInstanceState); 25 | setContentView(getRootViewId()); 26 | initUI(); 27 | 28 | } 29 | 30 | @Override 31 | public void setContentView(@LayoutRes int layoutResID) { 32 | super.setContentView(layoutResID); 33 | ButterKnife.bind(this); 34 | } 35 | 36 | 37 | public void toSetList(List list, List newList, boolean isMore){ 38 | 39 | if(list!=null && newList!=null){ 40 | synchronized (BaseFragment.class){ 41 | if(!isMore){ 42 | list.clear(); 43 | } 44 | list.addAll(newList); 45 | } 46 | } 47 | } 48 | 49 | 50 | public App getApp(){ 51 | return (App)getApplication(); 52 | } 53 | 54 | 55 | public abstract int getRootViewId(); 56 | 57 | public abstract void initUI(); 58 | 59 | public abstract void initData(); 60 | 61 | } 62 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/base/BasePresenter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.base; 2 | 3 | import com.hannesdorfmann.mosby.mvp.MvpBasePresenter; 4 | import com.king.base.util.LogUtils; 5 | import com.king.tv.App; 6 | import com.king.tv.dao.greendao.DaoSession; 7 | import com.king.tv.di.component.AppComponent; 8 | 9 | import javax.inject.Inject; 10 | 11 | /** 12 | * @author Jenly Jenly 13 | * @since 2017/2/20 14 | */ 15 | 16 | public class BasePresenter extends MvpBasePresenter { 17 | 18 | private App app; 19 | 20 | private DaoSession mDaoSession; 21 | 22 | private AppComponent mAppComponent; 23 | 24 | @Inject 25 | public BasePresenter(App app){ 26 | super(); 27 | this.app = app; 28 | mDaoSession = app.getDaoSession(); 29 | mAppComponent = app.getAppCommponent(); 30 | } 31 | 32 | 33 | public AppComponent getAppComponent(){ 34 | return mAppComponent; 35 | } 36 | 37 | public DaoSession getDaoSession(){ 38 | return mDaoSession; 39 | } 40 | 41 | public App getApp(){ 42 | return getApp(); 43 | } 44 | 45 | @Override 46 | public boolean isViewAttached() { 47 | LogUtils.d("isViewAttached:" + super.isViewAttached()); 48 | return super.isViewAttached(); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/base/BaseView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.base; 2 | 3 | import com.hannesdorfmann.mosby.mvp.MvpView; 4 | 5 | /** 6 | * @author Jenly Jenly 7 | * @since 2017/2/20 8 | */ 9 | 10 | public interface BaseView extends MvpView{ 11 | 12 | 13 | void showProgress(); 14 | 15 | void onCompleted(); 16 | 17 | void onError(Throwable e); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/base/PureActivity.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.base; 2 | 3 | import android.annotation.TargetApi; 4 | import android.content.Context; 5 | import android.graphics.Color; 6 | import android.os.Build; 7 | import android.os.Bundle; 8 | import android.support.annotation.IdRes; 9 | import android.support.annotation.Nullable; 10 | import android.support.v4.app.Fragment; 11 | import android.support.v7.app.AppCompatActivity; 12 | import android.view.View; 13 | import android.view.ViewGroup; 14 | import android.view.WindowManager; 15 | 16 | import com.king.tv.App; 17 | import com.king.tv.R; 18 | 19 | /** 20 | * @author Jenly Jenly 21 | * @since 2017/3/3 22 | */ 23 | 24 | public abstract class PureActivity extends AppCompatActivity { 25 | 26 | private static final int INVALID_VAL = -1; 27 | private static final int COLOR_DEFAULT = Color.parseColor("#7f000000"); 28 | 29 | protected Context context; 30 | 31 | @Override 32 | protected void onCreate(@Nullable Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT){ 35 | getWindow().setFlags(WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS, WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS); 36 | } 37 | context = this; 38 | setContentView(getRootViewId()); 39 | 40 | initUI(); 41 | setStatusViewColor(getResources().getColor(R.color.colorPrimaryDark)); 42 | } 43 | 44 | 45 | public void replaceFragment(Fragment fragmnet){ 46 | replaceFragment(R.id.fragmentContent,fragmnet); 47 | } 48 | 49 | public void replaceFragment(@IdRes int id, Fragment fragment) { 50 | getSupportFragmentManager().beginTransaction().replace(id, fragment).commit(); 51 | } 52 | 53 | 54 | public App getApp(){ 55 | return (App)getApplication(); 56 | } 57 | 58 | public void setStatusViewColorDefault(){ 59 | setStatusViewColor(COLOR_DEFAULT); 60 | } 61 | 62 | @TargetApi(Build.VERSION_CODES.LOLLIPOP) 63 | public void setStatusViewColor(int statusColor){ 64 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { 65 | if (statusColor != INVALID_VAL) { 66 | getWindow().setStatusBarColor(statusColor); 67 | } 68 | return; 69 | } 70 | // 71 | if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT && Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) { 72 | int color = COLOR_DEFAULT; 73 | ViewGroup contentView = (ViewGroup) findViewById(android.R.id.content); 74 | if (statusColor != INVALID_VAL) { 75 | color = statusColor; 76 | } 77 | View statusBarView = new View(this); 78 | ViewGroup.LayoutParams lp = new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, 79 | getStatusBarHeight(this)); 80 | statusBarView.setBackgroundColor(color); 81 | contentView.addView(statusBarView, lp); 82 | } 83 | } 84 | 85 | public int getStatusBarHeight(Context context) { 86 | int result = 0; 87 | int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android"); 88 | if (resourceId > 0) { 89 | result = context.getResources().getDimensionPixelSize(resourceId); 90 | } 91 | return result; 92 | } 93 | 94 | 95 | public abstract int getRootViewId(); 96 | 97 | public abstract void initUI(); 98 | } 99 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/AboutFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.content.Intent; 4 | import android.net.Uri; 5 | import android.os.Bundle; 6 | import android.text.Html; 7 | import android.view.View; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import com.king.base.util.SystemUtils; 12 | import com.king.tv.R; 13 | 14 | import butterknife.BindView; 15 | import butterknife.OnClick; 16 | 17 | /** 18 | * @author Jenly Jenly 19 | * @since 2017/3/21 20 | */ 21 | 22 | public class AboutFragment extends SimpleFragment { 23 | 24 | @BindView(R.id.ivLeft) 25 | ImageView ivLeft; 26 | @BindView(R.id.tvTitle) 27 | TextView tvTitle; 28 | @BindView(R.id.tvVersion) 29 | TextView tvVersion; 30 | @BindView(R.id.tvAuthor) 31 | TextView tvAuthor; 32 | @BindView(R.id.tvEmail) 33 | TextView tvEmail; 34 | @BindView(R.id.tvCSDN) 35 | TextView tvCSDN; 36 | @BindView(R.id.tvGithub) 37 | TextView tvGithub; 38 | 39 | public static AboutFragment newInstance() { 40 | 41 | Bundle args = new Bundle(); 42 | 43 | AboutFragment fragment = new AboutFragment(); 44 | fragment.setArguments(args); 45 | return fragment; 46 | } 47 | 48 | @Override 49 | public int getRootViewId() { 50 | return R.layout.fragment_about; 51 | } 52 | 53 | @Override 54 | public void initUI() { 55 | tvTitle.setText(R.string.about); 56 | 57 | tvVersion.setText(String.format(getString(R.string.current_version_), SystemUtils.getVersionName(context))); 58 | } 59 | 60 | @Override 61 | public void initData() { 62 | 63 | } 64 | 65 | private void clickEmail(){ 66 | Uri uri = Uri.parse("mailto:jenly1314@gmail.com"); 67 | Intent intent = new Intent(Intent.ACTION_SENDTO, uri); 68 | startActivity(Intent.createChooser(intent, "Choose Email Client")); 69 | } 70 | 71 | @OnClick({R.id.ivLeft,R.id.tvEmail,R.id.tvCSDN, R.id.tvGithub}) 72 | public void onClick(View view) { 73 | switch (view.getId()) { 74 | case R.id.ivLeft: 75 | finish(); 76 | break; 77 | case R.id.tvEmail: 78 | clickEmail(); 79 | break; 80 | case R.id.tvCSDN: 81 | startWeb("Jenly",tvCSDN.getText().toString()); 82 | break; 83 | case R.id.tvGithub: 84 | startWeb("Jenly",tvGithub.getText().toString()); 85 | break; 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/AnchorInfoFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.MainThread; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.TextView; 9 | 10 | import com.bumptech.glide.Glide; 11 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 12 | import com.king.base.util.LogUtils; 13 | import com.king.tv.R; 14 | import com.king.tv.bean.Room; 15 | import com.king.tv.util.DecimalFormatUtil; 16 | 17 | import org.greenrobot.eventbus.EventBus; 18 | import org.greenrobot.eventbus.Subscribe; 19 | import org.greenrobot.eventbus.ThreadMode; 20 | 21 | import butterknife.BindView; 22 | import butterknife.ButterKnife; 23 | import de.hdodenhof.circleimageview.CircleImageView; 24 | 25 | /** 26 | * @author Jenly Jenly 27 | * @since 2017/3/10 28 | */ 29 | 30 | public class AnchorInfoFragment extends SimpleFragment { 31 | 32 | @BindView(R.id.civAvatar) 33 | CircleImageView civAvatar; 34 | @BindView(R.id.tvAnchorName) 35 | TextView tvAnchorName; 36 | @BindView(R.id.tvAccount) 37 | TextView tvAccount; 38 | @BindView(R.id.tvFans) 39 | TextView tvFans; 40 | @BindView(R.id.tvWeight) 41 | TextView tvWeight; 42 | @BindView(R.id.tvStartLiveTime) 43 | TextView tvStartLiveTime; 44 | @BindView(R.id.tvAge) 45 | TextView tvAge; 46 | @BindView(R.id.tvEmotionalState) 47 | TextView tvEmotionalState; 48 | @BindView(R.id.tvLocation) 49 | TextView tvLocation; 50 | @BindView(R.id.tvOccupation) 51 | TextView tvOccupation; 52 | 53 | private Room room; 54 | 55 | public static AnchorInfoFragment newInstance(Room room) { 56 | Bundle args = new Bundle(); 57 | 58 | AnchorInfoFragment fragment = new AnchorInfoFragment(); 59 | fragment.room = room; 60 | fragment.setArguments(args); 61 | return fragment; 62 | } 63 | 64 | @Override 65 | public int getRootViewId() { 66 | return R.layout.fragment_anchor; 67 | } 68 | 69 | @Override 70 | public void initUI() { 71 | 72 | } 73 | 74 | public void onUpdateAnchor(Room room){ 75 | this.room = room; 76 | initData(); 77 | } 78 | 79 | 80 | @Override 81 | public void initData() { 82 | 83 | if (room != null && getRootView()!=null) { 84 | Glide.with(this).load(room.getAvatar()).error(R.drawable.mine_default_avatar).placeholder(R.drawable.mine_default_avatar).diskCacheStrategy(DiskCacheStrategy.SOURCE).into(civAvatar); 85 | tvAnchorName.setText(room.getNick()); 86 | tvAccount.setText(String.valueOf(room.getNo())); 87 | tvFans.setText(String.valueOf(room.getFollow())); 88 | tvWeight.setText(DecimalFormatUtil.formatW(room.getWeight()/100)); 89 | tvStartLiveTime.setText(room.getAnnouncement()); 90 | 91 | } 92 | } 93 | 94 | } 95 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/ChatFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.text.Spannable; 5 | import android.text.SpannableString; 6 | import android.text.SpannableStringBuilder; 7 | import android.text.style.ImageSpan; 8 | import android.view.View; 9 | import android.widget.EditText; 10 | import android.widget.ImageView; 11 | import android.widget.TextView; 12 | 13 | import com.king.tv.R; 14 | import com.king.tv.mvp.base.BaseFragment; 15 | import com.king.tv.mvp.presenter.ChatPresenter; 16 | import com.king.tv.mvp.view.IChatView; 17 | 18 | import butterknife.BindView; 19 | import butterknife.OnClick; 20 | 21 | /** 22 | * @author Jenly Jenly 23 | * @since 2017/3/9 24 | */ 25 | 26 | public class ChatFragment extends BaseFragment { 27 | 28 | 29 | @BindView(R.id.tvTips) 30 | TextView tvTips; 31 | @BindView(R.id.ivEmoji) 32 | ImageView ivEmoji; 33 | @BindView(R.id.etChat) 34 | EditText etChat; 35 | @BindView(R.id.ivDanmu) 36 | ImageView ivDanmu; 37 | @BindView(R.id.ivGif) 38 | ImageView ivGif; 39 | 40 | public static ChatFragment newInstance() { 41 | 42 | Bundle args = new Bundle(); 43 | 44 | ChatFragment fragment = new ChatFragment(); 45 | fragment.setArguments(args); 46 | return fragment; 47 | } 48 | 49 | @Override 50 | public int getRootViewId() { 51 | return R.layout.fragment_chat; 52 | } 53 | 54 | @Override 55 | public void initUI() { 56 | 57 | 58 | SpannableStringBuilder ssb = new SpannableStringBuilder(); 59 | //系统通知图片 60 | ImageSpan imageSpan = new ImageSpan(context,R.drawable.img_dm_xttz); 61 | SpannableString spannableString = new SpannableString("tips"); 62 | spannableString.setSpan(imageSpan,0,spannableString.length(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); 63 | ssb.append(spannableString); 64 | //系统通知内容 65 | ssb.append(getText(R.string.tips_notice_desc)); 66 | tvTips.setText(ssb); 67 | } 68 | 69 | @Override 70 | public void initData() { 71 | 72 | } 73 | 74 | @Override 75 | public ChatPresenter createPresenter() { 76 | return new ChatPresenter(getApp()); 77 | } 78 | 79 | 80 | @OnClick({R.id.ivEmoji, R.id.ivDanmu, R.id.ivGif}) 81 | public void onClick(View view) { 82 | switch (view.getId()) { 83 | case R.id.ivEmoji: 84 | break; 85 | case R.id.ivDanmu: 86 | startLogin(); 87 | break; 88 | case R.id.ivGif: 89 | break; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/FollowFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import com.king.base.util.ToastUtils; 9 | import com.king.tv.Constants; 10 | import com.king.tv.R; 11 | 12 | import butterknife.BindView; 13 | import butterknife.OnClick; 14 | 15 | /** 16 | * @author Jenly Jenly 17 | * @since 2017/3/9 18 | */ 19 | 20 | public class FollowFragment extends SimpleFragment { 21 | 22 | @BindView(R.id.ivLeft) 23 | ImageView ivLeft; 24 | @BindView(R.id.tvTitle) 25 | TextView tvTitle; 26 | @BindView(R.id.ivRight) 27 | ImageView ivRight; 28 | @BindView(R.id.tvLogin) 29 | TextView tvLogin; 30 | 31 | public static FollowFragment newInstance() { 32 | 33 | Bundle args = new Bundle(); 34 | 35 | FollowFragment fragment = new FollowFragment(); 36 | fragment.setArguments(args); 37 | return fragment; 38 | } 39 | 40 | @Override 41 | public int getRootViewId() { 42 | return R.layout.fragment_follow; 43 | } 44 | 45 | @Override 46 | public void initUI() { 47 | tvTitle.setText(R.string.tab_follw); 48 | } 49 | 50 | @Override 51 | public void initData() { 52 | 53 | } 54 | 55 | @OnClick({R.id.ivLeft, R.id.ivRight, R.id.tvLogin}) 56 | public void onClick(View view) { 57 | switch (view.getId()) { 58 | case R.id.ivLeft: 59 | startActivity(getFragmentIntent(Constants.SEARCH_FRAGMENT)); 60 | break; 61 | case R.id.ivRight: 62 | startLogin(); 63 | break; 64 | case R.id.tvLogin: 65 | startLogin(); 66 | break; 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/LiveFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.ImageView; 6 | import android.widget.TextView; 7 | 8 | import com.king.base.util.ToastUtils; 9 | import com.king.tv.Constants; 10 | import com.king.tv.R; 11 | import com.king.tv.mvp.base.BaseFragment; 12 | import com.king.tv.mvp.base.BasePresenter; 13 | import com.king.tv.mvp.base.BaseView; 14 | 15 | import butterknife.BindView; 16 | import butterknife.OnClick; 17 | 18 | /** 19 | * @author Jenly Jenly 20 | * @since 2017/3/7 21 | */ 22 | 23 | public class LiveFragment extends BaseFragment> { 24 | 25 | @BindView(R.id.ivLeft) 26 | ImageView ivLeft; 27 | @BindView(R.id.ivRight) 28 | ImageView ivRight; 29 | @BindView(R.id.tvTitle) 30 | TextView tvTitle; 31 | 32 | 33 | private String title; 34 | private String slug; 35 | private boolean isTabLive; 36 | 37 | public static LiveFragment newInstance(String title,String slug, boolean isTabLive) { 38 | 39 | Bundle args = new Bundle(); 40 | 41 | LiveFragment fragment = new LiveFragment(); 42 | fragment.title = title; 43 | fragment.slug = slug; 44 | fragment.isTabLive = isTabLive; 45 | fragment.setArguments(args); 46 | return fragment; 47 | } 48 | 49 | @Override 50 | public int getRootViewId() { 51 | return R.layout.fragment_live; 52 | } 53 | 54 | @Override 55 | public void initUI() { 56 | tvTitle.setText(title); 57 | if(isTabLive){ 58 | ivLeft.setImageResource(R.drawable.ic_top_search); 59 | ivRight.setVisibility(View.VISIBLE); 60 | }else{ 61 | ivLeft.setImageResource(R.drawable.btn_back_selector); 62 | ivRight.setVisibility(View.INVISIBLE); 63 | } 64 | replaceChildFragment(R.id.fragment,LiveListFragment.newInstance(slug)); 65 | } 66 | 67 | @Override 68 | public void initData() { 69 | 70 | } 71 | 72 | private void clickLeft(){ 73 | if(isTabLive){ 74 | startActivity(getFragmentIntent(Constants.SEARCH_FRAGMENT)); 75 | }else{ 76 | finish(); 77 | } 78 | } 79 | 80 | @OnClick({R.id.ivLeft,R.id.ivRight}) 81 | public void onClick(View v){ 82 | switch (v.getId()){ 83 | case R.id.ivLeft: 84 | clickLeft(); 85 | break; 86 | case R.id.ivRight: 87 | startLogin(); 88 | break; 89 | } 90 | } 91 | 92 | 93 | @Override 94 | public BasePresenter createPresenter() { 95 | return new BasePresenter(getApp()); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/LoginFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | import android.widget.Button; 6 | import android.widget.EditText; 7 | import android.widget.ImageView; 8 | import android.widget.TextView; 9 | 10 | import com.king.base.util.ToastUtils; 11 | import com.king.tv.R; 12 | 13 | import butterknife.BindView; 14 | import butterknife.OnClick; 15 | 16 | /** 17 | * @author Jenly Jenly 18 | * @since 2017/3/21 19 | */ 20 | 21 | public class LoginFragment extends SimpleFragment { 22 | 23 | 24 | @BindView(R.id.ivLeft) 25 | ImageView ivLeft; 26 | @BindView(R.id.tvRight) 27 | TextView tvRight; 28 | @BindView(R.id.tvTitle) 29 | TextView tvTitle; 30 | @BindView(R.id.etUsername) 31 | EditText etUsername; 32 | @BindView(R.id.etPassword) 33 | EditText etPassword; 34 | @BindView(R.id.btnLogin) 35 | Button btnLogin; 36 | @BindView(R.id.tvForgetPwd) 37 | TextView tvForgetPwd; 38 | @BindView(R.id.ivQQ) 39 | ImageView ivQQ; 40 | @BindView(R.id.ivSina) 41 | ImageView ivSina; 42 | @BindView(R.id.ivWeixin) 43 | ImageView ivWeixin; 44 | 45 | 46 | public static LoginFragment newInstance() { 47 | 48 | Bundle args = new Bundle(); 49 | 50 | LoginFragment fragment = new LoginFragment(); 51 | fragment.setArguments(args); 52 | return fragment; 53 | } 54 | 55 | @Override 56 | public int getRootViewId() { 57 | return R.layout.fragment_login; 58 | } 59 | 60 | @Override 61 | public void initUI() { 62 | tvTitle.setText(R.string.login); 63 | } 64 | 65 | @Override 66 | public void initData() { 67 | 68 | } 69 | 70 | @OnClick({R.id.ivLeft, R.id.tvRight, R.id.btnLogin, R.id.tvForgetPwd, R.id.ivQQ, R.id.ivSina, R.id.ivWeixin}) 71 | public void onClick(View view) { 72 | switch (view.getId()) { 73 | case R.id.ivLeft: 74 | finish(); 75 | break; 76 | case R.id.tvRight: 77 | ToastUtils.showToast(context,R.string.signup); 78 | break; 79 | case R.id.btnLogin: 80 | ToastUtils.showToast(context,R.string.login); 81 | break; 82 | case R.id.tvForgetPwd: 83 | ToastUtils.showToast(context,R.string.forget_password); 84 | break; 85 | case R.id.ivQQ: 86 | break; 87 | case R.id.ivSina: 88 | break; 89 | case R.id.ivWeixin: 90 | break; 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/RankFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.king.tv.R; 6 | 7 | /** 8 | * @author Jenly Jenly 9 | * @since 2017/3/15 10 | */ 11 | 12 | public class RankFragment extends SimpleFragment { 13 | 14 | public static RankFragment newInstance() { 15 | 16 | Bundle args = new Bundle(); 17 | 18 | RankFragment fragment = new RankFragment(); 19 | fragment.setArguments(args); 20 | return fragment; 21 | } 22 | 23 | @Override 24 | public int getRootViewId() { 25 | return R.layout.fragment_rank; 26 | } 27 | 28 | @Override 29 | public void initUI() { 30 | 31 | } 32 | 33 | @Override 34 | public void initData() { 35 | 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/SearchFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import android.content.Context; 4 | import android.os.Bundle; 5 | import android.view.KeyEvent; 6 | import android.view.View; 7 | import android.view.inputmethod.InputMethodManager; 8 | import android.widget.EditText; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.king.base.util.StringUtils; 13 | import com.king.base.util.ToastUtils; 14 | import com.king.tv.R; 15 | import com.king.tv.mvp.base.BaseFragment; 16 | import com.king.tv.mvp.base.BasePresenter; 17 | import com.king.tv.mvp.base.BaseView; 18 | 19 | import butterknife.BindView; 20 | import butterknife.OnClick; 21 | 22 | /** 23 | * @author Jenly Jenly 24 | * @since 2017/5/9 25 | */ 26 | 27 | public class SearchFragment extends BaseFragment> { 28 | 29 | 30 | @BindView(R.id.ivLeft) 31 | ImageView ivLeft; 32 | @BindView(R.id.etKey) 33 | EditText etKey; 34 | @BindView(R.id.tvRight) 35 | TextView tvRight; 36 | 37 | private LiveListFragment liveListFragment; 38 | 39 | 40 | public static SearchFragment newInstance() { 41 | 42 | Bundle args = new Bundle(); 43 | 44 | SearchFragment fragment = new SearchFragment(); 45 | fragment.setArguments(args); 46 | return fragment; 47 | } 48 | 49 | 50 | 51 | @Override 52 | public int getRootViewId() { 53 | return R.layout.fragment_search; 54 | } 55 | 56 | @Override 57 | public void initUI() { 58 | 59 | etKey.setOnKeyListener(new View.OnKeyListener() { 60 | @Override 61 | public boolean onKey(View v, int keyCode, KeyEvent event) { 62 | if(event.getAction() == KeyEvent.ACTION_UP){ 63 | if(keyCode == KeyEvent.KEYCODE_ENTER || keyCode == KeyEvent.KEYCODE_SEARCH){ 64 | clickSearch(); 65 | return true; 66 | } 67 | } 68 | 69 | return false; 70 | } 71 | }); 72 | } 73 | 74 | @Override 75 | public void initData() { 76 | liveListFragment = LiveListFragment.newInstance(null,true); 77 | replaceChildFragment(R.id.fragment,liveListFragment); 78 | } 79 | 80 | @Override 81 | public BasePresenter createPresenter() { 82 | return new BasePresenter(getApp()); 83 | } 84 | 85 | 86 | 87 | /** 88 | * 隐藏软键盘 89 | * 90 | * @param v 91 | */ 92 | public void hideInputMethod(final EditText v) { 93 | 94 | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); 95 | imm.hideSoftInputFromWindow(v.getWindowToken(),0); 96 | v.clearFocus(); 97 | } 98 | 99 | /** 100 | * 显示软键盘 101 | * 102 | * @param v 103 | */ 104 | public void showInputMethod(final EditText v) { 105 | 106 | v.requestFocus(); 107 | InputMethodManager imm = (InputMethodManager)context 108 | .getSystemService(Context.INPUT_METHOD_SERVICE); 109 | imm.showSoftInput(v,InputMethodManager.SHOW_IMPLICIT); 110 | } 111 | 112 | private boolean checkInputKey(){ 113 | if(StringUtils.isBlank(etKey.getText())){ 114 | ToastUtils.showToast(context,R.string.tips_search_keywords_cannot_be_empty); 115 | return false; 116 | } 117 | return true; 118 | } 119 | 120 | private void clickSearch(){ 121 | if(checkInputKey()){ 122 | hideInputMethod(etKey); 123 | liveListFragment.search(etKey.getText().toString(),0); 124 | 125 | } 126 | 127 | 128 | } 129 | 130 | 131 | @OnClick({R.id.ivLeft, R.id.tvRight}) 132 | public void onViewClicked(View view) { 133 | switch (view.getId()) { 134 | case R.id.ivLeft: 135 | finish(); 136 | break; 137 | case R.id.tvRight: 138 | clickSearch(); 139 | break; 140 | } 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/fragment/SimpleFragment.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.fragment; 2 | 3 | import com.king.tv.mvp.base.BaseFragment; 4 | import com.king.tv.mvp.base.BasePresenter; 5 | import com.king.tv.mvp.base.BaseView; 6 | 7 | /** 8 | * @author Jenly Jenly 9 | * @since 2017/3/10 10 | */ 11 | 12 | public abstract class SimpleFragment extends BaseFragment> { 13 | 14 | @Override 15 | public BasePresenter createPresenter() { 16 | return new BasePresenter<>(getApp()); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/presenter/CategoryPresenter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.presenter; 2 | 3 | import com.king.base.util.LogUtils; 4 | import com.king.tv.App; 5 | import com.king.tv.bean.LiveCategory; 6 | import com.king.tv.mvp.base.BasePresenter; 7 | import com.king.tv.mvp.view.ICategoryView; 8 | import com.king.tv.thread.ThreadPoolManager; 9 | 10 | 11 | import java.util.List; 12 | 13 | import javax.inject.Inject; 14 | 15 | import rx.Observer; 16 | import rx.android.schedulers.AndroidSchedulers; 17 | import rx.schedulers.Schedulers; 18 | 19 | /** 20 | * @author Jenly Jenly 21 | * @since 2017/2/21 22 | */ 23 | 24 | public class CategoryPresenter extends BasePresenter { 25 | 26 | @Inject 27 | public CategoryPresenter(App app) { 28 | super(app); 29 | } 30 | 31 | public void getAllCategories(){ 32 | getView().showProgress(); 33 | getAppComponent().getAPIService() 34 | .getAllCategories() 35 | .subscribeOn(Schedulers.io()) 36 | .observeOn(AndroidSchedulers.mainThread()) 37 | .subscribe(new Observer>() { 38 | @Override 39 | public void onCompleted() { 40 | if(isViewAttached()) 41 | getView().onCompleted(); 42 | 43 | } 44 | 45 | @Override 46 | public void onError(Throwable e) { 47 | if(isViewAttached()) 48 | getView().onError(e); 49 | } 50 | 51 | @Override 52 | public void onNext(final List list) { 53 | LogUtils.d("Response:" + list); 54 | 55 | ThreadPoolManager.getInstance().execute(new Runnable() { 56 | @Override 57 | public void run() { 58 | getDaoSession().getLiveCategoryDao().insertOrReplaceInTx(list); 59 | } 60 | }); 61 | if(isViewAttached()) 62 | getView().onGetLiveCategory(list); 63 | 64 | } 65 | }); 66 | 67 | 68 | 69 | 70 | } 71 | 72 | public void getAllCategoriesByDB(){ 73 | List list = getDaoSession().getLiveCategoryDao().loadAll(); 74 | LogUtils.d("list:" + list); 75 | if(list!=null && list.size()>0){ 76 | if(isViewAttached()) 77 | getView().onGetLiveCategory(list); 78 | } 79 | 80 | } 81 | 82 | 83 | } 84 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/presenter/ChatPresenter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.presenter; 2 | 3 | import com.king.tv.App; 4 | import com.king.tv.mvp.base.BasePresenter; 5 | import com.king.tv.mvp.view.IChatView; 6 | 7 | /** 8 | * @author Jenly Jenly 9 | * @since 2017/3/9 10 | */ 11 | 12 | public class ChatPresenter extends BasePresenter { 13 | 14 | public ChatPresenter(App app) { 15 | super(app); 16 | } 17 | 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/presenter/RecommendPresenter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.presenter; 2 | 3 | import com.king.base.util.LogUtils; 4 | import com.king.tv.App; 5 | import com.king.tv.bean.AppStart; 6 | import com.king.tv.bean.Recommend; 7 | import com.king.tv.mvp.base.BasePresenter; 8 | import com.king.tv.mvp.view.IRecommendView; 9 | 10 | import rx.Subscriber; 11 | import rx.android.schedulers.AndroidSchedulers; 12 | import rx.schedulers.Schedulers; 13 | 14 | /** 15 | * @author Jenly Jenly 16 | * @since 2017/3/16 17 | */ 18 | 19 | public class RecommendPresenter extends BasePresenter { 20 | 21 | public RecommendPresenter(App app) { 22 | super(app); 23 | } 24 | 25 | 26 | 27 | public void getRecommend(){ 28 | if(isViewAttached()){ 29 | getView().showProgress(); 30 | } 31 | getAppComponent().getAPIService() 32 | .getRecommend() 33 | .subscribeOn(Schedulers.io()) 34 | .observeOn(AndroidSchedulers.mainThread()) 35 | .subscribe(new Subscriber() { 36 | @Override 37 | public void onCompleted() { 38 | if(isViewAttached()) 39 | getView().onCompleted(); 40 | } 41 | 42 | @Override 43 | public void onError(Throwable e) { 44 | if(isViewAttached()) 45 | getView().onError(e); 46 | } 47 | 48 | @Override 49 | public void onNext(Recommend recommend) { 50 | LogUtils.d("Response:"+ recommend); 51 | if(isViewAttached()) 52 | getView().onGetRecommend(recommend); 53 | 54 | if(recommend!=null){ 55 | if(isViewAttached()) 56 | getView().onGetRooms(recommend.getRoom()); 57 | } 58 | } 59 | }); 60 | } 61 | 62 | public void getBanner(){ 63 | getAppComponent().getAPIService() 64 | .getAppStartInfo() 65 | .subscribeOn(Schedulers.io()) 66 | .observeOn(AndroidSchedulers.mainThread()) 67 | .subscribe(new Subscriber() { 68 | @Override 69 | public void onCompleted() { 70 | 71 | } 72 | 73 | @Override 74 | public void onError(Throwable e) { 75 | 76 | } 77 | 78 | @Override 79 | public void onNext(AppStart appStart) { 80 | if(appStart!=null){ 81 | if(isViewAttached()) 82 | getView().onGetBanner(appStart.getBanners()); 83 | } 84 | } 85 | 86 | }); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/presenter/RoomPresenter.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.presenter; 2 | 3 | import com.king.base.util.LogUtils; 4 | import com.king.tv.App; 5 | import com.king.tv.bean.Room; 6 | import com.king.tv.bean.RoomLine; 7 | import com.king.tv.mvp.base.BasePresenter; 8 | import com.king.tv.mvp.view.IRoomView; 9 | 10 | import rx.Observer; 11 | import rx.android.schedulers.AndroidSchedulers; 12 | import rx.schedulers.Schedulers; 13 | 14 | /** 15 | * @author Jenly Jenly 16 | * @since 2017/3/7 17 | */ 18 | 19 | public class RoomPresenter extends BasePresenter { 20 | 21 | public RoomPresenter(App app) { 22 | super(app); 23 | } 24 | 25 | public void enterRoom(String uid){ 26 | enterRoom(uid,false); 27 | } 28 | 29 | public void enterRoom(String uid,final boolean isShowing){ 30 | if(isViewAttached()) 31 | getView().showProgress(); 32 | getAppComponent().getAPIService() 33 | .enterRoom(uid) 34 | .subscribeOn(Schedulers.io()) 35 | .observeOn(AndroidSchedulers.mainThread()) 36 | .subscribe(new Observer() { 37 | @Override 38 | public void onCompleted() { 39 | if(isViewAttached()) 40 | getView().onCompleted(); 41 | } 42 | 43 | @Override 44 | public void onError(Throwable e) { 45 | if(isViewAttached()) 46 | getView().onError(e); 47 | } 48 | 49 | @Override 50 | public void onNext(Room room) { 51 | LogUtils.d("Response:" + room); 52 | if(isViewAttached()) 53 | getView().enterRoom(room); 54 | 55 | if(room!= null){ 56 | String url =null; 57 | // RoomLine roomLine = room.getRoom_lines().get(0); 58 | RoomLine roomLine = room.getLive().getWs(); 59 | 60 | RoomLine.FlvBean flv = roomLine.getFlv(); 61 | LogUtils.d("flv:" + flv); 62 | if(flv!=null){ 63 | url = flv.getValue(isShowing).getSrc(); 64 | }else{ 65 | url = roomLine.getHls().getValue(isShowing).getSrc(); 66 | } 67 | if(isViewAttached()) 68 | getView().playUrl(url); 69 | } 70 | 71 | } 72 | }); 73 | 74 | 75 | } 76 | 77 | 78 | 79 | } 80 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/view/ICategoryView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.view; 2 | 3 | import com.king.tv.bean.LiveCategory; 4 | import com.king.tv.mvp.base.BaseView; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Jenly Jenly 10 | * @since 2017/2/21 11 | */ 12 | 13 | public interface ICategoryView extends BaseView { 14 | 15 | void onGetLiveCategory(List list); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/view/IChatView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.view; 2 | 3 | import com.king.tv.mvp.base.BaseView; 4 | 5 | /** 6 | * @author Jenly Jenly 7 | * @since 2017/3/9 8 | */ 9 | 10 | public interface IChatView extends BaseView { 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/view/ILiveListView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.view; 2 | 3 | import com.king.tv.bean.LiveInfo; 4 | import com.king.tv.mvp.base.BaseView; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author Jenly Jenly 10 | * @since 2017/2/21 11 | */ 12 | 13 | public interface ILiveListView extends BaseView { 14 | 15 | 16 | void onGetLiveList(List list); 17 | void onGetMoreLiveList(List list); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/view/IRecommendView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.view; 2 | 3 | import com.king.tv.bean.Banner; 4 | import com.king.tv.bean.Recommend; 5 | import com.king.tv.mvp.base.BaseView; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author Jenly Jenly 11 | * @since 2017/3/16 12 | */ 13 | 14 | public interface IRecommendView extends BaseView { 15 | 16 | void onGetRecommend(Recommend recommend); 17 | 18 | void onGetRooms(List list); 19 | 20 | void onGetBanner(List list); 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/mvp/view/IRoomView.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.mvp.view; 2 | 3 | import com.king.tv.bean.Room; 4 | import com.king.tv.mvp.base.BaseView; 5 | 6 | /** 7 | * @author Jenly Jenly 8 | * @since 2017/3/7 9 | */ 10 | 11 | public interface IRoomView extends BaseView { 12 | 13 | 14 | 15 | void enterRoom(Room room); 16 | 17 | void playUrl(String url); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/thread/ThreadPoolManager.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.thread; 2 | 3 | import java.util.concurrent.BlockingDeque; 4 | import java.util.concurrent.Executors; 5 | import java.util.concurrent.LinkedBlockingDeque; 6 | import java.util.concurrent.RejectedExecutionHandler; 7 | import java.util.concurrent.ThreadFactory; 8 | import java.util.concurrent.ThreadPoolExecutor; 9 | import java.util.concurrent.TimeUnit; 10 | 11 | /** 12 | * @author Jenly Jenly 13 | * @since 2017/3/13 14 | */ 15 | 16 | public class ThreadPoolManager { 17 | 18 | private static ThreadPoolProxy mInstance; 19 | 20 | public static ThreadPoolProxy getInstance(){ 21 | if(mInstance == null){ 22 | synchronized (ThreadPoolManager.class){ 23 | if(mInstance == null){ 24 | mInstance = new ThreadPoolProxy(2,5); 25 | } 26 | } 27 | } 28 | 29 | return mInstance; 30 | } 31 | 32 | 33 | /** 34 | * 线程池代理 35 | */ 36 | public static class ThreadPoolProxy{ 37 | 38 | private ThreadPoolExecutor mThreadPoolExecutor; 39 | 40 | 41 | public ThreadPoolProxy(int corePoolSize, int maximumPoolSize){ 42 | initThreadPoolExecutor(corePoolSize,maximumPoolSize); 43 | } 44 | 45 | private void initThreadPoolExecutor(int corePoolSize, int maximumPoolSize){ 46 | 47 | if(mThreadPoolExecutor == null){ 48 | // ExecutorService executorService = Executors.newFixedThreadPool(3); 49 | //阻塞缓冲队列 50 | BlockingDeque workQueue = new LinkedBlockingDeque<>(); 51 | 52 | //线程工厂 53 | ThreadFactory threadFactory = Executors.defaultThreadFactory(); 54 | //拒绝任务处理策略(抛弃旧的任务) 55 | RejectedExecutionHandler handler = new ThreadPoolExecutor.DiscardPolicy(); 56 | 57 | mThreadPoolExecutor = new ThreadPoolExecutor(corePoolSize,maximumPoolSize,0, TimeUnit.MICROSECONDS,workQueue,threadFactory,handler); 58 | } 59 | } 60 | 61 | public void submit(Runnable task){ 62 | if(mThreadPoolExecutor!=null){ 63 | mThreadPoolExecutor.submit(task); 64 | } 65 | } 66 | 67 | public void execute(Runnable task){ 68 | if(mThreadPoolExecutor!=null){ 69 | mThreadPoolExecutor.execute(task); 70 | } 71 | } 72 | 73 | public void remove(Runnable task){ 74 | if(mThreadPoolExecutor!=null){ 75 | mThreadPoolExecutor.remove(task); 76 | } 77 | } 78 | 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/util/DecimalFormatUtil.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.util; 2 | 3 | import com.king.base.util.LogUtils; 4 | 5 | import java.text.DecimalFormat; 6 | 7 | import static android.icu.lang.UCharacter.GraphemeClusterBreak.L; 8 | 9 | /** 10 | * @author Jenly Jenly 11 | * @since 2017/3/15 12 | */ 13 | 14 | public class DecimalFormatUtil { 15 | 16 | private static final DecimalFormat decimalFormat = new DecimalFormat(); 17 | 18 | 19 | public static String formatW(int vaule){ 20 | if(vaule>=10000){ 21 | float l = vaule/10000.0f; 22 | 23 | return format(l,"#.#'W'"); 24 | } 25 | return String.valueOf(vaule); 26 | } 27 | 28 | public static String format(float vaule,String pattern){ 29 | LogUtils.d("vaule:" + vaule); 30 | decimalFormat.applyPattern(pattern); 31 | return decimalFormat.format(vaule); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/util/DensityUtil.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.util; 2 | 3 | import android.content.Context; 4 | import android.util.DisplayMetrics; 5 | import android.util.TypedValue; 6 | 7 | /** 8 | * @author Jenly Jenly 9 | * @since 2017/1/23 10 | */ 11 | public class DensityUtil { 12 | 13 | private DensityUtil(){ 14 | throw new AssertionError(); 15 | } 16 | 17 | 18 | /** 19 | * dp转px 20 | * @param context 21 | * @param dpVal 22 | * @return 23 | */ 24 | public static int dp2px(Context context, float dpVal){ 25 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP,dpVal,getDisplayMetrics(context)); 26 | } 27 | 28 | /** 29 | * sp转px 30 | * @param context 31 | * @param spVal 32 | * @return 33 | */ 34 | public static int sp2px(Context context, float spVal){ 35 | return (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_SP,spVal,getDisplayMetrics(context)); 36 | } 37 | 38 | /** 39 | * px转dp 40 | * @param context 41 | * @param pxVal 42 | * @return 43 | */ 44 | public static int px2dp(Context context, float pxVal){ 45 | return (int) (pxVal / getDisplayMetrics(context).density + 0.5f); 46 | } 47 | 48 | /** 49 | * px转sp 50 | * @param context 51 | * @param pxVal 52 | * @return 53 | */ 54 | public static int px2sp(Context context, float pxVal){ 55 | return (int) (pxVal / getDisplayMetrics(context).scaledDensity + 0.5f); 56 | } 57 | 58 | 59 | /** 60 | * 获取DisplayMetrics 61 | * @param context 62 | * @return 63 | */ 64 | public static DisplayMetrics getDisplayMetrics(Context context){ 65 | return context.getResources().getDisplayMetrics(); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/com/king/tv/view/ScollAwareFABBehavior.java: -------------------------------------------------------------------------------- 1 | package com.king.tv.view; 2 | 3 | import android.content.Context; 4 | import android.support.design.widget.CoordinatorLayout; 5 | import android.support.design.widget.FloatingActionButton; 6 | import android.support.v4.view.ViewCompat; 7 | import android.util.AttributeSet; 8 | import android.view.View; 9 | import com.king.base.util.LogUtils; 10 | 11 | /** 12 | * @author Jenly Jenly 13 | * @since 2017/3/8 14 | */ 15 | 16 | public class ScollAwareFABBehavior extends FloatingActionButton.Behavior { 17 | 18 | private Context context; 19 | 20 | public ScollAwareFABBehavior(Context context, AttributeSet attrs){ 21 | super(); 22 | this.context = context; 23 | } 24 | 25 | @Override 26 | public boolean onStartNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child, View directTargetChild, View target, int nestedScrollAxes) { 27 | return nestedScrollAxes == ViewCompat.SCROLL_AXIS_VERTICAL ||super.onStartNestedScroll(coordinatorLayout, child, directTargetChild, target, nestedScrollAxes); 28 | } 29 | 30 | @Override 31 | public void onNestedScroll(CoordinatorLayout coordinatorLayout, FloatingActionButton child, View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed) { 32 | super.onNestedScroll(coordinatorLayout, child, target, dxConsumed, dyConsumed, dxUnconsumed, dyUnconsumed); 33 | 34 | LogUtils.d("dy:" + dyConsumed +" -- dyu:" + dyUnconsumed); 35 | if(dyConsumed>0 && child.getVisibility() == View.VISIBLE){ 36 | // child.startAnimation(AnimationUtils.loadAnimation(context, R.anim.fab_behavior_out)); 37 | child.hide(); 38 | }else if(dyConsumed<0 && child.getVisibility() != View.VISIBLE){ 39 | // child.startAnimation(AnimationUtils.loadAnimation(context, R.anim.fab_behavior_in)); 40 | child.show(); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/jnilibs/armeabi-v7a/libpldroidplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/jnilibs/armeabi-v7a/libpldroidplayer.so -------------------------------------------------------------------------------- /app/src/main/jnilibs/armeabi/libpldroidplayer.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/jnilibs/armeabi/libpldroidplayer.so -------------------------------------------------------------------------------- /app/src/main/res/anim/fab_behavior_in.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fab_behavior_out.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/color/tab_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_close_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_close_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_conversation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_conversation.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_gift.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_gift_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_gift_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_home_fenlei_more_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_home_fenlei_more_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_home_fenlei_more_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_home_fenlei_more_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_input.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_input_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_input_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_message_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_message_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_nav_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_nav_close.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_nav_close_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_nav_close_click.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_share.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_share_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_share_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_guanzhu_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_guanzhu_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_guanzhu_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_guanzhu_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_home_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_home_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_home_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_home_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_wode_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_wode_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_wode_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_wode_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_zhibo_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_zhibo_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/btn_tabbar_zhibo_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/btn_tabbar_zhibo_selected.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/default_recommend_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/default_recommend_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/follow_lives_not_login.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/follow_lives_not_login.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_back.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_back_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_back_dark.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_dot_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_dot_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_dot_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_dot_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_history_islive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_history_islive.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_hor_room_ban_send_danmu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_hor_room_ban_send_danmu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_hor_room_ban_send_danmu_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_hor_room_ban_send_danmu_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_mine_push_start.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_mine_push_start.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_tips_no_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_tips_no_data.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_tips_no_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_tips_no_network.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_top_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_top_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_top_search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_top_search.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_triangle.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_triangle.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_triangle_hor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_triangle_hor.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_back_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_back_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_back_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_back_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_liwu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_liwu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_quanping_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_quanping_normal.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_quanping_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/ic_zhibojian_shu_quanping_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/icon_locationg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/icon_locationg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/img_dm_xttz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/img_dm_xttz.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/img_zhibojian_shu_zhubo_gerenziliao.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/img_zhibojian_shu_zhubo_gerenziliao.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/img_zhibojian_shu_zhubo_tg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/img_zhibojian_shu_zhubo_tg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_chat_message.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_chat_message.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_contribution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_contribution.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_default_avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_default_avatar.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_edit_profile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_edit_profile.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_game.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_game.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_level.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_level.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_niubi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_niubi.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_red_background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_red_background.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_seed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_seed.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_setting.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_setting.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_starlight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_starlight.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_task.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_task.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/mine_watch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/mine_watch.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/pic_portrait.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/pic_portrait.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/quanmin_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/quanmin_logo.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/res_contribution_header_avatar_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/res_contribution_header_avatar_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/share_qq_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/share_qq_on.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/share_sina.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/share_sina.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/share_weixin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/drawable-xxhdpi/share_weixin.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_back_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_close_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_gift_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_home_fenlei_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_input_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_bg_normal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_bg_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_login_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_message_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_nav_close_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_share_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_tabbar_guanzhu_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_tabbar_home_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_tabbar_wode_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_tabbar_zhibo_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_zhibojian_back_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_zhibojian_fenxiang_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/btn_zhibojian_quanping_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/follow_login_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 15 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/follow_login_btn_bg_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 15 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/follow_login_btn_bg_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/full_room_avatar_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_hor_room_ban_send_danmu_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/me_login_btn_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | 7 | 8 | 9 | 10 | 15 | 17 | 18 | 19 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/progress_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/room_bottom_chat_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/room_chat_edit_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/room_tips_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/search_edit_bg.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 14 | 15 | 16 | 17 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/tab_text_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_welcome.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/banner.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/bottom_tab_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 12 | 24 | 36 | 48 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/cover.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_chat.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | 20 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_content.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_follow.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 14 | 19 | 25 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 10 | 16 | 23 | 24 | 25 | 26 | 30 | 43 | 48 | 49 | 50 | 51 | 56 | 70 | 71 | 72 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_live.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_live_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_rank.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_recommend.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_search.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 12 | 18 | 36 | 44 | 45 | 46 | 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_video.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_webwiew.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 15 | 20 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_empty.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_error.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/line_h.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/line_h_mine.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/line_h_mine_space.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_live_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 15 | 28 | 38 | 45 | 52 | 63 | 64 | 65 | -------------------------------------------------------------------------------- /app/src/main/res/layout/list_remmend_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 15 | 20 | 27 | 34 | 35 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/load_more.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/progress_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/room_bottom_chat_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 22 | 32 | 39 | 40 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/top_back_title_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 23 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/top_text_title_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 23 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/top_title_bar.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 13 | 21 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_text_follow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_text_follow.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_text_followed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_text_followed.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_back_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_back_normal.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_back_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_back_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_concernxxhdpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_concernxxhdpi.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_emoji_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_emoji_click.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_fenxiang_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_fenxiang_normal.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_fenxiang_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_fenxiang_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_jp_click.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_jp_click.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_quanping_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_quanping_normal.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_quanping_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/ic_zhibojian_shu_quanping_pressed.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/live_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/live_default.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/viewer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxhdpi/viewer.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values-v21/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | 16dp 8 | 16dp 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | 16dp 8 | 16dp 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ffffff 4 | #FB5553 5 | #FB5553 6 | 7 | 8 | #A7A7A7 9 | #FB5553 10 | #FB5553 11 | #FB5553 12 | #FFEEF0 13 | 14 | #808080 15 | #333333 16 | #999999 17 | #666666 18 | 19 | #7fFB5553 20 | 21 | #7f000000 22 | 23 | #999999 24 | 25 | #f0f0f0 26 | #f8f8f8 27 | #fafafa 28 | #1f000000 29 | #e5e5e5 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 0dp 7 | 0dp 8 | 9 | 10 | 20sp 11 | 12sp 12 | 13sp 13 | 13sp 14 | 12sp 15 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | KingTV 3 | 4 | text 5 | 做年轻人爱看的直播 6 | 首页 7 | 直播 8 | 关注 9 | 我的 10 | 11 | 全部 12 | 13 | 搜索 14 | 15 | 再按一次退出KingTV 16 | 17 | .view.ScollAwareFABBehavior 18 | 19 | 20 | 聊天 21 | 排行 22 | 主播 23 | 关注 24 | 和主播说点什么… 25 |  全民直播提倡绿色直播。封页和直播内容含吸烟,低俗,引诱,暴露等都将被封停账号。网警在线24小时巡查哦。 26 | 27 | 全民号: 28 | 粉丝: 29 | 战斗力: 30 | | 31 | 直播公告 32 | 开播时间 33 | 个人资料 34 | 年龄 35 | 情感状态 36 | 所在地 37 | 职业 38 | 保密 39 | 外太空 40 | 全民号 %1$s 41 | 粉丝 %1$d 42 | 43 | 44 | 当前未登录 45 | 点击登录,精彩不再错过 46 | 47 | 48 | 点击登录 49 | 关注 50 | 粉丝 51 | 充值 52 | 我的星光 53 | 星光贡献榜 54 | 观看历史 55 | 我的等级 56 | 任务中心 57 | 游戏中心 58 | 设置 59 | 60 | 61 | 登录 62 | 注册 63 | 用户名/手机号 64 | 密码 65 | 忘记密码 66 | 第三方登录 67 | 68 | 69 | 推荐 70 | 更多 71 | 72 | 73 | 请输入主播昵称或全民号 74 | 搜索关键字不能为空 75 | 正在直播 76 | 77 | 找不到你想要的内容,换个关键词试试! 78 | 没有更多了 79 | 网络状态不佳 80 | 加载失败… 81 | 下拉刷新数据 82 | 83 | KingTV %1$s 84 | 关于 85 | Author: 86 | Email: 87 | CSDN: 88 | Github: 89 | 90 | Jenly 91 | jenly1314@gmail.com 92 | http://blog.csdn.net/jenly121 93 | https://github.com/jenly1314 94 | 95 | 96 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | 19 | 20 | 21 | 24 | 25 | 26 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/test/java/com/king/tv/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.king.tv; 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/tinker-support.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.tencent.bugly.tinker-support' 2 | 3 | def bakPath = file("${buildDir}/bakApk/") 4 | 5 | /** 6 | * 此处填写每次构建生成的基准包目录 7 | */ 8 | def baseApkDir = "app-0510-13-57-38" 9 | 10 | /** 11 | * 对于插件各参数的详细解析请参考 12 | */ 13 | tinkerSupport { 14 | 15 | // 开启tinker-support插件,默认值true 16 | enable = true 17 | 18 | // 指定归档目录,默认值当前module的子目录tinker 19 | autoBackupApkDir = "${bakPath}" 20 | 21 | // 是否启用覆盖tinkerPatch配置功能,默认值false 22 | // 开启后tinkerPatch配置不生效,即无需添加tinkerPatch 23 | overrideTinkerPatchConfiguration = true 24 | 25 | // 编译补丁包时,必需指定基线版本的apk,默认值为空 26 | // 如果为空,则表示不是进行补丁包的编译 27 | // @{link tinkerPatch.oldApk } 28 | baseApk = "${bakPath}/${baseApkDir}/app-release.apk" 29 | 30 | // 对应tinker插件applyMapping 31 | baseApkProguardMapping = "${bakPath}/${baseApkDir}/app-release-mapping.txt" 32 | 33 | // 对应tinker插件applyResourceMapping 34 | baseApkResourceMapping = "${bakPath}/${baseApkDir}/app-release-R.txt" 35 | 36 | // 构建基准包和补丁包都要指定不同的tinkerId,并且必须保证唯一性 37 | tinkerId = "base-1.2.0" 38 | 39 | // 构建多渠道补丁时使用 40 | // buildAllFlavorsDir = "${bakPath}/${baseApkDir}" 41 | 42 | // 是否开启反射Application模式 43 | enableProxyApplication = true 44 | 45 | } 46 | 47 | /** 48 | * 一般来说,我们无需对下面的参数做任何的修改 49 | * 对于各参数的详细介绍请参考: 50 | * https://github.com/Tencent/tinker/wiki/Tinker-%E6%8E%A5%E5%85%A5%E6%8C%87%E5%8D%97 51 | */ 52 | tinkerPatch { 53 | //oldApk ="${bakPath}/${appName}/app-release.apk" 54 | ignoreWarning = false 55 | useSign = true 56 | dex { 57 | dexMode = "jar" 58 | pattern = ["classes*.dex"] 59 | loader = [] 60 | } 61 | lib { 62 | pattern = ["lib/*/*.so"] 63 | } 64 | 65 | res { 66 | pattern = ["res/*", "r/*", "assets/*", "resources.arsc", "AndroidManifest.xml"] 67 | ignoreChange = [] 68 | largeModSize = 100 69 | } 70 | 71 | packageConfig { 72 | } 73 | sevenZip { 74 | zipArtifact = "com.tencent.mm:SevenZip:1.1.10" 75 | // path = "/usr/local/bin/7za" 76 | } 77 | buildConfig { 78 | keepDexApply = false 79 | //tinkerId = "1.0.1-base" 80 | //applyMapping = "${bakPath}/${appName}/app-release-mapping.txt" // 可选,设置mapping文件,建议保持旧apk的proguard混淆方式 81 | //applyResourceMapping = "${bakPath}/${appName}/app-release-R.txt" // 可选,设置R.txt文件,通过旧apk文件保持ResId的分配 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | repositories { 5 | jcenter() 6 | 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:2.2.3' 10 | classpath 'org.greenrobot:greendao-gradle-plugin:3.2.1' 11 | classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8' 12 | // classpath 'com.tencent.tinker:tinker-patch-gradle-plugin:1.7.7' 13 | 14 | classpath "com.tencent.bugly:tinker-support:latest.release" 15 | 16 | // NOTE: Do not place your application dependencies here; they belong 17 | // in the individual module build.gradle files 18 | } 19 | } 20 | 21 | allprojects { 22 | repositories { 23 | jcenter() 24 | maven { url 'https://dl.bintray.com/jenly/maven' } 25 | } 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | org.gradle.jvmargs=-Xmx1536m 13 | 14 | # When configured, Gradle will run in incubating parallel mode. 15 | # This option should only be used with decoupled projects. More details, visit 16 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 17 | # org.gradle.parallel=true 18 | android.useDeprecatedNdk=true 19 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /pictures/QR_KingTV.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/pictures/QR_KingTV.png -------------------------------------------------------------------------------- /pictures/gif.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/pictures/gif.gif -------------------------------------------------------------------------------- /pictures/live.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/pictures/live.png -------------------------------------------------------------------------------- /pictures/recommend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/pictures/recommend.png -------------------------------------------------------------------------------- /pictures/room.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jenly1314/KingTV/2bab52cd519e729c1b9979fff1fac0431c61e2d9/pictures/room.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | --------------------------------------------------------------------------------