├── .gitignore ├── .idea ├── compiler.xml ├── copyright │ └── profiles_settings.xml ├── dictionaries │ └── Administrator.xml ├── gradle.xml ├── inspectionProfiles │ ├── Project_Default.xml │ └── profiles_settings.xml ├── kotlinc.xml ├── markdown-navigator.xml ├── markdown-navigator │ └── profiles_settings.xml ├── misc.xml ├── modules.xml ├── runConfigurations.xml └── vcs.xml ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ ├── assets │ │ └── litepal.xml │ │ ├── java │ │ └── cn │ │ │ └── flyexp │ │ │ └── douban_movie │ │ │ ├── MyApplication.java │ │ │ ├── adapter │ │ │ ├── FragmentAdapter.java │ │ │ ├── GiftAdapter.java │ │ │ ├── MovieAdapter.java │ │ │ ├── MovieDetailAdapter.java │ │ │ └── TagAdapter.java │ │ │ ├── assistview │ │ │ ├── FullyGridLayoutManager.java │ │ │ ├── GridDividerItemDecoration.java │ │ │ ├── MyRecyclerView.java │ │ │ ├── MyScrollview.java │ │ │ ├── NoScrollViewPager.java │ │ │ ├── SpaceItemDecoration.java │ │ │ └── StaggeredSpacesItemDecoration.java │ │ │ ├── base │ │ │ ├── BaseActivity.java │ │ │ ├── BaseLazyFragment.java │ │ │ ├── BasePresenter.java │ │ │ ├── IBaseView.java │ │ │ └── LazyFragment.java │ │ │ ├── model │ │ │ ├── CelebrityDetailModel.java │ │ │ ├── GiftModel.java │ │ │ ├── MessageEvent.java │ │ │ ├── MovieDetailModel.java │ │ │ ├── MovieModel.java │ │ │ ├── MovieSubjectsModel.java │ │ │ └── TagData.java │ │ │ ├── net │ │ │ ├── DouBanApi.java │ │ │ ├── GankApi.java │ │ │ └── NetWork.java │ │ │ ├── presenter │ │ │ ├── AnimePresenter.java │ │ │ ├── CelebrityDetailPresenter.java │ │ │ ├── FavoritePresenter.java │ │ │ ├── GiftPresenter.java │ │ │ ├── MovieDetailPresenter.java │ │ │ ├── MoviePresenter.java │ │ │ ├── SearchDetailPresenter.java │ │ │ ├── TVPresenter.java │ │ │ ├── TagPresenter.java │ │ │ ├── Top250Presenter.java │ │ │ └── ipresenter │ │ │ │ ├── IAnimePresenter.java │ │ │ │ ├── ICelebrityDetailPresenter.java │ │ │ │ ├── IFavoritePresenter.java │ │ │ │ ├── IGiftPresenter.java │ │ │ │ ├── IMovieDetailPresenter.java │ │ │ │ ├── IMoviePresenter.java │ │ │ │ ├── ISearchDetailPresenter.java │ │ │ │ ├── ITVPresenter.java │ │ │ │ ├── ITagPresenter.java │ │ │ │ └── ITop250Presenter.java │ │ │ ├── util │ │ │ └── Utils.java │ │ │ └── view │ │ │ ├── activity │ │ │ ├── CelebrityDetailActivity.java │ │ │ ├── FavoriteActivity.java │ │ │ ├── GiftActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── MovieDetailActivity.java │ │ │ ├── PhotoActivity.java │ │ │ └── SearchDetailActivity.java │ │ │ ├── fragment │ │ │ ├── AnimeFragment.java │ │ │ ├── MovieFragment.java │ │ │ ├── TVFragment.java │ │ │ ├── TagFragment.java │ │ │ └── Top250Fragment.java │ │ │ └── iview │ │ │ ├── IAnimeView.java │ │ │ ├── ICelebrityDetailView.java │ │ │ ├── IFavoriteView.java │ │ │ ├── IGiftView.java │ │ │ ├── IMovieDetailView.java │ │ │ ├── IMovieView.java │ │ │ ├── ISearchDetailView.java │ │ │ ├── ITVView.java │ │ │ ├── ITagView.java │ │ │ └── ITop250View.java │ │ └── res │ │ ├── drawable-hdpi │ │ ├── ic_about_black_24dp.png │ │ ├── ic_anime_black_24dp.png │ │ ├── ic_arrow_right_white_24dp.png │ │ ├── ic_artist_24dp.png │ │ ├── ic_back_white_24dp.png │ │ ├── ic_check_white_24dp.png │ │ ├── ic_country_24dp.png │ │ ├── ic_delete_white_24dp.png │ │ ├── ic_exit_black_24dp.png │ │ ├── ic_favorite_black_24dp.png │ │ ├── ic_favorite_border_white_24dp.png │ │ ├── ic_favorite_white_24dp.png │ │ ├── ic_gift_black_24dp.png │ │ ├── ic_hot_black_24dp.png │ │ ├── ic_menu_white_24dp.png │ │ ├── ic_movie_black_24dp.png │ │ ├── ic_night_black_24dp.png │ │ ├── ic_search_white_24dp.png │ │ ├── ic_sunny_black_24dp.png │ │ ├── ic_tag_black_24dp.png │ │ ├── ic_tv_black_24dp.png │ │ ├── ic_type_24dp.png │ │ └── ic_year_24dp.png │ │ ├── drawable-mdpi │ │ ├── ic_about_black_24dp.png │ │ ├── ic_anime_black_24dp.png │ │ ├── ic_arrow_right_white_24dp.png │ │ ├── ic_artist_24dp.png │ │ ├── ic_back_white_24dp.png │ │ ├── ic_check_white_24dp.png │ │ ├── ic_country_24dp.png │ │ ├── ic_delete_white_24dp.png │ │ ├── ic_exit_black_24dp.png │ │ ├── ic_favorite_black_24dp.png │ │ ├── ic_favorite_border_white_24dp.png │ │ ├── ic_favorite_white_24dp.png │ │ ├── ic_gift_black_24dp.png │ │ ├── ic_hot_black_24dp.png │ │ ├── ic_menu_white_24dp.png │ │ ├── ic_movie_black_24dp.png │ │ ├── ic_night_black_24dp.png │ │ ├── ic_search_white_24dp.png │ │ ├── ic_sunny_black_24dp.png │ │ ├── ic_tag_black_24dp.png │ │ ├── ic_tv_black_24dp.png │ │ ├── ic_type_24dp.png │ │ └── ic_year_24dp.png │ │ ├── drawable-xhdpi │ │ ├── ic_about_black_24dp.png │ │ ├── ic_anime_black_24dp.png │ │ ├── ic_arrow_right_white_24dp.png │ │ ├── ic_artist_24dp.png │ │ ├── ic_back_white_24dp.png │ │ ├── ic_check_white_24dp.png │ │ ├── ic_country_24dp.png │ │ ├── ic_delete_white_24dp.png │ │ ├── ic_exit_black_24dp.png │ │ ├── ic_favorite_black_24dp.png │ │ ├── ic_favorite_border_white_24dp.png │ │ ├── ic_favorite_white_24dp.png │ │ ├── ic_gift_black_24dp.png │ │ ├── ic_hot_black_24dp.png │ │ ├── ic_menu_white_24dp.png │ │ ├── ic_movie_black_24dp.png │ │ ├── ic_night_black_24dp.png │ │ ├── ic_search_white_24dp.png │ │ ├── ic_sunny_black_24dp.png │ │ ├── ic_tag_black_24dp.png │ │ ├── ic_tv_black_24dp.png │ │ ├── ic_type_24dp.png │ │ └── ic_year_24dp.png │ │ ├── drawable-xxhdpi │ │ ├── ic_about_black_24dp.png │ │ ├── ic_anime_black_24dp.png │ │ ├── ic_arrow_right_white_24dp.png │ │ ├── ic_artist_24dp.png │ │ ├── ic_back_white_24dp.png │ │ ├── ic_check_white_24dp.png │ │ ├── ic_country_24dp.png │ │ ├── ic_delete_white_24dp.png │ │ ├── ic_exit_black_24dp.png │ │ ├── ic_favorite_black_24dp.png │ │ ├── ic_favorite_border_white_24dp.png │ │ ├── ic_favorite_white_24dp.png │ │ ├── ic_gift_black_24dp.png │ │ ├── ic_hot_black_24dp.png │ │ ├── ic_menu_white_24dp.png │ │ ├── ic_movie_black_24dp.png │ │ ├── ic_night_black_24dp.png │ │ ├── ic_search_white_24dp.png │ │ ├── ic_sunny_black_24dp.png │ │ ├── ic_tag_black_24dp.png │ │ ├── ic_tv_black_24dp.png │ │ ├── ic_type_24dp.png │ │ └── ic_year_24dp.png │ │ ├── drawable-xxxhdpi │ │ ├── ic_about_black_24dp.png │ │ ├── ic_anime_black_24dp.png │ │ ├── ic_arrow_right_white_24dp.png │ │ ├── ic_artist_24dp.png │ │ ├── ic_back_white_24dp.png │ │ ├── ic_check_white_24dp.png │ │ ├── ic_country_24dp.png │ │ ├── ic_delete_white_24dp.png │ │ ├── ic_exit_black_24dp.png │ │ ├── ic_favorite_black_24dp.png │ │ ├── ic_favorite_border_white_24dp.png │ │ ├── ic_favorite_white_24dp.png │ │ ├── ic_gift_black_24dp.png │ │ ├── ic_hot_black_24dp.png │ │ ├── ic_menu_white_24dp.png │ │ ├── ic_movie_black_24dp.png │ │ ├── ic_night_black_24dp.png │ │ ├── ic_search_white_24dp.png │ │ ├── ic_sunny_black_24dp.png │ │ ├── ic_tag_black_24dp.png │ │ ├── ic_tv_black_24dp.png │ │ ├── ic_type_24dp.png │ │ └── ic_year_24dp.png │ │ ├── drawable │ │ ├── button_tag_selector.xml │ │ ├── drawlayout_bg.png │ │ ├── flash.jpg │ │ └── text_selector.xml │ │ ├── layout-v21 │ │ ├── movie_detail_item.xml │ │ └── movie_item.xml │ │ ├── layout │ │ ├── activity_celebrity_detail.xml │ │ ├── activity_favorite.xml │ │ ├── activity_gift.xml │ │ ├── activity_main.xml │ │ ├── activity_movie_detail.xml │ │ ├── activity_photo.xml │ │ ├── activity_searchdetail.xml │ │ ├── dialog_save.xml │ │ ├── footerview.xml │ │ ├── gift_item.xml │ │ ├── main_anime.xml │ │ ├── main_movie.xml │ │ ├── main_tag.xml │ │ ├── main_top250.xml │ │ ├── main_tv.xml │ │ ├── mian_tag_item.xml │ │ ├── movie_detail_item.xml │ │ ├── movie_item.xml │ │ └── navigationview_header.xml │ │ ├── menu │ │ ├── menu_drawer.xml │ │ ├── menu_favorite.xml │ │ ├── menu_main.xml │ │ └── menu_movie_detail.xml │ │ ├── mipmap-hdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-mdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── mipmap-xxxhdpi │ │ ├── ic_launcher.png │ │ └── ic_launcher_round.png │ │ ├── values-v19 │ │ └── styles.xml │ │ ├── values │ │ ├── colors.xml │ │ ├── dimens.xml │ │ ├── strings.xml │ │ └── styles.xml │ │ └── xml │ │ ├── bottombar_night_tabs.xml │ │ └── bottombar_tabs.xml └── 小瓣.apk ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── preview ├── anima.png ├── celebrity_detail.png ├── gift.png ├── movie.png ├── movie_detail.png ├── navigationview.png ├── night.png ├── qcode.png ├── search.png ├── tag.png ├── top250.png └── tv.png ├── searchbox ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── com │ │ └── wyt │ │ └── searchbox │ │ ├── SearchFragment.java │ │ ├── adapter │ │ └── SearchHistoryAdapter.java │ │ ├── custom │ │ ├── CircularRevealAnim.java │ │ ├── IOnItemClickListener.java │ │ └── IOnSearchClickListener.java │ │ ├── db │ │ └── SearchHistoryDB.java │ │ └── utils │ │ └── KeyBoardUtils.java │ └── res │ ├── drawable │ ├── ic_back_24dp.xml │ ├── ic_close_16dp.xml │ ├── ic_history_24dp.xml │ ├── ic_search_24dp.xml │ ├── ic_search_bg_24dp.xml │ └── shape_corner_white.xml │ ├── layout │ ├── dialog_search.xml │ └── item_search_history.xml │ └── values │ ├── colors.xml │ ├── strings.xml │ └── styles.xml └── 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 | /app/src/main/java/cn/flyexp/douban_movie/test.java 11 | -------------------------------------------------------------------------------- /.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/dictionaries/Administrator.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | presente 5 | 6 | 7 | -------------------------------------------------------------------------------- /.idea/gradle.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/kotlinc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | -------------------------------------------------------------------------------- /.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 | 39 | 40 | 41 | 42 | 43 | 44 | 46 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/runConfigurations.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 11 | 12 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 小瓣APP 2 | 一个用于Android学习的项目,使用了豆瓣公开的api接口https://developers.douban.com/wiki/ 和一个代码家的http://gank.io 中的接口 3 | 4 | 项目内使用了MVP + Rxjava + Retrofit2 + Material Design等开源库及相关控件开发. 5 | 6 | 因为不知道叫什么名字 , 所以就随便起了个名字叫「小瓣」了. 7 | 8 | 纯属个人学习项目 , 仅供参考 , 如有侵权 , 联系即删 . 9 | 10 | 喜欢或觉得有用的就点个star呗 , 又不会怀孕(。・´ω´・) 11 | 12 | 顺便下载到手机看看 ? (用浏览器扫描啦~) 13 | 14 | 15 | 16 | 一些截图 17 | -------- 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 感谢开源 32 | -------- 33 | 34 | - [Google](https://developer.android.google.cn/index.html) 35 | - [Butterknife注解](https://github.com/JakeWharton/butterknife) 36 | - [Rxjava](https://github.com/ReactiveX/RxJava) 37 | - [Retrofit](https://github.com/square/retrofit) 38 | - [仿bilibili搜索框](https://github.com/wenwenwen888/SearchDialog) 39 | - [bottom控件](https://github.com/roughike/BottomBar) 40 | - [圆角imageview](https://github.com/hdodenhof/CircleImageView) 41 | - [Glide图片加载库](https://github.com/bumptech/glide) 42 | - [Android 万能的Adapter](https://github.com/hongyangAndroid/baseAdapter) 43 | - [滑动返回SwipeBackLayout](https://github.com/XBeats/and_swipeback) 44 | - [图片查看器](https://github.com/bm-x/PhotoView) 45 | - [LitePal数据库](https://github.com/LitePalFramework/LitePal) 46 | - [EventBus](https://github.com/greenrobot/EventBus) 47 | 48 | 完 (。・`ω´・) 49 | -------- 50 | -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | defaultConfig { 7 | applicationId "cn.flyexp.douban_movie" 8 | minSdkVersion 15 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | } 21 | 22 | repositories { 23 | mavenCentral() // jcenter() works as well because it pulls from Maven Central 24 | } 25 | 26 | dependencies { 27 | compile fileTree(include: ['*.jar'], dir: 'libs') 28 | //搜索框:https://github.com/wenwenwen888/SearchDialog 29 | compile project(':searchbox') 30 | compile 'com.android.support:appcompat-v7:25.2.0' 31 | compile 'com.android.support.constraint:constraint-layout:1.0.1' 32 | compile 'io.reactivex:rxandroid:1.2.1' 33 | compile 'io.reactivex:rxjava:1.2.7' 34 | compile 'com.squareup.retrofit2:retrofit:2.2.0' 35 | compile 'com.squareup.retrofit2:converter-gson:2.2.0' 36 | compile 'com.squareup.retrofit2:adapter-rxjava:2.2.0' 37 | //底部导航控件:https://github.com/roughike/BottomBar 38 | compile 'com.roughike:bottom-bar:2.1.1' 39 | compile 'com.android.support:design:25.2.0' 40 | //圆角imageview 41 | compile 'de.hdodenhof:circleimageview:2.1.0' 42 | compile 'com.android.support:cardview-v7:25.2.0' 43 | //glide图片加载库:https://github.com/bumptech/glide 44 | compile 'com.github.bumptech.glide:glide:3.7.0' 45 | compile 'com.android.support:support-v4:25.2.0' 46 | //RecyclerView添加HeaderView和FooterView:https://github.com/hongyangAndroid/baseAdapter 47 | compile 'com.zhy:base-rvadapter:3.0.3' 48 | //SwipeBackLayout:https://github.com/XBeats/and_swipeback 49 | compile 'com.aitangba:swipeback:1.0.2' 50 | //图片查看器:https://github.com/bm-x/PhotoView 51 | compile 'com.bm.photoview:library:1.4.1' 52 | //数据库:https://github.com/LitePalFramework/LitePal 53 | compile 'org.litepal.android:core:1.5.1' 54 | compile 'com.jakewharton:butterknife:8.5.1' 55 | annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1' 56 | //EventBus:https://github.com/greenrobot/EventBus 57 | compile 'org.greenrobot:eventbus:3.0.0' 58 | } 59 | -------------------------------------------------------------------------------- /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 F:\AndroidSdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | 19 | # Uncomment this to preserve the line number information for 20 | # debugging stack traces. 21 | #-keepattributes SourceFile,LineNumberTable 22 | 23 | # If you keep the line number information, uncomment this to 24 | # hide the original source file name. 25 | #-renamesourcefileattribute SourceFile 26 | -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 17 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 29 | 32 | 35 | 38 | 41 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /app/src/main/assets/litepal.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/MyApplication.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie; 2 | 3 | import com.aitangba.swipeback.ActivityLifecycleHelper; 4 | 5 | import org.litepal.LitePalApplication; 6 | 7 | /** 8 | * Created by Won on 2017/3/11. 9 | */ 10 | 11 | public class MyApplication extends LitePalApplication { 12 | 13 | public static int REQUESTCODE = 0x00; 14 | 15 | public static int RESULTCODE = 0x01; 16 | 17 | //是否夜间模式 18 | public static boolean NIGHT_MODE = false; 19 | 20 | @Override 21 | public void onCreate() { 22 | super.onCreate(); 23 | //滑动返回注册 24 | registerActivityLifecycleCallbacks(ActivityLifecycleHelper.build()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/adapter/FragmentAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentPagerAdapter; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * 功能:主页引导栏的三个Fragment页面设置适配器 11 | */ 12 | public class FragmentAdapter extends FragmentPagerAdapter { 13 | private List fragments; 14 | 15 | public FragmentAdapter(FragmentManager fm, List fragments) { 16 | super(fm); 17 | this.fragments = fragments; 18 | } 19 | 20 | public Fragment getItem(int fragment) { 21 | return fragments.get(fragment); 22 | } 23 | 24 | public int getCount() { 25 | return fragments.size(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/adapter/GiftAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.adapter; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.ImageView; 8 | 9 | import com.bumptech.glide.Glide; 10 | import com.bumptech.glide.load.engine.DiskCacheStrategy; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | import butterknife.BindView; 16 | import butterknife.ButterKnife; 17 | import cn.flyexp.douban_movie.R; 18 | import cn.flyexp.douban_movie.model.GiftModel; 19 | 20 | /** 21 | * Created by Won on 2017/5/13. 22 | */ 23 | 24 | public class GiftAdapter extends RecyclerView.Adapter { 25 | private static final String TAG = "GiftAdapter"; 26 | 27 | private List giftModels = new ArrayList<>(); 28 | 29 | public GiftAdapter(List giftModels) { 30 | this.giftModels = giftModels; 31 | } 32 | 33 | @Override 34 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 35 | MyViewHolder myViewHolder = new MyViewHolder(LayoutInflater.from(parent.getContext()) 36 | .inflate(R.layout.gift_item, parent, false)); 37 | return myViewHolder; 38 | } 39 | 40 | @Override 41 | public void onBindViewHolder(final MyViewHolder holder, int position) { 42 | 43 | Glide.with(holder.itemView.getContext()).load(giftModels.get(position).getUrl()). 44 | diskCacheStrategy(DiskCacheStrategy.SOURCE).crossFade().into(holder.ivGift); 45 | 46 | holder.itemView.setOnClickListener(new View.OnClickListener() { 47 | @Override 48 | public void onClick(View view) { 49 | mOnItemClickListener.onItemClick(holder.getAdapterPosition()); 50 | } 51 | }); 52 | 53 | } 54 | 55 | @Override 56 | public int getItemCount() { 57 | return giftModels.size(); 58 | } 59 | 60 | class MyViewHolder extends RecyclerView.ViewHolder { 61 | 62 | @BindView(R.id.iv_gift) 63 | ImageView ivGift; 64 | 65 | public MyViewHolder(View itemView) { 66 | super(itemView); 67 | ButterKnife.bind(this, itemView); 68 | } 69 | } 70 | 71 | private IOnItemClickListener mOnItemClickListener; 72 | 73 | public void setOnItemClickListener(IOnItemClickListener mOnItemClickListener) { 74 | this.mOnItemClickListener = mOnItemClickListener; 75 | } 76 | 77 | public interface IOnItemClickListener { 78 | void onItemClick(int position); 79 | } 80 | 81 | } 82 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/adapter/MovieDetailAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.CardView; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | import android.widget.ImageView; 10 | import android.widget.TextView; 11 | 12 | import com.bumptech.glide.Glide; 13 | 14 | import java.util.ArrayList; 15 | 16 | import butterknife.BindView; 17 | import butterknife.ButterKnife; 18 | import cn.flyexp.douban_movie.MyApplication; 19 | import cn.flyexp.douban_movie.R; 20 | 21 | /** 22 | * Created by Won on 2017/3/11. 23 | */ 24 | 25 | public class MovieDetailAdapter extends RecyclerView.Adapter { 26 | 27 | private ArrayList imgs = new ArrayList<>(); 28 | private ArrayList names = new ArrayList<>(); 29 | private ArrayList ids = new ArrayList<>(); 30 | 31 | public MovieDetailAdapter(ArrayList imgs, ArrayList names, ArrayList ids) { 32 | this.imgs = imgs; 33 | this.names = names; 34 | this.ids = ids; 35 | } 36 | 37 | @Override 38 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 39 | MyViewHolder myViewHolder = new MyViewHolder(LayoutInflater.from(parent.getContext()) 40 | .inflate(R.layout.movie_detail_item, parent, false)); 41 | return myViewHolder; 42 | } 43 | 44 | @Override 45 | public void onBindViewHolder(final MyViewHolder holder, int position) { 46 | Context context = holder.itemView.getContext(); 47 | if (MyApplication.NIGHT_MODE) { 48 | holder.cardView.setBackgroundColor(context.getResources().getColor(R.color.colorNight)); 49 | } 50 | //设置头像 51 | Glide.with(context).load(imgs.get(position)).into(holder.ivMovieDetailItem); 52 | //设置名字 53 | holder.tvMovieDetailItem.setText(names.get(position)); 54 | holder.itemView.setOnClickListener(new View.OnClickListener() { 55 | @Override 56 | public void onClick(View view) { 57 | mOnItemClickListener.onItemClick(ids.get(holder.getAdapterPosition()), names.get(holder.getAdapterPosition())); 58 | } 59 | }); 60 | } 61 | 62 | @Override 63 | public int getItemCount() { 64 | return imgs.size(); 65 | } 66 | 67 | class MyViewHolder extends RecyclerView.ViewHolder { 68 | 69 | @BindView(R.id.card_view) 70 | CardView cardView; 71 | @BindView(R.id.iv_movie_detail_item) 72 | ImageView ivMovieDetailItem; 73 | @BindView(R.id.tv_movie_detail_item) 74 | TextView tvMovieDetailItem; 75 | 76 | public MyViewHolder(View itemView) { 77 | super(itemView); 78 | ButterKnife.bind(this, itemView); 79 | } 80 | } 81 | 82 | private IOnItemClickListener mOnItemClickListener; 83 | 84 | public void setOnItemClickListener(IOnItemClickListener mOnItemClickListener) { 85 | this.mOnItemClickListener = mOnItemClickListener; 86 | } 87 | 88 | public interface IOnItemClickListener { 89 | void onItemClick(String id, String name); 90 | } 91 | 92 | } 93 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/adapter/TagAdapter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.adapter; 2 | 3 | import android.support.v7.widget.RecyclerView; 4 | import android.view.LayoutInflater; 5 | import android.view.View; 6 | import android.view.ViewGroup; 7 | import android.widget.TextView; 8 | 9 | import butterknife.BindView; 10 | import butterknife.ButterKnife; 11 | import cn.flyexp.douban_movie.R; 12 | 13 | /** 14 | * Created by Won on 2017/3/13. 15 | */ 16 | 17 | public class TagAdapter extends RecyclerView.Adapter { 18 | 19 | private String[] tags = null; 20 | 21 | public TagAdapter(String[] tags) { 22 | this.tags = tags; 23 | } 24 | 25 | @Override 26 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 27 | MyViewHolder myViewHolder = new MyViewHolder(LayoutInflater.from(parent.getContext()) 28 | .inflate(R.layout.mian_tag_item, parent, false)); 29 | return myViewHolder; 30 | } 31 | 32 | @Override 33 | public void onBindViewHolder(MyViewHolder holder, final int position) { 34 | holder.btMainTagItem.setText(tags[position]); 35 | holder.btMainTagItem.setOnClickListener(new View.OnClickListener() { 36 | @Override 37 | public void onClick(View view) { 38 | mOnItemClickListener.onItemClick(tags[position]); 39 | } 40 | }); 41 | } 42 | 43 | @Override 44 | public int getItemCount() { 45 | return tags == null ? 0 : tags.length; 46 | } 47 | 48 | class MyViewHolder extends RecyclerView.ViewHolder { 49 | @BindView(R.id.bt_main_tag_item) 50 | TextView btMainTagItem; 51 | 52 | public MyViewHolder(View itemView) { 53 | super(itemView); 54 | ButterKnife.bind(this, itemView); 55 | } 56 | } 57 | 58 | private IOnItemClickListener mOnItemClickListener; 59 | 60 | public void setOnItemClickListener(IOnItemClickListener mOnItemClickListener){ 61 | this.mOnItemClickListener = mOnItemClickListener; 62 | } 63 | 64 | public interface IOnItemClickListener{ 65 | void onItemClick(String tag); 66 | } 67 | 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/FullyGridLayoutManager.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.GridLayoutManager; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | 9 | /** 10 | * Created by Won on 2016/5/9. 11 | */ 12 | public class FullyGridLayoutManager extends GridLayoutManager { 13 | 14 | private int mwidth = 0; 15 | private int mheight = 0; 16 | 17 | public FullyGridLayoutManager(Context context, int spanCount) { 18 | super(context, spanCount); 19 | } 20 | 21 | public FullyGridLayoutManager(Context context, int spanCount, int orientation, boolean reverseLayout) { 22 | super(context, spanCount, orientation, reverseLayout); 23 | } 24 | 25 | private int[] mMeasuredDimension = new int[2]; 26 | 27 | public int getMwidth() { 28 | return mwidth; 29 | } 30 | 31 | public void setMwidth(int mwidth) { 32 | this.mwidth = mwidth; 33 | } 34 | 35 | public int getMheight() { 36 | return mheight; 37 | } 38 | 39 | public void setMheight(int mheight) { 40 | this.mheight = mheight; 41 | } 42 | 43 | @Override 44 | public void onMeasure(RecyclerView.Recycler recycler, RecyclerView.State state, int widthSpec, int heightSpec) { 45 | final int widthMode = View.MeasureSpec.getMode(widthSpec); 46 | final int heightMode = View.MeasureSpec.getMode(heightSpec); 47 | final int widthSize = View.MeasureSpec.getSize(widthSpec); 48 | final int heightSize = View.MeasureSpec.getSize(heightSpec); 49 | 50 | int width = 0; 51 | int height = 0; 52 | int count = getItemCount(); 53 | int span = getSpanCount(); 54 | for (int i = 0; i < count; i++) { 55 | measureScrapChild(recycler, i, 56 | View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED), 57 | View.MeasureSpec.makeMeasureSpec(i, View.MeasureSpec.UNSPECIFIED), 58 | mMeasuredDimension); 59 | 60 | if (getOrientation() == HORIZONTAL) { 61 | if (i % span == 0) { 62 | width = width + mMeasuredDimension[0]; 63 | } 64 | if (i == 0) { 65 | height = mMeasuredDimension[1]; 66 | } 67 | } else { 68 | if (i % span == 0) { 69 | height = height + mMeasuredDimension[1]; 70 | } 71 | if (i == 0) { 72 | width = mMeasuredDimension[0]; 73 | } 74 | } 75 | } 76 | 77 | switch (widthMode) { 78 | case View.MeasureSpec.EXACTLY: 79 | width = widthSize; 80 | case View.MeasureSpec.AT_MOST: 81 | case View.MeasureSpec.UNSPECIFIED: 82 | } 83 | 84 | switch (heightMode) { 85 | case View.MeasureSpec.EXACTLY: 86 | height = heightSize; 87 | case View.MeasureSpec.AT_MOST: 88 | case View.MeasureSpec.UNSPECIFIED: 89 | } 90 | setMheight(height); 91 | setMwidth(width); 92 | setMeasuredDimension(width, height); 93 | } 94 | 95 | private void measureScrapChild(RecyclerView.Recycler recycler, int position, int widthSpec, 96 | int heightSpec, int[] measuredDimension) { 97 | if (position < getItemCount()) { 98 | try { 99 | View view = recycler.getViewForPosition(0);//fix 动态添加时报IndexOutOfBoundsException 100 | if (view != null) { 101 | RecyclerView.LayoutParams p = (RecyclerView.LayoutParams) view.getLayoutParams(); 102 | int childWidthSpec = ViewGroup.getChildMeasureSpec(widthSpec, 103 | getPaddingLeft() + getPaddingRight(), p.width); 104 | int childHeightSpec = ViewGroup.getChildMeasureSpec(heightSpec, 105 | getPaddingTop() + getPaddingBottom(), p.height); 106 | view.measure(childWidthSpec, childHeightSpec); 107 | measuredDimension[0] = view.getMeasuredWidth() + p.leftMargin + p.rightMargin; 108 | measuredDimension[1] = view.getMeasuredHeight() + p.bottomMargin + p.topMargin; 109 | recycler.recycleView(view); 110 | } 111 | } catch (Exception e) { 112 | e.printStackTrace(); 113 | } 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/MyRecyclerView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.content.Context; 4 | import android.support.annotation.Nullable; 5 | import android.support.v7.widget.RecyclerView; 6 | import android.util.AttributeSet; 7 | 8 | /** 9 | * Created by Won on 2016/9/7. 10 | * 此自定义RecyclerView是用于和ScrollView嵌套使用时显示不全时使用 11 | * 参考:http://blog.csdn.net/u013121097/article/details/52044997 12 | */ 13 | public class MyRecyclerView extends RecyclerView { 14 | public MyRecyclerView(Context context) { 15 | super(context); 16 | } 17 | 18 | public MyRecyclerView(Context context, @Nullable AttributeSet attrs) { 19 | super(context, attrs); 20 | } 21 | 22 | public MyRecyclerView(Context context, @Nullable AttributeSet attrs, int defStyle) { 23 | super(context, attrs, defStyle); 24 | } 25 | 26 | @Override 27 | protected void onMeasure(int widthSpec, int heightSpec) { 28 | int expandSpec = MeasureSpec.makeMeasureSpec(Integer.MAX_VALUE >> 2, MeasureSpec.AT_MOST); 29 | super.onMeasure(widthSpec, expandSpec); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/MyScrollview.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.content.Context; 4 | import android.util.AttributeSet; 5 | import android.view.MotionEvent; 6 | import android.view.ViewConfiguration; 7 | import android.widget.ScrollView; 8 | 9 | /** 10 | * Created by Won on 2016/5/9. 11 | */ 12 | public class MyScrollview extends ScrollView { 13 | private int downX; 14 | private int downY; 15 | private int mTouchSlop; 16 | 17 | public MyScrollview(Context context) { 18 | super(context); 19 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); 20 | } 21 | 22 | public MyScrollview(Context context, AttributeSet attrs) { 23 | super(context, attrs); 24 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); 25 | } 26 | 27 | public MyScrollview(Context context, AttributeSet attrs, int defStyleAttr) { 28 | super(context, attrs, defStyleAttr); 29 | mTouchSlop = ViewConfiguration.get(context).getScaledTouchSlop(); 30 | } 31 | 32 | @Override 33 | public boolean onInterceptTouchEvent(MotionEvent e) { 34 | int action = e.getAction(); 35 | switch (action) { 36 | case MotionEvent.ACTION_DOWN: 37 | downX = (int) e.getRawX(); 38 | downY = (int) e.getRawY(); 39 | break; 40 | case MotionEvent.ACTION_MOVE: 41 | int moveY = (int) e.getRawY(); 42 | if (Math.abs(moveY - downY) > mTouchSlop) { 43 | return true; 44 | } 45 | } 46 | return super.onInterceptTouchEvent(e); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/NoScrollViewPager.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.content.Context; 4 | import android.support.v4.view.ViewPager; 5 | import android.util.AttributeSet; 6 | import android.view.MotionEvent; 7 | 8 | /** 9 | * Created by Won on 2016/8/30. 10 | */ 11 | public class NoScrollViewPager extends ViewPager { 12 | private boolean noScroll = false; 13 | 14 | public NoScrollViewPager(Context context, AttributeSet attrs) { 15 | super(context, attrs); 16 | // TODO Auto-generated constructor stub 17 | } 18 | 19 | public NoScrollViewPager(Context context) { 20 | super(context); 21 | } 22 | 23 | public void setNoScroll(boolean noScroll) { 24 | this.noScroll = noScroll; 25 | } 26 | 27 | @Override 28 | public void scrollTo(int x, int y) { 29 | super.scrollTo(x, y); 30 | } 31 | 32 | @Override 33 | public boolean onTouchEvent(MotionEvent arg0) { 34 | /* return false;//super.onTouchEvent(arg0); */ 35 | if (noScroll) 36 | return false; 37 | else 38 | return super.onTouchEvent(arg0); 39 | } 40 | 41 | @Override 42 | public boolean onInterceptTouchEvent(MotionEvent arg0) { 43 | if (noScroll) 44 | return false; 45 | else 46 | return super.onInterceptTouchEvent(arg0); 47 | } 48 | 49 | @Override 50 | public void setCurrentItem(int item, boolean smoothScroll) { 51 | super.setCurrentItem(item, smoothScroll); 52 | } 53 | 54 | @Override 55 | public void setCurrentItem(int item) { 56 | super.setCurrentItem(item); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/SpaceItemDecoration.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.graphics.Rect; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by Won on 2016/8/30. 9 | */ 10 | public class SpaceItemDecoration extends RecyclerView.ItemDecoration { 11 | 12 | private int space; 13 | private boolean firstTop = false; 14 | 15 | public SpaceItemDecoration(int space) { 16 | this.space = space; 17 | } 18 | 19 | public SpaceItemDecoration(int space, boolean firstTop) { 20 | this.space = space; 21 | this.firstTop = firstTop; 22 | } 23 | 24 | @Override 25 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { 26 | outRect.bottom = space; 27 | //获取最后一个可见view的位置 28 | if (firstTop && parent.getChildPosition(view) == 0) { 29 | outRect.top = space; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/assistview/StaggeredSpacesItemDecoration.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.assistview; 2 | 3 | import android.graphics.Rect; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.View; 6 | 7 | /** 8 | * Created by Won on 2017/5/13. 9 | */ 10 | 11 | public class StaggeredSpacesItemDecoration extends RecyclerView.ItemDecoration { 12 | 13 | private int space; 14 | 15 | public StaggeredSpacesItemDecoration(int space) { 16 | this.space = space; 17 | } 18 | 19 | @Override 20 | public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { 21 | outRect.left = space; 22 | outRect.right = space; 23 | outRect.bottom = space; 24 | if (parent.getChildAdapterPosition(view) == 0) { 25 | outRect.top = space; 26 | } 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/base/BaseActivity.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.base; 2 | 3 | import android.os.Bundle; 4 | 5 | import com.aitangba.swipeback.SwipeBackActivity; 6 | 7 | import butterknife.ButterKnife; 8 | import cn.flyexp.douban_movie.MyApplication; 9 | import cn.flyexp.douban_movie.R; 10 | 11 | /** 12 | * Created by Won on 2017/3/11. 13 | */ 14 | 15 | public abstract class BaseActivity> extends SwipeBackActivity { 16 | 17 | protected T presenter; 18 | 19 | @Override 20 | protected void onCreate(Bundle savedInstanceState) { 21 | if (MyApplication.NIGHT_MODE) { 22 | setTheme(R.style.NightThemeTransNav); 23 | } else { 24 | setTheme(getIntent().getIntExtra("theme", R.style.MovieThemeTransNav)); 25 | } 26 | super.onCreate(savedInstanceState); 27 | setContentView(setLayoutId()); 28 | ButterKnife.bind(this); 29 | presenter = initPresenter(); 30 | presenter.attach((V) this); 31 | initView(); 32 | //夜间模式颜色 33 | if (MyApplication.NIGHT_MODE) { 34 | findViewById(R.id.root_view).setBackgroundColor(getResources().getColor(R.color.colorNightBg)); 35 | } 36 | } 37 | 38 | @Override 39 | protected void onDestroy() { 40 | super.onDestroy(); 41 | presenter.dettach(); 42 | presenter.onDestroy(); 43 | } 44 | 45 | abstract protected T initPresenter(); 46 | 47 | abstract protected int setLayoutId(); 48 | 49 | abstract protected void initView(); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/base/BaseLazyFragment.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | import org.greenrobot.eventbus.EventBus; 11 | 12 | import butterknife.ButterKnife; 13 | 14 | /** 15 | * Created by Won on 2016/8/19. 16 | */ 17 | public abstract class BaseLazyFragment> extends Fragment implements IBaseView { 18 | 19 | private static final String TAG = "BaseLazyFragment"; 20 | 21 | protected T presenter; 22 | protected boolean isVisible; 23 | protected View view; 24 | // 标志位,标志已经初始化完成。 25 | protected boolean isPrepared; 26 | 27 | @Nullable 28 | @Override 29 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 30 | view = inflater.inflate(setLayoutId(), container, false); 31 | ButterKnife.bind(this, view); 32 | 33 | EventBus.getDefault().register(this); 34 | 35 | presenter = initPresenter(); 36 | presenter.attach(getContext(), (V) this); 37 | 38 | initView(); 39 | isPrepared = true; 40 | lazyLoad();//加载数据 41 | 42 | return view; 43 | } 44 | 45 | abstract protected T initPresenter(); 46 | 47 | abstract protected int setLayoutId(); 48 | 49 | abstract protected void initView(); 50 | 51 | abstract protected void lazyLoad(); 52 | 53 | /** 54 | * 在这里实现Fragment数据的缓加载. 55 | */ 56 | @Override 57 | public void setUserVisibleHint(boolean isVisibleToUser) { 58 | super.setUserVisibleHint(isVisibleToUser); 59 | if (getUserVisibleHint()) { 60 | isVisible = true; 61 | lazyLoad(); 62 | } else { 63 | isVisible = false; 64 | } 65 | } 66 | 67 | 68 | @Override 69 | public void onDestroyView() { 70 | super.onDestroyView(); 71 | EventBus.getDefault().unregister(this); 72 | presenter.dettach(); 73 | presenter.onDestroy(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/base/BasePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.base; 2 | 3 | import android.content.Context; 4 | 5 | import rx.Subscription; 6 | 7 | /** 8 | * Created by Won on 2017/3/12. 9 | */ 10 | 11 | public abstract class BasePresenter { 12 | 13 | protected V mView; 14 | protected Context context; 15 | protected Subscription subscription; 16 | 17 | /** 18 | * BaseActivity调用这个方法 19 | */ 20 | protected void attach(V mView) { 21 | this.context = (Context) mView; 22 | this.mView = mView; 23 | } 24 | 25 | /** 26 | * BaseFragment调用这个方法 27 | */ 28 | protected void attach(Context context , V mView) { 29 | this.context = context; 30 | this.mView = mView; 31 | } 32 | 33 | protected void dettach() { 34 | mView = null; 35 | } 36 | 37 | /** 38 | * Presenter销毁时调用 39 | */ 40 | abstract protected void onDestroy(); 41 | 42 | /** 43 | * 取消订阅 , 释放内存 44 | */ 45 | protected void unsubscribe() { 46 | if (subscription != null && !subscription.isUnsubscribed()) { 47 | subscription.unsubscribe(); 48 | } 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/base/IBaseView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.base; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IBaseView { 10 | 11 | /** 12 | * showLoading 方法主要用于页面请求数据时显示加载状态 13 | */ 14 | void showLoading(); 15 | 16 | /** 17 | * showEmpty 方法用于请求的数据为空的状态 18 | */ 19 | void showEmpty(); 20 | 21 | /** 22 | * showError 方法用于请求数据出错 23 | */ 24 | void showError(); 25 | 26 | /** 27 | * loadingComplete 方法用于请求数据完成 28 | */ 29 | void showComplete(ArrayList models); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/base/LazyFragment.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.base; 2 | 3 | import android.os.Bundle; 4 | import android.support.annotation.Nullable; 5 | import android.support.v4.app.Fragment; 6 | import android.view.LayoutInflater; 7 | import android.view.View; 8 | import android.view.ViewGroup; 9 | 10 | import org.greenrobot.eventbus.EventBus; 11 | 12 | import butterknife.ButterKnife; 13 | 14 | /** 15 | * Created by Won on 2016/8/19. 16 | */ 17 | public abstract class LazyFragment extends Fragment { 18 | 19 | private static final String TAG = "LazyFragment"; 20 | 21 | protected boolean isVisible; 22 | protected View view; 23 | // 标志位,标志已经初始化完成。 24 | protected boolean isPrepared; 25 | 26 | @Nullable 27 | @Override 28 | public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { 29 | view = inflater.inflate(setLayoutId(), container, false); 30 | ButterKnife.bind(this, view); 31 | 32 | EventBus.getDefault().register(this); 33 | 34 | initView(); 35 | isPrepared = true; 36 | lazyLoad();//加载数据 37 | 38 | return view; 39 | } 40 | 41 | abstract protected int setLayoutId(); 42 | 43 | abstract protected void initView(); 44 | 45 | abstract protected void lazyLoad(); 46 | 47 | /** 48 | * 在这里实现Fragment数据的缓加载. 49 | */ 50 | @Override 51 | public void setUserVisibleHint(boolean isVisibleToUser) { 52 | super.setUserVisibleHint(isVisibleToUser); 53 | if (getUserVisibleHint()) { 54 | isVisible = true; 55 | lazyLoad(); 56 | } else { 57 | isVisible = false; 58 | } 59 | } 60 | 61 | @Override 62 | public void onDestroy() { 63 | super.onDestroy(); 64 | EventBus.getDefault().unregister(this); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/model/MessageEvent.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.model; 2 | 3 | /** 4 | * Created by Won on 2017/5/23. 5 | */ 6 | 7 | public class MessageEvent { 8 | 9 | public final boolean isNight; 10 | 11 | public MessageEvent(boolean isNight) { 12 | this.isNight = isNight; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/model/MovieModel.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by Won on 2017/3/13. 7 | */ 8 | 9 | public class MovieModel { 10 | 11 | /** 12 | * count : 20 13 | * start : 0 14 | * total : 19947 15 | * title : 搜索 "喜剧" 的结果 16 | */ 17 | 18 | private int count; 19 | private int start; 20 | private int total; 21 | private String title; 22 | private List subjects; 23 | 24 | public int getCount() { 25 | return count; 26 | } 27 | 28 | public void setCount(int count) { 29 | this.count = count; 30 | } 31 | 32 | public int getStart() { 33 | return start; 34 | } 35 | 36 | public void setStart(int start) { 37 | this.start = start; 38 | } 39 | 40 | public int getTotal() { 41 | return total; 42 | } 43 | 44 | public void setTotal(int total) { 45 | this.total = total; 46 | } 47 | 48 | public String getTitle() { 49 | return title; 50 | } 51 | 52 | public void setTitle(String title) { 53 | this.title = title; 54 | } 55 | 56 | public List getSubjects() { 57 | return subjects; 58 | } 59 | 60 | public void setSubjects(List subjects) { 61 | this.subjects = subjects; 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/model/TagData.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.model; 2 | 3 | /** 4 | * Created by Won on 2017/3/13. 5 | */ 6 | 7 | public class TagData { 8 | 9 | public static String[] types = {"爱情", "喜剧", "剧情", "动画", "科幻", "动作", "经典", "悬疑", "青春", 10 | "犯罪", "惊悚", "文艺", "搞笑", "纪录片", "励志", "恐怖", "战争", "短片", "黑色幽默", "魔幻", 11 | "传记", "情色", "感人", "暴力", "家庭", "音乐", "动画短片", "童年", "浪漫", "黑帮", "女性", 12 | "同志", "史诗", "烂片", "童话", "西部"}; 13 | 14 | public static String[] countrys = {"美国", "日本", "香港", "英国", "中国", "韩国", "法国", "台湾", 15 | "中国大陆", "德国", "意大利", "印度", "内地", "泰国", "西班牙", "欧洲", "加拿大", "澳大利亚", 16 | "俄罗斯", "伊朗", "爱尔兰", "瑞典", "巴西", "丹麦", "波兰", "捷克", "阿根廷", "比利时", "墨西哥", 17 | "新西兰", "荷兰", "奥地利", "土耳其", "匈牙利", "以色列", "瑞士"}; 18 | 19 | public static String[] artists = {"周星驰", "宫崎骏", "王家卫", "JohnnyDepp", "梁朝伟", "张艺谋", 20 | "尼古拉斯·凯奇", "斯皮尔伯格", "成龙", "刘德华", "岩井俊二", "张国荣", "冯小刚", "杜琪峰", 21 | "李连杰", "徐克", "姜文", "李安", "TimBurton", "桂纶镁", "周迅", "周润发", "金城武", "刘青云", 22 | "舒淇", "王晶", "希区柯克", "新海诚", "汤姆·汉克斯", "吴彦祖", "奥黛丽·赫本", "AnneHathaway", 23 | "科恩兄弟", "JimCarrey", "贾樟柯", "黑泽明"}; 24 | 25 | public static String[] years = {"2016", "2015", "2013", "2014", "2011", "2012", "2010", "2009", "2008", 26 | "2007", "2006", "2004", "2005", "2003", "2001", "2002", "1994", "2000", "1997", "1999", "1998", 27 | "1995", "1996", "1993", "1992", "1990", "1991", "1988"}; 28 | } -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/net/DouBanApi.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.net; 2 | 3 | import cn.flyexp.douban_movie.model.CelebrityDetailModel; 4 | import cn.flyexp.douban_movie.model.MovieDetailModel; 5 | import cn.flyexp.douban_movie.model.MovieModel; 6 | import retrofit2.http.GET; 7 | import retrofit2.http.Path; 8 | import retrofit2.http.Query; 9 | import rx.Observable; 10 | 11 | /** 12 | * Created by Won on 2017/3/14. 13 | */ 14 | 15 | public interface DouBanApi { 16 | 17 | @GET("top250") 18 | Observable getTop250(@Query("start") int start, @Query("count") int count); 19 | 20 | @GET("search") 21 | Observable searchKeyword(@Query("q") String q, @Query("start") int start, @Query("count") int count); 22 | 23 | @GET("search") 24 | Observable searchTag(@Query("tag") String tag, @Query("start") int start, @Query("count") int count); 25 | 26 | @GET("subject/{id}") 27 | Observable getMovieDetail(@Path("id") String id); 28 | 29 | @GET("celebrity/{id}") 30 | Observable getCelebrityDetail(@Path("id") String id); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/net/GankApi.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.net; 2 | 3 | import cn.flyexp.douban_movie.model.GiftModel; 4 | import retrofit2.http.GET; 5 | import retrofit2.http.Path; 6 | import rx.Observable; 7 | 8 | public interface GankApi { 9 | 10 | @GET("data/福利/{number}/{page}") 11 | Observable getGifts(@Path("number") int number, @Path("page") int page); 12 | 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/net/NetWork.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.net; 2 | 3 | import retrofit2.Retrofit; 4 | import retrofit2.adapter.rxjava.RxJavaCallAdapterFactory; 5 | import retrofit2.converter.gson.GsonConverterFactory; 6 | 7 | /** 8 | * Created by Won on 2017/3/14. 9 | */ 10 | 11 | public class NetWork { 12 | 13 | private static DouBanApi douBanApi; 14 | private static GankApi gankApi; 15 | 16 | public static DouBanApi getDouBanApi() { 17 | if (douBanApi == null) { 18 | Retrofit retrofit = new Retrofit.Builder() 19 | .baseUrl("https://api.douban.com/v2/movie/") 20 | .addConverterFactory(GsonConverterFactory.create())//使用工厂模式创建Gson的解析器 21 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 22 | .build(); 23 | douBanApi = retrofit.create(DouBanApi.class); 24 | } 25 | return douBanApi; 26 | } 27 | 28 | public static GankApi getGankApi() { 29 | if (gankApi == null) { 30 | Retrofit retrofit = new Retrofit.Builder() 31 | .baseUrl("http://gank.io/api/") 32 | .addConverterFactory(GsonConverterFactory.create())//使用工厂模式创建Gson的解析器 33 | .addCallAdapterFactory(RxJavaCallAdapterFactory.create()) 34 | .build(); 35 | gankApi = retrofit.create(GankApi.class); 36 | } 37 | return gankApi; 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/AnimePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.flyexp.douban_movie.base.BasePresenter; 8 | import cn.flyexp.douban_movie.model.MovieModel; 9 | import cn.flyexp.douban_movie.net.NetWork; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.IAnimePresenter; 11 | import cn.flyexp.douban_movie.view.iview.IAnimeView; 12 | import rx.Observer; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Won on 2017/3/12. 18 | */ 19 | 20 | public class AnimePresenter extends BasePresenter implements IAnimePresenter{ 21 | 22 | private static final String TAG = "AnimePresenter"; 23 | 24 | private int start = 0; 25 | 26 | private Observer observer = new Observer() { 27 | @Override 28 | public void onCompleted() { 29 | 30 | } 31 | 32 | @Override 33 | public void onError(Throwable e) { 34 | Log.e(TAG, "onError: ", e); 35 | mView.showError(); 36 | } 37 | 38 | @Override 39 | public void onNext(MovieModel movieModel) { 40 | if (movieModel.getSubjects().size() > 0) { 41 | mView.showComplete((ArrayList) movieModel.getSubjects()); 42 | start = start + movieModel.getSubjects().size(); 43 | } else { 44 | mView.showEmpty(); 45 | } 46 | 47 | } 48 | }; 49 | 50 | @Override 51 | public void loadingData() { 52 | mView.showLoading(); 53 | subscription = NetWork.getDouBanApi() 54 | .searchTag("动漫", start, 20) 55 | .subscribeOn(Schedulers.io()) 56 | .observeOn(AndroidSchedulers.mainThread()) 57 | .subscribe(observer); 58 | } 59 | 60 | @Override 61 | protected void onDestroy() { 62 | unsubscribe(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/CelebrityDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import cn.flyexp.douban_movie.base.BasePresenter; 6 | import cn.flyexp.douban_movie.model.CelebrityDetailModel; 7 | import cn.flyexp.douban_movie.net.NetWork; 8 | import cn.flyexp.douban_movie.presenter.ipresenter.ICelebrityDetailPresenter; 9 | import cn.flyexp.douban_movie.view.iview.ICelebrityDetailView; 10 | import rx.Observer; 11 | import rx.android.schedulers.AndroidSchedulers; 12 | import rx.schedulers.Schedulers; 13 | 14 | /** 15 | * Created by Won on 2017/3/15. 16 | */ 17 | 18 | public class CelebrityDetailPresenter extends BasePresenter implements ICelebrityDetailPresenter { 19 | 20 | private static final String TAG = "CelebrityDetailPresente"; 21 | 22 | private Observer observer = new Observer() { 23 | @Override 24 | public void onCompleted() { 25 | 26 | } 27 | 28 | @Override 29 | public void onError(Throwable e) { 30 | Log.e(TAG, "onError: ", e); 31 | mView.showError(); 32 | } 33 | 34 | @Override 35 | public void onNext(CelebrityDetailModel celebrityDetailModel) { 36 | mView.showComplete(celebrityDetailModel); 37 | } 38 | }; 39 | 40 | 41 | @Override 42 | public void loadingData(String id) { 43 | mView.showLoading(); 44 | subscription = NetWork.getDouBanApi() 45 | .getCelebrityDetail(id) 46 | .subscribeOn(Schedulers.io()) 47 | .observeOn(AndroidSchedulers.mainThread()) 48 | .subscribe(observer); 49 | } 50 | 51 | @Override 52 | protected void onDestroy() { 53 | unsubscribe(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/FavoritePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import org.litepal.crud.DataSupport; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | import cn.flyexp.douban_movie.base.BasePresenter; 9 | import cn.flyexp.douban_movie.model.MovieSubjectsModel; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.IFavoritePresenter; 11 | import cn.flyexp.douban_movie.view.iview.IFavoriteView; 12 | import rx.Observable; 13 | import rx.Subscriber; 14 | import rx.android.schedulers.AndroidSchedulers; 15 | import rx.functions.Action1; 16 | import rx.schedulers.Schedulers; 17 | 18 | /** 19 | * Created by Won on 2017/3/12. 20 | */ 21 | 22 | public class FavoritePresenter extends BasePresenter implements IFavoritePresenter { 23 | 24 | private static final String TAG = "FavoritePresenter"; 25 | 26 | @Override 27 | public void loadData() { 28 | mView.showLoading(); 29 | 30 | Observable.create(new Observable.OnSubscribe>() { 31 | @Override 32 | public void call(Subscriber> subscriber) { 33 | //数据库取出数据 34 | subscriber.onNext(DataSupport.order("id desc").find(MovieSubjectsModel.class, true)); 35 | } 36 | }) 37 | .subscribeOn(Schedulers.io()) // 指定 subscribe() 发生在 IO 线程 38 | .observeOn(AndroidSchedulers.mainThread()) // 指定 Subscriber 的回调发生在主线程 39 | .subscribe(new Action1>() { 40 | @Override 41 | public void call(List movieSubjectsModels) { 42 | //判断有无数据 43 | if (movieSubjectsModels.size() > 0) { 44 | mView.showComplete(movieSubjectsModels); 45 | } else { 46 | mView.showEmpty(); 47 | } 48 | } 49 | }); 50 | } 51 | 52 | @Override 53 | public boolean deleteData(ArrayList selectIds) { 54 | for (String id : selectIds) { 55 | DataSupport.deleteAll(MovieSubjectsModel.class, "movie_id = ?", id); 56 | } 57 | return true; 58 | } 59 | 60 | @Override 61 | protected void onDestroy() { 62 | unsubscribe(); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/GiftPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.flyexp.douban_movie.base.BasePresenter; 8 | import cn.flyexp.douban_movie.model.GiftModel; 9 | import cn.flyexp.douban_movie.net.NetWork; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.IGiftPresenter; 11 | import cn.flyexp.douban_movie.view.iview.IGiftView; 12 | import rx.Observer; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Won on 2017/3/12. 18 | */ 19 | 20 | public class GiftPresenter extends BasePresenter implements IGiftPresenter { 21 | 22 | private static final String TAG = "GiftPresenter"; 23 | 24 | private int page = 1; 25 | 26 | private Observer observer = new Observer() { 27 | @Override 28 | public void onCompleted() { 29 | 30 | } 31 | 32 | @Override 33 | public void onError(Throwable e) { 34 | Log.e(TAG, "onError: ", e); 35 | mView.showError(); 36 | } 37 | 38 | @Override 39 | public void onNext(GiftModel giftModel) { 40 | if (giftModel.getResults().size() > 0) { 41 | mView.showComplete((ArrayList) giftModel.getResults()); 42 | page++; 43 | } else { 44 | mView.showEmpty(); 45 | } 46 | 47 | } 48 | }; 49 | 50 | @Override 51 | public void loadingData(boolean isRefresh) { 52 | mView.showLoading(); 53 | if (isRefresh) { 54 | page = 1; 55 | } 56 | subscription = NetWork.getGankApi() 57 | .getGifts(20, page) 58 | .subscribeOn(Schedulers.io()) 59 | .observeOn(AndroidSchedulers.mainThread()) 60 | .subscribe(observer); 61 | } 62 | 63 | @Override 64 | protected void onDestroy() { 65 | unsubscribe(); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/MoviePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | import java.util.Random; 7 | 8 | import cn.flyexp.douban_movie.base.BasePresenter; 9 | import cn.flyexp.douban_movie.model.MovieModel; 10 | import cn.flyexp.douban_movie.model.TagData; 11 | import cn.flyexp.douban_movie.net.NetWork; 12 | import cn.flyexp.douban_movie.presenter.ipresenter.IMoviePresenter; 13 | import cn.flyexp.douban_movie.view.iview.IMovieView; 14 | import rx.Observer; 15 | import rx.android.schedulers.AndroidSchedulers; 16 | import rx.schedulers.Schedulers; 17 | 18 | /** 19 | * Created by Won on 2017/3/12. 20 | */ 21 | 22 | public class MoviePresenter extends BasePresenter implements IMoviePresenter { 23 | 24 | private static final String TAG = "MoviePresenter"; 25 | 26 | private int start = 0; 27 | //关键字 28 | private String artist; 29 | 30 | private Observer observer = new Observer() { 31 | @Override 32 | public void onCompleted() { 33 | 34 | } 35 | 36 | @Override 37 | public void onError(Throwable e) { 38 | Log.e(TAG, "onError: ", e); 39 | mView.showError(); 40 | } 41 | 42 | @Override 43 | public void onNext(MovieModel movieModel) { 44 | if (movieModel.getSubjects().size() > 0) { 45 | mView.showComplete((ArrayList) movieModel.getSubjects()); 46 | start = start + movieModel.getSubjects().size(); 47 | } else { 48 | mView.showEmpty(); 49 | } 50 | 51 | } 52 | }; 53 | 54 | @Override 55 | public void loadingData(boolean isRefresh) { 56 | mView.showLoading(); 57 | if (isRefresh) { 58 | artist = TagData.artists[new Random().nextInt(36)]; 59 | start = 0; 60 | } 61 | subscription = NetWork.getDouBanApi() 62 | .searchTag(artist, start, 20) 63 | .subscribeOn(Schedulers.io()) 64 | .observeOn(AndroidSchedulers.mainThread()) 65 | .subscribe(observer); 66 | } 67 | 68 | @Override 69 | protected void onDestroy() { 70 | unsubscribe(); 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/SearchDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.flyexp.douban_movie.base.BasePresenter; 8 | import cn.flyexp.douban_movie.model.MovieModel; 9 | import cn.flyexp.douban_movie.net.NetWork; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.ISearchDetailPresenter; 11 | import cn.flyexp.douban_movie.view.iview.ISearchDetailView; 12 | import rx.Observer; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Won on 2017/3/12. 18 | */ 19 | 20 | public class SearchDetailPresenter extends BasePresenter implements ISearchDetailPresenter { 21 | 22 | private static final String TAG = "SearchDetailPresenter"; 23 | 24 | private int start = 0; 25 | 26 | private Observer observer = new Observer() { 27 | @Override 28 | public void onCompleted() { 29 | 30 | } 31 | 32 | @Override 33 | public void onError(Throwable e) { 34 | Log.e(TAG, "onError: ", e); 35 | mView.showError(); 36 | } 37 | 38 | @Override 39 | public void onNext(MovieModel movieModel) { 40 | if (movieModel.getSubjects().size() > 0) { 41 | mView.showComplete((ArrayList) movieModel.getSubjects()); 42 | start = start + movieModel.getSubjects().size(); 43 | } else { 44 | mView.showEmpty(); 45 | } 46 | 47 | } 48 | }; 49 | 50 | @Override 51 | public void search(String keyword, boolean isTag, boolean isRefresh) { 52 | mView.showLoading(); 53 | if (isRefresh) { 54 | start = 0; 55 | } 56 | if (isTag) { 57 | subscription = NetWork.getDouBanApi() 58 | .searchTag(keyword, start, 20) 59 | .subscribeOn(Schedulers.io()) 60 | .observeOn(AndroidSchedulers.mainThread()) 61 | .subscribe(observer); 62 | } else { 63 | subscription = NetWork.getDouBanApi() 64 | .searchKeyword(keyword, start, 20) 65 | .subscribeOn(Schedulers.io()) 66 | .observeOn(AndroidSchedulers.mainThread()) 67 | .subscribe(observer); 68 | } 69 | } 70 | 71 | @Override 72 | protected void onDestroy() { 73 | unsubscribe(); 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/TVPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.flyexp.douban_movie.base.BasePresenter; 8 | import cn.flyexp.douban_movie.model.MovieModel; 9 | import cn.flyexp.douban_movie.net.NetWork; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.ITVPresenter; 11 | import cn.flyexp.douban_movie.view.iview.ITVView; 12 | import rx.Observer; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Won on 2017/3/12. 18 | */ 19 | 20 | public class TVPresenter extends BasePresenter implements ITVPresenter { 21 | 22 | private static final String TAG = "TVPresenter"; 23 | 24 | private int start = 0; 25 | 26 | private Observer observer = new Observer() { 27 | @Override 28 | public void onCompleted() { 29 | 30 | } 31 | 32 | @Override 33 | public void onError(Throwable e) { 34 | Log.e(TAG, "onError: ", e); 35 | mView.showError(); 36 | } 37 | 38 | @Override 39 | public void onNext(MovieModel movieModel) { 40 | if (movieModel.getSubjects().size() > 0) { 41 | mView.showComplete((ArrayList) movieModel.getSubjects()); 42 | start = start + movieModel.getSubjects().size(); 43 | } else { 44 | mView.showEmpty(); 45 | } 46 | 47 | } 48 | }; 49 | 50 | @Override 51 | public void loadingData() { 52 | mView.showLoading(); 53 | subscription = NetWork.getDouBanApi() 54 | .searchTag("电视剧", start, 20) 55 | .subscribeOn(Schedulers.io()) 56 | .observeOn(AndroidSchedulers.mainThread()) 57 | .subscribe(observer); 58 | } 59 | 60 | @Override 61 | protected void onDestroy() { 62 | unsubscribe(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/TagPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import cn.flyexp.douban_movie.base.BasePresenter; 4 | import cn.flyexp.douban_movie.presenter.ipresenter.ITagPresenter; 5 | import cn.flyexp.douban_movie.view.iview.ITagView; 6 | 7 | /** 8 | * Created by Won on 2017/3/12. 9 | */ 10 | 11 | public class TagPresenter extends BasePresenter implements ITagPresenter{ 12 | 13 | @Override 14 | protected void onDestroy() { 15 | 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/Top250Presenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter; 2 | 3 | import android.util.Log; 4 | 5 | import java.util.ArrayList; 6 | 7 | import cn.flyexp.douban_movie.base.BasePresenter; 8 | import cn.flyexp.douban_movie.model.MovieModel; 9 | import cn.flyexp.douban_movie.net.NetWork; 10 | import cn.flyexp.douban_movie.presenter.ipresenter.ITop250Presenter; 11 | import cn.flyexp.douban_movie.view.iview.ITop250View; 12 | import rx.Observer; 13 | import rx.android.schedulers.AndroidSchedulers; 14 | import rx.schedulers.Schedulers; 15 | 16 | /** 17 | * Created by Won on 2017/3/12. 18 | */ 19 | 20 | public class Top250Presenter extends BasePresenter implements ITop250Presenter{ 21 | 22 | private static final String TAG = "Top250Presenter"; 23 | 24 | private int start = 0; 25 | 26 | private Observer observer = new Observer() { 27 | @Override 28 | public void onCompleted() { 29 | 30 | } 31 | 32 | @Override 33 | public void onError(Throwable e) { 34 | Log.e(TAG, "onError: ", e); 35 | mView.showError(); 36 | } 37 | 38 | @Override 39 | public void onNext(MovieModel movieModel) { 40 | if (movieModel.getSubjects().size() > 0) { 41 | mView.showComplete((ArrayList) movieModel.getSubjects()); 42 | start = start + movieModel.getSubjects().size(); 43 | } else { 44 | mView.showEmpty(); 45 | } 46 | 47 | } 48 | }; 49 | 50 | @Override 51 | public void loadingData() { 52 | mView.showLoading(); 53 | subscription = NetWork.getDouBanApi() 54 | .getTop250(start, 20) 55 | .subscribeOn(Schedulers.io()) 56 | .observeOn(AndroidSchedulers.mainThread()) 57 | .subscribe(observer); 58 | } 59 | 60 | @Override 61 | protected void onDestroy() { 62 | unsubscribe(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/IAnimePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface IAnimePresenter { 8 | 9 | void loadingData(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/ICelebrityDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ICelebrityDetailPresenter { 8 | 9 | void loadingData(String id); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/IFavoritePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IFavoritePresenter { 10 | 11 | //加载内容 12 | void loadData(); 13 | 14 | //删除内容 15 | boolean deleteData(ArrayList selectIds); 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/IGiftPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface IGiftPresenter { 8 | 9 | void loadingData(boolean isRefresh); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/IMovieDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | import cn.flyexp.douban_movie.model.MovieSubjectsModel; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IMovieDetailPresenter { 10 | 11 | //加载数据 12 | void loadingData(String id); 13 | //判断是否已收藏 14 | boolean isFavorite(String id); 15 | //插入数据 16 | boolean saveFavorite(MovieSubjectsModel movieSubjectsModel); 17 | //删除数据 18 | boolean deleteFavorite(String id); 19 | 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/IMoviePresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface IMoviePresenter { 8 | 9 | void loadingData(boolean isRefresh); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/ISearchDetailPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ISearchDetailPresenter { 8 | 9 | void search(String keyword, boolean isTag, boolean isRefresh); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/ITVPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ITVPresenter { 8 | 9 | void loadingData(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/ITagPresenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ITagPresenter { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/presenter/ipresenter/ITop250Presenter.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.presenter.ipresenter; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ITop250Presenter { 8 | 9 | void loadingData(); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/util/Utils.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.util; 2 | 3 | /** 4 | * Created by Won on 2017/3/11. 5 | */ 6 | 7 | public class Utils { 8 | 9 | 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/activity/GiftActivity.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.activity; 2 | 3 | import android.content.Intent; 4 | import android.support.v4.widget.SwipeRefreshLayout; 5 | import android.support.v7.widget.GridLayoutManager; 6 | import android.support.v7.widget.RecyclerView; 7 | import android.support.v7.widget.Toolbar; 8 | import android.view.View; 9 | import android.widget.TextView; 10 | import android.widget.Toast; 11 | 12 | import java.util.ArrayList; 13 | import java.util.Collection; 14 | import java.util.List; 15 | 16 | import butterknife.BindView; 17 | import cn.flyexp.douban_movie.R; 18 | import cn.flyexp.douban_movie.adapter.GiftAdapter; 19 | import cn.flyexp.douban_movie.base.BaseActivity; 20 | import cn.flyexp.douban_movie.model.GiftModel; 21 | import cn.flyexp.douban_movie.presenter.GiftPresenter; 22 | import cn.flyexp.douban_movie.view.iview.IGiftView; 23 | 24 | public class GiftActivity extends BaseActivity implements IGiftView, SwipeRefreshLayout.OnRefreshListener, View.OnClickListener, GiftAdapter.IOnItemClickListener { 25 | 26 | @BindView(R.id.tb_gift) 27 | Toolbar tbGift; 28 | @BindView(R.id.tv_tip_gift) 29 | TextView tvTipGift; 30 | @BindView(R.id.rv_gift) 31 | RecyclerView rvGift; 32 | @BindView(R.id.srl_gift) 33 | SwipeRefreshLayout srlGift; 34 | 35 | private List giftModels = new ArrayList<>(); 36 | private GiftAdapter giftAdapter; 37 | //是否刷新 38 | private boolean isRefresh = true; 39 | 40 | @Override 41 | protected GiftPresenter initPresenter() { 42 | return new GiftPresenter(); 43 | } 44 | 45 | @Override 46 | protected int setLayoutId() { 47 | return R.layout.activity_gift; 48 | } 49 | 50 | @Override 51 | protected void initView() { 52 | //toolbar设置初始标题 53 | tbGift.setTitle(getResources().getString(R.string.gift)); 54 | //以上属性必须在setSupportActionBar(toolbar)之前调用 55 | setSupportActionBar(tbGift); 56 | tbGift.setBackgroundColor(getIntent().getIntExtra("color", getResources().getColor(R.color.colorMovie))); 57 | tbGift.setNavigationIcon(R.drawable.ic_back_white_24dp); 58 | 59 | //配置SwipeRefreshLayout 60 | srlGift.setColorSchemeColors(getIntent().getIntExtra("color", getResources().getColor(R.color.colorMovie))); 61 | 62 | //适配器 63 | giftAdapter = new GiftAdapter(giftModels); 64 | //配置RecyclerView 65 | rvGift.setLayoutManager(new GridLayoutManager(this, 3));//设置瀑布流风格 66 | rvGift.setAdapter(giftAdapter); 67 | //监听上拉 68 | rvGift.addOnScrollListener(mOnScrollListener); 69 | 70 | //加载数据 71 | presenter.loadingData(isRefresh); 72 | 73 | srlGift.setOnRefreshListener(this);//监听下拉刷新 74 | tbGift.setNavigationOnClickListener(this);//监听返回键 75 | giftAdapter.setOnItemClickListener(this);//列表监听 76 | } 77 | 78 | @Override 79 | public void onRefresh() { 80 | isRefresh = true; 81 | presenter.loadingData(isRefresh); 82 | } 83 | 84 | /** 85 | * 上拉加载更多 86 | */ 87 | private RecyclerView.OnScrollListener mOnScrollListener = new RecyclerView.OnScrollListener() { 88 | @Override 89 | public void onScrolled(RecyclerView recyclerView, int dx, int dy) { 90 | if (!recyclerView.canScrollVertically(1) && dy != 0 && !srlGift.isRefreshing()) {// 手指不能向上滑动了并且不在加载状态 91 | presenter.loadingData(false);//加载下一页 92 | } 93 | } 94 | }; 95 | 96 | /** 97 | * showLoading 方法主要用于页面请求数据时显示加载状态 98 | */ 99 | @Override 100 | public void showLoading() { 101 | srlGift.setRefreshing(true); 102 | } 103 | 104 | /** 105 | * showEmpty 方法用于请求的数据为空的状态 106 | */ 107 | @Override 108 | public void showEmpty() { 109 | srlGift.setRefreshing(false); 110 | if (giftModels.size() > 0) { 111 | Toast.makeText(this, "已经没有数据了", Toast.LENGTH_SHORT).show(); 112 | } else { 113 | tvTipGift.setText(getText(R.string.error_tips2)); 114 | } 115 | } 116 | 117 | /** 118 | * showError 方法用于请求数据出错 119 | */ 120 | @Override 121 | public void showError() { 122 | srlGift.setRefreshing(false); 123 | if (giftModels.size() > 0) { 124 | Toast.makeText(this, getText(R.string.error_tips), Toast.LENGTH_SHORT).show(); 125 | } else { 126 | tvTipGift.setText(getText(R.string.error_tips2)); 127 | } 128 | } 129 | 130 | /** 131 | * loadingComplete 方法用于请求数据完成 132 | * 133 | * @param models 134 | */ 135 | @Override 136 | public void showComplete(ArrayList models) { 137 | if (isRefresh) { 138 | giftModels.clear(); 139 | } 140 | isRefresh = false; 141 | tvTipGift.setVisibility(View.GONE); 142 | srlGift.setRefreshing(false); 143 | giftModels.addAll((Collection) models); 144 | giftAdapter.notifyDataSetChanged(); 145 | } 146 | 147 | @Override 148 | public void onClick(View view) { 149 | finish(); 150 | } 151 | 152 | @Override 153 | public void onItemClick(int position) { 154 | Intent intent = new Intent(this, PhotoActivity.class); 155 | intent.putExtra("img_url", giftModels.get(position).getUrl()); 156 | startActivity(intent); 157 | } 158 | } 159 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/fragment/TagFragment.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.fragment; 2 | 3 | import android.content.Intent; 4 | import android.widget.LinearLayout; 5 | 6 | import org.greenrobot.eventbus.Subscribe; 7 | import org.greenrobot.eventbus.ThreadMode; 8 | 9 | import butterknife.BindView; 10 | import cn.flyexp.douban_movie.R; 11 | import cn.flyexp.douban_movie.adapter.TagAdapter; 12 | import cn.flyexp.douban_movie.assistview.FullyGridLayoutManager; 13 | import cn.flyexp.douban_movie.assistview.MyRecyclerView; 14 | import cn.flyexp.douban_movie.assistview.SpaceItemDecoration; 15 | import cn.flyexp.douban_movie.base.LazyFragment; 16 | import cn.flyexp.douban_movie.model.MessageEvent; 17 | import cn.flyexp.douban_movie.model.TagData; 18 | import cn.flyexp.douban_movie.view.activity.SearchDetailActivity; 19 | 20 | /** 21 | * Created by Won on 2016/5/4. 22 | */ 23 | public class TagFragment extends LazyFragment implements TagAdapter.IOnItemClickListener { 24 | 25 | private static final String TAG = "TagFragment"; 26 | 27 | @BindView(R.id.rv_type) 28 | MyRecyclerView rvType; 29 | @BindView(R.id.rv_country) 30 | MyRecyclerView rvCountry; 31 | @BindView(R.id.rv_artist) 32 | MyRecyclerView rvArtist; 33 | @BindView(R.id.rv_year) 34 | MyRecyclerView rvYear; 35 | @BindView(R.id.ll_tag) 36 | LinearLayout llTag; 37 | 38 | @Override 39 | protected int setLayoutId() { 40 | return R.layout.main_tag; 41 | } 42 | 43 | @Override 44 | protected void initView() { 45 | initRecyclerView(rvType, TagData.types); 46 | initRecyclerView(rvCountry, TagData.countrys); 47 | initRecyclerView(rvArtist, TagData.artists); 48 | initRecyclerView(rvYear, TagData.years); 49 | } 50 | 51 | private void initRecyclerView(MyRecyclerView myRecyclerView, String[] datas) { 52 | int spacingInPixels = getResources().getDimensionPixelSize(R.dimen.item_space); 53 | 54 | myRecyclerView.setLayoutManager(new FullyGridLayoutManager(getContext(), 4));//Gird类型 55 | myRecyclerView.addItemDecoration(new SpaceItemDecoration(spacingInPixels));//设置间隔 56 | myRecyclerView.setNestedScrollingEnabled(false); 57 | 58 | TagAdapter tagAdapter = new TagAdapter(datas); 59 | myRecyclerView.setAdapter(tagAdapter); 60 | 61 | tagAdapter.setOnItemClickListener(this);//监听点击 62 | } 63 | 64 | 65 | /** 66 | * 实现懒加载,当屏幕显示这个界面的时候才会触发次方法 67 | */ 68 | @Override 69 | protected void lazyLoad() { 70 | //显示数据 71 | if (isPrepared && isVisible) { 72 | 73 | } 74 | } 75 | 76 | @Subscribe(threadMode = ThreadMode.MAIN) 77 | public void onMessageEvent(MessageEvent event) { 78 | if (event.isNight) { 79 | llTag.setBackgroundColor(getResources().getColor(R.color.colorNightBg)); 80 | } else { 81 | llTag.setBackgroundColor(getResources().getColor(R.color.colorWhite)); 82 | } 83 | } 84 | 85 | @Override 86 | public void onItemClick(String tag) { 87 | Intent intent = new Intent(getContext(), SearchDetailActivity.class); 88 | intent.putExtra("theme", R.style.TagThemeTransNav); 89 | intent.putExtra("color", getResources().getColor(R.color.colorTag)); 90 | intent.putExtra("tag", tag); 91 | startActivity(intent); 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/IAnimeView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IAnimeView extends IBaseView{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/ICelebrityDetailView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.model.CelebrityDetailModel; 4 | 5 | /** 6 | * Created by Won on 2017/3/15. 7 | */ 8 | 9 | public interface ICelebrityDetailView { 10 | 11 | /** 12 | * showLoading 方法主要用于页面请求数据时显示加载状态 13 | */ 14 | void showLoading(); 15 | 16 | /** 17 | * showEmpty 方法用于请求的数据为空的状态 18 | */ 19 | void showEmpty(); 20 | 21 | /** 22 | * showError 方法用于请求数据出错 23 | */ 24 | void showError(); 25 | 26 | /** 27 | * loadingComplete 方法用于请求数据完成 28 | */ 29 | void showComplete(CelebrityDetailModel celebrityDetailModel); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/IFavoriteView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import java.util.List; 4 | 5 | import cn.flyexp.douban_movie.model.MovieSubjectsModel; 6 | 7 | /** 8 | * Created by Won on 2017/3/12. 9 | */ 10 | 11 | public interface IFavoriteView { 12 | /** 13 | * showLoading 方法主要用于页面请求数据时显示加载状态 14 | */ 15 | void showLoading(); 16 | 17 | /** 18 | * showEmpty 方法用于请求的数据为空的状态 19 | */ 20 | void showEmpty(); 21 | 22 | /** 23 | * loadingComplete 方法用于请求数据完成 24 | */ 25 | void showComplete(List movieSubjectsModels); 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/IGiftView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IGiftView extends IBaseView { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/IMovieDetailView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.model.MovieDetailModel; 4 | 5 | /** 6 | * Created by Won on 2017/3/15. 7 | */ 8 | 9 | public interface IMovieDetailView { 10 | 11 | /** 12 | * showLoading 方法主要用于页面请求数据时显示加载状态 13 | */ 14 | void showLoading(); 15 | 16 | /** 17 | * showEmpty 方法用于请求的数据为空的状态 18 | */ 19 | void showEmpty(); 20 | 21 | /** 22 | * showError 方法用于请求数据出错 23 | */ 24 | void showError(boolean is404); 25 | 26 | /** 27 | * loadingComplete 方法用于请求数据完成 28 | */ 29 | void showComplete(MovieDetailModel movieDetailModel); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/IMovieView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface IMovieView extends IBaseView{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/ISearchDetailView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface ISearchDetailView extends IBaseView{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/ITVView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface ITVView extends IBaseView{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/ITagView.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | /** 4 | * Created by Won on 2017/3/12. 5 | */ 6 | 7 | public interface ITagView { 8 | 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/java/cn/flyexp/douban_movie/view/iview/ITop250View.java: -------------------------------------------------------------------------------- 1 | package cn.flyexp.douban_movie.view.iview; 2 | 3 | import cn.flyexp.douban_movie.base.IBaseView; 4 | 5 | /** 6 | * Created by Won on 2017/3/12. 7 | */ 8 | 9 | public interface ITop250View extends IBaseView{ 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_anime_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_anime_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_arrow_right_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_arrow_right_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_artist_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_artist_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_check_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_check_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_country_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_country_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_exit_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_exit_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_favorite_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_favorite_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_favorite_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_favorite_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_gift_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_gift_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_hot_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_hot_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_movie_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_movie_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_night_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_night_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_sunny_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_sunny_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_tag_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_tag_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_tv_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_tv_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_type_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_type_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-hdpi/ic_year_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-hdpi/ic_year_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_anime_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_anime_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_arrow_right_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_arrow_right_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_artist_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_artist_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_check_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_check_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_country_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_country_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_exit_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_exit_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_favorite_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_favorite_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_favorite_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_favorite_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_gift_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_gift_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_hot_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_hot_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_movie_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_movie_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_night_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_night_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_sunny_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_sunny_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_tag_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_tag_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_tv_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_tv_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_type_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_type_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-mdpi/ic_year_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-mdpi/ic_year_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_anime_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_anime_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_arrow_right_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_arrow_right_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_artist_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_artist_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_check_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_country_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_country_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_exit_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_exit_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_favorite_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_favorite_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_favorite_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_favorite_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_gift_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_gift_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_hot_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_hot_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_movie_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_movie_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_night_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_night_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_sunny_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_sunny_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_tag_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_tag_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_tv_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_tv_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_type_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_type_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_year_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xhdpi/ic_year_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_anime_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_anime_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_arrow_right_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_arrow_right_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_artist_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_artist_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_check_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_country_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_country_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_exit_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_exit_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_favorite_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_favorite_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_favorite_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_favorite_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_gift_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_gift_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_hot_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_hot_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_movie_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_movie_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_night_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_night_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_sunny_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_sunny_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_tag_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_tag_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_tv_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_tv_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_type_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_type_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_year_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxhdpi/ic_year_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_about_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_about_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_anime_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_anime_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_arrow_right_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_arrow_right_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_artist_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_artist_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_back_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_back_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_check_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_country_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_country_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_delete_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_exit_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_exit_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_favorite_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_favorite_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_favorite_border_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_favorite_border_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_favorite_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_favorite_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_gift_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_gift_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_hot_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_hot_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_menu_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_movie_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_movie_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_night_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_night_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_search_white_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_search_white_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_sunny_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_sunny_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_tag_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_tag_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_tv_black_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_tv_black_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_type_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_type_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_year_24dp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable-xxxhdpi/ic_year_24dp.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_tag_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/drawlayout_bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable/drawlayout_bg.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/flash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/drawable/flash.jpg -------------------------------------------------------------------------------- /app/src/main/res/drawable/text_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/layout-v21/movie_detail_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 23 | 24 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout-v21/movie_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 23 | 24 | 31 | 32 | 37 | 38 | 43 | 44 | 54 | 55 | 66 | 67 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_favorite.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 26 | 27 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_gift.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 26 | 27 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 14 | 15 | 18 | 19 | 24 | 25 | 26 | 27 | 34 | 35 | 47 | 48 | 49 | 58 | 59 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_photo.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_searchdetail.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 26 | 27 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/res/layout/dialog_save.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/res/layout/footerview.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 14 | 15 | 26 | 27 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/gift_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_anime.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_movie.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 23 | 24 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_tag.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 27 | 28 | 33 | 34 | 45 | 46 | 51 | 52 | 63 | 64 | 69 | 70 | 81 | 82 | 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_top250.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/main_tv.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 16 | 17 | 23 | 24 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/mian_tag_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/movie_detail_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 22 | 23 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/movie_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 14 | 15 | 22 | 23 | 30 | 31 | 36 | 37 | 42 | 43 | 53 | 54 | 65 | 66 | 75 | 76 | 77 | 78 | 79 | 86 | 87 | 88 | 89 | 90 | -------------------------------------------------------------------------------- /app/src/main/res/layout/navigationview_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | 26 | 27 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_drawer.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 13 | 14 | 15 | 16 | 19 | 23 | 27 | 28 | 29 | 30 | 33 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_favorite.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_movie_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-v19/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #00BBD3 4 | #303F9F 5 | #FF4081 6 | #FFFFFF 7 | #000000 8 | #202020 9 | #303030 10 | #009688 11 | #F7BACF 12 | #FE9700 13 | #00BBD3 14 | #785447 15 | #bb9e94 16 | #795548 17 | #363F45 18 | #cccccc 19 | #999999 20 | #212121 21 | #BDBDBD 22 | #4C4C4C 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5dp 5 | 6 | 10dp 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 小瓣 3 | Wan Chun Nam 4 | https://github.com/wenwenwen888 5 | 电影 6 | 动画 7 | 电视剧 8 | Top250 9 | 分类 10 | 收藏 11 | 删除 12 | 福利 13 | 日间模式 14 | 夜间模式 15 | 关于我 16 | 搜索 17 | 选择 18 | 收藏 19 | 退出 20 | 搜索:%s 21 | 类型 · · · · · · 22 | 国家/地区 · · · · · · 23 | 艺术家 · · · · · · 24 | 年代 · · · · · · 25 | 网络出错,请重试 26 | 网络出错,点我重新加载 27 | 查找不到此条目 28 | 查询不到数据,换个关键字试试 29 | 暂时没有收藏的电影条目 30 | 正在拼命加载中... 31 | 我是有底线(。・`ω´・) 32 | 导演:%s 33 | 主演:%s 34 | %s分 35 | 年份:%s 36 | 地区:%s 37 | 类型:%s 38 | 导演 39 | 主演 40 | 简介 41 | 作品 42 | 浏览更多作品 43 | \u3000\u3000%s 44 | 保存 45 | 收藏出现错误 , 请重试 46 | 取消收藏出现错误 , 请重试 47 | 请等待加载完后再收藏 48 | 未知 49 | 保存该图片 50 | 已保存在%s 51 | 存储权限不可用 52 | 请先开启存储权限;\n否则,您将无法正常保存图片 53 | 取消 54 | 立即开启 55 | 56 | 57 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 24 | 25 | 30 | 31 | 36 | 37 | 42 | 43 | 48 | 49 | 54 | 55 | 60 | 61 | 62 | 66 | 67 | 68 | 72 | 73 | 74 | 77 | 78 | 79 | -------------------------------------------------------------------------------- /app/src/main/res/xml/bottombar_night_tabs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/xml/bottombar_tabs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | 13 | 18 | 23 | 28 | -------------------------------------------------------------------------------- /app/小瓣.apk: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/app/小瓣.apk -------------------------------------------------------------------------------- /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 | dependencies { 8 | classpath 'com.android.tools.build:gradle:2.3.0' 9 | 10 | // NOTE: Do not place your application dependencies here; they belong 11 | // in the individual module build.gradle files 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | jcenter() 18 | } 19 | } 20 | 21 | task clean(type: Delete) { 22 | delete rootProject.buildDir 23 | } 24 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Mar 10 16:25:37 CST 2017 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-3.3-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 | -------------------------------------------------------------------------------- /preview/anima.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/anima.png -------------------------------------------------------------------------------- /preview/celebrity_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/celebrity_detail.png -------------------------------------------------------------------------------- /preview/gift.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/gift.png -------------------------------------------------------------------------------- /preview/movie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/movie.png -------------------------------------------------------------------------------- /preview/movie_detail.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/movie_detail.png -------------------------------------------------------------------------------- /preview/navigationview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/navigationview.png -------------------------------------------------------------------------------- /preview/night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/night.png -------------------------------------------------------------------------------- /preview/qcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/qcode.png -------------------------------------------------------------------------------- /preview/search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/search.png -------------------------------------------------------------------------------- /preview/tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/tag.png -------------------------------------------------------------------------------- /preview/top250.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/top250.png -------------------------------------------------------------------------------- /preview/tv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wenwenwen888/DouBan_Movie/3ae505692f65f0a521820ac8a8fef37fc9025614/preview/tv.png -------------------------------------------------------------------------------- /searchbox/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /searchbox/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 25 5 | buildToolsVersion "25.0.2" 6 | 7 | defaultConfig { 8 | minSdkVersion 15 9 | targetSdkVersion 25 10 | versionCode 1 11 | versionName "1.0" 12 | 13 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 14 | 15 | } 16 | buildTypes { 17 | release { 18 | minifyEnabled false 19 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 20 | } 21 | } 22 | } 23 | 24 | dependencies { 25 | compile fileTree(include: ['*.jar'], dir: 'libs') 26 | compile 'com.android.support:appcompat-v7:25.0.1' 27 | compile 'com.android.support:design:25.0.1' 28 | } 29 | -------------------------------------------------------------------------------- /searchbox/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 E:\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 | -------------------------------------------------------------------------------- /searchbox/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/adapter/SearchHistoryAdapter.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.adapter; 2 | 3 | import android.content.Context; 4 | import android.support.v7.widget.RecyclerView; 5 | import android.view.LayoutInflater; 6 | import android.view.View; 7 | import android.view.ViewGroup; 8 | import android.widget.ImageView; 9 | import android.widget.TextView; 10 | 11 | import com.wyt.searchbox.R; 12 | import com.wyt.searchbox.custom.IOnItemClickListener; 13 | 14 | import java.util.ArrayList; 15 | 16 | public class SearchHistoryAdapter extends RecyclerView.Adapter { 17 | 18 | private Context context; 19 | 20 | private ArrayList historys = new ArrayList<>(); 21 | 22 | public SearchHistoryAdapter(Context context, ArrayList historys) { 23 | this.context = context; 24 | this.historys = historys; 25 | } 26 | 27 | @Override 28 | public MyViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { 29 | MyViewHolder holder = new MyViewHolder(LayoutInflater.from(context). 30 | inflate(R.layout.item_search_history, parent, false)); 31 | return holder; 32 | } 33 | 34 | @Override 35 | public void onBindViewHolder(final MyViewHolder holder, final int position) { 36 | holder.historyInfo.setText(historys.get(position)); 37 | 38 | holder.historyInfo.setOnClickListener(new View.OnClickListener() { 39 | @Override 40 | public void onClick(View view) { 41 | iOnItemClickListener.onItemClick(historys.get(position)); 42 | } 43 | }); 44 | 45 | holder.delete.setOnClickListener(new View.OnClickListener() { 46 | @Override 47 | public void onClick(View view) { 48 | iOnItemClickListener.onItemDeleteClick(historys.get(position)); 49 | } 50 | }); 51 | 52 | } 53 | 54 | @Override 55 | public int getItemCount() { 56 | return historys.size(); 57 | } 58 | 59 | class MyViewHolder extends RecyclerView.ViewHolder { 60 | 61 | TextView historyInfo; 62 | ImageView delete; 63 | 64 | public MyViewHolder(View view) { 65 | super(view); 66 | historyInfo = (TextView) view.findViewById(R.id.tv_item_search_history); 67 | delete = (ImageView) view.findViewById(R.id.iv_item_search_delete); 68 | } 69 | } 70 | 71 | private IOnItemClickListener iOnItemClickListener; 72 | 73 | public void setOnItemClickListener(IOnItemClickListener iOnItemClickListener) { 74 | this.iOnItemClickListener = iOnItemClickListener; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/custom/CircularRevealAnim.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.custom; 2 | 3 | import android.animation.Animator; 4 | import android.animation.AnimatorListenerAdapter; 5 | import android.annotation.SuppressLint; 6 | import android.view.View; 7 | import android.view.ViewAnimationUtils; 8 | import android.view.animation.DecelerateInterpolator; 9 | 10 | public class CircularRevealAnim { 11 | 12 | public static final long DURATION = 200; 13 | 14 | private AnimListener mListener; 15 | 16 | public interface AnimListener { 17 | 18 | void onHideAnimationEnd(); 19 | 20 | void onShowAnimationEnd(); 21 | } 22 | 23 | @SuppressLint("NewApi") 24 | private void actionOtherVisible(final boolean isShow, final View triggerView, final View animView) { 25 | 26 | if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.LOLLIPOP) { 27 | if (isShow) { 28 | animView.setVisibility(View.VISIBLE); 29 | if (mListener != null) mListener.onShowAnimationEnd(); 30 | } else { 31 | animView.setVisibility(View.GONE); 32 | if (mListener != null) mListener.onHideAnimationEnd(); 33 | } 34 | return; 35 | } 36 | 37 | /** 38 | * 计算 triggerView 的中心位置 39 | */ 40 | int[] tvLocation = new int[2]; 41 | triggerView.getLocationInWindow(tvLocation); 42 | int tvX = tvLocation[0] + triggerView.getWidth() / 2; 43 | int tvY = tvLocation[1] + triggerView.getHeight() / 2; 44 | 45 | /** 46 | * 计算 animView 的中心位置 47 | */ 48 | int[] avLocation = new int[2]; 49 | animView.getLocationInWindow(avLocation); 50 | int avX = avLocation[0] + animView.getWidth() / 2; 51 | int avY = avLocation[1] + animView.getHeight() / 2; 52 | 53 | int rippleW = tvX < avX ? animView.getWidth() - tvX : tvX - avLocation[0]; 54 | int rippleH = tvY < avY ? animView.getHeight() - tvY : tvY - avLocation[1]; 55 | 56 | float maxRadius = (float) Math.sqrt(rippleW * rippleW + rippleH * rippleH); 57 | float startRadius; 58 | float endRadius; 59 | 60 | if (isShow) { 61 | startRadius = 0; 62 | endRadius = maxRadius; 63 | } else { 64 | startRadius = maxRadius; 65 | endRadius = 0; 66 | } 67 | 68 | Animator anim = ViewAnimationUtils.createCircularReveal(animView, tvX, tvY, startRadius, endRadius); 69 | animView.setVisibility(View.VISIBLE); 70 | anim.setDuration(DURATION); 71 | anim.setInterpolator(new DecelerateInterpolator()); 72 | 73 | anim.addListener(new AnimatorListenerAdapter() { 74 | @Override 75 | public void onAnimationEnd(Animator animation) { 76 | super.onAnimationEnd(animation); 77 | if (isShow) { 78 | animView.setVisibility(View.VISIBLE); 79 | if (mListener != null) mListener.onShowAnimationEnd(); 80 | } else { 81 | animView.setVisibility(View.GONE); 82 | if (mListener != null) mListener.onHideAnimationEnd(); 83 | } 84 | } 85 | }); 86 | 87 | anim.start(); 88 | } 89 | 90 | public void show(View triggerView, View showView) { 91 | actionOtherVisible(true, triggerView, showView); 92 | } 93 | 94 | public void hide(View triggerView, View hideView) { 95 | actionOtherVisible(false, triggerView, hideView); 96 | } 97 | 98 | public void setAnimListener(AnimListener listener) { 99 | mListener = listener; 100 | } 101 | 102 | } -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/custom/IOnItemClickListener.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.custom; 2 | 3 | /** 4 | * Created by Won on 2016/4/22. 5 | */ 6 | public interface IOnItemClickListener { 7 | 8 | void onItemClick(String keyword); 9 | 10 | void onItemDeleteClick(String keyword); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/custom/IOnSearchClickListener.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.custom; 2 | 3 | /** 4 | * Created by Won on 2017/1/13. 5 | */ 6 | 7 | public interface IOnSearchClickListener { 8 | 9 | void OnSearchClick(String keyword); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/db/SearchHistoryDB.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.db; 2 | 3 | import android.content.ContentValues; 4 | import android.content.Context; 5 | import android.database.Cursor; 6 | import android.database.sqlite.SQLiteDatabase; 7 | import android.database.sqlite.SQLiteOpenHelper; 8 | 9 | import java.util.ArrayList; 10 | 11 | /** 12 | * Created by Won on 2017/1/13. 13 | */ 14 | 15 | public class SearchHistoryDB extends SQLiteOpenHelper { 16 | 17 | public static final String DB_NAME = "SearchHistory_db"; 18 | 19 | public static final String TABLE_NAME = "SearchHistory"; 20 | 21 | private static final String CREATE_TABLE = "create table if not exists " + TABLE_NAME + " (" 22 | + "id integer primary key autoincrement, " 23 | + "history text)"; 24 | 25 | public SearchHistoryDB(Context context, String name, SQLiteDatabase.CursorFactory factory, int version) { 26 | super(context, name, factory, version); 27 | } 28 | 29 | @Override 30 | public void onCreate(SQLiteDatabase sqLiteDatabase) { 31 | sqLiteDatabase.execSQL(CREATE_TABLE);//创建表 32 | } 33 | 34 | @Override 35 | public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) { 36 | 37 | } 38 | 39 | /** 40 | * 查询全部搜索记录 41 | */ 42 | public ArrayList queryAllHistory() { 43 | ArrayList historys = new ArrayList<>(); 44 | //获取数据库对象 45 | SQLiteDatabase db = getReadableDatabase(); 46 | //查询表中的数据 47 | Cursor cursor = db.query(TABLE_NAME, null, null, null, null, null, "id desc"); 48 | //获取name列的索引 49 | for (cursor.moveToFirst(); !(cursor.isAfterLast()); cursor.moveToNext()) { 50 | String history = cursor.getString(1); 51 | historys.add(history); 52 | } 53 | cursor.close();//关闭结果集 54 | db.close();//关闭数据库对象 55 | return historys; 56 | } 57 | 58 | /** 59 | * 插入数据到数据库 60 | */ 61 | public void insertHistory(String keyword) { 62 | SQLiteDatabase db = getWritableDatabase(); 63 | //生成ContentValues对象 64 | ContentValues cv = new ContentValues(); 65 | //往ContentValues对象存放数据,键-值对模式 66 | cv.put("history", keyword); 67 | //调用insert方法,将数据插入数据库 68 | db.insert(TABLE_NAME, null, cv); 69 | //关闭数据库 70 | db.close(); 71 | } 72 | 73 | /** 74 | * 删除某条数据 75 | */ 76 | public void deleteHistory(String keyword) { 77 | SQLiteDatabase db = getWritableDatabase(); 78 | //生成ContentValues对象 79 | db.delete(TABLE_NAME, "history=?", new String[]{keyword}); 80 | //关闭数据库 81 | db.close(); 82 | } 83 | 84 | /** 85 | * 删除全部数据 86 | */ 87 | public void deleteAllHistory() { 88 | SQLiteDatabase db = getWritableDatabase(); 89 | //删除全部数据 90 | db.execSQL("delete from " + TABLE_NAME); 91 | //关闭数据库 92 | db.close(); 93 | } 94 | 95 | } 96 | -------------------------------------------------------------------------------- /searchbox/src/main/java/com/wyt/searchbox/utils/KeyBoardUtils.java: -------------------------------------------------------------------------------- 1 | package com.wyt.searchbox.utils; 2 | 3 | import android.content.Context; 4 | import android.view.inputmethod.InputMethodManager; 5 | import android.widget.EditText; 6 | 7 | public class KeyBoardUtils { 8 | 9 | public static void openKeyboard(Context context, EditText editText) { 10 | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); 11 | imm.showSoftInput(editText, InputMethodManager.RESULT_SHOWN); 12 | imm.toggleSoftInput(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY); 13 | } 14 | 15 | public static void closeKeyboard(Context context, EditText editText) { 16 | InputMethodManager imm = (InputMethodManager) context.getSystemService(Context.INPUT_METHOD_SERVICE); 17 | imm.hideSoftInputFromWindow(editText.getWindowToken(), 0); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/ic_back_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/ic_close_16dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/ic_history_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/ic_search_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/ic_search_bg_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /searchbox/src/main/res/drawable/shape_corner_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /searchbox/src/main/res/layout/dialog_search.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 11 | 12 | 18 | 19 | 25 | 26 | 38 | 39 | 45 | 46 | 47 | 48 | 52 | 53 | 58 | 59 | 64 | 65 | 75 | 76 | 77 | 81 | 82 | -------------------------------------------------------------------------------- /searchbox/src/main/res/layout/item_search_history.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 27 | 28 | 40 | -------------------------------------------------------------------------------- /searchbox/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFF 4 | #0000 5 | 6 | #737373 7 | #9DA0A3 8 | 9 | #e6e6e6 10 | 11 | -------------------------------------------------------------------------------- /searchbox/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | SearchBox 3 | 4 | -------------------------------------------------------------------------------- /searchbox/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':searchbox' 2 | --------------------------------------------------------------------------------