├── .gitignore ├── EveArchitecture.png ├── README.md ├── app ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── ic_launcher-web.png │ ├── java │ └── bob │ │ └── eve │ │ └── walle │ │ ├── app │ │ ├── AppBlockCanaryContext.java │ │ ├── AppCompatPreferenceActivity.java │ │ ├── Constants.java │ │ ├── EveApplication.java │ │ ├── EveDiBaseFragment.java │ │ ├── InitializeService.java │ │ └── Navigation.java │ │ ├── config │ │ ├── ImplPreferencesHelper.java │ │ └── PreferencesHelper.java │ │ ├── di │ │ ├── component │ │ │ ├── ActivityComponent.java │ │ │ └── FragmentComponent.java │ │ └── module │ │ │ ├── ActivityModule.java │ │ │ └── FragmentModule.java │ │ ├── mvp │ │ ├── cache │ │ │ ├── AqicnCacheService.java │ │ │ ├── CityListCacheService.java │ │ │ ├── DouEveCacheService.java │ │ │ ├── GankioCacheService.java │ │ │ ├── Pm25InCacheService.java │ │ │ ├── SojsonWeatherCacheService.java │ │ │ ├── TianApiCacheService.java │ │ │ └── ZhihuPagerCacheService.java │ │ ├── contract │ │ │ ├── HiGirlFromGankContract.java │ │ │ ├── HiGirlFromTianContract.java │ │ │ ├── ITCircleFromGankCategoryContract.java │ │ │ ├── MovieFromDoubanTop250Contract.java │ │ │ ├── MovieFromDoubanUSBoxContract.java │ │ │ └── MovieFromGankContract.java │ │ ├── entity │ │ │ ├── AqicnAQIDetailsEntity.java │ │ │ ├── AqicnStationsEntiry.java │ │ │ ├── Pm25InAQIDetailsEntity.java │ │ │ ├── SojsonWeatherEntity.java │ │ │ ├── cities │ │ │ │ ├── City.java │ │ │ │ ├── County.java │ │ │ │ ├── Province.java │ │ │ │ └── Provinces.java │ │ │ ├── douban │ │ │ │ ├── MovieSearchEntity.java │ │ │ │ ├── Top250Entity.java │ │ │ │ └── USBoxEntity.java │ │ │ ├── gank │ │ │ │ ├── GankISearchItemEntity.java │ │ │ │ └── GankItemEntity.java │ │ │ ├── tian │ │ │ │ └── TianGirlEntity.java │ │ │ └── zhihu │ │ │ │ ├── ZhihuCommentEntity.java │ │ │ │ ├── ZhihuDetailEntity.java │ │ │ │ ├── ZhihuDetailExtraEntity.java │ │ │ │ ├── ZhihuDetailSourceEntity.java │ │ │ │ ├── ZhihuHotsEntity.java │ │ │ │ ├── ZhihuLatestsEntity.java │ │ │ │ ├── ZhihuSectionListEntity.java │ │ │ │ ├── ZhihuSectionsEntity.java │ │ │ │ ├── ZhihuThemeListEntity.java │ │ │ │ └── ZhihuThemesEntity.java │ │ ├── mapper │ │ │ ├── AqiDetailsFromAqicnMapper.java │ │ │ ├── AqiDetailsFromPm25inMapper.java │ │ │ ├── DoubanTop250Mapper.java │ │ │ ├── DoubanUSBoxMapper.java │ │ │ ├── ForecastWeatherFromSojsonMapper.java │ │ │ ├── GankItemMapper.java │ │ │ ├── ProvinceMapper.java │ │ │ └── TianGirlMapper.java │ │ ├── model │ │ │ ├── bean │ │ │ │ ├── douban │ │ │ │ │ └── MovieSubject.java │ │ │ │ ├── gank │ │ │ │ │ ├── GankISearchItem.java │ │ │ │ │ └── GankItem.java │ │ │ │ ├── tian │ │ │ │ │ └── TianGirl.java │ │ │ │ ├── weather │ │ │ │ │ ├── AQIDetailsCase.java │ │ │ │ │ ├── ChooseCitiesCase.java │ │ │ │ │ └── ForecastWeathersCase.java │ │ │ │ └── zhihu │ │ │ │ │ ├── ZhihuDetail.java │ │ │ │ │ ├── ZhihuEditor.java │ │ │ │ │ ├── ZhihuHot.java │ │ │ │ │ ├── ZhihuLatests.java │ │ │ │ │ ├── ZhihuSectionList.java │ │ │ │ │ ├── ZhihuStory.java │ │ │ │ │ ├── ZhihuThemeList.java │ │ │ │ │ └── ZhihuThemeOrSection.java │ │ │ ├── douban │ │ │ │ ├── MovieSearchModel.java │ │ │ │ ├── Top250Model.java │ │ │ │ └── USBoxModel.java │ │ │ ├── gank │ │ │ │ ├── CategoryGanksModel.java │ │ │ │ ├── DateGanksModel.java │ │ │ │ ├── GankCategoryType.java │ │ │ │ ├── RandomGirlsModel.java │ │ │ │ └── SearchGanksModel.java │ │ │ ├── tian │ │ │ │ └── TianGirlsModel.java │ │ │ ├── weather │ │ │ │ ├── AqicnAQIDetailsModel.java │ │ │ │ ├── Pm25inAQIDetailsModel.java │ │ │ │ ├── ProvinceModel.java │ │ │ │ └── SojsonForecastWeatherModel.java │ │ │ └── zhihu │ │ │ │ ├── ZhihuDetailModel.java │ │ │ │ ├── ZhihuHotsModel.java │ │ │ │ ├── ZhihuLatestsModel.java │ │ │ │ ├── ZhihuLongCommentModel.java │ │ │ │ ├── ZhihuSectionListModel.java │ │ │ │ ├── ZhihuSectionsModel.java │ │ │ │ ├── ZhihuShortCommentModel.java │ │ │ │ ├── ZhihuThemeListModel.java │ │ │ │ └── ZhihuThemesModel.java │ │ ├── presenter │ │ │ ├── HiGirlFromGankPresenter.java │ │ │ ├── HiGirlFromTianPresenter.java │ │ │ ├── ITCircleFromCategoryPresenter.java │ │ │ ├── MainPresenter.java │ │ │ ├── MovieFromDoubanTop250Presenter.java │ │ │ ├── MovieFromDoubanUSBoxPresenter.java │ │ │ ├── MovieFromGankPresenter.java │ │ │ ├── SettingPresenter.java │ │ │ └── weather │ │ │ │ ├── AqicnAQIDetailsPresenter.java │ │ │ │ ├── Pm25inAQIPresenter.java │ │ │ │ ├── ProvincePresenter.java │ │ │ │ └── SojsonForecastWeatherPresenter.java │ │ └── service │ │ │ ├── AqicnService.java │ │ │ ├── CityListService.java │ │ │ ├── DouEveService.java │ │ │ ├── GankioService.java │ │ │ ├── Pm25InService.java │ │ │ ├── SojsonWeatherService.java │ │ │ ├── TianApiService.java │ │ │ └── ZhihuPagerService.java │ │ ├── ui │ │ ├── activity │ │ │ ├── EveWebActivity.java │ │ │ ├── ImageDetailActivity.java │ │ │ ├── MainActivity.java │ │ │ ├── WelcomeActivity.java │ │ │ └── slide │ │ │ │ ├── DrawerAdapter.java │ │ │ │ ├── DrawerItem.java │ │ │ │ ├── SimpleItem.java │ │ │ │ └── SpaceItem.java │ │ ├── adapter │ │ │ ├── EveEasyFragmentAdapter.java │ │ │ ├── EveEasyRefreshFragmentAdapter.java │ │ │ ├── HiGirlGankAdapter.java │ │ │ ├── HiGirlTianAdapter.java │ │ │ ├── ITCircleFromGankCategoryAdapter.java │ │ │ ├── MovieDoubanAdapter.java │ │ │ └── MovieGankAdapter.java │ │ ├── fragment │ │ │ ├── AboutFragment.java │ │ │ ├── HiGirlFromGankFragment.java │ │ │ ├── HiGirlFromTianFragment.java │ │ │ ├── ITCircleFromGankCategoryFragment.java │ │ │ ├── ITCircleFromGankSearchFragment.java │ │ │ ├── MovieFromDoubanSearchFragment.java │ │ │ ├── MovieFromDoubanTop250Fragment.java │ │ │ ├── MovieFromDoubanUSBoxFragment.java │ │ │ ├── MovieFromGankFragment.java │ │ │ ├── ReadFromGankFragment.java │ │ │ ├── ReadFromZhihuHotsFragment.java │ │ │ ├── ReadFromZhihuLatestsFragment.java │ │ │ ├── ReadFromZhihuSectionsFragment.java │ │ │ ├── ReadFromZhihuThemesFragment.java │ │ │ ├── SettingFragment.java │ │ │ └── tab │ │ │ │ ├── HiGirlTabFragment.java │ │ │ │ ├── ITCircleTabFragment.java │ │ │ │ ├── MovieTabFragment.java │ │ │ │ └── ReadTabFragment.java │ │ └── widget │ │ │ ├── imageloader │ │ │ ├── CustomGlideModule.java │ │ │ ├── GlideImageLoader.java │ │ │ └── IImageLoder.java │ │ │ └── transition │ │ │ └── BlurTransformation.java │ │ └── util │ │ ├── ClickableMovementMethod.java │ │ ├── DateUtils.java │ │ ├── GetDiskCacheSizeTask.java │ │ ├── HtmlUtils.java │ │ ├── SnackbarUtil.java │ │ └── SpannableStringUtils.java │ └── res │ ├── anim │ ├── dock_bottom_enter.xml │ ├── dock_bottom_exit.xml │ ├── fade_in.xml │ └── fade_out.xml │ ├── drawable-night │ └── ic_launcher_foreground.xml │ ├── drawable-xhdpi │ └── ic_eve_any.png │ ├── drawable-xxhdpi │ └── ic_eve_any.png │ ├── drawable-xxxhdpi │ └── ic_eve_any.png │ ├── drawable │ ├── ic_info_black_24dp.xml │ ├── ic_item_categroy_android.xml │ ├── ic_item_categroy_expand.xml │ ├── ic_item_categroy_ios.xml │ ├── ic_item_categroy_web.xml │ ├── ic_item_click_me.xml │ ├── ic_item_movie_64.xml │ ├── ic_launcher_background.xml │ ├── ic_launcher_foreground.xml │ ├── ic_load_place_background.xml │ ├── ic_load_place_day_foreground.xml │ ├── ic_load_place_night_background.xml │ ├── ic_load_place_night_foreground.xml │ ├── ic_menu_about.xml │ ├── ic_menu_coding.xml │ ├── ic_menu_girls.xml │ ├── ic_menu_movie.xml │ ├── ic_menu_read.xml │ ├── ic_menu_setting.xml │ ├── ic_notifications_black_24dp.xml │ ├── ic_sync_black_24dp.xml │ ├── ic_tag_box.xml │ ├── ic_toolbar_copy.xml │ ├── ic_toolbar_fav.xml │ ├── ic_toolbar_save.xml │ ├── ic_toolbar_search.xml │ ├── ic_toolbar_share.xml │ ├── ic_toolbar_unfav.xml │ ├── ic_transparent.xml │ ├── line_05.xml │ ├── shape_shadow_black.xml │ └── welcome_launcher.xml │ ├── layout │ ├── activity_image_detail_layout.xml │ ├── activity_main.xml │ ├── activity_tencent_web_layout.xml │ ├── common_state_recyclerview.xml │ ├── fragment_common_recycler_layout.xml │ ├── fragment_higirl_gank_layout.xml │ ├── fragment_higirl_tab_layout.xml │ ├── fragment_it_circle_tab_layout.xml │ ├── fragment_movie_gank_layout.xml │ ├── fragment_movie_tab_layout.xml │ ├── fragment_setting_layout.xml │ ├── include_toolbar.xml │ ├── item_hi_girl_layout.xml │ ├── item_it_cicle_category_girl_layout.xml │ ├── item_it_cicle_category_have_image_layout.xml │ ├── item_it_cicle_category_no_image_layout.xml │ ├── item_movie_douban_layout.xml │ ├── item_movie_gank_image_layout.xml │ ├── item_slide_left_layout.xml │ ├── menu_slide_left_layout.xml │ └── view_line_05.xml │ ├── menu │ ├── girl_menu.xml │ ├── main_menu.xml │ └── web_meun.xml │ ├── mipmap-anydpi-v26 │ ├── ic_launcher.xml │ ├── ic_launcher_round.xml │ ├── ic_load_place_day.xml │ ├── ic_load_place_day_round.xml │ ├── ic_load_place_night.xml │ └── ic_load_place_night_round.xml │ ├── mipmap-hdpi │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── ic_load_place_day.png │ ├── ic_load_place_day_round.png │ ├── ic_load_place_night.png │ ├── ic_load_place_night_round.png │ └── walle_launcher.png │ ├── mipmap-night-xxhdpi │ ├── ic_check_update.png │ ├── ic_clear_cache.png │ ├── ic_feedback.png │ ├── ic_night.png │ └── walle_launcher.png │ ├── mipmap-xhdpi │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── ic_load_place_day.png │ ├── ic_load_place_day_round.png │ ├── ic_load_place_night.png │ ├── ic_load_place_night_round.png │ └── walle_launcher.png │ ├── mipmap-xxhdpi │ ├── ic_check_update.png │ ├── ic_clear_cache.png │ ├── ic_feedback.png │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── ic_load_place_day.png │ ├── ic_load_place_day_round.png │ ├── ic_load_place_night.png │ ├── ic_load_place_night_round.png │ ├── ic_night.png │ └── walle_launcher.png │ ├── mipmap-xxxhdpi │ ├── ic_launcher.png │ ├── ic_launcher_round.png │ ├── ic_load_place_day.png │ ├── ic_load_place_day_round.png │ ├── ic_load_place_night.png │ └── ic_load_place_night_round.png │ ├── values-night │ └── colors.xml │ ├── values-v21 │ └── styles.xml │ └── values │ ├── aboutlibraries_description.xml │ ├── arrays.xml │ ├── colors.xml │ ├── dimens.xml │ ├── ic_launcher_background.xml │ ├── ids.xml │ ├── strings.xml │ └── styles.xml ├── build.gradle ├── config.gradle ├── evelib ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── bob │ │ └── eve │ │ └── comm │ │ └── lib │ │ ├── configuration │ │ ├── AbsBuilderConfig.java │ │ ├── IApplicationLifecycle.java │ │ └── IConfiguration.java │ │ ├── layout │ │ ├── coordinator │ │ │ └── CoordinatorTabLayout.java │ │ ├── shadow │ │ │ └── ShadowLayout.java │ │ ├── state │ │ │ └── StateLayout.java │ │ ├── tab │ │ │ ├── NavigationTabStrip.java │ │ │ └── OnEveCoordinatorTabLayoutLoadImageListener.java │ │ └── viewpager │ │ │ ├── Mode.java │ │ │ ├── ParallaxTransformer.java │ │ │ ├── ParallaxViewPager.java │ │ │ └── adapter │ │ │ ├── EveCommonViewPagerAdapter.java │ │ │ ├── ViewPagerHolder.java │ │ │ └── ViewPagerHolderCreator.java │ │ ├── util │ │ ├── ArrayUtils.java │ │ ├── BitmapUtils.java │ │ ├── ColorUtils.java │ │ ├── DeviceUtils.java │ │ ├── FastBlur.java │ │ ├── FileUtils.java │ │ ├── HanziToPinyin.java │ │ ├── HanziToPinyinUtils.java │ │ ├── IOUtils.java │ │ ├── ImageUtils.java │ │ ├── ListUtils.java │ │ ├── LocationUtils.java │ │ ├── MapUtils.java │ │ ├── NetworkUtils.java │ │ ├── ObjectUtils.java │ │ ├── Preconditions.java │ │ ├── RSBlur.java │ │ ├── ScreenUtils.java │ │ ├── StringUtils.java │ │ ├── SystemShareUtils.java │ │ ├── SystemUtils.java │ │ └── ToastUtils.java │ │ └── view │ │ ├── DividerItemDecoration.java │ │ ├── ScrollImageView.java │ │ ├── SlideImageView.java │ │ └── TagGroup.java │ └── res │ ├── anim │ ├── anim_alpha_dismiss.xml │ └── anim_alpha_show.xml │ ├── animator-v21 │ ├── rotate_add_to_remove.xml │ ├── rotate_remove_to_add.xml │ ├── slide_in_bottom.xml │ ├── slide_in_left.xml │ ├── slide_out_right.xml │ └── slide_out_top.xml │ ├── animator │ ├── rotate_add_to_remove.xml │ ├── rotate_remove_to_add.xml │ ├── slide_in_bottom.xml │ ├── slide_in_left.xml │ ├── slide_out_right.xml │ └── slide_out_top.xml │ ├── drawable │ ├── appbar_layout_elevated.xml │ ├── ic_arrow_white_24dp.xml │ ├── ic_bob_logo.xml │ ├── ic_error_image.xml │ ├── ic_eve_logo.xml │ ├── ic_hanzi.xml │ ├── ic_lovely_blush.xml │ ├── ic_lovely_cold_sweat.xml │ ├── ic_lovely_despise.xml │ ├── ic_lovely_fans.xml │ ├── ic_lovely_gaze.xml │ ├── ic_lovely_laugh.xml │ ├── ic_lovely_laugh_cry.xml │ ├── ic_lovely_muah.xml │ ├── ic_place_image.xml │ ├── ic_state_layout_empty.xml │ ├── ic_state_layout_error.xml │ └── state_layout_error_retry_btn.xml │ ├── layout │ ├── coordinatortablayout.xml │ ├── state_layout_emtpy.xml │ ├── state_layout_error.xml │ └── state_layout_loading.xml │ └── values │ ├── attrs.xml │ ├── color.xml │ ├── dimen.xml │ ├── strings.xml │ └── styles.xml ├── evemvp ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── bob │ │ └── eve │ │ └── mvp │ │ ├── base │ │ ├── AbsEveBaseActivity.java │ │ ├── AbsEveBaseFragment.java │ │ ├── AbsEveEasyActivity.java │ │ ├── AbsEveEasyFragment.java │ │ ├── ApplicationRegister.java │ │ ├── EveActivityManager.java │ │ ├── EveBaseApplication.java │ │ ├── EveLazyBaseFragement.java │ │ ├── IActivity.java │ │ ├── IApplication.java │ │ ├── IFragment.java │ │ ├── StateBaseActivity.java │ │ └── proxy │ │ │ └── ApplicationProxy.java │ │ ├── di │ │ ├── component │ │ │ └── AppComponent.java │ │ ├── module │ │ │ └── ApplicationModule.java │ │ └── scope │ │ │ ├── PreActivity.java │ │ │ └── PreFragment.java │ │ ├── executor │ │ ├── JobExecutor.java │ │ ├── MainThread.java │ │ ├── PostExecutionThread.java │ │ └── ThreadExecutor.java │ │ ├── mapper │ │ ├── AbsEntityToModelMapper.java │ │ └── IEntityToModelMapper.java │ │ ├── model │ │ ├── EveBaseModel.java │ │ └── IModel.java │ │ ├── presenter │ │ ├── EveBasePresenter.java │ │ └── IPresenter.java │ │ ├── rx │ │ └── error │ │ │ ├── EveErrorFunction.java │ │ │ ├── EveErrorMapper.java │ │ │ ├── EveRxErrorFactory.java │ │ │ ├── EveRxErrorFlowable.java │ │ │ ├── EveRxErrorHandler.java │ │ │ ├── EveRxErrorListener.java │ │ │ ├── EveRxErrorObserver.java │ │ │ └── exception │ │ │ ├── EveStatusException.java │ │ │ ├── NetworkConnectionException.java │ │ │ └── ParamsException.java │ │ └── view │ │ └── IView.java │ └── res │ └── values │ └── strings.xml ├── everepository ├── .gitignore ├── build.gradle ├── proguard-rules.pro └── src │ └── main │ ├── AndroidManifest.xml │ ├── java │ └── bob │ │ └── eve │ │ └── repository │ │ ├── EveInterceptorOnRequestResponseHandler.java │ │ ├── EveLogInterceptor.java │ │ ├── EveRepositoryManager.java │ │ ├── IEveRepositoryManager.java │ │ ├── cache │ │ ├── IEveCache.java │ │ ├── IEveCacheType.java │ │ └── LruCache.java │ │ ├── converter │ │ ├── AESRequestConverter.java │ │ ├── AESResponseConverter.java │ │ ├── GsonConverterFactory.java │ │ ├── GsonRequestBodyConverter.java │ │ ├── GsonResponseBodyConverter.java │ │ └── JsonResponseBodyConverter.java │ │ ├── cookies │ │ ├── DiskHttpCookie.java │ │ └── InDiskCookieStore.java │ │ ├── di │ │ ├── component │ │ │ └── EveRepositoryComponent.java │ │ └── module │ │ │ ├── EveRepositoryConfig.java │ │ │ ├── EveRepositoryConfigModule.java │ │ │ └── EveRepositoryModule.java │ │ └── encoding │ │ └── AES.java │ └── res │ └── values │ └── strings.xml ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── screen ├── eve_01.gif ├── eve_02.gif ├── eve_03.gif └── eve_04.gif └── 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 | -------------------------------------------------------------------------------- /EveArchitecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/EveArchitecture.png -------------------------------------------------------------------------------- /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /app/src/main/ic_launcher-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/ic_launcher-web.png -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/app/Constants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午4:41 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午4:41 6 | */ 7 | 8 | package bob.eve.walle.app; 9 | 10 | import android.os.Environment; 11 | import java.io.File; 12 | 13 | /** 14 | * Created by Bob on 17/12/12. 15 | */ 16 | 17 | public final class Constants { 18 | public static final String PM25IN_PUBLIC_KEY = "5j1znBVAsnSf5xQyNQyq"; 19 | public static final String AQICN_TOKEN = "21acde2c4ac1fc1f47d4cbeb752e6bc000ea171d"; 20 | public static final String TIAN_XING_KEY = "965831c7d8400cb5f065e3d783c5296b"; 21 | public static final String BUGLY_APP_ID = "9a7bb55bcb"; 22 | 23 | public static final String GIRLS_SDCARD_PATH = Environment.getExternalStorageDirectory() 24 | .getAbsolutePath() + File.separator + "Eve" + 25 | File.separator + "Girls"; 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/config/PreferencesHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-20 下午7:21 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-20 下午7:21 6 | */ 7 | 8 | package bob.eve.walle.config; 9 | 10 | /** 11 | * Created by Bob on 17/12/20. 12 | */ 13 | 14 | public interface PreferencesHelper { 15 | 16 | boolean getNightModeState(); 17 | 18 | void setNightModeState(boolean state); 19 | 20 | boolean getNoImageState(); 21 | 22 | void setNoImageState(boolean state); 23 | 24 | boolean getAutoCacheState(); 25 | 26 | void setAutoCacheState(boolean state); 27 | 28 | int getFragmentIndex(); 29 | 30 | void setFragmentIndex(int index); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/di/component/ActivityComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午11:36 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午11:36 6 | */ 7 | 8 | package bob.eve.walle.di.component; 9 | 10 | import bob.eve.mvp.di.component.AppComponent; 11 | import bob.eve.mvp.di.scope.PreActivity; 12 | import bob.eve.walle.di.module.ActivityModule; 13 | import bob.eve.walle.ui.activity.EveWebActivity; 14 | import bob.eve.walle.ui.activity.MainActivity; 15 | import dagger.Component; 16 | 17 | /** 18 | * Created by Bob on 17/12/12. 19 | */ 20 | 21 | @PreActivity 22 | @Component(modules = ActivityModule.class, dependencies = AppComponent.class) 23 | public interface ActivityComponent { 24 | 25 | void inject(MainActivity mainActivity); 26 | 27 | void inject(EveWebActivity eveWebActivity); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/di/component/FragmentComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 下午3:53 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 下午3:53 6 | */ 7 | 8 | package bob.eve.walle.di.component; 9 | 10 | import android.app.Activity; 11 | import bob.eve.mvp.di.component.AppComponent; 12 | import bob.eve.mvp.di.scope.PreFragment; 13 | import bob.eve.walle.di.module.FragmentModule; 14 | import bob.eve.walle.ui.fragment.HiGirlFromGankFragment; 15 | import bob.eve.walle.ui.fragment.HiGirlFromTianFragment; 16 | import bob.eve.walle.ui.fragment.ITCircleFromGankCategoryFragment; 17 | import bob.eve.walle.ui.fragment.MovieFromDoubanTop250Fragment; 18 | import bob.eve.walle.ui.fragment.MovieFromDoubanUSBoxFragment; 19 | import bob.eve.walle.ui.fragment.MovieFromGankFragment; 20 | import bob.eve.walle.ui.fragment.SettingFragment; 21 | import dagger.Component; 22 | 23 | /** 24 | * Created by Bob on 17/12/19. 25 | */ 26 | @PreFragment 27 | @Component(dependencies = AppComponent.class, modules = FragmentModule.class) 28 | public interface FragmentComponent { 29 | Activity getActivity(); 30 | 31 | void inject(ITCircleFromGankCategoryFragment itCircleFromGankCategoryFragment); 32 | 33 | void inject(MovieFromDoubanTop250Fragment movieFromDoubanTop250Fragment); 34 | 35 | void inject(MovieFromGankFragment movieFromGankFragment); 36 | 37 | void inject(MovieFromDoubanUSBoxFragment movieFromDoubanUSBoxFragment); 38 | 39 | void inject(HiGirlFromGankFragment hiGirlFromGankFragment); 40 | 41 | void inject(HiGirlFromTianFragment hiGirlFromTianFragment); 42 | 43 | void inject(SettingFragment settingFragment); 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/di/module/ActivityModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午11:36 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午11:36 6 | */ 7 | 8 | package bob.eve.walle.di.module; 9 | 10 | import android.app.Activity; 11 | import android.app.Application; 12 | import bob.eve.mvp.di.scope.PreActivity; 13 | import bob.eve.mvp.di.scope.PreFragment; 14 | import bob.eve.walle.config.ImplPreferencesHelper; 15 | import dagger.Module; 16 | import dagger.Provides; 17 | import javax.inject.Named; 18 | 19 | /** 20 | * Created by Bob on 17/12/12. 21 | */ 22 | 23 | @Module 24 | public class ActivityModule { 25 | private Activity mActivity; 26 | 27 | public ActivityModule(Activity activity) { 28 | this.mActivity = activity; 29 | } 30 | 31 | @Provides 32 | @PreActivity 33 | public Activity provideActivity() { 34 | return mActivity; 35 | } 36 | 37 | } 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/di/module/FragmentModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 下午3:52 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 下午3:52 6 | */ 7 | 8 | package bob.eve.walle.di.module; 9 | 10 | import android.app.Activity; 11 | import android.app.Application; 12 | import android.support.v4.app.Fragment; 13 | import bob.eve.mvp.di.scope.PreFragment; 14 | import bob.eve.walle.config.ImplPreferencesHelper; 15 | import dagger.Module; 16 | import dagger.Provides; 17 | import javax.inject.Named; 18 | 19 | /** 20 | * Created by Bob on 17/12/19. 21 | */ 22 | @Module 23 | public class FragmentModule { 24 | 25 | private Fragment fragment; 26 | 27 | public FragmentModule(Fragment fragment) { 28 | this.fragment = fragment; 29 | } 30 | 31 | @Provides 32 | @PreFragment 33 | public Activity provideActivity() { 34 | return fragment.getActivity(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/AqicnCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午12:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 下午12:00 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.AqicnStationsEntiry; 11 | import io.reactivex.Observable; 12 | import io.rx_cache2.DynamicKey; 13 | import io.rx_cache2.EvictProvider; 14 | import io.rx_cache2.LifeCache; 15 | import io.rx_cache2.Reply; 16 | import java.util.concurrent.TimeUnit; 17 | 18 | /** 19 | * Created by Bob on 17/12/13. 20 | * 21 | * 方法名 + $d$d$d$" + DynamicKey.dynamicKey + "$g$g$g$" + DynamicKeyGroup.group 22 | */ 23 | 24 | public interface AqicnCacheService { 25 | // @LifeCache(duration = 10, timeUnit = TimeUnit.MINUTES) 26 | // Observable> getAQIDetailsForCity( 27 | // Observable source, DynamicKey dynamicKey, EvictProvider evictProvider); 28 | 29 | /** 30 | * 一月更新一次观察点信息 31 | */ 32 | @LifeCache(duration = 30, timeUnit = TimeUnit.DAYS) 33 | Observable> getAQIStationsForCity( 34 | Observable source, DynamicKey dynamicKey, EvictProvider evictProvider); 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/CityListCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午4:49 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 上午11:43 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import io.reactivex.Observable; 11 | import io.rx_cache2.DynamicKey; 12 | import io.rx_cache2.EvictProvider; 13 | import io.rx_cache2.LifeCache; 14 | import io.rx_cache2.Reply; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | /** 18 | * Created by Bob on 17/12/12. 19 | */ 20 | 21 | public interface CityListCacheService { 22 | String CITYLIST_BASE_PATH = "http://www.weather.com.cn/data/city3jdata"; 23 | 24 | String PROVINCE = "http://www.weather.com.cn/data/city3jdata/china.html"; 25 | String CITY = "http://www.weather.com.cn/data/city3jdata/provshi/10120.html"; 26 | String COUNTY = "http://www.weather.com.cn/data/city3jdata/station/1012002.html"; 27 | 28 | @LifeCache(duration = 20, timeUnit = TimeUnit.SECONDS) 29 | Observable> getProvices(Observable provices, DynamicKey dk, 30 | EvictProvider ep); 31 | 32 | @LifeCache(duration = 2, timeUnit = TimeUnit.MINUTES) 33 | Observable> getCities(Observable provices, DynamicKey dk, EvictProvider ep); 34 | 35 | @LifeCache(duration = 2, timeUnit = TimeUnit.MINUTES) 36 | Observable> getCounties(Observable provices, DynamicKey dk, 37 | EvictProvider ep); 38 | 39 | } 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/DouEveCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午12:06 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午12:06 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.douban.Top250Entity; 11 | import bob.eve.walle.mvp.entity.douban.USBoxEntity; 12 | import io.reactivex.Observable; 13 | import io.rx_cache2.DynamicKey; 14 | import io.rx_cache2.EvictDynamicKey; 15 | import io.rx_cache2.EvictProvider; 16 | import io.rx_cache2.LifeCache; 17 | import io.rx_cache2.Reply; 18 | import java.util.concurrent.TimeUnit; 19 | 20 | /** 21 | * Created by Bob on 17/12/18. 22 | */ 23 | 24 | public interface DouEveCacheService { 25 | /** 26 | * Top250 27 | * 28 | * /v2/movie/top250 29 | * 30 | * params 31 | * start start int Y Y N/A 0 32 | * count count int Y Y N/A 10 33 | */ 34 | @LifeCache(duration = 12, timeUnit = TimeUnit.HOURS) 35 | Observable> getTop250Movies(Observable provices, DynamicKey dk, 36 | EvictDynamicKey ek); 37 | 38 | /** 39 | * 北美票房榜 40 | * 41 | * /v2/movie/us_box 42 | */ 43 | @LifeCache(duration = 12, timeUnit = TimeUnit.HOURS) 44 | Observable> getUSBox(Observable provices, DynamicKey dk, 45 | EvictDynamicKey ek); 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/GankioCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午10:58 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午10:54 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.gank.GankItemEntity; 11 | import io.reactivex.Observable; 12 | import io.rx_cache2.DynamicKey; 13 | import io.rx_cache2.EvictDynamicKey; 14 | import io.rx_cache2.EvictProvider; 15 | import io.rx_cache2.LifeCache; 16 | import io.rx_cache2.Reply; 17 | import java.util.concurrent.TimeUnit; 18 | 19 | /** 20 | * Created by Bob on 17/12/18. 21 | */ 22 | 23 | public interface GankioCacheService { 24 | @LifeCache(duration = 12, timeUnit = TimeUnit.HOURS) 25 | Observable> getGanksWithCategory(Observable provices, 26 | DynamicKey dk, EvictDynamicKey ek); 27 | 28 | @LifeCache(duration = 12, timeUnit = TimeUnit.HOURS) 29 | Observable> getGanksWithDate(Observable provices, 30 | DynamicKey dk, EvictDynamicKey ek); 31 | 32 | } -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/Pm25InCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 上午11:43 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 上午11:43 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.Pm25InAQIDetailsEntity; 11 | import io.reactivex.Observable; 12 | import io.rx_cache2.DynamicKey; 13 | import io.rx_cache2.EvictProvider; 14 | import io.rx_cache2.LifeCache; 15 | import io.rx_cache2.Reply; 16 | import java.util.List; 17 | import java.util.concurrent.TimeUnit; 18 | 19 | /** 20 | * Created by Bob on 17/12/12. 21 | */ 22 | 23 | public interface Pm25InCacheService { 24 | /** 25 | * @param source 26 | * 网络请求数据源Observable 27 | * @param dynamicKey 28 | * 缓存key 29 | * @param evictProvider 30 | * 是否更新{@link EvictProvider} 31 | */ 32 | @LifeCache(duration = 10, timeUnit = TimeUnit.MINUTES) 33 | Observable>> getAQIDetailsForCity( 34 | Observable> source, DynamicKey dynamicKey, 35 | EvictProvider evictProvider); 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/SojsonWeatherCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 上午11:42 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 上午11:36 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.SojsonWeatherEntity; 11 | import io.reactivex.Observable; 12 | import io.rx_cache2.DynamicKey; 13 | import io.rx_cache2.EvictProvider; 14 | import io.rx_cache2.LifeCache; 15 | import io.rx_cache2.Reply; 16 | import java.util.concurrent.TimeUnit; 17 | 18 | /** 19 | * Created by Bob on 17/12/13. 20 | */ 21 | 22 | public interface SojsonWeatherCacheService { 23 | 24 | @LifeCache(duration = 10, timeUnit = TimeUnit.MINUTES) 25 | Observable> getForecastWeathersFromSojson( 26 | Observable provices, DynamicKey dk, EvictProvider ep); 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/cache/TianApiCacheService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午11:12 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午11:11 6 | */ 7 | 8 | package bob.eve.walle.mvp.cache; 9 | 10 | import bob.eve.walle.mvp.entity.tian.TianGirlEntity; 11 | import io.reactivex.Observable; 12 | import io.rx_cache2.DynamicKey; 13 | import io.rx_cache2.EvictDynamicKey; 14 | import io.rx_cache2.LifeCache; 15 | import io.rx_cache2.Reply; 16 | import java.util.concurrent.TimeUnit; 17 | 18 | /** 19 | * Created by Bob on 17/12/18. 20 | */ 21 | 22 | public interface TianApiCacheService { 23 | // http://api.tianapi.com/meinv/?key=APIKEY&num=10 24 | 25 | @LifeCache(duration = 12, timeUnit = TimeUnit.HOURS) 26 | Observable> getTianGirls(Observable provices, DynamicKey dk, 27 | EvictDynamicKey ek); 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/HiGirlFromGankContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 下午10:50 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午5:11 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.gank.GankItem; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface HiGirlFromGankContract { 20 | interface View extends IView { 21 | void showGirls(List items); 22 | 23 | void showMoreGirls(List items); 24 | } 25 | 26 | interface Presenter extends IPresenter { 27 | void getGirls(String category); 28 | 29 | void getMoreGirls(String category); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/HiGirlFromTianContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-22 下午5:32 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午10:54 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.tian.TianGirl; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface HiGirlFromTianContract { 20 | interface View extends IView { 21 | void showGirls(List items); 22 | 23 | void showMoreGirls(List items); 24 | } 25 | 26 | interface Presenter extends IPresenter { 27 | void getGirls(); 28 | 29 | void getMoreGirls(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/ITCircleFromGankCategoryContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午11:10 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午11:10 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.gank.GankItem; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface ITCircleFromGankCategoryContract { 20 | interface View extends IView { 21 | void showTechs(List items); 22 | 23 | void showMoreTechs(List items); 24 | 25 | void showTopGirl(GankItem girl); 26 | } 27 | 28 | interface Presenter extends IPresenter { 29 | void getTechs(String category); 30 | 31 | void getMoreTechs(String category); 32 | 33 | void getTopGirl(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/MovieFromDoubanTop250Contract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 上午2:48 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 下午2:46 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.douban.MovieSubject; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface MovieFromDoubanTop250Contract { 20 | interface View extends IView { 21 | void showMovies(List items); 22 | 23 | void showMoreMovies(List items); 24 | } 25 | 26 | interface Presenter extends IPresenter { 27 | void getMovies(); 28 | 29 | void getMoreMovies(); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/MovieFromDoubanUSBoxContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 下午4:13 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 上午2:50 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.douban.MovieSubject; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface MovieFromDoubanUSBoxContract { 20 | interface View extends IView { 21 | void showMovies(List items); 22 | } 23 | 24 | interface Presenter extends IPresenter { 25 | void getMovies(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/contract/MovieFromGankContract.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 下午4:32 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 下午2:46 6 | */ 7 | 8 | package bob.eve.walle.mvp.contract; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import bob.eve.mvp.view.IView; 12 | import bob.eve.walle.mvp.model.bean.gank.GankItem; 13 | import java.util.List; 14 | 15 | /** 16 | * Created by Bob on 17/12/19. 17 | */ 18 | 19 | public interface MovieFromGankContract { 20 | interface View extends IView { 21 | void showMovies(List items); 22 | 23 | void showMoreMovies(List items); 24 | 25 | void showTopGirl(GankItem girl); 26 | } 27 | 28 | interface Presenter extends IPresenter { 29 | void getMovies(String category); 30 | 31 | void getMoreMovies(String category); 32 | 33 | void getTopGirl(); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/cities/City.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午2:08 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-13 下午4:28 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.cities; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Bob on 17/12/12. 14 | */ 15 | 16 | public class City { 17 | private String name; 18 | private String code; 19 | private String pinyin; 20 | private String firstLetter; 21 | 22 | private List counties; 23 | 24 | public List getCounties() { 25 | return counties; 26 | } 27 | 28 | public void setCounties(List counties) { 29 | this.counties = counties; 30 | } 31 | 32 | public String getName() { 33 | return name; 34 | } 35 | 36 | public void setName(String name) { 37 | this.name = name; 38 | } 39 | 40 | public String getCode() { 41 | return code; 42 | } 43 | 44 | public void setCode(String code) { 45 | this.code = code; 46 | } 47 | 48 | public String getPinyin() { 49 | return pinyin; 50 | } 51 | 52 | public void setPinyin(String pinyin) { 53 | this.pinyin = pinyin; 54 | } 55 | 56 | public String getFirstLetter() { 57 | return firstLetter; 58 | } 59 | 60 | public void setFirstLetter(String firstLetter) { 61 | this.firstLetter = firstLetter; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "City{" + "name='" + name + '\'' + ", code='" + code + '\'' + ", pinyin='" + pinyin + 67 | '\'' + ", firstLetter='" + firstLetter + '\'' + ", counties=" + counties + '}'; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/cities/County.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午2:08 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-13 下午4:28 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.cities; 9 | 10 | /** 11 | * Created by Bob on 17/12/12. 12 | */ 13 | 14 | public class County { 15 | private String name; 16 | private String code; 17 | private String pinyin; 18 | private String firstLetter; 19 | 20 | public String getName() { 21 | return name; 22 | } 23 | 24 | public void setName(String name) { 25 | this.name = name; 26 | } 27 | 28 | public String getCode() { 29 | return code; 30 | } 31 | 32 | public void setCode(String code) { 33 | this.code = code; 34 | } 35 | 36 | public String getPinyin() { 37 | return pinyin; 38 | } 39 | 40 | public void setPinyin(String pinyin) { 41 | this.pinyin = pinyin; 42 | } 43 | 44 | public String getFirstLetter() { 45 | return firstLetter; 46 | } 47 | 48 | public void setFirstLetter(String firstLetter) { 49 | this.firstLetter = firstLetter; 50 | } 51 | 52 | @Override 53 | public String toString() { 54 | return "County{" + "name='" + name + '\'' + ", code='" + code + '\'' + ", pinyin='" + pinyin + 55 | '\'' + ", firstLetter='" + firstLetter + '\'' + '}'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/cities/Province.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午2:08 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-13 下午4:28 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.cities; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Bob on 17/12/12. 14 | */ 15 | 16 | public class Province { 17 | private String name; 18 | private String code; 19 | private String pinyin; 20 | private String firstLetter; 21 | 22 | private List cities; 23 | 24 | public List getCities() { 25 | return cities; 26 | } 27 | 28 | public void setCities(List cities) { 29 | this.cities = cities; 30 | } 31 | 32 | public void setName(String name) { 33 | this.name = name; 34 | } 35 | 36 | public void setCode(String code) { 37 | this.code = code; 38 | } 39 | 40 | public String getName() { 41 | return name; 42 | } 43 | 44 | public String getCode() { 45 | return code; 46 | } 47 | 48 | public String getPinyin() { 49 | return pinyin; 50 | } 51 | 52 | public void setPinyin(String pinyin) { 53 | this.pinyin = pinyin; 54 | } 55 | 56 | public String getFirstLetter() { 57 | return firstLetter; 58 | } 59 | 60 | public void setFirstLetter(String firstLetter) { 61 | this.firstLetter = firstLetter; 62 | } 63 | 64 | @Override 65 | public String toString() { 66 | return "Province{" + "name='" + name + '\'' + ", code='" + code + '\'' + ", pinyin='" + pinyin + 67 | '\'' + ", firstLetter='" + firstLetter + '\'' + ", cities=" + cities + '}'; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/cities/Provinces.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午3:12 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 下午3:12 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.cities; 9 | 10 | import java.util.Arrays; 11 | import java.util.List; 12 | 13 | /** 14 | * Created by Bob on 17/12/14. 15 | */ 16 | 17 | public class Provinces { 18 | List provinces; 19 | 20 | public List getProvinces() { 21 | return provinces; 22 | } 23 | 24 | public void setProvinces(List provinces) { 25 | this.provinces = provinces; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | String string = provinces == null ? "" : Arrays.toString(provinces.toArray()); 31 | return "Provinces{" + "provinces=" + string + '}'; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/zhihu/ZhihuDetailExtraEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午10:50 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午9:52 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.zhihu; 9 | 10 | import com.google.gson.annotations.SerializedName; 11 | 12 | /** 13 | * Created by Bob on 17/12/18. 14 | */ 15 | public class ZhihuDetailExtraEntity { 16 | 17 | /** 18 | * long_comments : 0 19 | * popularity : 161 20 | * short_comments : 19 21 | * comments : 19 22 | */ 23 | 24 | @SerializedName("long_comments") 25 | private int long_comments; 26 | @SerializedName("popularity") 27 | private int popularity; 28 | @SerializedName("short_comments") 29 | private int short_comments; 30 | @SerializedName("comments") 31 | private int comments; 32 | 33 | public int getLong_comments() { 34 | return long_comments; 35 | } 36 | 37 | public void setLong_comments(int long_comments) { 38 | this.long_comments = long_comments; 39 | } 40 | 41 | public int getPopularity() { 42 | return popularity; 43 | } 44 | 45 | public void setPopularity(int popularity) { 46 | this.popularity = popularity; 47 | } 48 | 49 | public int getShort_comments() { 50 | return short_comments; 51 | } 52 | 53 | public void setShort_comments(int short_comments) { 54 | this.short_comments = short_comments; 55 | } 56 | 57 | public int getComments() { 58 | return comments; 59 | } 60 | 61 | public void setComments(int comments) { 62 | this.comments = comments; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/entity/zhihu/ZhihuDetailSourceEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午10:47 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午10:47 6 | */ 7 | 8 | package bob.eve.walle.mvp.entity.zhihu; 9 | 10 | import com.google.gson.annotations.SerializedName; 11 | 12 | /** 13 | * Created by Bob on 17/12/18. 14 | * 15 | * 当前知乎页面来源信息,比如主题 or 专栏 16 | */ 17 | 18 | public class ZhihuDetailSourceEntity { 19 | /** 20 | * "thumbnail": "http://pic3.zhimg.com/00eba01080138a5ac861d581a64ff9bd.jpg", 21 | * "id": 3, 22 | * "name": "电影日报" 23 | */ 24 | 25 | @SerializedName("thumbnail") 26 | private String thumbnail; 27 | @SerializedName("name") 28 | private String name; 29 | @SerializedName("id") 30 | private int id; 31 | 32 | public String getThumbnail() { 33 | return thumbnail; 34 | } 35 | 36 | public void setThumbnail(String thumbnail) { 37 | this.thumbnail = thumbnail; 38 | } 39 | 40 | public String getName() { 41 | return name; 42 | } 43 | 44 | public void setName(String name) { 45 | this.name = name; 46 | } 47 | 48 | public int getId() { 49 | return id; 50 | } 51 | 52 | public void setId(int id) { 53 | this.id = id; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/mapper/ProvinceMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午8:31 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午8:31 6 | */ 7 | 8 | package bob.eve.walle.mvp.mapper; 9 | 10 | import bob.eve.mvp.di.scope.PreActivity; 11 | import bob.eve.mvp.mapper.AbsEntityToModelMapper; 12 | import bob.eve.walle.mvp.entity.cities.Province; 13 | import javax.inject.Inject; 14 | 15 | /** 16 | * Created by Bob on 17/12/12. 17 | */ 18 | 19 | @PreActivity 20 | public class ProvinceMapper extends AbsEntityToModelMapper { 21 | @Inject 22 | public ProvinceMapper() { 23 | } 24 | 25 | @Override 26 | public Province transform(Province province) { 27 | return province; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/mapper/TianGirlMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-22 下午5:37 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午4:34 6 | */ 7 | 8 | package bob.eve.walle.mvp.mapper; 9 | 10 | import bob.eve.mvp.di.scope.PreFragment; 11 | import bob.eve.mvp.mapper.AbsEntityToModelMapper; 12 | import bob.eve.walle.mvp.entity.tian.TianGirlEntity; 13 | import bob.eve.walle.mvp.model.bean.tian.TianGirl; 14 | import javax.inject.Inject; 15 | 16 | /** 17 | * Created by Bob on 17/12/19. 18 | */ 19 | @PreFragment 20 | public class TianGirlMapper extends AbsEntityToModelMapper { 21 | 22 | @Inject 23 | public TianGirlMapper() { 24 | } 25 | 26 | @Override 27 | public TianGirl transform(TianGirlEntity.NewslistBean data) { 28 | TianGirl tianGirl = null; 29 | if (data != null) { 30 | tianGirl = new TianGirl(); 31 | tianGirl.setCtime(data.getCtime()); 32 | tianGirl.setDescription(data.getDescription()); 33 | tianGirl.setPicUrl(data.getPicUrl()); 34 | tianGirl.setTitle(data.getTitle()); 35 | } 36 | return tianGirl; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/bean/weather/ChooseCitiesCase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:55 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 下午9:50 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.bean.weather; 9 | 10 | /** 11 | * Created by Bob on 17/12/14. 12 | * 13 | * 关注的城市 14 | */ 15 | 16 | public class ChooseCitiesCase { 17 | private String name; 18 | private String code; 19 | private String pinyin; 20 | private String firstLetter; 21 | 22 | public String getName() { 23 | return name; 24 | } 25 | 26 | public void setName(String name) { 27 | this.name = name; 28 | } 29 | 30 | public String getCode() { 31 | return code; 32 | } 33 | 34 | public void setCode(String code) { 35 | this.code = code; 36 | } 37 | 38 | public String getPinyin() { 39 | return pinyin; 40 | } 41 | 42 | public void setPinyin(String pinyin) { 43 | this.pinyin = pinyin; 44 | } 45 | 46 | public String getFirstLetter() { 47 | return firstLetter; 48 | } 49 | 50 | public void setFirstLetter(String firstLetter) { 51 | this.firstLetter = firstLetter; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/bean/zhihu/ZhihuEditor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:40 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:40 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.bean.zhihu; 9 | 10 | /** 11 | * Created by Bob on 17/12/18. 12 | */ 13 | 14 | public class ZhihuEditor { 15 | /** 16 | * url : http://www.zhihu.com/people/deng-ruo-xu 17 | * bio : 好奇心日报 18 | * id : 82 19 | * avatar : http://pic2.zhimg.com/d3b31fa32_m.jpg 20 | * name : 邓若虚 21 | */ 22 | 23 | private String url; 24 | private String bio; 25 | private int id; 26 | private String avatar; 27 | private String name; 28 | 29 | public String getUrl() { 30 | return url; 31 | } 32 | 33 | public void setUrl(String url) { 34 | this.url = url; 35 | } 36 | 37 | public String getBio() { 38 | return bio; 39 | } 40 | 41 | public void setBio(String bio) { 42 | this.bio = bio; 43 | } 44 | 45 | public int getId() { 46 | return id; 47 | } 48 | 49 | public void setId(int id) { 50 | this.id = id; 51 | } 52 | 53 | public String getAvatar() { 54 | return avatar; 55 | } 56 | 57 | public void setAvatar(String avatar) { 58 | this.avatar = avatar; 59 | } 60 | 61 | public String getName() { 62 | return name; 63 | } 64 | 65 | public void setName(String name) { 66 | this.name = name; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/bean/zhihu/ZhihuHot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:45 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:45 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.bean.zhihu; 9 | 10 | /** 11 | * Created by Bob on 17/12/18. 12 | */ 13 | 14 | public class ZhihuHot { 15 | private int newsId; 16 | private String url; 17 | private String thumbnail; 18 | private String title; 19 | 20 | public int getNewsId() { 21 | return newsId; 22 | } 23 | 24 | public void setNewsId(int newsId) { 25 | this.newsId = newsId; 26 | } 27 | 28 | public String getUrl() { 29 | return url; 30 | } 31 | 32 | public void setUrl(String url) { 33 | this.url = url; 34 | } 35 | 36 | public String getThumbnail() { 37 | return thumbnail; 38 | } 39 | 40 | public void setThumbnail(String thumbnail) { 41 | this.thumbnail = thumbnail; 42 | } 43 | 44 | public String getTitle() { 45 | return title; 46 | } 47 | 48 | public void setTitle(String title) { 49 | this.title = title; 50 | } 51 | 52 | @Override 53 | public String toString() { 54 | return "ZhihuNews{" + "newsId=" + newsId + ", url='" + url + '\'' + ", thumbnail='" + 55 | thumbnail + '\'' + ", title='" + title + '\'' + '}'; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/bean/zhihu/ZhihuLatests.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:43 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:43 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.bean.zhihu; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Bob on 17/12/18. 14 | */ 15 | 16 | public class ZhihuLatests { 17 | private String date; 18 | private List stories; 19 | private List topStories; 20 | 21 | public String getDate() { 22 | return date; 23 | } 24 | 25 | public void setDate(String date) { 26 | this.date = date; 27 | } 28 | 29 | public List getStories() { 30 | return stories; 31 | } 32 | 33 | public void setStories(List stories) { 34 | this.stories = stories; 35 | } 36 | 37 | public List getTopStories() { 38 | return topStories; 39 | } 40 | 41 | public void setTopStories(List topStories) { 42 | this.topStories = topStories; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "ZhihuLatests{" + "date='" + date + '\'' + ", stories=" + stories + ", topStories=" + 48 | topStories + '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/bean/zhihu/ZhihuSectionList.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:42 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:42 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.bean.zhihu; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Created by Bob on 17/12/18. 14 | */ 15 | 16 | public class ZhihuSectionList { 17 | private int timestamp; 18 | private String name; 19 | private List stories; 20 | 21 | public int getTimestamp() { 22 | return timestamp; 23 | } 24 | 25 | public void setTimestamp(int timestamp) { 26 | this.timestamp = timestamp; 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public void setName(String name) { 34 | this.name = name; 35 | } 36 | 37 | public List getStories() { 38 | return stories; 39 | } 40 | 41 | public void setStories(List stories) { 42 | this.stories = stories; 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return "ZhihuSectionList{" + "timestamp=" + timestamp + ", name='" + name + '\'' + 48 | ", stories=" + stories + '}'; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/douban/MovieSearchModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午12:16 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午12:16 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.douban; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.douban.MovieSearchEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import javax.inject.Inject; 15 | 16 | /** 17 | * Created by Bob on 17/12/18. 18 | */ 19 | 20 | public class MovieSearchModel extends EveBaseModel { 21 | 22 | @Inject 23 | protected MovieSearchModel(IEveRepositoryManager repositoryManager) { 24 | super(repositoryManager); 25 | } 26 | 27 | @Override 28 | protected Observable buildModelDataObservable(Params params) { 29 | return null; 30 | } 31 | 32 | public static final class Params { 33 | private String q; 34 | private String tag; 35 | private int start; 36 | private int count; 37 | 38 | private Params(String q, String tag, int start, int count) { 39 | this.q = q; 40 | this.tag = tag; 41 | this.start = start; 42 | this.count = count; 43 | } 44 | 45 | public static Params forMovieSearch(String q, String tag, int start, int count) { 46 | return new Params(q, tag, start, count); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/gank/DateGanksModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午9:52 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午9:52 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.gank; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.gank.GankItemEntity; 12 | import bob.eve.walle.mvp.entity.tian.TianGirlEntity; 13 | import bob.eve.repository.IEveRepositoryManager; 14 | import io.reactivex.Observable; 15 | import io.rx_cache2.Reply; 16 | import javax.inject.Inject; 17 | 18 | /** 19 | * Created by Bob on 17/12/18. 20 | */ 21 | 22 | public class DateGanksModel extends EveBaseModel, DateGanksModel.Params> { 23 | 24 | @Inject 25 | protected DateGanksModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private int day; 36 | private int year; 37 | private int month; 38 | 39 | private Params(int day, int year, int month) { 40 | this.day = day; 41 | this.year = year; 42 | this.month = month; 43 | } 44 | 45 | public static Params forDateGanks(int day, int year, int month) { 46 | return new Params(day, year, month); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/gank/GankCategoryType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:09 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:09 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.gank; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public interface GankCategoryType { 15 | /** 16 | * category: all | Android | iOS | 休息视频 | 福利 | 拓展资源 | 前端 | 瞎推荐 | App 17 | */ 18 | 19 | String GANK_CATEGORY_ALL = "all"; 20 | int GANK_CATEGORY_ALL_TYPE = 1; 21 | 22 | String GANK_CATEGORY_MOVIE = "休息视频"; 23 | int GANK_CATEGORY_MOVIE_TYPE = 4; 24 | 25 | String GANK_CATEGORY_GIRLS = "福利"; 26 | int GANK_CATEGORY_GIRLS_TYPE = 5; 27 | 28 | String GANK_CATEGORY_RECOMMEND = "瞎推荐"; 29 | int GANK_CATEGORY_RECOMMEND_TYPE = 8; 30 | 31 | String GANK_CATEGORY_APP = "App"; 32 | int GANK_CATEGORY_APP_TYPE = 9; 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/gank/RandomGirlsModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午9:54 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午9:52 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.gank; 9 | 10 | import bob.eve.mvp.di.scope.PreFragment; 11 | import bob.eve.mvp.model.EveBaseModel; 12 | import bob.eve.walle.mvp.entity.gank.GankItemEntity; 13 | import bob.eve.walle.mvp.service.GankioService; 14 | import bob.eve.repository.IEveRepositoryManager; 15 | import io.reactivex.Observable; 16 | import javax.inject.Inject; 17 | 18 | /** 19 | * Created by Bob on 17/12/18. 20 | */ 21 | @PreFragment 22 | public class RandomGirlsModel extends EveBaseModel { 23 | 24 | @Inject 25 | protected RandomGirlsModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable buildModelDataObservable(Params params) { 31 | return repositoryManager.obtainRetrofitService(GankioService.class) 32 | .getRandomGirls(params.num); 33 | } 34 | 35 | public static final class Params { 36 | private int num; 37 | 38 | private Params(int num) { 39 | this.num = num; 40 | } 41 | 42 | public static Params forRandomGirls(int num) { 43 | return new Params(num); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/gank/SearchGanksModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:03 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午9:52 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.gank; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.gank.GankISearchItemEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import javax.inject.Inject; 15 | 16 | /** 17 | * Created by Bob on 17/12/18. 18 | */ 19 | 20 | public class SearchGanksModel extends EveBaseModel { 21 | 22 | @Inject 23 | protected SearchGanksModel(IEveRepositoryManager repositoryManager) { 24 | super(repositoryManager); 25 | } 26 | 27 | @Override 28 | protected Observable buildModelDataObservable(Params params) { 29 | return null; 30 | } 31 | 32 | public static final class Params { 33 | String query; 34 | String category; 35 | int num; 36 | int page; 37 | 38 | private Params(String query, String category, int num, int page) { 39 | this.query = query; 40 | this.category = category; 41 | this.num = num; 42 | this.page = page; 43 | } 44 | 45 | public static Params forSearchGanks(String query, String category, int num, int page) { 46 | return new Params(query, category, num, page); 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuDetailModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:56 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:56 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuDetailEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuDetailModel 22 | extends EveBaseModel, ZhihuDetailModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuDetailModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String id; 36 | 37 | private Params(String id) { 38 | this.id = id; 39 | } 40 | 41 | public static ZhihuDetailModel.Params forZhihuDetail(String id) { 42 | return new ZhihuDetailModel.Params(id); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuHotsModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:59 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuHotsEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuHotsModel extends EveBaseModel, ZhihuHotsModel.Params> { 22 | 23 | @Inject 24 | protected ZhihuHotsModel(IEveRepositoryManager repositoryManager) { 25 | super(repositoryManager); 26 | } 27 | 28 | @Override 29 | protected Observable> buildModelDataObservable(Params params) { 30 | return null; 31 | } 32 | 33 | public static final class Params { 34 | private String cacheKey; 35 | 36 | private Params(String cacheKey) { 37 | this.cacheKey = cacheKey; 38 | } 39 | 40 | public static ZhihuHotsModel.Params forCacheKey(String cacheKey) { 41 | return new ZhihuHotsModel.Params(cacheKey); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuLatestsModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:01 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuLatestsEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuLatestsModel 22 | extends EveBaseModel, ZhihuLatestsModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuLatestsModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String cacheKey; 36 | 37 | private Params(String cacheKey) { 38 | this.cacheKey = cacheKey; 39 | } 40 | 41 | public static ZhihuLatestsModel.Params forCacheKey(String cacheKey) { 42 | return new ZhihuLatestsModel.Params(cacheKey); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuLongCommentModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:00 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:00 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuCommentEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuLongCommentModel 22 | extends EveBaseModel, ZhihuLongCommentModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuLongCommentModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String id; 36 | 37 | private Params(String id) { 38 | this.id = id; 39 | } 40 | 41 | public static ZhihuLongCommentModel.Params forLongComment(String id) { 42 | return new ZhihuLongCommentModel.Params(id); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuSectionListModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:02 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:02 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuSectionListEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuSectionListModel 22 | extends EveBaseModel, ZhihuSectionListModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuSectionListModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String id; 36 | 37 | private Params(String id) { 38 | this.id = id; 39 | } 40 | 41 | public static ZhihuSectionListModel.Params forSectionList(String id) { 42 | return new ZhihuSectionListModel.Params(id); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuSectionsModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:01 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuSectionsEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuSectionsModel 22 | extends EveBaseModel, ZhihuSectionsModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuSectionsModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String cacheKey; 36 | 37 | private Params(String cacheKey) { 38 | this.cacheKey = cacheKey; 39 | } 40 | 41 | public static ZhihuSectionsModel.Params forCacheKey(String cacheKey) { 42 | return new ZhihuSectionsModel.Params(cacheKey); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuShortCommentModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 上午11:59 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:59 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuCommentEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuShortCommentModel 22 | extends EveBaseModel, ZhihuShortCommentModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuShortCommentModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String id; 36 | 37 | private Params(String id) { 38 | this.id = id; 39 | } 40 | 41 | public static ZhihuShortCommentModel.Params forShortComment(String id) { 42 | return new ZhihuShortCommentModel.Params(id); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuThemeListModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:02 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:01 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuThemeListEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuThemeListModel 22 | extends EveBaseModel, ZhihuThemeListModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuThemeListModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String id; 36 | 37 | private Params(String id) { 38 | this.id = id; 39 | } 40 | 41 | public static ZhihuThemeListModel.Params forThemeList(String id) { 42 | return new ZhihuThemeListModel.Params(id); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/model/zhihu/ZhihuThemesModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午12:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午12:01 6 | */ 7 | 8 | package bob.eve.walle.mvp.model.zhihu; 9 | 10 | import bob.eve.mvp.model.EveBaseModel; 11 | import bob.eve.walle.mvp.entity.zhihu.ZhihuThemesEntity; 12 | import bob.eve.repository.IEveRepositoryManager; 13 | import io.reactivex.Observable; 14 | import io.rx_cache2.Reply; 15 | import javax.inject.Inject; 16 | 17 | /** 18 | * Created by Bob on 17/12/18. 19 | */ 20 | 21 | public class ZhihuThemesModel 22 | extends EveBaseModel, ZhihuThemesModel.Params> { 23 | 24 | @Inject 25 | protected ZhihuThemesModel(IEveRepositoryManager repositoryManager) { 26 | super(repositoryManager); 27 | } 28 | 29 | @Override 30 | protected Observable> buildModelDataObservable(Params params) { 31 | return null; 32 | } 33 | 34 | public static final class Params { 35 | private String cacheKey; 36 | 37 | private Params(String cacheKey) { 38 | this.cacheKey = cacheKey; 39 | } 40 | 41 | public static ZhihuThemesModel.Params forCacheKey(String cacheKey) { 42 | return new ZhihuThemesModel.Params(cacheKey); 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/presenter/MainPresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 下午8:37 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午8:37 6 | */ 7 | 8 | package bob.eve.walle.mvp.presenter; 9 | 10 | import bob.eve.mvp.di.scope.PreActivity; 11 | import bob.eve.mvp.presenter.IPresenter; 12 | import bob.eve.mvp.view.IView; 13 | import javax.inject.Inject; 14 | 15 | /** 16 | * Created by Bob on 17/12/21. 17 | */ 18 | 19 | @PreActivity 20 | public class MainPresenter implements IPresenter { 21 | 22 | @Inject 23 | public MainPresenter() { 24 | } 25 | 26 | @Override 27 | public void resume() { 28 | 29 | } 30 | 31 | @Override 32 | public void pause() { 33 | 34 | } 35 | 36 | @Override 37 | public void destroy() { 38 | 39 | } 40 | 41 | @Override 42 | public void attach(IView view) { 43 | 44 | } 45 | 46 | @Override 47 | public void detach() { 48 | 49 | } 50 | 51 | @Override 52 | public boolean isAttach() { 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/presenter/SettingPresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-22 下午8:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午8:37 6 | */ 7 | 8 | package bob.eve.walle.mvp.presenter; 9 | 10 | import bob.eve.mvp.di.scope.PreFragment; 11 | import bob.eve.mvp.presenter.IPresenter; 12 | import bob.eve.mvp.view.IView; 13 | import javax.inject.Inject; 14 | 15 | /** 16 | * Created by Bob on 17/12/21. 17 | */ 18 | 19 | @PreFragment 20 | public class SettingPresenter implements IPresenter { 21 | 22 | @Inject 23 | public SettingPresenter() { 24 | } 25 | 26 | @Override 27 | public void resume() { 28 | 29 | } 30 | 31 | @Override 32 | public void pause() { 33 | 34 | } 35 | 36 | @Override 37 | public void destroy() { 38 | 39 | } 40 | 41 | @Override 42 | public void attach(IView view) { 43 | 44 | } 45 | 46 | @Override 47 | public void detach() { 48 | 49 | } 50 | 51 | @Override 52 | public boolean isAttach() { 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/presenter/weather/ProvincePresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:43 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午11:58 6 | */ 7 | 8 | package bob.eve.walle.mvp.presenter.weather; 9 | 10 | import bob.eve.mvp.di.scope.PreActivity; 11 | import bob.eve.mvp.presenter.EveBasePresenter; 12 | import bob.eve.mvp.rx.error.EveRxErrorObserver; 13 | import bob.eve.walle.ui.activity.MainActivity; 14 | import bob.eve.walle.mvp.entity.cities.Province; 15 | import bob.eve.walle.mvp.mapper.ProvinceMapper; 16 | import bob.eve.walle.mvp.model.weather.ProvinceModel; 17 | import java.util.List; 18 | import javax.inject.Inject; 19 | 20 | /** 21 | * Created by Bob on 17/12/12. 22 | */ 23 | 24 | @PreActivity 25 | public class ProvincePresenter 26 | extends EveBasePresenter { 27 | 28 | @Inject 29 | public ProvincePresenter(ProvinceModel store, ProvinceMapper mapper) { 30 | super(store, mapper); 31 | } 32 | 33 | public void getProvinces() { 34 | store.execute(new EveRxErrorObserver>(view) { 35 | @Override 36 | public void onComplete() { 37 | view.complete(); 38 | } 39 | 40 | @Override 41 | public void onNext(List provinces) { 42 | 43 | } 44 | 45 | @Override 46 | public void onError(Throwable e) { 47 | 48 | } 49 | }, ProvinceModel.Params.forUser(1)); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/service/AqicnService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-13 下午4:41 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-13 下午4:41 6 | */ 7 | 8 | package bob.eve.walle.mvp.service; 9 | 10 | import bob.eve.walle.mvp.entity.AqicnAQIDetailsEntity; 11 | import bob.eve.walle.mvp.entity.AqicnStationsEntiry; 12 | import io.reactivex.Observable; 13 | import retrofit2.http.GET; 14 | import retrofit2.http.Path; 15 | import retrofit2.http.Query; 16 | 17 | /** 18 | * Created by Bob on 17/12/13. 19 | */ 20 | 21 | public interface AqicnService { 22 | // https://api.waqi.info/feed/geo:40.09;116.174/?token=21acde2c4ac1fc1f47d4cbeb752e6bc000ea171d 经纬度获取 23 | 24 | // https://api.waqi.info/map/bounds/?latlng=39.379436,116.091230,40.235643,116.784382&token=demo 经纬度范围获取 25 | 26 | // https://api.waqi.info/search/?token=21acde2c4ac1fc1f47d4cbeb752e6bc000ea171d&keyword=beijing 全北京所有观察点数据,但是不能单独获取某一个观察点数据,可以全部获取进行地区匹配显示各观察点数据 27 | 28 | /** 29 | * 通过百度定位获取lat&lng 30 | * 31 | * @param lat 32 | * latitude 纬度 33 | * @param lng 34 | * longitude 经度 35 | */ 36 | @GET("https://api.waqi.info/feed/geo:{lat};{lng}/") 37 | Observable getAQIDetailsForCity(@Path("lat") double lat, 38 | @Path("lng") double lng, 39 | @Query("token") String token); 40 | 41 | /** 42 | * @param city 43 | * 查询城市所有观察点,拼音 44 | */ 45 | @GET("https://api.waqi.info/search/") 46 | Observable getAQIStationsForCity(@Query("keyword") String city, 47 | @Query("token") String token); 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/service/CityListService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午7:31 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午7:31 6 | */ 7 | 8 | package bob.eve.walle.mvp.service; 9 | 10 | import io.reactivex.Observable; 11 | import retrofit2.http.GET; 12 | import retrofit2.http.Path; 13 | 14 | /** 15 | * Created by Bob on 17/12/12. 16 | */ 17 | 18 | public interface CityListService { 19 | String CITYLIST_BASE_PATH = "http://www.weather.com.cn/data/city3jdata"; 20 | 21 | String PROVINCE = "http://www.weather.com.cn/data/city3jdata/china.html"; 22 | String CITY = "http://www.weather.com.cn/data/city3jdata/provshi/10120.html"; 23 | String COUNTY = "http://www.weather.com.cn/data/city3jdata/station/1012002.html"; 24 | 25 | @GET("china.html") 26 | Observable getProvices(); 27 | 28 | @GET("provshi/{id}.html") 29 | Observable getCities(@Path("id") String id); 30 | 31 | @GET("station/{id}.html") 32 | Observable getCounties(@Path("id") String id); 33 | } 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/service/SojsonWeatherService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-13 下午10:25 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-13 下午10:25 6 | */ 7 | 8 | package bob.eve.walle.mvp.service; 9 | 10 | import bob.eve.walle.mvp.entity.SojsonWeatherEntity; 11 | import io.reactivex.Observable; 12 | import retrofit2.http.GET; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by Bob on 17/12/13. 17 | */ 18 | 19 | public interface SojsonWeatherService { 20 | // params city=北京 21 | String SOJSON_WEATHER_BASE_URL = "http://www.sojson.com/open/api/weather/json.shtml"; 22 | 23 | /** 24 | * @param city 25 | * eg.北京 注意需要汉字 26 | */ 27 | @GET("http://www.sojson.com/open/api/weather/json.shtml") 28 | Observable getForecastWeathersFromSojson(@Query("city") String city); 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/mvp/service/TianApiService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午11:06 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午11:06 6 | */ 7 | 8 | package bob.eve.walle.mvp.service; 9 | 10 | import bob.eve.walle.mvp.entity.tian.TianGirlEntity; 11 | import io.reactivex.Observable; 12 | import retrofit2.http.GET; 13 | import retrofit2.http.Query; 14 | 15 | /** 16 | * Created by Bob on 17/12/18. 17 | */ 18 | 19 | public interface TianApiService { 20 | // http://api.tianapi.com/meinv/?key=APIKEY&num=10 21 | 22 | @GET("http://api.tianapi.com/meinv/") 23 | Observable getTianGirls(@Query("key") String key, @Query("num") int num, 24 | @Query("page") int page); 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/activity/WelcomeActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-22 下午11:40 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-22 下午11:39 6 | */ 7 | 8 | package bob.eve.walle.ui.activity; 9 | 10 | import android.content.Intent; 11 | import android.os.Bundle; 12 | import android.os.Handler; 13 | import android.support.annotation.Nullable; 14 | import android.support.v7.app.AppCompatActivity; 15 | import bob.eve.walle.R; 16 | 17 | /** 18 | * Created by Bob on 17/12/22. 19 | */ 20 | 21 | public class WelcomeActivity extends AppCompatActivity { 22 | private Handler handler = new Handler(); 23 | 24 | @Override 25 | protected void onCreate(@Nullable Bundle savedInstanceState) { 26 | super.onCreate(savedInstanceState); 27 | handler.postDelayed(new Runnable() { 28 | @Override 29 | public void run() { 30 | toMain(); 31 | } 32 | }, 1200); 33 | } 34 | 35 | private void toMain() { 36 | Intent intent = new Intent(); 37 | intent.setClass(this, MainActivity.class); 38 | startActivity(intent); 39 | finish(); 40 | overridePendingTransition(R.anim.fade_in, R.anim.fade_out); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/activity/slide/DrawerItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午5:39 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午12:37 6 | */ 7 | 8 | package bob.eve.walle.ui.activity.slide; 9 | 10 | import android.view.ViewGroup; 11 | 12 | public abstract class DrawerItem { 13 | 14 | protected boolean isChecked; 15 | 16 | public abstract T createViewHolder(ViewGroup parent); 17 | 18 | public abstract void bindViewHolder(T holder); 19 | 20 | public DrawerItem setChecked(boolean isChecked) { 21 | this.isChecked = isChecked; 22 | return this; 23 | } 24 | 25 | public boolean isChecked() { 26 | return isChecked; 27 | } 28 | 29 | public boolean isSelectable() { 30 | return true; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/activity/slide/SpaceItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午5:39 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 上午12:38 6 | */ 7 | 8 | package bob.eve.walle.ui.activity.slide; 9 | 10 | import android.content.Context; 11 | import android.view.View; 12 | import android.view.ViewGroup; 13 | 14 | public class SpaceItem extends DrawerItem { 15 | 16 | private int spaceDp; 17 | 18 | public SpaceItem(int spaceDp) { 19 | this.spaceDp = spaceDp; 20 | } 21 | 22 | @Override 23 | public ViewHolder createViewHolder(ViewGroup parent) { 24 | Context c = parent.getContext(); 25 | View view = new View(c); 26 | int height = (int) (c.getResources() 27 | .getDisplayMetrics().density * spaceDp); 28 | view.setLayoutParams(new ViewGroup.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, height)); 29 | return new ViewHolder(view); 30 | } 31 | 32 | @Override 33 | public void bindViewHolder(ViewHolder holder) { 34 | 35 | } 36 | 37 | @Override 38 | public boolean isSelectable() { 39 | return false; 40 | } 41 | 42 | static class ViewHolder extends DrawerAdapter.ViewHolder { 43 | 44 | public ViewHolder(View itemView) { 45 | super(itemView); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/adapter/EveEasyFragmentAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 下午1:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 下午1:01 6 | */ 7 | 8 | package bob.eve.walle.ui.adapter; 9 | 10 | import android.support.v4.app.Fragment; 11 | import android.support.v4.app.FragmentManager; 12 | import android.support.v4.app.FragmentPagerAdapter; 13 | import android.view.ViewGroup; 14 | import bob.eve.mvp.base.AbsEveBaseFragment; 15 | import java.util.Collections; 16 | import java.util.List; 17 | 18 | /** 19 | * Created by Bob on 17/12/19. 20 | */ 21 | 22 | public class EveEasyFragmentAdapter extends FragmentPagerAdapter { 23 | 24 | private List mFragments; 25 | 26 | public EveEasyFragmentAdapter(FragmentManager fm, List fragments) { 27 | super(fm); 28 | if (fragments == null) { 29 | fragments = Collections.emptyList(); 30 | } 31 | 32 | this.mFragments = fragments; 33 | } 34 | 35 | @Override 36 | public Fragment getItem(int position) { 37 | return mFragments.get(position); 38 | } 39 | 40 | @Override 41 | public int getCount() { 42 | return mFragments.size(); 43 | } 44 | 45 | @Override 46 | public int getItemPosition(Object object) { 47 | return POSITION_NONE; 48 | } 49 | 50 | @Override 51 | public void destroyItem(ViewGroup container, int position, Object object) { 52 | // super.destroyItem(container, position, object); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/adapter/MovieGankAdapter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 下午4:46 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 下午12:42 6 | */ 7 | 8 | package bob.eve.walle.ui.adapter; 9 | 10 | import android.support.annotation.LayoutRes; 11 | import android.support.v4.app.Fragment; 12 | import bob.eve.walle.R; 13 | import bob.eve.walle.mvp.model.bean.gank.GankItem; 14 | import bob.eve.walle.util.DateUtils; 15 | import com.chad.library.adapter.base.BaseQuickAdapter; 16 | import com.chad.library.adapter.base.BaseViewHolder; 17 | import java.text.ParseException; 18 | 19 | /** 20 | * Created by Bob on 17/12/19. 21 | */ 22 | 23 | public class MovieGankAdapter extends BaseQuickAdapter { 24 | private Fragment fragment; 25 | 26 | public MovieGankAdapter(Fragment fragment, @LayoutRes int layoutResId) { 27 | super(layoutResId); 28 | this.fragment = fragment; 29 | } 30 | 31 | @Override 32 | protected void convert(BaseViewHolder helper, GankItem item) { 33 | helper.setText(R.id.icc_title, item.getDesc()); 34 | try { 35 | helper.setText(R.id.icc_time, DateUtils.subStandardTime(item.getPublishedAt())); 36 | } catch (ParseException e) { 37 | helper.setText(R.id.icc_time, "N/A"); 38 | } 39 | helper.setText(R.id.icc_user, item.getWho()); 40 | helper.setText(R.id.icc_tag, item.getType()); 41 | } 42 | } 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/AboutFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午9:41 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午9:23 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | import android.os.Bundle; 11 | import android.view.View; 12 | import bob.eve.comm.lib.layout.tab.NavigationTabStrip; 13 | import bob.eve.comm.lib.layout.viewpager.ParallaxViewPager; 14 | import bob.eve.mvp.base.AbsEveEasyFragment; 15 | import bob.eve.walle.R; 16 | import butterknife.BindView; 17 | 18 | /** 19 | * Created by Bob on 17/12/18. 20 | */ 21 | 22 | public class AboutFragment extends AbsEveEasyFragment { 23 | @BindView(R.id.parallaxViewPager) 24 | ParallaxViewPager mParallaxViewPager; 25 | @BindView(R.id.navigationTabStrip) 26 | NavigationTabStrip mNavigationTabStrip; 27 | 28 | public static AboutFragment newInstance() { 29 | Bundle args = new Bundle(); 30 | AboutFragment fragment = new AboutFragment(); 31 | fragment.setArguments(args); 32 | return fragment; 33 | } 34 | 35 | @Override 36 | public int layoutResID() { 37 | return R.layout.fragment_it_circle_tab_layout; 38 | } 39 | 40 | @Override 41 | public void attachView() { 42 | 43 | } 44 | 45 | @Override 46 | public void initView(View view) { 47 | 48 | } 49 | 50 | @Override 51 | public void initLazyView(View view) { 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ITCircleFromGankSearchFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:48 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:48 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ITCircleFromGankSearchFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/MovieFromDoubanSearchFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:50 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:50 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class MovieFromDoubanSearchFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ReadFromGankFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:54 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:53 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ReadFromGankFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ReadFromZhihuHotsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:52 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:52 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ReadFromZhihuHotsFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ReadFromZhihuLatestsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:53 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:53 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ReadFromZhihuLatestsFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ReadFromZhihuSectionsFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:53 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:53 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ReadFromZhihuSectionsFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/ReadFromZhihuThemesFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 上午10:53 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午10:53 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public class ReadFromZhihuThemesFragment { 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/fragment/tab/ReadTabFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午9:21 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午9:21 6 | */ 7 | 8 | package bob.eve.walle.ui.fragment.tab; 9 | 10 | import android.os.Bundle; 11 | import android.view.View; 12 | import bob.eve.comm.lib.layout.tab.NavigationTabStrip; 13 | import bob.eve.comm.lib.layout.viewpager.ParallaxViewPager; 14 | import bob.eve.mvp.base.AbsEveEasyFragment; 15 | import bob.eve.walle.R; 16 | import butterknife.BindView; 17 | 18 | /** 19 | * Created by Bob on 17/12/18. 20 | */ 21 | 22 | public class ReadTabFragment extends AbsEveEasyFragment { 23 | @BindView(R.id.parallaxViewPager) 24 | ParallaxViewPager mParallaxViewPager; 25 | @BindView(R.id.navigationTabStrip) 26 | NavigationTabStrip mNavigationTabStrip; 27 | 28 | public static ReadTabFragment newInstance() { 29 | Bundle args = new Bundle(); 30 | ReadTabFragment fragment = new ReadTabFragment(); 31 | fragment.setArguments(args); 32 | return fragment; 33 | } 34 | 35 | @Override 36 | public int layoutResID() { 37 | return R.layout.fragment_it_circle_tab_layout; 38 | } 39 | 40 | @Override 41 | public void attachView() { 42 | 43 | } 44 | 45 | @Override 46 | public void initView(View view) { 47 | 48 | } 49 | 50 | @Override 51 | public void initLazyView(View view) { 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/widget/imageloader/CustomGlideModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 上午11:54 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 上午11:54 6 | */ 7 | 8 | package bob.eve.walle.ui.widget.imageloader; 9 | 10 | import android.content.Context; 11 | import com.bumptech.glide.GlideBuilder; 12 | import com.bumptech.glide.annotation.GlideModule; 13 | import com.bumptech.glide.load.engine.cache.LruResourceCache; 14 | import com.bumptech.glide.load.engine.cache.MemorySizeCalculator; 15 | import com.bumptech.glide.module.AppGlideModule; 16 | 17 | /** 18 | * Created by Bob on 17/12/21. 19 | */ 20 | @GlideModule 21 | public class CustomGlideModule extends AppGlideModule { 22 | @Override 23 | public boolean isManifestParsingEnabled() { 24 | return false; 25 | } 26 | 27 | @Override 28 | public void applyOptions(Context context, GlideBuilder builder) { 29 | MemorySizeCalculator calculator = 30 | new MemorySizeCalculator.Builder(context).setMemoryCacheScreens(6) // 缓存图片数量 31 | .build(); 32 | builder.setMemoryCache(new LruResourceCache(calculator.getMemoryCacheSize())); 33 | 34 | /* 35 | int memoryCacheSizeBytes = 1024 * 1024 * 20; // 20mb 36 | builder.setMemoryCache(new LruResourceCache(memoryCacheSizeBytes)); 37 | */ 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/ui/widget/imageloader/IImageLoder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 上午11:31 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 上午11:31 6 | */ 7 | 8 | package bob.eve.walle.ui.widget.imageloader; 9 | 10 | import android.content.Context; 11 | import android.support.annotation.DrawableRes; 12 | import android.support.v4.app.Fragment; 13 | import android.view.View; 14 | import android.widget.ImageView; 15 | 16 | /** 17 | * Created by Bob on 17/12/21. 18 | */ 19 | 20 | public interface IImageLoder { 21 | 22 | void displayImage(Context context, String url, ImageView imageView); 23 | 24 | void displayImageWithoutCrop(Context context, String url, ImageView imageView); 25 | 26 | void displayImage(Context context, @DrawableRes int resID, ImageView imageView); 27 | 28 | void displayImage(Fragment fragment, String url, ImageView imageView); 29 | 30 | void displayImageWithoutCrop(Fragment fragment, String url, ImageView imageView); 31 | 32 | void displayImage(Fragment fragment, @DrawableRes int resID, ImageView imageView); 33 | 34 | void displayImage(View view, String url, ImageView imageView); 35 | 36 | void displayImageWithoutCrop(View view, String url, ImageView imageView); 37 | 38 | void displayImage(View view, @DrawableRes int resID, ImageView imageView); 39 | 40 | void displayImageWithoutPlace(Fragment fragment, String url, ImageView imageView); 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/bob/eve/walle/util/SnackbarUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-22 下午3:23 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-22 下午3:23 6 | */ 7 | 8 | package bob.eve.walle.util; 9 | 10 | import android.support.design.widget.Snackbar; 11 | import android.view.View; 12 | 13 | /** 14 | * Created by Bob on 17/12/22. 15 | */ 16 | 17 | public class SnackbarUtil { 18 | public static void show(View view, String msg) { 19 | Snackbar.make(view, msg, Snackbar.LENGTH_LONG) 20 | .show(); 21 | } 22 | 23 | public static void showShort(View view, String msg) { 24 | Snackbar.make(view, msg, Snackbar.LENGTH_SHORT) 25 | .show(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dock_bottom_enter.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/dock_bottom_exit.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 11 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_in.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/anim/fade_out.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-xhdpi/ic_eve_any.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/drawable-xhdpi/ic_eve_any.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxhdpi/ic_eve_any.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/drawable-xxhdpi/ic_eve_any.png -------------------------------------------------------------------------------- /app/src/main/res/drawable-xxxhdpi/ic_eve_any.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/drawable-xxxhdpi/ic_eve_any.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_info_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_categroy_android.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_categroy_expand.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_categroy_ios.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_item_movie_64.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_load_place_background.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_load_place_night_background.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_about.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_movie.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_read.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_menu_setting.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_notifications_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_sync_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tag_box.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toolbar_copy.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toolbar_save.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toolbar_share.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_toolbar_unfav.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_transparent.xml: -------------------------------------------------------------------------------- 1 | 6 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/line_05.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_shadow_black.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/welcome_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_image_detail_layout.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | 15 | 23 | 24 | 31 | 32 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 40 | 41 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_tencent_web_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 16 | 21 | 22 | 23 | 24 | 25 | 26 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /app/src/main/res/layout/common_state_recyclerview.xml: -------------------------------------------------------------------------------- 1 | 7 | 15 | 16 | 21 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_common_recycler_layout.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_higirl_gank_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 13 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/res/layout/include_toolbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_hi_girl_layout.xml: -------------------------------------------------------------------------------- 1 | 7 | 18 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_slide_left_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 10 | 11 | 16 | 17 | 21 | 22 | 30 | 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/view_line_05.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/res/menu/girl_menu.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 11 | 16 | 17 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/menu/main_menu.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 11 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/menu/web_meun.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | 11 | 16 | 17 | 22 | 23 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_load_place_day.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_load_place_day_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_load_place_night.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-anydpi-v26/ic_load_place_night_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_load_place_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_load_place_day.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_load_place_day_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_load_place_day_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_load_place_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_load_place_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_load_place_night_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/ic_load_place_night_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/walle_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-hdpi/walle_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-night-xxhdpi/ic_check_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-night-xxhdpi/ic_check_update.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-night-xxhdpi/ic_clear_cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-night-xxhdpi/ic_clear_cache.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-night-xxhdpi/ic_feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-night-xxhdpi/ic_feedback.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-night-xxhdpi/ic_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-night-xxhdpi/ic_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-night-xxhdpi/walle_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-night-xxhdpi/walle_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_load_place_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_load_place_day.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_load_place_day_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_load_place_day_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_load_place_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_load_place_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_load_place_night_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/ic_load_place_night_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/walle_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xhdpi/walle_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_check_update.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_check_update.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_clear_cache.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_clear_cache.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_feedback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_feedback.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_load_place_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_load_place_day.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_load_place_day_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_load_place_day_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_load_place_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_load_place_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_load_place_night_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_load_place_night_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/ic_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/walle_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxhdpi/walle_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_load_place_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_load_place_day.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_load_place_day_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_load_place_day_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_load_place_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_load_place_night.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_load_place_night_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/app/src/main/res/mipmap-xxxhdpi/ic_load_place_night_round.png -------------------------------------------------------------------------------- /app/src/main/res/values-night/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #424242 4 | #1b1b1b 5 | #26a69a 6 | 7 | #c2c2c2 8 | #f5f5f5 9 | #ffffff 10 | 11 | #616161 12 | #373737 13 | 14 | #c2c2c2 15 | #f5f5f5 16 | #ffffff 17 | 18 | #f06292 19 | #00b8d4 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #00b8d4 4 | #0088a3 5 | #f06292 6 | 7 | #1b1b1b 8 | #424242 9 | #696D6F 10 | 11 | #F7F7F8 12 | #F0F0F0 13 | 14 | #12161A 15 | #3C4350 16 | #2C3239 17 | 18 | #00b8d4 19 | #f06292 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 16dp 10 | 16dp 11 | 12 | 16dp 13 | 6dp 14 | 15 | 4dp 16 | 6dp 17 | 8dp 18 | 16dp 19 | 20 | 12sp 21 | 14sp 22 | 20sp 23 | 2dp 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #26A69A 4 | -------------------------------------------------------------------------------- /app/src/main/res/values/ids.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | EveHttp 3 | 4 | 收藏 5 | 分享 6 | 保存 7 | 复制 8 | 搜索 9 | pm2.5 10 | 110 11 | from Aqicn.org 12 | 常规 13 | 自动缓存 14 | 无图模式 15 | WIFI自动加载图片 16 | 夜间模式 17 | 其他 18 | 意见反馈 19 | 清除缓存 20 | 检查更新 21 | 当前版本号:v1.0.1 22 | 感谢你的意见 23 | 当前版本号 v%s 24 | 25 | 26 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | apply from: 'config.gradle' 3 | 4 | buildscript { 5 | 6 | repositories { 7 | google() 8 | jcenter() 9 | maven { url "https://jitpack.io" } 10 | } 11 | dependencies { 12 | classpath 'com.android.tools.build:gradle:3.0.0' 13 | 14 | 15 | // NOTE: Do not place your application dependencies here; they belong 16 | // in the individual module build.gradle files 17 | } 18 | } 19 | 20 | allprojects { 21 | repositories { 22 | google() 23 | jcenter() 24 | maven { url "https://jitpack.io" } 25 | } 26 | } 27 | 28 | task clean(type: Delete) { 29 | delete rootProject.buildDir 30 | } 31 | -------------------------------------------------------------------------------- /evelib/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /evelib/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /evelib/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/configuration/AbsBuilderConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午6:21 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午6:11 6 | */ 7 | 8 | package bob.eve.comm.lib.configuration; 9 | 10 | /** 11 | * Created by Bob on 17/12/11. 12 | */ 13 | 14 | public abstract class AbsBuilderConfig { 15 | 16 | public abstract static class AbsBuilder { 17 | 18 | protected abstract T build(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/configuration/IApplicationLifecycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午7:11 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午7:11 6 | */ 7 | 8 | package bob.eve.comm.lib.configuration; 9 | 10 | import android.app.Application; 11 | import android.content.Context; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | */ 16 | 17 | public interface IApplicationLifecycle { 18 | void attachBaseContext(Context base); 19 | 20 | void onCreate(Application application); 21 | 22 | void onTerminate(Application application); 23 | } 24 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/configuration/IConfiguration.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午6:22 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午5:21 6 | */ 7 | 8 | package bob.eve.comm.lib.configuration; 9 | 10 | import android.content.Context; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public interface IConfiguration { 17 | void applyOptions(Context context, T builder); 18 | } 19 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/layout/tab/OnEveCoordinatorTabLayoutLoadImageListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午6:58 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午2:45 6 | */ 7 | 8 | package bob.eve.comm.lib.layout.tab; 9 | 10 | import android.support.design.widget.TabLayout; 11 | import android.widget.ImageView; 12 | 13 | /** 14 | * Created by Bob on 17/12/18. 15 | */ 16 | 17 | public interface OnEveCoordinatorTabLayoutLoadImageListener { 18 | void loadHeaderImages(ImageView imageView, TabLayout.Tab tab); 19 | } 20 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/layout/viewpager/Mode.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午6:56 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午6:56 6 | */ 7 | 8 | package bob.eve.comm.lib.layout.viewpager; 9 | 10 | /** 11 | * Created by Bob on 17/12/18. 12 | */ 13 | 14 | public enum Mode { 15 | 16 | LEFT_OVERLAY(0), RIGHT_OVERLAY(1), NONE(2); 17 | int value; 18 | 19 | Mode(int value) { 20 | this.value = value; 21 | } 22 | } -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/layout/viewpager/adapter/ViewPagerHolder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 下午12:44 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午11:40 6 | */ 7 | 8 | package bob.eve.comm.lib.layout.viewpager.adapter; 9 | 10 | import android.content.Context; 11 | import android.view.View; 12 | 13 | /** 14 | * Created by Bob on 17/12/19. 15 | */ 16 | 17 | public interface ViewPagerHolder { 18 | /** 19 | * 创建Item View 20 | */ 21 | View createView(Context context); 22 | 23 | /** 24 | * 绑定数据 25 | */ 26 | void onBindData(Context context, View view, int position, T data); 27 | } 28 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/layout/viewpager/adapter/ViewPagerHolderCreator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-19 下午12:44 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-19 上午11:42 6 | */ 7 | 8 | package bob.eve.comm.lib.layout.viewpager.adapter; 9 | 10 | /** 11 | * Created by Bob on 17/12/19. 12 | */ 13 | 14 | public interface ViewPagerHolderCreator { 15 | VPH createViewPagerHolder(); 16 | } 17 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/DeviceUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-17 下午2:22 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-17 下午2:22 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.content.Context; 11 | import android.util.DisplayMetrics; 12 | import android.view.WindowManager; 13 | 14 | /** 15 | * Created by Bob on 17/12/17. 16 | */ 17 | 18 | public class DeviceUtils { 19 | 20 | public static int dp2px(Context context, float dp) { 21 | return (int) (getDisplayMetrics(context).density * dp); 22 | } 23 | 24 | public static int px2dp(Context context, float px) { 25 | return (int) (px / getDisplayMetrics(context).density + 0.5f); 26 | } 27 | 28 | public static DisplayMetrics getDisplayMetrics(Context context) { 29 | WindowManager wm = (WindowManager) context.getSystemService(Context.WINDOW_SERVICE); 30 | DisplayMetrics metrics = new DisplayMetrics(); 31 | wm.getDefaultDisplay() 32 | .getMetrics(metrics); 33 | return metrics; 34 | } 35 | 36 | public static int getStatusBarHeight(Context context) { 37 | int result = 0; 38 | int resourceId = context.getResources() 39 | .getIdentifier("status_bar_height", "dimen", "android"); 40 | if (resourceId > 0) { 41 | result = context.getResources() 42 | .getDimensionPixelSize(resourceId); 43 | } 44 | return result; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/HanziToPinyinUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-14 下午2:24 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-14 下午2:24 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import java.util.ArrayList; 11 | 12 | /** 13 | * Created by Bob on 17/12/14. 14 | */ 15 | 16 | public class HanziToPinyinUtils { 17 | public static String getPinYin(String hanzi) { 18 | ArrayList tokens = HanziToPinyin.getInstance() 19 | .get(hanzi); 20 | StringBuilder sb = new StringBuilder(); 21 | if (tokens != null && tokens.size() > 0) { 22 | for (HanziToPinyin.Token token : tokens) { 23 | if (HanziToPinyin.Token.PINYIN == token.type) { 24 | sb.append(token.target); 25 | } else { 26 | sb.append(token.source); 27 | } 28 | } 29 | } 30 | 31 | return sb.toString() 32 | .toUpperCase(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/IOUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午10:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午10:01 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import java.io.Closeable; 11 | import java.io.IOException; 12 | 13 | /** 14 | * Created by Bob on 17/12/9. 15 | */ 16 | 17 | public class IOUtils { 18 | 19 | private IOUtils() { 20 | throw new AssertionError(); 21 | } 22 | 23 | /** 24 | * Close closable object and wrap {@link IOException} with {@link RuntimeException} 25 | * 26 | * @param closeable 27 | * closeable object 28 | */ 29 | public static void close(Closeable closeable) { 30 | if (closeable != null) { 31 | try { 32 | closeable.close(); 33 | } catch (IOException e) { 34 | throw new RuntimeException("IOException occurred. ", e); 35 | } 36 | } 37 | } 38 | 39 | /** 40 | * Close closable and hide possible {@link IOException} 41 | * 42 | * @param closeable 43 | * closeable object 44 | */ 45 | public static void closeQuietly(Closeable closeable) { 46 | if (closeable != null) { 47 | try { 48 | closeable.close(); 49 | } catch (IOException e) { 50 | // Ignored 51 | } 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/Preconditions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 上午10:15 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 上午2:26 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.support.annotation.Nullable; 11 | 12 | /** 13 | * Created by Bob on 17/12/9. 14 | */ 15 | 16 | // TODO move to commlibs 17 | public class Preconditions { 18 | private Preconditions() { 19 | throw new IllegalStateException("you can't instantiate me!"); 20 | } 21 | 22 | public static void checkArgument(boolean expression) { 23 | if (!expression) { 24 | throw new IllegalArgumentException(); 25 | } 26 | } 27 | 28 | public static void checkArgument(boolean expression, @Nullable String errorMessage) { 29 | if (!expression) { 30 | throw new IllegalArgumentException(errorMessage); 31 | } 32 | } 33 | 34 | public static T checkNotNull(T reference) { 35 | if (reference == null) { 36 | throw new NullPointerException(); 37 | } else { 38 | return reference; 39 | } 40 | } 41 | 42 | public static T checkNotNull(T reference, @Nullable String errorMessage) { 43 | if (reference == null) { 44 | throw new NullPointerException(errorMessage); 45 | } else { 46 | 47 | return reference; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/RSBlur.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-21 上午11:26 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-21 上午11:26 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.annotation.TargetApi; 11 | import android.content.Context; 12 | import android.graphics.Bitmap; 13 | import android.os.Build; 14 | import android.renderscript.Allocation; 15 | import android.renderscript.Element; 16 | import android.renderscript.RSRuntimeException; 17 | import android.renderscript.RenderScript; 18 | import android.renderscript.ScriptIntrinsicBlur; 19 | 20 | /** 21 | * Created by Bob on 17/12/21. 22 | */ 23 | public class RSBlur { 24 | @TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1) 25 | public static Bitmap blur(Context context, Bitmap blurredBitmap, int radius) 26 | throws RSRuntimeException { 27 | try { 28 | RenderScript rs = RenderScript.create(context); 29 | Allocation input = 30 | Allocation.createFromBitmap(rs, blurredBitmap, Allocation.MipmapControl.MIPMAP_NONE, 31 | Allocation.USAGE_SCRIPT); 32 | Allocation output = Allocation.createTyped(rs, input.getType()); 33 | ScriptIntrinsicBlur blur = ScriptIntrinsicBlur.create(rs, Element.U8_4(rs)); 34 | 35 | blur.setInput(input); 36 | blur.setRadius(radius); 37 | blur.forEach(output); 38 | output.copyTo(blurredBitmap); 39 | rs.destroy(); 40 | } catch (RSRuntimeException e) { 41 | blurredBitmap = FastBlur.blur(blurredBitmap, radius, true); 42 | } 43 | return blurredBitmap; 44 | } 45 | } -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/ScreenUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午10:15 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午10:15 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.content.Context; 11 | import android.util.DisplayMetrics; 12 | 13 | /** 14 | * Created by Bob on 17/12/9. 15 | */ 16 | 17 | public class ScreenUtils { 18 | 19 | private ScreenUtils() { 20 | throw new AssertionError(); 21 | } 22 | 23 | public static DisplayMetrics displayMetrics(Context context) { 24 | if (context == null) { 25 | return null; 26 | } 27 | return context.getResources() 28 | .getDisplayMetrics(); 29 | } 30 | 31 | public static float density(Context context) { 32 | if (context == null) { 33 | return -1; 34 | } 35 | return context.getResources() 36 | .getDisplayMetrics().density; 37 | } 38 | 39 | public static float dpToPx(Context context, float dp) { 40 | if (context == null) { 41 | return -1; 42 | } 43 | return dp * context.getResources() 44 | .getDisplayMetrics().density; 45 | } 46 | 47 | public static float pxToDp(Context context, float px) { 48 | if (context == null) { 49 | return -1; 50 | } 51 | return px / context.getResources() 52 | .getDisplayMetrics().density; 53 | } 54 | 55 | public static int dpToPxInt(Context context, float dp) { 56 | return (int) (dpToPx(context, dp) + 0.5f); 57 | } 58 | 59 | public static int pxToDpCeilInt(Context context, float px) { 60 | return (int) (pxToDp(context, px) + 0.5f); 61 | } 62 | } -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/SystemShareUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-20 下午8:18 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-20 下午8:18 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.content.Context; 11 | import android.content.Intent; 12 | import android.net.Uri; 13 | 14 | /** 15 | * Created by Bob on 17/12/20. 16 | */ 17 | 18 | public class SystemShareUtils { 19 | private static final String EMAIL_ADDRESS = "bodroid@163.com"; 20 | 21 | public static void shareText(Context context, String text, String title) { 22 | Intent intent = new Intent(Intent.ACTION_SEND); 23 | intent.setType("text/plain"); 24 | intent.putExtra(Intent.EXTRA_TITLE, "来自Eve的分享"); 25 | intent.putExtra(Intent.EXTRA_TEXT, text); 26 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 27 | context.startActivity(Intent.createChooser(intent, title)); 28 | } 29 | 30 | public static void shareImage(Context context, Uri uri, String title) { 31 | Intent intent = new Intent(Intent.ACTION_SEND); 32 | intent.setType("image/*"); 33 | intent.putExtra(Intent.EXTRA_STREAM, uri); 34 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 35 | context.startActivity(Intent.createChooser(intent, title)); 36 | } 37 | 38 | public static void sendEmail(Context context, String title) { 39 | Intent intent = new Intent(Intent.ACTION_SENDTO); 40 | intent.setData(Uri.parse("mailto:" + EMAIL_ADDRESS)); 41 | intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 42 | context.startActivity(Intent.createChooser(intent, title)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /evelib/src/main/java/bob/eve/comm/lib/util/ToastUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-20 下午8:11 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-20 下午8:11 6 | */ 7 | 8 | package bob.eve.comm.lib.util; 9 | 10 | import android.annotation.SuppressLint; 11 | import android.content.Context; 12 | import android.widget.Toast; 13 | 14 | /** 15 | * Created by Bob on 17/12/20. 16 | */ 17 | 18 | public class ToastUtils { 19 | 20 | private static Toast toast; 21 | 22 | private ToastUtils() { 23 | } 24 | 25 | public static void show(Context context, int resId) { 26 | create(context, context.getResources() 27 | .getString(resId)).show(); 28 | } 29 | 30 | public static void show(Context context, String msg) { 31 | create(context, msg).show(); 32 | } 33 | 34 | @SuppressLint("ShowToast") 35 | private static Toast create(Context context, String text) { 36 | if (toast != null) { 37 | toast.setText(text); 38 | return toast; 39 | } 40 | toast = Toast.makeText(context, text, Toast.LENGTH_SHORT); 41 | return toast; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /evelib/src/main/res/anim/anim_alpha_dismiss.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /evelib/src/main/res/anim/anim_alpha_show.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 8 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/rotate_add_to_remove.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/rotate_remove_to_add.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/slide_in_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator-v21/slide_out_top.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/rotate_add_to_remove.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/rotate_remove_to_add.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/slide_in_bottom.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/animator/slide_out_top.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/appbar_layout_elevated.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/ic_arrow_white_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/ic_eve_logo.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/ic_state_layout_empty.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/ic_state_layout_error.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 16 | 17 | -------------------------------------------------------------------------------- /evelib/src/main/res/drawable/state_layout_error_retry_btn.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /evelib/src/main/res/layout/state_layout_emtpy.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 19 | 20 | 34 | -------------------------------------------------------------------------------- /evelib/src/main/res/layout/state_layout_loading.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 13 | 23 | 24 | 35 | 36 | -------------------------------------------------------------------------------- /evelib/src/main/res/values/color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | #88757575 5 | #ffffff 6 | 7 | -------------------------------------------------------------------------------- /evelib/src/main/res/values/dimen.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 4dp 11 | 4dp 12 | 13 | -------------------------------------------------------------------------------- /evelib/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | EveCommonLibrary 10 | ImageView 11 | The source is not specified. 12 | 暂无数据 13 | 点击重试 14 | 加载中... 15 | 16 | 17 | -------------------------------------------------------------------------------- /evelib/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | 10 | 13 | 14 | 17 | 18 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /evemvp/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /evemvp/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午10:10 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午10:10 6 | */ 7 | 8 | apply plugin: 'com.android.library' 9 | 10 | android { 11 | compileSdkVersion rootProject.ext.android["compileSdkVersion"] 12 | 13 | defaultConfig { 14 | minSdkVersion rootProject.ext.android["minSdkVersion"] 15 | targetSdkVersion rootProject.ext.android["targetSdkVersion"] 16 | versionCode rootProject.ext.android["versionCode"] 17 | versionName rootProject.ext.android["versionName"] 18 | 19 | testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" 20 | } 21 | 22 | buildTypes { 23 | release { 24 | minifyEnabled false 25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 26 | } 27 | } 28 | } 29 | 30 | dependencies { 31 | implementation fileTree(dir: 'libs', include: ['*.jar']) 32 | 33 | implementation project(':everepository') 34 | implementation project(':evelib') 35 | 36 | api rootProject.ext.dependencies["statusbaruitl"] 37 | // api rootProject.ext.dependencies["swipebacklayout"] 38 | 39 | // annotationProcessor来代替android-apt 40 | annotationProcessor rootProject.ext.dependencies["dagger2-compiler"] 41 | annotationProcessor(rootProject.ext.dependencies["butterknife-compiler"]) { 42 | exclude module: 'support-annotations' 43 | } 44 | 45 | // test 46 | testApi rootProject.ext.dependencies["junit"] 47 | testApi rootProject.ext.dependencies["runner"] 48 | testApi rootProject.ext.dependencies["espresso-core"] 49 | } 50 | -------------------------------------------------------------------------------- /evemvp/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /evemvp/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 10 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/AbsEveBaseFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午9:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午9:01 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | import javax.inject.Inject; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | */ 16 | 17 | public abstract class AbsEveBaseFragment

extends AbsEveEasyFragment { 18 | 19 | @Inject 20 | protected P mPresenter; 21 | 22 | @Override 23 | public void onDestroyView() { 24 | if (mPresenter != null) { 25 | mPresenter.destroy(); 26 | } 27 | super.onDestroyView(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/EveLazyBaseFragement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:00 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:00 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import android.os.Bundle; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public abstract class EveLazyBaseFragement extends AbsEveBaseFragment { 17 | private boolean isPrepared = false; 18 | private boolean isFirstVisible = false; 19 | private boolean isFirstInvisible = false; 20 | 21 | @Override 22 | public void onActivityCreated(Bundle savedInstanceState) { 23 | super.onActivityCreated(savedInstanceState); 24 | initPrepare(); 25 | } 26 | 27 | private synchronized void initPrepare() { 28 | if (isPrepared) { 29 | lazeFirstVisible(); 30 | } else { 31 | isPrepared = true; 32 | } 33 | } 34 | 35 | @Override 36 | public void setUserVisibleHint(boolean isVisibleToUser) { 37 | super.setUserVisibleHint(isVisibleToUser); 38 | if (isVisibleToUser) { 39 | if (isFirstVisible) { 40 | isFirstVisible = false; 41 | initPrepare(); 42 | } else { 43 | lazeVisible(); 44 | } 45 | } else { 46 | if (isFirstInvisible) { 47 | isFirstInvisible = false; 48 | lazeFirstInvisible(); 49 | } else { 50 | lazeInvisible(); 51 | } 52 | } 53 | } 54 | 55 | protected abstract void lazeFirstVisible(); 56 | 57 | protected abstract void lazeVisible(); 58 | 59 | protected abstract void lazeInvisible(); 60 | 61 | private void lazeFirstInvisible() { 62 | } 63 | } 64 | 65 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/IActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午7:37 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午7:37 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import bob.eve.mvp.di.component.AppComponent; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public interface IActivity { 17 | void injectComponent(AppComponent appComponent); 18 | 19 | C getComponent(); 20 | 21 | int layoutResID(); 22 | 23 | void initView(); 24 | } 25 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/IApplication.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午3:37 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午3:37 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import bob.eve.mvp.di.component.AppComponent; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public interface IApplication { 17 | AppComponent getAppComponent(); 18 | } 19 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/IFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午6:42 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午9:09 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import android.app.Application; 11 | import android.view.View; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | */ 16 | 17 | public interface IFragment { 18 | 19 | int layoutResID(); 20 | 21 | void attachView(); 22 | 23 | /** 24 | * toolbar 或者无动画 25 | */ 26 | void initView(View view); 27 | 28 | /** 29 | * 设置Adapter 尺寸改变等 30 | */ 31 | void initLazyView(View view); 32 | 33 | Application application(); 34 | } 35 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/base/StateBaseActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-18 下午6:22 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-18 下午6:22 6 | */ 7 | 8 | package bob.eve.mvp.base; 9 | 10 | import bob.eve.mvp.presenter.IPresenter; 11 | 12 | /** 13 | * Created by Bob on 17/12/18. 14 | */ 15 | 16 | public abstract class StateBaseActivity

extends AbsEveBaseActivity { 17 | 18 | } 19 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/di/component/AppComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午4:46 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午4:46 6 | */ 7 | 8 | package bob.eve.mvp.di.component; 9 | 10 | import android.app.Application; 11 | import bob.eve.mvp.base.EveActivityManager; 12 | import bob.eve.mvp.base.proxy.ApplicationProxy; 13 | import bob.eve.mvp.di.module.ApplicationModule; 14 | import bob.eve.repository.EveLogInterceptor; 15 | import bob.eve.repository.IEveRepositoryManager; 16 | import bob.eve.repository.di.module.EveRepositoryConfigModule; 17 | import bob.eve.repository.di.module.EveRepositoryModule; 18 | import com.google.gson.Gson; 19 | import dagger.Component; 20 | import java.io.File; 21 | import javax.inject.Singleton; 22 | 23 | /** 24 | * Created by Bob on 17/12/11. 25 | */ 26 | 27 | @Singleton 28 | @Component(modules = { 29 | ApplicationModule.class, EveRepositoryModule.class, EveRepositoryConfigModule.class 30 | }) 31 | public interface AppComponent { 32 | 33 | void inject(ApplicationProxy proxy); 34 | 35 | Application application(); 36 | 37 | EveActivityManager eveActivityManager(); 38 | 39 | EveLogInterceptor eveLogInterceptor(); 40 | 41 | IEveRepositoryManager eveRepositoryManager(); 42 | 43 | Gson gson(); 44 | 45 | /* 总缓存目录,包括RxCache、图片等其他都应该在该缓存目录下 */ 46 | File cacheFile(); 47 | } 48 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/di/module/ApplicationModule.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:49 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:49 6 | */ 7 | 8 | package bob.eve.mvp.di.module; 9 | 10 | import android.app.Application; 11 | import dagger.Module; 12 | import dagger.Provides; 13 | import javax.inject.Singleton; 14 | 15 | /** 16 | * Created by Bob on 17/12/11. 17 | */ 18 | 19 | @Module 20 | public class ApplicationModule { 21 | private Application application; 22 | 23 | public ApplicationModule(Application application) { 24 | this.application = application; 25 | } 26 | 27 | @Singleton 28 | @Provides 29 | public Application provideApplication() { 30 | return application; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/di/scope/PreActivity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:57 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:57 6 | */ 7 | 8 | package bob.eve.mvp.di.scope; 9 | 10 | import java.lang.annotation.Documented; 11 | import java.lang.annotation.Retention; 12 | import javax.inject.Scope; 13 | 14 | import static java.lang.annotation.RetentionPolicy.RUNTIME; 15 | 16 | /** 17 | * Created by Bob on 17/12/11. 18 | */ 19 | 20 | @Scope 21 | @Documented 22 | @Retention(RUNTIME) 23 | public @interface PreActivity { 24 | } 25 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/di/scope/PreFragment.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 上午10:01 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 上午2:29 6 | */ 7 | 8 | package bob.eve.mvp.di.scope; 9 | 10 | import java.lang.annotation.Documented; 11 | import java.lang.annotation.Retention; 12 | import java.lang.annotation.RetentionPolicy; 13 | import javax.inject.Scope; 14 | 15 | /** 16 | * Created by Bob on 17/12/9. 17 | */ 18 | 19 | @Scope 20 | @Documented 21 | @Retention(RetentionPolicy.RUNTIME) 22 | public @interface PreFragment { 23 | } 24 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/executor/JobExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午11:31 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-6 下午12:21 6 | */ 7 | package bob.eve.mvp.executor; 8 | 9 | import android.support.annotation.NonNull; 10 | import java.util.concurrent.ArrayBlockingQueue; 11 | import java.util.concurrent.ThreadFactory; 12 | import java.util.concurrent.ThreadPoolExecutor; 13 | import java.util.concurrent.TimeUnit; 14 | import javax.inject.Inject; 15 | import javax.inject.Singleton; 16 | 17 | /** 18 | * Decorated {@link java.util.concurrent.ThreadPoolExecutor} 19 | */ 20 | @Singleton 21 | public class JobExecutor implements ThreadExecutor { 22 | private final ThreadPoolExecutor threadPoolExecutor; 23 | 24 | @Inject 25 | JobExecutor() { 26 | this.threadPoolExecutor = 27 | new ThreadPoolExecutor(3, 5, 10, TimeUnit.SECONDS, new ArrayBlockingQueue(5), 28 | new JobThreadFactory()); 29 | } 30 | 31 | @Override 32 | public void execute(@NonNull Runnable runnable) { 33 | this.threadPoolExecutor.execute(runnable); 34 | } 35 | 36 | private static class JobThreadFactory implements ThreadFactory { 37 | private int counter = 0; 38 | 39 | @Override 40 | public Thread newThread(@NonNull Runnable runnable) { 41 | return new Thread(runnable, "android_" + counter++); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/executor/MainThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午11:36 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午11:36 6 | */ 7 | 8 | package bob.eve.mvp.executor; 9 | 10 | import io.reactivex.Scheduler; 11 | import io.reactivex.android.schedulers.AndroidSchedulers; 12 | import javax.inject.Inject; 13 | import javax.inject.Singleton; 14 | 15 | @Singleton 16 | public class MainThread implements PostExecutionThread { 17 | 18 | @Inject 19 | MainThread() { 20 | } 21 | 22 | @Override 23 | public Scheduler getScheduler() { 24 | return AndroidSchedulers.mainThread(); 25 | } 26 | } -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/executor/PostExecutionThread.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午11:30 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-6 下午12:21 6 | */ 7 | package bob.eve.mvp.executor; 8 | 9 | import io.reactivex.Scheduler; 10 | 11 | public interface PostExecutionThread { 12 | Scheduler getScheduler(); 13 | } 14 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/executor/ThreadExecutor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午11:30 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-6 下午12:21 6 | */ 7 | package bob.eve.mvp.executor; 8 | 9 | import java.util.concurrent.Executor; 10 | 11 | public interface ThreadExecutor extends Executor {} 12 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/mapper/AbsEntityToModelMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 上午12:15 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 上午12:15 6 | */ 7 | 8 | package bob.eve.mvp.mapper; 9 | 10 | import java.util.ArrayList; 11 | import java.util.Collection; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | * {@link #transform(Object)}实现Data to Model具体方式,对Model中数据安全业务等方面检查以方便UI展示Model 16 | * 17 | * 提供2中转换方式{@link Collection}和{@link Model} 18 | */ 19 | 20 | public abstract class AbsEntityToModelMapper 21 | implements IEntityToModelMapper { 22 | private static final String LOG_TAG = "DataToModelMapper"; 23 | 24 | @Override 25 | public Collection transform(Collection dataCollection) { 26 | Collection modelCollection; 27 | if (dataCollection != null && !dataCollection.isEmpty()) { 28 | modelCollection = new ArrayList<>(); 29 | for (Entity data : dataCollection) { 30 | modelCollection.add(transform(data)); 31 | } 32 | } else { 33 | modelCollection = new ArrayList<>(); 34 | } 35 | return modelCollection; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/mapper/IEntityToModelMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午10:55 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午10:55 6 | */ 7 | 8 | package bob.eve.mvp.mapper; 9 | 10 | import java.util.Collection; 11 | 12 | /** 13 | * Created by Bob on 17/12/10. 14 | */ 15 | 16 | public interface IEntityToModelMapper { 17 | Model transform(Entity data); 18 | 19 | Collection transform(Collection data); 20 | } 21 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/model/IModel.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午2:02 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午2:02 6 | */ 7 | 8 | package bob.eve.mvp.model; 9 | 10 | import io.reactivex.disposables.Disposable; 11 | import io.reactivex.observers.DisposableObserver; 12 | 13 | /** 14 | * Created by Bob on 17/12/10. 15 | */ 16 | 17 | public interface IModel { 18 | 19 | // Observable buildModelDataObservable(P params); 20 | 21 | void execute(DisposableObserver observer, PARAMS params); 22 | 23 | void addDisposable(Disposable disposable); 24 | 25 | void dispose(); 26 | } 27 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/presenter/EveBasePresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午10:57 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午10:57 6 | */ 7 | 8 | package bob.eve.mvp.presenter; 9 | 10 | import bob.eve.mvp.mapper.IEntityToModelMapper; 11 | import bob.eve.mvp.model.IModel; 12 | import bob.eve.mvp.view.IView; 13 | 14 | /** 15 | * Created by Bob on 17/12/10. 16 | */ 17 | 18 | public class EveBasePresenter 19 | implements IPresenter { 20 | private boolean isAttach = false; 21 | protected V view; 22 | protected Model store; 23 | protected Mapper mapper; 24 | 25 | public EveBasePresenter(Model store, Mapper mapper) { 26 | this.store = store; 27 | this.mapper = mapper; 28 | } 29 | 30 | @Override 31 | public void attach(V view) { 32 | this.view = view; 33 | isAttach = true; 34 | } 35 | 36 | @Override 37 | public void detach() { 38 | this.view = null; 39 | isAttach = false; 40 | } 41 | 42 | @Override 43 | public boolean isAttach() { 44 | return isAttach; 45 | } 46 | 47 | @Override 48 | public void resume() { 49 | 50 | } 51 | 52 | @Override 53 | public void pause() { 54 | 55 | } 56 | 57 | @Override 58 | public void destroy() { 59 | detach(); 60 | mapper = null; 61 | if (store != null) { 62 | store.dispose(); 63 | store = null; 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/presenter/IPresenter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午10:42 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午10:42 6 | */ 7 | 8 | package bob.eve.mvp.presenter; 9 | 10 | import bob.eve.mvp.mapper.IEntityToModelMapper; 11 | import bob.eve.mvp.model.IModel; 12 | import bob.eve.mvp.view.IView; 13 | 14 | /** 15 | * Created by Bob on 17/12/10. 16 | * 17 | * View与Model交互 18 | * 19 | * {@link IView }UI展示 Model 20 | * {@link IModel } 数据获取 Data 21 | * {@link IEntityToModelMapper } 数据转换 Data -> Model 22 | */ 23 | 24 | public interface IPresenter { 25 | 26 | /** 27 | * On view's (Activity or Fragment) onResume() will be call. 28 | */ 29 | void resume(); 30 | 31 | /** 32 | * On view's (Activity or Fragment) onPause() will be call. 33 | */ 34 | void pause(); 35 | 36 | /** 37 | * On view's (Activity or Fragment) onDestroy() will be call. 38 | */ 39 | void destroy(); 40 | 41 | /** 42 | * On view's (Activity or Fragment) bind will be call. 43 | */ 44 | void attach(V v); 45 | 46 | /** 47 | * On view's (Activity or Fragment) unbind will be call. 48 | */ 49 | void detach(); 50 | 51 | /** 52 | * @return view is attached return true,else false. 53 | */ 54 | boolean isAttach(); 55 | } 56 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/EveErrorFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午12:58 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午12:58 6 | */ 7 | 8 | package bob.eve.mvp.rx.error; 9 | 10 | import io.reactivex.Observable; 11 | import io.reactivex.functions.Function; 12 | 13 | /** 14 | * Created by Bob on 17/12/12. 15 | */ 16 | 17 | public class EveErrorFunction implements Function> { 18 | // @Inject 19 | // public Application application; 20 | 21 | @Override 22 | public Observable apply(Throwable throwable) throws Exception { 23 | return Observable.error(EveErrorMapper.create(null, throwable)); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/EveRxErrorFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:22 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:22 6 | */ 7 | 8 | package bob.eve.mvp.rx.error; 9 | 10 | import android.content.Context; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public class EveRxErrorFactory { 17 | private static final String TAG = "EveErrorFactory"; 18 | 19 | private Context mContext; 20 | private EveRxErrorListener mErrorListener; 21 | 22 | public EveRxErrorFactory(Context mContext, EveRxErrorListener mErrorListener) { 23 | this.mErrorListener = mErrorListener; 24 | this.mContext = mContext; 25 | } 26 | 27 | public void onError(Throwable throwable) { 28 | mErrorListener.rxError(mContext, throwable); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/EveRxErrorFlowable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:32 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:31 6 | */ 7 | 8 | package bob.eve.mvp.rx.error; 9 | 10 | import io.reactivex.annotations.NonNull; 11 | import io.reactivex.subscribers.DisposableSubscriber; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | */ 16 | 17 | public abstract class EveRxErrorFlowable extends DisposableSubscriber { 18 | private EveRxErrorFactory mErrorFactory; 19 | 20 | public EveRxErrorFlowable(EveRxErrorHandler errorHandler) { 21 | this.mErrorFactory = errorHandler.getErrorFactory(); 22 | } 23 | 24 | @Override 25 | public void onComplete() { 26 | 27 | } 28 | 29 | /** 30 | * 如果不调用supper,则子类自行处理错误 31 | */ 32 | @Override 33 | public void onError(@NonNull Throwable t) { 34 | t.printStackTrace(); 35 | mErrorFactory.onError(t); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/EveRxErrorListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:20 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:20 6 | */ 7 | 8 | package bob.eve.mvp.rx.error; 9 | 10 | import android.content.Context; 11 | 12 | /** 13 | * Created by Bob on 17/12/11. 14 | */ 15 | 16 | public interface EveRxErrorListener { 17 | void rxError(Context context, Throwable t); 18 | 19 | EveRxErrorListener EMPTY = new EveRxErrorListener() { 20 | @Override 21 | public void rxError(Context context, Throwable t) { 22 | 23 | } 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/EveRxErrorObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 下午10:17 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 下午10:17 6 | */ 7 | 8 | package bob.eve.mvp.rx.error; 9 | 10 | import bob.eve.mvp.view.IView; 11 | import io.reactivex.observers.DisposableObserver; 12 | 13 | /** 14 | * Created by Bob on 17/12/11. 15 | */ 16 | 17 | public abstract class EveRxErrorObserver extends DisposableObserver { 18 | private IView view; 19 | 20 | public EveRxErrorObserver(IView view) { 21 | this.view = view; 22 | } 23 | 24 | @Override 25 | protected void onStart() { 26 | if (view != null) { 27 | view.start(); 28 | } 29 | } 30 | 31 | @Override 32 | public void onComplete() { 33 | if (view != null) { 34 | view.complete(); 35 | } 36 | } 37 | 38 | @Override 39 | public void onError(Throwable e) { 40 | if (view != null) { 41 | view.error(e); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/exception/EveStatusException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-12 下午1:04 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-12 下午1:03 6 | */ 7 | 8 | package bob.eve.mvp.rx.error.exception; 9 | 10 | /** 11 | * Created by Bob on 17/12/12. 12 | */ 13 | 14 | public class EveStatusException extends Throwable { 15 | public static final int DEFAULT_ERROR_CODE = -1; 16 | private int errorCode = DEFAULT_ERROR_CODE; 17 | 18 | public EveStatusException(String message, Throwable cause, int errorCode) { 19 | super(message, cause); 20 | this.errorCode = errorCode; 21 | } 22 | 23 | public int errorCode() { 24 | return errorCode; 25 | } 26 | 27 | public void setErrorCode(int errorCode) { 28 | this.errorCode = errorCode; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/exception/NetworkConnectionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 上午1:38 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 上午1:38 6 | */ 7 | 8 | package bob.eve.mvp.rx.error.exception; 9 | 10 | /** 11 | * Created by Bob on 17/12/11. 12 | */ 13 | 14 | public class NetworkConnectionException extends Exception { 15 | private static final String LOG_TAG = "NetworkConnectionException"; 16 | 17 | public NetworkConnectionException() { 18 | super(); 19 | } 20 | 21 | public NetworkConnectionException(final Throwable cause) { 22 | super(cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/rx/error/exception/ParamsException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-11 上午1:47 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-11 上午1:39 6 | */ 7 | 8 | package bob.eve.mvp.rx.error.exception; 9 | 10 | /** 11 | * Created by Bob on 17/12/11. 12 | */ 13 | 14 | public class ParamsException extends Exception { 15 | private static final String LOG_TAG = "ParamsException"; 16 | 17 | public ParamsException() { 18 | super(); 19 | } 20 | 21 | public ParamsException(final Throwable cause) { 22 | super(cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /evemvp/src/main/java/bob/eve/mvp/view/IView.java: -------------------------------------------------------------------------------- 1 | package bob.eve.mvp.view; 2 | 3 | import bob.eve.mvp.presenter.IPresenter; 4 | import bob.eve.mvp.rx.error.exception.EveStatusException; 5 | 6 | /** 7 | * Created by Bob on 17/12/10. 8 | * 9 | * {@link IPresenter}负责按照{@link IView}要求进行数据处理,反馈结果到{@link IView} 10 | * {@link IView}向{@link IPresenter}提出请求,按照自己的逻辑处理{@link IPresenter}反馈,如页面展示 11 | */ 12 | 13 | public interface IView { 14 | /** 15 | * 通知UI Presenter开始处理,具体展示逻辑由UI自己处理 16 | */ 17 | void start(); 18 | 19 | /** 20 | * 通知UI Presenter处理完成 21 | */ 22 | void complete(); 23 | 24 | /** 25 | * 通知UI Presenter处理失败,{@link EveStatusException}中按照具体Store业务封装了ERROR_CODE 26 | */ 27 | void error(Throwable e); 28 | } 29 | -------------------------------------------------------------------------------- /evemvp/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 | EveMvp 10 | 11 | // error message 12 | TUnknown error 13 | There is no internet connection 14 | The params error 15 | 16 | -------------------------------------------------------------------------------- /everepository/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /everepository/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # You can control the set of applied configuration files using the 3 | # proguardFiles setting in build.gradle. 4 | # 5 | # For more details, see 6 | # http://developer.android.com/guide/developing/tools/proguard.html 7 | 8 | # If your project uses WebView with JS, uncomment the following 9 | # and specify the fully qualified class name to the JavaScript interface 10 | # class: 11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 12 | # public *; 13 | #} 14 | 15 | # Uncomment this to preserve the line number information for 16 | # debugging stack traces. 17 | #-keepattributes SourceFile,LineNumberTable 18 | 19 | # If you keep the line number information, uncomment this to 20 | # hide the original source file name. 21 | #-renamesourcefileattribute SourceFile 22 | -------------------------------------------------------------------------------- /everepository/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/EveInterceptorOnRequestResponseHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午5:09 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午5:09 6 | */ 7 | 8 | package bob.eve.repository; 9 | 10 | import okhttp3.Interceptor; 11 | import okhttp3.Request; 12 | import okhttp3.Response; 13 | import okhttp3.ResponseBody; 14 | 15 | /** 16 | * Created by Bob on 17/12/9. 17 | */ 18 | 19 | public interface EveInterceptorOnRequestResponseHandler { 20 | // 在服务器响应后,客户端处理前,可处理验证操作(eg. token) 21 | Response whenOkHttpResponse(ResponseBody body, Interceptor.Chain chain, Response response); 22 | 23 | // 在客户端请求后,服务器接收前,可处理统一参数、请求头等 24 | Request beforeOkHttpRequest(Interceptor.Chain chain, Request request); 25 | } 26 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/EveLogInterceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午5:40 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午5:40 6 | */ 7 | 8 | package bob.eve.repository; 9 | 10 | import android.support.annotation.Nullable; 11 | import java.io.IOException; 12 | import java.util.concurrent.TimeUnit; 13 | import javax.inject.Inject; 14 | import javax.inject.Singleton; 15 | import okhttp3.Interceptor; 16 | import okhttp3.Request; 17 | import okhttp3.Response; 18 | import okhttp3.ResponseBody; 19 | import timber.log.Timber; 20 | 21 | /** 22 | * Created by Bob on 17/12/9. 23 | */ 24 | 25 | @Singleton 26 | public class EveLogInterceptor implements Interceptor { 27 | private final String TAG = "EveLogInterceptor"; 28 | 29 | private EveInterceptorOnRequestResponseHandler hanlder; 30 | 31 | @Inject 32 | public EveLogInterceptor(@Nullable EveInterceptorOnRequestResponseHandler hanlder) { 33 | this.hanlder = hanlder; 34 | } 35 | 36 | @Override 37 | public Response intercept(Chain chain) throws IOException { 38 | Request request = chain.request(); 39 | 40 | long t1 = System.nanoTime(); 41 | Response originalResponse = chain.proceed(request); 42 | long t2 = System.nanoTime(); 43 | 44 | // TODO 配置打印级别和Log开关 45 | Timber.e(request.url() 46 | .toString() + "请求时间:" + TimeUnit.NANOSECONDS.toMillis(t2 - t1)); 47 | 48 | ResponseBody responseBody = originalResponse.body(); 49 | 50 | if (hanlder != null) { 51 | hanlder.whenOkHttpResponse(responseBody, chain, originalResponse); 52 | } 53 | return originalResponse; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/IEveRepositoryManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午3:04 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午3:01 6 | */ 7 | 8 | package bob.eve.repository; 9 | 10 | import android.content.Context; 11 | 12 | /** 13 | * Created by Bob on 17/12/9. 14 | */ 15 | 16 | public interface IEveRepositoryManager { 17 | T obtainRetrofitService(Class service); 18 | 19 | T obtainCacheService(Class service); 20 | 21 | void clearCache(); 22 | 23 | Context getContext(); 24 | } 25 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/cache/IEveCache.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-9 下午3:04 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-9 下午2:46 6 | */ 7 | 8 | package bob.eve.repository.cache; 9 | 10 | import android.support.annotation.Nullable; 11 | import java.util.Set; 12 | 13 | /** 14 | * Created by Bob on 17/12/9. 15 | */ 16 | 17 | public interface IEveCache { 18 | interface Factory { 19 | IEveCache build(IEveCacheType type); 20 | } 21 | 22 | @Nullable 23 | Y get(T k); 24 | 25 | @Nullable 26 | Y put(T k, Y v); 27 | 28 | @Nullable 29 | Y remove(T k); 30 | 31 | int size(); 32 | 33 | int getMaxSize(); 34 | 35 | Set keySet(); 36 | 37 | boolean contains(T k); 38 | 39 | void evict(); 40 | 41 | void clear(); 42 | } 43 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/converter/AESRequestConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午5:24 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午5:24 6 | */ 7 | 8 | package bob.eve.repository.converter; 9 | 10 | import bob.eve.repository.encoding.AES; 11 | import com.google.gson.Gson; 12 | import java.io.IOException; 13 | import okhttp3.MediaType; 14 | import okhttp3.RequestBody; 15 | import retrofit2.Converter; 16 | 17 | /** 18 | * Created by Bob on 17/12/10. 19 | */ 20 | 21 | public class AESRequestConverter implements Converter { 22 | private static final String LOG_TAG = "RequestConverter"; 23 | private static final MediaType MEDIA_TYPE = MediaType.parse("application/wxt;charset=UTF-8"); 24 | private static final MediaType MEDIA_TYPE1 = MediaType.parse("application/json;charset=UTF-8"); 25 | private boolean isAes; 26 | private Gson gson; 27 | 28 | public AESRequestConverter(boolean isAes, Gson gson) { 29 | this.isAes = isAes; 30 | this.gson = gson; 31 | } 32 | 33 | /** 34 | * @param value 35 | * 加密可能失败,需要进行处理 36 | */ 37 | @Override 38 | public RequestBody convert(T value) throws IOException { 39 | if (isAes) { 40 | AES aes = new AES(); 41 | try { 42 | return RequestBody.create(MEDIA_TYPE, aes.encrypt(gson.toJson(value) 43 | .getBytes(), AES.ALGORITHM)); 44 | } catch (Exception e) { 45 | return null; 46 | } 47 | } else { 48 | return RequestBody.create(MEDIA_TYPE1, gson.toJson(value)); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/converter/AESResponseConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-10 下午5:23 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-10 下午5:23 6 | */ 7 | 8 | package bob.eve.repository.converter; 9 | 10 | import bob.eve.repository.encoding.AES; 11 | import com.google.gson.Gson; 12 | import java.io.IOException; 13 | import java.lang.reflect.Type; 14 | import okhttp3.ResponseBody; 15 | import retrofit2.Converter; 16 | 17 | /** 18 | * Created by Bob on 17/12/10. 19 | */ 20 | 21 | public class AESResponseConverter implements Converter { 22 | private static final String LOG_TAG = "ResponseConverter"; 23 | 24 | private boolean isAes; 25 | private Type type; 26 | 27 | public AESResponseConverter(Type type, boolean isAes) { 28 | this.isAes = isAes; 29 | this.type = type; 30 | } 31 | 32 | /** 33 | * @return T 34 | * 加密可能失败,需要进行处理 35 | */ 36 | @Override 37 | public T convert(ResponseBody value) { 38 | try { 39 | if (isAes) { 40 | byte[] b = value.bytes(); 41 | AES aes = new AES(); 42 | byte[] a = aes.decrypt(b, AES.ALGORITHM); 43 | String json = new String(a); 44 | return new Gson().fromJson(json, type); 45 | } else { 46 | String json = value.string(); 47 | return new Gson().fromJson(json, type); 48 | } 49 | } catch (IOException e) { 50 | return null; 51 | } catch (Exception e) { 52 | return null; 53 | } finally { 54 | value.close(); 55 | } 56 | } 57 | } 58 | 59 | 60 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/converter/GsonRequestBodyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-13 上午12:51 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-3-13 上午11:50 6 | */ 7 | 8 | package bob.eve.repository.converter; 9 | 10 | import com.google.gson.Gson; 11 | import com.google.gson.TypeAdapter; 12 | import com.google.gson.stream.JsonWriter; 13 | import java.io.IOException; 14 | import java.io.OutputStreamWriter; 15 | import java.io.Writer; 16 | import java.nio.charset.Charset; 17 | import okhttp3.MediaType; 18 | import okhttp3.RequestBody; 19 | import okio.Buffer; 20 | import retrofit2.Converter; 21 | 22 | /** 23 | * Created by Bob on 2017/3/8. 24 | */ 25 | final class GsonRequestBodyConverter implements Converter { 26 | private static final MediaType MEDIA_TYPE = MediaType.parse("init/json; charset=UTF-8"); 27 | private static final Charset UTF_8 = Charset.forName("UTF-8"); 28 | 29 | private final Gson gson; 30 | private final TypeAdapter adapter; 31 | 32 | GsonRequestBodyConverter(Gson gson, TypeAdapter adapter) { 33 | this.gson = gson; 34 | this.adapter = adapter; 35 | } 36 | 37 | @Override 38 | public RequestBody convert(T value) throws IOException { 39 | Buffer buffer = new Buffer(); 40 | Writer writer = new OutputStreamWriter(buffer.outputStream(), UTF_8); 41 | JsonWriter jsonWriter = gson.newJsonWriter(writer); 42 | adapter.write(jsonWriter, value); 43 | jsonWriter.close(); 44 | return RequestBody.create(MEDIA_TYPE, buffer.readByteString()); 45 | } 46 | } -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/converter/JsonResponseBodyConverter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Create by BobEve on 17-12-13 上午12:51 3 | * Copyright (c) 2017. All rights reserved. 4 | * 5 | * Last modified 17-12-7 下午4:21 6 | */ 7 | 8 | package bob.eve.repository.converter; 9 | 10 | import java.io.IOException; 11 | import okhttp3.ResponseBody; 12 | import retrofit2.Converter; 13 | 14 | /** 15 | * Created by Bob on 2017/3/8. 16 | */ 17 | 18 | final class JsonResponseBodyConverter implements Converter { 19 | 20 | JsonResponseBodyConverter() { 21 | } 22 | 23 | @Override 24 | public T convert(ResponseBody value) throws IOException { 25 | return (T) value.string(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /everepository/src/main/java/bob/eve/repository/di/component/EveRepositoryComponent.java: -------------------------------------------------------------------------------- 1 | package bob.eve.repository.di.component; 2 | 3 | /** 4 | * Created by Bob on 17/12/9. 5 | */ 6 | 7 | //@Singleton 8 | //@Component(modules = { EveRepositoryModule.class, EveRepositoryConfigModule.class }) 9 | public interface EveRepositoryComponent { 10 | // Application application(); 11 | 12 | // EveInterceptor eveInterceptor(); 13 | 14 | // EveRepositoryManager eveRepositoryManager(); 15 | 16 | // Gson gson(); 17 | } 18 | -------------------------------------------------------------------------------- /everepository/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | EveRepository 3 | 4 | -------------------------------------------------------------------------------- /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 | # TODO 更新版本信息到此处 19 | ANDROID_SUPPORT_VERSION=27.0.2 -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Dec 08 23:32:01 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-4.1-all.zip 7 | -------------------------------------------------------------------------------- /screen/eve_01.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/screen/eve_01.gif -------------------------------------------------------------------------------- /screen/eve_02.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/screen/eve_02.gif -------------------------------------------------------------------------------- /screen/eve_03.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/screen/eve_03.gif -------------------------------------------------------------------------------- /screen/eve_04.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/bobby-walle/Eva/9578bbcc60ba39234d465c95216cafaaf0823a5f/screen/eve_04.gif -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':everepository', ':evelib', ':evemvp' 2 | --------------------------------------------------------------------------------