├── app ├── .gitignore ├── src │ └── main │ │ ├── jniLibs │ │ ├── x86 │ │ │ └── liblbs.so │ │ └── armeabi │ │ │ └── liblbs.so │ │ ├── res │ │ ├── mipmap-xhdpi │ │ │ ├── splash.jpg │ │ │ ├── ic_launcher.png │ │ │ ├── icon_no_network.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── default_headimg_male.png │ │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_launcher_foreground.png │ │ ├── mipmap-xxhdpi │ │ │ ├── icon_add.png │ │ │ ├── icon_exit.png │ │ │ ├── icon_favor.png │ │ │ ├── icon_hot.png │ │ │ ├── icon_info.png │ │ │ ├── icon_like.png │ │ │ ├── icon_share.png │ │ │ ├── back_android.png │ │ │ ├── ic_launcher.png │ │ │ ├── icon_notice.png │ │ │ ├── icon_unlike.png │ │ │ ├── icon_calendar.png │ │ │ ├── icon_settings.png │ │ │ ├── ic_launcher_round.png │ │ │ ├── icon_empty_common.png │ │ │ ├── icon_placeholder.png │ │ │ ├── icon_share_white.png │ │ │ ├── more_android_light.png │ │ │ ├── ic_launcher_foreground.png │ │ │ ├── icon_tabbar_shop_gray.png │ │ │ ├── icon_tabbar_merchant_gray.png │ │ │ └── icon_tabbar_setting_gray.png │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ ├── ic_launcher_round.png │ │ │ └── ic_launcher_foreground.png │ │ ├── values │ │ │ ├── ic_launcher_background.xml │ │ │ ├── attrs.xml │ │ │ ├── dimens.xml │ │ │ └── colors.xml │ │ ├── values-v19 │ │ │ └── dimens.xml │ │ ├── drawable │ │ │ ├── white_shape_radius_dialog.xml │ │ │ ├── rectangle_black.xml │ │ │ ├── shape_rectangle_f4.xml │ │ │ ├── shape_rectangle_white.xml │ │ │ ├── button_shape_rectangle.xml │ │ │ ├── shape_rectangle_white_press.xml │ │ │ ├── button_shape_rectangle_unpressed.xml │ │ │ ├── bg_white.xml │ │ │ ├── selector_f4bg_onclick.xml │ │ │ ├── selector_whitebg_onclick.xml │ │ │ ├── selector_button_login.xml │ │ │ ├── ic_tab_home.xml │ │ │ ├── ic_tab_meizi.xml │ │ │ ├── ic_hot_fill.xml │ │ │ ├── ic_search.xml │ │ │ ├── color_progressbar.xml │ │ │ ├── ic_project.xml │ │ │ ├── ic_new.xml │ │ │ ├── ic_todo.xml │ │ │ ├── ic_tab_chapter.xml │ │ │ └── ic_navigation.xml │ │ ├── anim │ │ │ ├── slide_in_left.xml │ │ │ ├── slide_out_right.xml │ │ │ ├── slide_in_right.xml │ │ │ └── slide_out_left.xml │ │ ├── color │ │ │ └── selector_item_color.xml │ │ ├── layout │ │ │ ├── item_main_banner.xml │ │ │ ├── item_main_recommend.xml │ │ │ ├── activity_commonwebsites.xml │ │ │ ├── layout_pop_canlendar.xml │ │ │ ├── item_main_center.xml │ │ │ ├── item_common_website.xml │ │ │ ├── item_main_recommend_item.xml │ │ │ ├── activity_mei_zi_detail.xml │ │ │ ├── content_about_us.xml │ │ │ ├── item_todo_top_date.xml │ │ │ ├── fragment_home_recommend.xml │ │ │ ├── fragment_main.xml │ │ │ ├── fragment_recommend.xml │ │ │ ├── item_meizi.xml │ │ │ ├── base_loading.xml │ │ │ ├── fragment_video.xml │ │ │ ├── toolbar_base_layout.xml │ │ │ ├── fragment_joke.xml │ │ │ ├── fragment_image.xml │ │ │ ├── toast_warning.xml │ │ │ ├── item_navigation.xml │ │ │ ├── toolbar_main.xml │ │ │ ├── activity_quary_result.xml │ │ │ ├── item_todo_list_item.xml │ │ │ ├── activity_cars_list.xml │ │ │ ├── layout_mine_top.xml │ │ │ ├── item_main_center_item.xml │ │ │ ├── base_retry.xml │ │ │ ├── base_empty.xml │ │ │ ├── fragment_chapters.xml │ │ │ ├── activity_detail.xml │ │ │ ├── fragment_navigation.xml │ │ │ ├── layout_pop_todo_menu.xml │ │ │ ├── activity_todo.xml │ │ │ ├── fragment_mine.xml │ │ │ └── activity_search.xml │ │ ├── drawable-v21 │ │ │ └── bg_white.xml │ │ ├── menu │ │ │ ├── menu_search.xml │ │ │ ├── menu_share.xml │ │ │ ├── menu_check_success.xml │ │ │ ├── menu_todo.xml │ │ │ ├── menu_hot.xml │ │ │ ├── menu_detail.xml │ │ │ ├── bottomnavagition.xml │ │ │ └── menu_main_drawerlayout.xml │ │ └── xml │ │ │ └── file_paths.xml │ │ ├── java │ │ └── com │ │ │ └── gank │ │ │ └── chen │ │ │ ├── mvp │ │ │ ├── model │ │ │ │ ├── MainModel.java │ │ │ │ ├── BaseGankModel.java │ │ │ │ ├── BaseModel.java │ │ │ │ ├── CarsListModel.java │ │ │ │ ├── MainHomeModel.java │ │ │ │ ├── TodoList.java │ │ │ │ ├── NavigationModel.java │ │ │ │ ├── TodoListData.java │ │ │ │ ├── Event.java │ │ │ │ ├── MeiZi.java │ │ │ │ ├── CommonWebsiteModel.java │ │ │ │ ├── ArticleModel.java │ │ │ │ ├── ChaptersModel.java │ │ │ │ ├── ChaptersListModel.java │ │ │ │ ├── BannerModel.java │ │ │ │ └── RegisterModel.java │ │ │ ├── view │ │ │ │ ├── ImpMainActivity.java │ │ │ │ ├── OnLoadSuccessViewImp.java │ │ │ │ ├── ImpProjectsFragment.java │ │ │ │ ├── PullDownLoadMoreViewImp.java │ │ │ │ ├── ImpChaptersFragment.java │ │ │ │ ├── ImpNavigationFragment.java │ │ │ │ ├── ImpSearchActivity.java │ │ │ │ ├── ImpAddTodo.java │ │ │ │ ├── ImpProjectsListFragment.java │ │ │ │ ├── ImpMainHomeFragment.java │ │ │ │ ├── ImpChaptersListFragment.java │ │ │ │ └── ImpTodoList.java │ │ │ └── presenter │ │ │ │ ├── DetailPresenter.java │ │ │ │ ├── MainActivityPresenter.java │ │ │ │ ├── ProjectsPresenter.java │ │ │ │ ├── NavigationPresenter.java │ │ │ │ ├── MinePresenter.java │ │ │ │ ├── RegisterPresenter.java │ │ │ │ ├── LoginPresenter.java │ │ │ │ ├── SearchPresenter.java │ │ │ │ ├── CommonWebsitesPresenter.java │ │ │ │ ├── ChaptersPresenter.java │ │ │ │ ├── MeiZiListPresenter.java │ │ │ │ └── AddTodoPresenter.java │ │ │ ├── base │ │ │ ├── BaseView.java │ │ │ ├── BaseFailView.java │ │ │ ├── BaseViewInterface.java │ │ │ ├── CreatePresenter.java │ │ │ ├── factory │ │ │ │ ├── IPresenterFactory.java │ │ │ │ └── PresenterFactory.java │ │ │ ├── proxy │ │ │ │ └── IPresenterProxy.java │ │ │ └── BasePrestener.java │ │ │ ├── util │ │ │ ├── keyboard │ │ │ │ ├── KeyboardVisibilityEventListener.java │ │ │ │ ├── Unregistrar.java │ │ │ │ ├── AutoActivityLifecycleCallback.java │ │ │ │ └── SimpleUnregistrar.java │ │ │ ├── GlideImageLoader.java │ │ │ ├── NativeShareUtil.java │ │ │ ├── PixelFormatUtil.java │ │ │ ├── LogUtil.java │ │ │ ├── GlideCircleTransform.java │ │ │ └── SharePreferenceUtil.java │ │ │ ├── common │ │ │ ├── QuitCockroachException.java │ │ │ ├── ConstantMap.java │ │ │ ├── BaseLoginInterceptor.java │ │ │ └── RouterUrlManager.java │ │ │ ├── widget │ │ │ ├── behavior │ │ │ │ ├── AnimateHelper.java │ │ │ │ ├── ByeBurgerFloatButtonBehavior.java │ │ │ │ ├── ByeBurgerTitleBehavior.java │ │ │ │ ├── ByeBurgerBottomBehavior.java │ │ │ │ └── ScaleAnimateHelper.java │ │ │ ├── ColorFlipPagerTitleView.java │ │ │ └── BottomNavigationViewHelper.java │ │ │ ├── http │ │ │ ├── exception │ │ │ │ ├── FuncFlowableException.java │ │ │ │ ├── FuncObservableException.java │ │ │ │ ├── HandleBooleanFuc.java │ │ │ │ ├── HandleFuc.java │ │ │ │ ├── HandleGankFuc.java │ │ │ │ └── ServerException.java │ │ │ ├── ApiFactory.java │ │ │ ├── ApiScheduler.java │ │ │ ├── LoggingInterceptor.java │ │ │ └── subscriber │ │ │ │ ├── LodeMoreFlowableSubscriber.java │ │ │ │ ├── LodeMoreObserverSubscriber.java │ │ │ │ ├── ApiSubscriberFlowable.java │ │ │ │ ├── ApiSubscriberObserver.java │ │ │ │ ├── SubscriberFlowableProgress.java │ │ │ │ └── SubscriberObserverProgress.java │ │ │ ├── ui │ │ │ ├── activity │ │ │ │ ├── WebViewActivity.java │ │ │ │ ├── MineMessageActivity.java │ │ │ │ ├── SplashActivity.java │ │ │ │ └── AboutUsActivity.java │ │ │ └── fragment │ │ │ │ └── FragmentFactory.java │ │ │ └── adapter │ │ │ ├── viewholder │ │ │ ├── MeiZiViewHolder.java │ │ │ ├── MainCenterViewHolder.java │ │ │ └── HomeDataViewHolder.java │ │ │ ├── CommonWebsiteAdapter.java │ │ │ ├── NavigationItemAdapter.java │ │ │ ├── MeiZiPicAdapter.java │ │ │ ├── MineCollectionsAdapter.java │ │ │ ├── MainPageAdapter.java │ │ │ ├── HomePageAdapter.java │ │ │ ├── MainArticleAdapter.java │ │ │ ├── ProjectsListAdapter.java │ │ │ ├── ProjectsPageAdapter.java │ │ │ ├── ChaptersPageAdapter.java │ │ │ └── NavigationAdapter.java │ │ └── assets │ │ └── about.html ├── libs │ └── tbs_sdk_thirdapp_v3.6.0.1234_43608_sharewithdownload_withoutGame_obfs_20180510_111111.jar └── channel ├── swipebacklibrary ├── .gitignore ├── src │ └── main │ │ ├── AndroidManifest.xml │ │ └── res │ │ ├── drawable │ │ └── bga_sbl_shadow.9.png │ │ ├── values │ │ └── bga_sbl_integers.xml │ │ └── anim │ │ ├── bga_sbl_activity_swipeback_enter.xml │ │ ├── bga_sbl_activity_swipeback_exit.xml │ │ ├── bga_sbl_activity_backward_enter.xml │ │ ├── bga_sbl_activity_backward_exit.xml │ │ ├── bga_sbl_activity_forward_enter.xml │ │ └── bga_sbl_activity_forward_exit.xml ├── build.gradle └── proguard-rules.pro ├── settings.gradle ├── screenshot ├── 1.png ├── 2.png ├── 3.png ├── 4.png ├── 5.png └── 6.png ├── gradle └── wrapper │ └── gradle-wrapper.jar ├── .gitignore └── README.md /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /swipebacklibrary/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':swipebacklibrary' 2 | -------------------------------------------------------------------------------- /screenshot/1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/1.png -------------------------------------------------------------------------------- /screenshot/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/2.png -------------------------------------------------------------------------------- /screenshot/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/3.png -------------------------------------------------------------------------------- /screenshot/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/4.png -------------------------------------------------------------------------------- /screenshot/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/5.png -------------------------------------------------------------------------------- /screenshot/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/screenshot/6.png -------------------------------------------------------------------------------- /app/src/main/jniLibs/x86/liblbs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/jniLibs/x86/liblbs.so -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/jniLibs/armeabi/liblbs.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/jniLibs/armeabi/liblbs.so -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/splash.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/splash.jpg -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_add.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_exit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_exit.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_favor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_favor.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_hot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_hot.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_info.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_like.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_like.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_share.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_share.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/back_android.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/back_android.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_notice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_notice.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_unlike.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_unlike.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/icon_no_network.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/icon_no_network.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_calendar.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_settings.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_empty_common.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_empty_common.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_placeholder.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_share_white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_share_white.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/default_headimg_male.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/default_headimg_male.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/more_android_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/more_android_light.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_tabbar_shop_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_tabbar_shop_gray.png -------------------------------------------------------------------------------- /swipebacklibrary/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_tabbar_merchant_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_tabbar_merchant_gray.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/icon_tabbar_setting_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxhdpi/icon_tabbar_setting_gray.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/drawable/bga_sbl_shadow.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/swipebacklibrary/src/main/res/drawable/bga_sbl_shadow.9.png -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/MainModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | 4 | /** 5 | * @author chenbo 6 | */ 7 | public class MainModel { 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/ic_launcher_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #FFFFFF 4 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/values/bga_sbl_integers.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 200 4 | -------------------------------------------------------------------------------- /app/src/main/res/values-v19/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 25dp 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/BaseView.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base; 2 | 3 | /** 4 | * 5 | * @author chen 6 | * @date 2017/12/17 7 | */ 8 | 9 | public interface BaseView { 10 | } 11 | -------------------------------------------------------------------------------- /app/libs/tbs_sdk_thirdapp_v3.6.0.1234_43608_sharewithdownload_withoutGame_obfs_20180510_111111.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/boiyun/WanAndroid/HEAD/app/libs/tbs_sdk_thirdapp_v3.6.0.1234_43608_sharewithdownload_withoutGame_obfs_20180510_111111.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/white_shape_radius_dialog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_in_right.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/anim/slide_out_left.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/rectangle_black.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_rectangle_f4.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_rectangle_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_rectangle.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/shape_rectangle_white_press.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/util/keyboard/KeyboardVisibilityEventListener.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.util.keyboard; 2 | 3 | /** 4 | * Created by yshrsmz on 15/03/17. 5 | */ 6 | public interface KeyboardVisibilityEventListener { 7 | 8 | void onVisibilityChanged(boolean isOpen); 9 | } 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_rectangle_unpressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/bg_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/common/QuitCockroachException.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.common; 2 | 3 | /** 4 | * Created by wanjian on 2017/2/15. 5 | */ 6 | 7 | final class QuitCockroachException extends RuntimeException { 8 | public QuitCockroachException(String message) { 9 | super(message); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app/channel: -------------------------------------------------------------------------------- 1 | meituan # 美团 2 | samsungapps #三星 3 | hiapk 4 | anzhi 5 | xiaomi # 小米 6 | 91com 7 | gfan 8 | appchina 9 | nduoa 10 | 3gcn 11 | mumayi 12 | 10086com 13 | wostore 14 | 189store 15 | lenovomm 16 | hicloud 17 | meizu 18 | wandou 19 | # Google Play 20 | # googleplay 21 | # 百度 22 | baidu 23 | # 24 | # 360 25 | 360cn 26 | # 27 | # 应用宝 28 | myapp -------------------------------------------------------------------------------- /app/src/main/res/values/attrs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/BaseFailView.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base; 2 | 3 | /** 4 | * 5 | * @author chen 6 | * @date 2017/12/17 7 | */ 8 | 9 | public interface BaseFailView extends BaseView{ 10 | /** 11 | * 加载更多失败 12 | * 13 | * @param msg 14 | */ 15 | void onLoadMoreFail(String msg); 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/color/selector_item_color.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_swipeback_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_f4bg_onclick.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_swipeback_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_whitebg_onclick.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/BaseGankModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | /** 4 | * 5 | * @author chen 6 | * @date 2017/12/17 7 | */ 8 | 9 | public class BaseGankModel { 10 | public boolean error; 11 | public T results; 12 | 13 | public boolean isFalse() { 14 | return error; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/selector_button_login.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_backward_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_backward_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_forward_enter.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /swipebacklibrary/src/main/res/anim/bga_sbl_activity_forward_exit.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/BaseViewInterface.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base; 2 | 3 | /** 4 | * 5 | * @author chenbo 6 | * @date 2018/1/7 7 | */ 8 | 9 | public interface BaseViewInterface { 10 | /** 11 | * get布局id 12 | * @return 13 | */ 14 | int getLayoutId(); 15 | /** 16 | * 初始化布局 17 | * @return 18 | */ 19 | void initView(); 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpMainActivity.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | 5 | /** 6 | * @author chen 7 | * @date 2017/12/17 8 | */ 9 | 10 | public interface ImpMainActivity extends BaseView { 11 | /** 12 | * 退出账号成功 13 | * 14 | * @param boo 15 | */ 16 | void onLogoutSucess(Boolean boo); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/OnLoadSuccessViewImp.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | 5 | /** 6 | * @author chen 7 | * @date 2017/12/17 8 | */ 9 | 10 | public interface OnLoadSuccessViewImp extends BaseView { 11 | /** 12 | * 加载成功 13 | * 14 | * @param obj 15 | */ 16 | void onLoadSucess(T obj); 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 120dp 4 | 0dp 5 | 24dp 6 | 180dp 7 | 16dp 8 | 16dp 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_banner.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/CreatePresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base; 2 | 3 | import java.lang.annotation.Inherited; 4 | import java.lang.annotation.Retention; 5 | import java.lang.annotation.RetentionPolicy; 6 | 7 | /** 8 | * Created by chen on 2017/12/17. 9 | */ 10 | @Inherited 11 | @Retention(RetentionPolicy.RUNTIME) 12 | public @interface CreatePresenter { 13 | Class value(); 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/widget/behavior/AnimateHelper.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.widget.behavior; 2 | 3 | /** 4 | * @author wing 5 | * @date 11/8/16 6 | */ 7 | 8 | public interface AnimateHelper { 9 | public static int STATE_SHOW = 1; 10 | public static int STATE_HIDE = 0; 11 | 12 | void show(); 13 | 14 | void hide(); 15 | 16 | void setStartY(float y); 17 | 18 | void setMode(int modeBottom); 19 | 20 | int getState(); 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/factory/IPresenterFactory.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base.factory; 2 | 3 | import com.gank.chen.base.BasePrestener; 4 | import com.gank.chen.base.BaseView; 5 | 6 | /** 7 | * @author chen 8 | * @date 2017/12/17 9 | */ 10 | 11 | public interface IPresenterFactory> { 12 | /** 13 | * 创建Presenter 14 | * 15 | * @return Presenter 16 | */ 17 | P createPresenter(); 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/res/drawable-v21/bg_white.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/BaseModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | /** 4 | * @author chen 5 | * @date 2017/12/17 6 | */ 7 | 8 | public class BaseModel { 9 | /** 10 | * errorCode = 0 代表执行成功,如果为负数则认为错误 11 | * errorCode = -1001 代表登录失效,需要重新登录。 12 | */ 13 | public int errorCode; 14 | public String errorMsg; 15 | public T data; 16 | 17 | public boolean isOk() { 18 | return errorCode == 0; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_search.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_share.xml: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_check_success.xml: -------------------------------------------------------------------------------- 1 | 5 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/FuncFlowableException.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http.exception; 2 | 3 | import io.reactivex.Flowable; 4 | import io.reactivex.functions.Function; 5 | 6 | /** 7 | * 8 | * @author pc 9 | * @date 2018/1/31 10 | */ 11 | 12 | public class FuncFlowableException implements Function> { 13 | 14 | @Override 15 | public Flowable apply(Throwable throwable) { 16 | return Flowable.error(ApiException.handleException(null,throwable)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/DetailPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.base.BaseView; 7 | import com.gank.chen.widget.StateView; 8 | 9 | /** 10 | * @author chen 11 | * @date 2017/12/20 12 | */ 13 | 14 | public class DetailPresenter extends BasePrestener { 15 | public void getDetailData(Context context, StateView stateView) { 16 | 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/util/GlideImageLoader.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.util; 2 | 3 | import android.content.Context; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | import com.youth.banner.loader.ImageLoader; 8 | 9 | /** 10 | * @author chenbo 11 | */ 12 | public class GlideImageLoader extends ImageLoader { 13 | @Override 14 | public void displayImage(Context context, Object path, ImageView imageView) { 15 | Glide.with(context).load(path).into(imageView); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/util/keyboard/Unregistrar.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.util.keyboard; 2 | 3 | import android.view.ViewTreeObserver; 4 | 5 | /** 6 | * @author Anoop S S 7 | * anoopvvs@gmail.com 8 | * on 28/02/2017 9 | */ 10 | 11 | public interface Unregistrar { 12 | 13 | /** 14 | * unregisters the {@link ViewTreeObserver.OnGlobalLayoutListener} and there by does provide any more callback to the {@link KeyboardVisibilityEventListener} 15 | */ 16 | void unregister(); 17 | 18 | } 19 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/ui/activity/WebViewActivity.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.ui.activity; 2 | 3 | import com.gank.chen.base.BaseNoNetActivity; 4 | 5 | /** 6 | * 7 | * @author ChenBo 8 | * @date 2018/5/25 9 | */ 10 | 11 | public class WebViewActivity extends BaseNoNetActivity { 12 | @Override 13 | public int getViewLayoutId() { 14 | return 0; 15 | } 16 | 17 | @Override 18 | public void initData() { 19 | 20 | } 21 | 22 | @Override 23 | public void initView() { 24 | 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/FuncObservableException.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http.exception; 2 | 3 | import io.reactivex.Observable; 4 | import io.reactivex.functions.Function; 5 | 6 | /** 7 | * 8 | * @author pc 9 | * @date 2018/1/31 10 | */ 11 | 12 | public class FuncObservableException implements Function> { 13 | 14 | @Override 15 | public Observable apply(Throwable throwable) { 16 | return Observable.error(ApiException.handleException(null,throwable)); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/CarsListModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | /** 4 | * @author chenbo 5 | */ 6 | public class CarsListModel { 7 | private String name; 8 | private String type; 9 | 10 | public String getName() { 11 | return name; 12 | } 13 | 14 | public void setName(String name) { 15 | this.name = name; 16 | } 17 | 18 | public String getType() { 19 | return type; 20 | } 21 | 22 | public void setType(String type) { 23 | this.type = type; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpProjectsFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ChaptersListModel; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author chen 10 | * @date 2017/12/17 11 | */ 12 | 13 | public interface ImpProjectsFragment extends BaseView { 14 | 15 | /** 16 | * 加载公众号列表成功 17 | * 18 | * @param chaptersListModel 19 | */ 20 | void onLoadChapterSucess(List chaptersListModel); 21 | } 22 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_recommend.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/ApiFactory.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http; 2 | 3 | /** 4 | * 5 | * @author chen 6 | * @date 2017/12/17 7 | */ 8 | 9 | public class ApiFactory { 10 | protected static final Object MONITOR = new Object(); 11 | private static ApiUtil apiUtil = null; 12 | public static ApiUtil getApiUtil(){ 13 | synchronized (MONITOR){ 14 | if (apiUtil == null) { 15 | apiUtil=new ApiRetrofit().getApi(); 16 | } 17 | return apiUtil; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/HandleBooleanFuc.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http.exception; 2 | 3 | import com.gank.chen.mvp.model.BaseModel; 4 | 5 | import io.reactivex.functions.Function; 6 | 7 | 8 | /** 9 | * Creat by chen on 2018/9/30 10 | * Describe: 11 | * 12 | * @author chenbo 13 | */ 14 | public class HandleBooleanFuc implements Function { 15 | @Override 16 | public Boolean apply(BaseModel response) { 17 | if (!response.isOk()) { 18 | return false; 19 | } 20 | return true; 21 | } 22 | } -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/PullDownLoadMoreViewImp.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseFailView; 4 | import com.gank.chen.base.BaseView; 5 | 6 | /** 7 | * @author chen 8 | * @date 2017/12/17 9 | */ 10 | 11 | public interface PullDownLoadMoreViewImp extends BaseFailView { 12 | /** 13 | * 加载成功 14 | * 15 | * @param obj 16 | */ 17 | void onLoadSucess(T obj); 18 | /** 19 | * 加载更多成功 20 | * 21 | * @param obj 22 | */ 23 | void onLoadMoreSuccess(T obj); 24 | 25 | 26 | } 27 | -------------------------------------------------------------------------------- /.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 | # Built application files 11 | *.apk 12 | *.ap_ 13 | 14 | # Files for the Dalvik VM 15 | *.dex 16 | 17 | # Java class files 18 | *.class 19 | 20 | # Generated files 21 | bin/ 22 | gen/ 23 | 24 | # Gradle files 25 | .gradle/ 26 | build/ 27 | 28 | # Local configuration file (sdk path, etc) 29 | *.properties 30 | 31 | # Proguard folder generated by Eclipse 32 | proguard/ 33 | 34 | #Log Files 35 | *.log 36 | .idea 37 | *.bat 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_commonwebsites.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_pop_canlendar.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/HandleFuc.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http.exception; 2 | 3 | import com.gank.chen.mvp.model.BaseModel; 4 | 5 | import io.reactivex.functions.Function; 6 | 7 | 8 | /** 9 | * Creat by chen on 2018/9/30 10 | * Describe: 11 | * @author chenbo 12 | */ 13 | public class HandleFuc implements Function, T> { 14 | @Override 15 | public T apply(BaseModel response) { 16 | if (!response.isOk()) { 17 | throw new ServerException(response.errorCode, response.errorMsg); 18 | } 19 | return response.data; 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/HandleGankFuc.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http.exception; 2 | 3 | import com.gank.chen.mvp.model.BaseGankModel; 4 | 5 | import io.reactivex.functions.Function; 6 | 7 | 8 | /** 9 | * Creat by chen on 2018/9/30 10 | * Describe: 11 | * @author chenbo 12 | */ 13 | public class HandleGankFuc implements Function, T> { 14 | @Override 15 | public T apply(BaseGankModel response) { 16 | if (response.isFalse()) { 17 | throw new ServerException(400, "error"); 18 | } 19 | return response.results; 20 | } 21 | } -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpChaptersFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ArticleModel; 5 | import com.gank.chen.mvp.model.ChaptersListModel; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author chen 11 | * @date 2017/12/17 12 | */ 13 | 14 | public interface ImpChaptersFragment extends BaseView { 15 | 16 | /** 17 | * 加载公众号列表成功 18 | * 19 | * @param chaptersListModel 20 | */ 21 | void onLoadChapterSucess(List chaptersListModel); 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/exception/ServerException.java: -------------------------------------------------------------------------------- 1 | 2 | package com.gank.chen.http.exception; 3 | 4 | /** 5 | * @author chenbo 6 | */ 7 | public class ServerException extends RuntimeException { 8 | private int errCode; 9 | private String message; 10 | 11 | public ServerException(int errCode, String msg) { 12 | super(msg); 13 | this.errCode = errCode; 14 | this.message = msg; 15 | } 16 | 17 | public int getErrCode() { 18 | return errCode; 19 | } 20 | 21 | @Override 22 | public String getMessage() { 23 | return message; 24 | } 25 | } -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpNavigationFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ChaptersListModel; 5 | import com.gank.chen.mvp.model.NavigationModel; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author chen 11 | * @date 2017/12/17 12 | */ 13 | 14 | public interface ImpNavigationFragment extends BaseView { 15 | 16 | /** 17 | * 加载导航数据成功 18 | * 19 | * @param navigationModelslist 20 | */ 21 | void onLoadNavigationSuccess(List navigationModelslist); 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/viewholder/MeiZiViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter.viewholder; 2 | 3 | import android.view.View; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.gank.chen.R; 9 | 10 | /** 11 | * 12 | * @author pc 13 | * @date 2018/2/26 14 | */ 15 | 16 | public class MeiZiViewHolder extends BaseViewHolder { 17 | public ImageView itemIvMeizi; 18 | 19 | MeiZiViewHolder(View view) { 20 | super(view); 21 | itemIvMeizi = view.findViewById(R.id.item_iv_meizi); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_center.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_common_website.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpSearchActivity.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.CommonWebsiteModel; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author chen 10 | * @date 2017/12/17 11 | */ 12 | 13 | public interface ImpSearchActivity extends BaseView { 14 | /** 15 | * 加载热搜词成功 16 | * 17 | * @param searchModelList 18 | */ 19 | void onLoadSuccess(List searchModelList); 20 | 21 | /** 22 | * 加载历史搜索词成功 23 | * 24 | * @param boo 25 | */ 26 | void onLoadHistorySuccess(Boolean boo); 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_recommend_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpAddTodo.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.TodoListData; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * @author chen 10 | */ 11 | 12 | public interface ImpAddTodo extends BaseView { 13 | /** 14 | * 更新成功 15 | */ 16 | void onUpdateSuccess(); 17 | 18 | /** 19 | * 更新失败 20 | * 21 | * @param msg 22 | */ 23 | void onUpdateFail(String msg); 24 | 25 | /** 26 | * 添加成功 27 | */ 28 | void onAddSuccess(String msg); 29 | 30 | /** 31 | * 添加失败 32 | */ 33 | void onAddFail(String msg); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /swipebacklibrary/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.library' 2 | 3 | android { 4 | compileSdkVersion 27 5 | buildToolsVersion '27.0.3' 6 | 7 | defaultConfig { 8 | minSdkVersion 16 9 | targetSdkVersion 27 10 | 11 | } 12 | lintOptions { 13 | abortOnError false 14 | } 15 | buildTypes { 16 | release { 17 | minifyEnabled false 18 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 19 | } 20 | build{ 21 | 22 | } 23 | } 24 | } 25 | 26 | dependencies { 27 | implementation fileTree(dir: 'libs', include: ['*.jar']) 28 | implementation 'com.android.support:support-v4:27.1.1' 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/MainHomeModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | import java.util.ArrayList; 4 | 5 | /** 6 | * @author chenbo 7 | */ 8 | public class MainHomeModel { 9 | 10 | private ArrayList bannerModels; 11 | private ArticleModel articleListModels; 12 | 13 | public MainHomeModel(ArrayList bannerModels, ArticleModel articleListModels) { 14 | this.bannerModels = bannerModels; 15 | this.articleListModels = articleListModels; 16 | } 17 | 18 | public ArrayList getBannerModels() { 19 | return bannerModels; 20 | } 21 | 22 | public ArticleModel getArticleListModels() { 23 | return articleListModels; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_mei_zi_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 17 | 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/TodoList.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Creat by chen on 2018/11/15 7 | * Describe: 8 | * 9 | * @author chenbo 10 | */ 11 | public class TodoList { 12 | private List doneList; 13 | private List todoList; 14 | 15 | public List getDoneList() { 16 | return doneList; 17 | } 18 | 19 | public void setDoneList(List doneList) { 20 | this.doneList = doneList; 21 | } 22 | 23 | public List getTodoList() { 24 | return todoList; 25 | } 26 | 27 | public void setTodoList(List todoList) { 28 | this.todoList = todoList; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_about_us.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_todo_top_date.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 18 | 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/viewholder/MainCenterViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter.viewholder; 2 | 3 | import android.view.View; 4 | import android.widget.ImageView; 5 | import android.widget.TextView; 6 | 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.gank.chen.R; 9 | 10 | /** 11 | * 12 | * @author pc 13 | * @date 2018/2/26 14 | */ 15 | 16 | public class MainCenterViewHolder extends BaseViewHolder { 17 | public ImageView ivMainItemCenterPic; 18 | public TextView tvMainItemCenterName; 19 | 20 | MainCenterViewHolder(View view) { 21 | super(view); 22 | ivMainItemCenterPic = view.findViewById(R.id.iv_main_item_center_pic); 23 | tvMainItemCenterName = view.findViewById(R.id.tv_main_item_center_name); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/ui/activity/MineMessageActivity.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.ui.activity; 2 | 3 | import com.alibaba.android.arouter.facade.annotation.Route; 4 | import com.gank.chen.R; 5 | import com.gank.chen.base.BaseNoNetActivity; 6 | import com.gank.chen.common.RouterUrlManager; 7 | 8 | /** 9 | * Creat by chen on 2018/10/29 10 | * Describe: 11 | * @author chenbo 12 | */ 13 | @Route(path = RouterUrlManager.MINE_MESSAGE) 14 | public class MineMessageActivity extends BaseNoNetActivity { 15 | @Override 16 | public int getViewLayoutId() { 17 | return R.layout.activity_about_us; 18 | } 19 | 20 | @Override 21 | public void initData() { 22 | 23 | } 24 | 25 | @Override 26 | public void initView() { 27 | initToolBar("我的消息", false); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_home_recommend.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_recommend.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_meizi.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 12 | 13 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/http/ApiScheduler.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.http; 2 | 3 | import io.reactivex.FlowableTransformer; 4 | import io.reactivex.ObservableTransformer; 5 | import io.reactivex.android.schedulers.AndroidSchedulers; 6 | import io.reactivex.schedulers.Schedulers; 7 | 8 | /** 9 | * 10 | * @author chen 11 | * @date 2017/12/17 12 | */ 13 | 14 | public class ApiScheduler { 15 | public static FlowableTransformer getFlowableScheduler(){ 16 | return upstream -> upstream.subscribeOn(Schedulers.io()) 17 | .observeOn(AndroidSchedulers.mainThread()); 18 | } 19 | public static ObservableTransformer getObservableScheduler(){ 20 | return upstream -> upstream.subscribeOn(Schedulers.io()) 21 | .observeOn(AndroidSchedulers.mainThread()); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /swipebacklibrary/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 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/base/proxy/IPresenterProxy.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.base.proxy; 2 | 3 | import com.gank.chen.base.BasePrestener; 4 | import com.gank.chen.base.BaseView; 5 | import com.gank.chen.base.factory.IPresenterFactory; 6 | 7 | /** 8 | * 9 | * @author chen 10 | * @date 2017/12/17 11 | */ 12 | 13 | public interface IPresenterProxy> { 14 | /** 15 | * 设置创建Presenter的工厂 16 | * @param presenterfactory 类型 17 | */ 18 | void setPresenterFactory(IPresenterFactory presenterfactory); 19 | 20 | /** 21 | * 获取Presenter的工厂类 22 | * @return IPresenterFactory 23 | */ 24 | IPresenterFactory getPresenterFactory(); 25 | 26 | /** 27 | * 获取创建的Presenter 28 | * @return 指定类型的Presenter 29 | */ 30 | P getPresenter(); 31 | } 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/util/NativeShareUtil.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.util; 2 | 3 | import android.content.Context; 4 | import android.content.Intent; 5 | import android.net.Uri; 6 | 7 | /** 8 | * 9 | * @author ChenBo 10 | * @date 2018/5/30 11 | */ 12 | 13 | public class NativeShareUtil { 14 | /** 15 | * 分享图片 16 | */ 17 | public static void shareImage(Context context, Uri uri, String title) { 18 | Intent shareIntent = new Intent(); 19 | shareIntent.setAction(Intent.ACTION_SEND); 20 | shareIntent.putExtra(Intent.EXTRA_STREAM, uri); 21 | shareIntent.setType("image/*"); 22 | //添加分享内容标题 23 | shareIntent.putExtra(Intent.EXTRA_SUBJECT, "分享到"); 24 | shareIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 25 | context.startActivity(Intent.createChooser(shareIntent, title)); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tab_home.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpProjectsListFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ArticleModel; 5 | 6 | /** 7 | * @author chen 8 | * @date 2017/12/17 9 | */ 10 | 11 | public interface ImpProjectsListFragment extends BaseView { 12 | /** 13 | * 收藏成功 14 | * 15 | * @param position 16 | */ 17 | void onCollectSucess(int position); 18 | 19 | /** 20 | * 取消收藏成功 21 | * 22 | * @param position 23 | */ 24 | void onUnCollectSucess(int position); 25 | 26 | /** 27 | * 加载成功 28 | * 29 | * @param obj 30 | */ 31 | void onLoadSucess(ArticleModel obj); 32 | 33 | /** 34 | * 加载更多成功 35 | * 36 | * @param obj 37 | */ 38 | void onLoadMoreSuccess(ArticleModel obj); 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/base_loading.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 20 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/viewholder/HomeDataViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter.viewholder; 2 | 3 | import android.view.View; 4 | import android.widget.RelativeLayout; 5 | import android.widget.TextView; 6 | 7 | import com.chad.library.adapter.base.BaseViewHolder; 8 | import com.gank.chen.R; 9 | 10 | /** 11 | * 12 | * @author ChenBo 13 | * @date 2018/5/11 14 | */ 15 | 16 | public class HomeDataViewHolder extends BaseViewHolder { 17 | TextView tvUserName; 18 | TextView tvType; 19 | TextView tvTitle; 20 | RelativeLayout rlItemMain; 21 | 22 | public HomeDataViewHolder(View view) { 23 | super(view); 24 | rlItemMain = view.findViewById(R.id.rl_item_main); 25 | tvUserName = view.findViewById(R.id.tv_user_name); 26 | tvType = view.findViewById(R.id.tv_type); 27 | tvTitle = view.findViewById(R.id.tv_title); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_video.xml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 12 | 13 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/CommonWebsiteAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.gank.chen.R; 6 | import com.gank.chen.mvp.model.CommonWebsiteModel; 7 | import com.gank.chen.util.CommenUtil; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * @author chenbo 13 | */ 14 | public class CommonWebsiteAdapter extends BaseQuickAdapter { 15 | 16 | 17 | public CommonWebsiteAdapter(List data) { 18 | super(R.layout.item_common_website, data); 19 | } 20 | 21 | @Override 22 | protected void convert(BaseViewHolder helper, CommonWebsiteModel item) { 23 | helper.setText(R.id.tv_title, item.getName()) 24 | .setBackgroundColor(R.id.tv_title, CommenUtil.randomTagColor()); 25 | 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpMainHomeFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ArticleModel; 5 | import com.gank.chen.mvp.model.MainHomeModel; 6 | 7 | /** 8 | * @author chen 9 | * @date 2017/12/17 10 | */ 11 | 12 | public interface ImpMainHomeFragment extends BaseView { 13 | /** 14 | * 收藏成功 15 | * 16 | * @param position 17 | */ 18 | void onCollectSucess(int position); 19 | 20 | /** 21 | * 取消收藏成功 22 | * 23 | * @param position 24 | */ 25 | void onUnCollectSucess(int position); 26 | 27 | /** 28 | * 加载成功 29 | * 30 | * @param obj 31 | */ 32 | void onLoadSucess(MainHomeModel obj); 33 | 34 | /** 35 | * 加载更多成功 36 | * 37 | * @param obj 38 | */ 39 | void onLoadMoreSuccess(ArticleModel obj); 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_todo.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_hot.xml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 17 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_tab_meizi.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 12 | 13 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/NavigationModel.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Creat by chen on 2018/11/13 7 | * Describe: 8 | */ 9 | public class NavigationModel { 10 | // "cid": 272, 11 | // "name": "常用网站" 12 | // articles 13 | 14 | private int cid; 15 | private String name; 16 | private List articles; 17 | 18 | public int getCid() { 19 | return cid; 20 | } 21 | 22 | public void setCid(int cid) { 23 | this.cid = cid; 24 | } 25 | 26 | public String getName() { 27 | return name; 28 | } 29 | 30 | public void setName(String name) { 31 | this.name = name; 32 | } 33 | 34 | public List getArticles() { 35 | return articles; 36 | } 37 | 38 | public void setArticles(List articles) { 39 | this.articles = articles; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar_base_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_joke.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_detail.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 10 | 15 | 21 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpChaptersListFragment.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ArticleModel; 5 | import com.gank.chen.mvp.model.ChaptersListModel; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author chen 11 | * @date 2017/12/17 12 | */ 13 | 14 | public interface ImpChaptersListFragment extends BaseView { 15 | /** 16 | * 收藏成功 17 | * 18 | * @param position 19 | */ 20 | void onCollectSucess(int position); 21 | 22 | /** 23 | * 取消收藏成功 24 | * 25 | * @param position 26 | */ 27 | void onUnCollectSucess(int position); 28 | 29 | /** 30 | * 加载成功 31 | * 32 | * @param obj 33 | */ 34 | void onLoadSucess(ArticleModel obj); 35 | 36 | /** 37 | * 加载更多成功 38 | * 39 | * @param obj 40 | */ 41 | void onLoadMoreSuccess(ArticleModel obj); 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_image.xml: -------------------------------------------------------------------------------- 1 | 8 | 9 | 13 | 14 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/NavigationItemAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.gank.chen.R; 6 | import com.gank.chen.mvp.model.ArticleListModel; 7 | import com.gank.chen.mvp.model.CommonWebsiteModel; 8 | import com.gank.chen.util.CommenUtil; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * @author chenbo 14 | */ 15 | public class NavigationItemAdapter extends BaseQuickAdapter { 16 | 17 | 18 | public NavigationItemAdapter(List data) { 19 | super(R.layout.item_common_website, data); 20 | } 21 | 22 | @Override 23 | protected void convert(BaseViewHolder helper, ArticleListModel item) { 24 | helper.setText(R.id.tv_title, item.getTitle()) 25 | .setBackgroundColor(R.id.tv_title, CommenUtil.randomTagColor()); 26 | 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_hot_fill.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toast_warning.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 17 | 18 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_search.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_navigation.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/MeiZiPicAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import android.support.annotation.Nullable; 4 | import android.widget.ImageView; 5 | 6 | import com.bumptech.glide.Glide; 7 | import com.chad.library.adapter.base.BaseQuickAdapter; 8 | import com.gank.chen.R; 9 | import com.gank.chen.adapter.viewholder.MeiZiViewHolder; 10 | import com.gank.chen.mvp.model.MeiZi; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * @author chen 16 | * @date 2017/12/20 17 | */ 18 | 19 | public class MeiZiPicAdapter extends BaseQuickAdapter { 20 | 21 | 22 | public MeiZiPicAdapter(@Nullable List data) { 23 | super(R.layout.item_meizi, data); 24 | } 25 | 26 | @Override 27 | protected void convert(MeiZiViewHolder helper, MeiZi item) { 28 | Glide.with(mContext).load(item.url) 29 | .asBitmap() 30 | .placeholder(R.mipmap.icon_empty_common) 31 | .into(helper.itemIvMeizi); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/menu/bottomnavagition.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 14 | 15 | 19 | 23 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 10 | 11 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/MineCollectionsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import com.chad.library.adapter.base.BaseQuickAdapter; 4 | import com.chad.library.adapter.base.BaseViewHolder; 5 | import com.gank.chen.R; 6 | import com.gank.chen.mvp.model.ArticleListModel; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * @author chenbo 12 | */ 13 | public class MineCollectionsAdapter extends BaseQuickAdapter { 14 | 15 | 16 | public MineCollectionsAdapter(List data) { 17 | super(R.layout.item_home_pic_list, data); 18 | } 19 | 20 | @Override 21 | protected void convert(BaseViewHolder helper, ArticleListModel item) { 22 | helper.setText(R.id.tv_title, item.getTitle()) 23 | .setText(R.id.tv_user_name, item.getAuthor()) 24 | .setText(R.id.tv_type, item.getNiceDate()) 25 | .setImageResource(R.id.iv_like, R.mipmap.icon_like) 26 | .addOnClickListener(R.id.iv_like); 27 | 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/color_progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/MainActivityPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.SubscriberObserverProgress; 8 | import com.gank.chen.mvp.model.RegisterModel; 9 | import com.gank.chen.mvp.view.ImpMainActivity; 10 | import com.gank.chen.mvp.view.OnLoadSuccessViewImp; 11 | 12 | import java.util.HashMap; 13 | import java.util.Map; 14 | 15 | /** 16 | * Creat by chen on 2018/10/18 17 | * Describe: 18 | * @author chenbo 19 | */ 20 | public class MainActivityPresenter extends BasePrestener { 21 | public void toLogout(Context context) { 22 | ApiRetrofit.setObservableBooleanSubscribe(apiUtil.toLogout(), new SubscriberObserverProgress(context) { 23 | @Override 24 | public void onSuccess(Boolean aBoolean) { 25 | getView().onLogoutSucess(aBoolean); 26 | } 27 | }); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/widget/behavior/ByeBurgerFloatButtonBehavior.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.widget.behavior; 2 | 3 | import android.content.Context; 4 | import android.support.design.widget.CoordinatorLayout; 5 | import android.support.v4.view.ViewCompat; 6 | import android.util.AttributeSet; 7 | import android.view.View; 8 | import android.view.ViewConfiguration; 9 | 10 | /** 11 | * Behavior for Float Button 12 | * Created by wing on 11/8/16. 13 | */ 14 | 15 | public class ByeBurgerFloatButtonBehavior extends ByeBurgerBehavior { 16 | 17 | public ByeBurgerFloatButtonBehavior(Context context, AttributeSet attrs) { 18 | super(context, attrs); 19 | } 20 | 21 | @Override public boolean layoutDependsOn(CoordinatorLayout parent, View child, View dependency) { 22 | if(canInit) { 23 | mAnimateHelper = ScaleAnimateHelper.get(child); 24 | canInit = false; 25 | } 26 | return super.layoutDependsOn(parent, child, dependency); 27 | } 28 | 29 | 30 | @Override protected void onNestPreScrollInit(View child) { 31 | 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/MainPageAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentStatePagerAdapter; 6 | import android.view.ViewGroup; 7 | 8 | import java.util.List; 9 | 10 | /** 11 | * 12 | * @author chen 13 | * @date 2017/12/16 14 | */ 15 | 16 | public class MainPageAdapter extends FragmentStatePagerAdapter { 17 | private List mFragments; 18 | 19 | public MainPageAdapter(FragmentManager fm, List fragments) { 20 | super(fm); 21 | this.mFragments = fragments; 22 | } 23 | 24 | @Override 25 | public Fragment getItem(int position) { 26 | return mFragments.get(position); 27 | } 28 | 29 | @Override 30 | public int getCount() { 31 | return mFragments.size(); 32 | } 33 | 34 | @Override 35 | public void destroyItem(ViewGroup container, int position, Object object) { 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_quary_result.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 16 | 17 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #2196F3 4 | #1976D2 5 | #FF4081 6 | 7 | #FF4081 8 | #802196F3 9 | #ffffff 10 | 11 | #a9858585 12 | #99ffffff 13 | #4Dffffff 14 | #000000 15 | 16 | #f4f4f4 17 | #212121 18 | #DDDEE3 19 | #757575//second text 20 | #edebeb 21 | #F44336 22 | #Ff5722 23 | //divider 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/adapter/HomePageAdapter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.adapter; 2 | 3 | import android.support.v4.app.Fragment; 4 | import android.support.v4.app.FragmentManager; 5 | import android.support.v4.app.FragmentStatePagerAdapter; 6 | import android.view.ViewGroup; 7 | 8 | import com.gank.chen.ui.fragment.FragmentFactory; 9 | 10 | /** 11 | * @author chen 12 | * @date 2017/12/16 13 | */ 14 | 15 | public class HomePageAdapter extends FragmentStatePagerAdapter { 16 | private String[] mhomeTab; 17 | 18 | public HomePageAdapter(FragmentManager fm, String[] fragments) { 19 | super(fm); 20 | this.mhomeTab = fragments; 21 | } 22 | 23 | @Override 24 | public Fragment getItem(int position) { 25 | return FragmentFactory.creatTodoFragment(position); 26 | } 27 | 28 | @Override 29 | public int getCount() { 30 | return mhomeTab.length; 31 | } 32 | 33 | @Override 34 | public CharSequence getPageTitle(int position) { 35 | return mhomeTab[position]; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/common/ConstantMap.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.common; 2 | 3 | /** 4 | * Creat by chen on 2018/10/10 5 | * Describe: 6 | * 7 | * @author chenbo 8 | */ 9 | public class ConstantMap { 10 | public static final int NUM_ZERO = 0; 11 | public static final int NUM_ONE = 1; 12 | public static final int NUM_SIX = 6; 13 | public static final int NUM_EIGHTTY = 18; 14 | public static final int NUM_SIXTY = 60; 15 | public static final int LOGIN_EXTRA = 1; 16 | 17 | public static final int TODO_THIS_ONE = 0; 18 | public static final int TODO_WORK = 1; 19 | public static final int TODO_STUDY = 2; 20 | public static final int TODO_LIFE = 3; 21 | 22 | public static final String IS_LOGIN = "isLogin"; 23 | public static final String USER_HEADER_ICON = "user_header"; 24 | public static final String USER_PHONE = "user_phone"; 25 | public static final String LOGINUSERNAME = "loginUserName="; 26 | public static final String LOGINUSERPASSWORD = "loginUserPassword="; 27 | public static final String LOGIN_INTERCEPTOR = "登录拦截器"; 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/ProjectsPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.ApiSubscriberObserver; 8 | import com.gank.chen.mvp.model.ChaptersListModel; 9 | import com.gank.chen.mvp.view.ImpProjectsFragment; 10 | import com.gank.chen.widget.StateView; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Created by chen on 2017/12/17 16 | * 17 | * @author chenbo 18 | */ 19 | 20 | public class ProjectsPresenter extends BasePrestener { 21 | 22 | public void getProjects(Context context, StateView stateView) { 23 | ApiRetrofit.setObservableSubscribe(apiUtil.toGetProject(), new ApiSubscriberObserver>(context, stateView) { 24 | @Override 25 | public void onSuccess(List chaptersListModels) { 26 | getView().onLoadChapterSucess(chaptersListModels); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/NavigationPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.ApiSubscriberObserver; 8 | import com.gank.chen.mvp.model.NavigationModel; 9 | import com.gank.chen.mvp.view.ImpNavigationFragment; 10 | import com.gank.chen.widget.StateView; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Creat by chen on 2018/11/13 16 | * Describe: 17 | * 18 | * @author chenbo 19 | */ 20 | public class NavigationPresenter extends BasePrestener { 21 | 22 | public void getNavigationData(Context context, StateView stateView) { 23 | ApiRetrofit.setObservableSubscribe(apiUtil.getNavigationData(), new ApiSubscriberObserver>(context, stateView) { 24 | @Override 25 | public void onSuccess(List navigationModels) { 26 | getView().onLoadNavigationSuccess(navigationModels); 27 | } 28 | }); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/view/ImpTodoList.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.view; 2 | 3 | import com.gank.chen.base.BaseView; 4 | import com.gank.chen.mvp.model.ArticleModel; 5 | import com.gank.chen.mvp.model.TodoListData; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * @author chen 11 | * @date 2017/12/17 12 | */ 13 | 14 | public interface ImpTodoList extends BaseView { 15 | 16 | /** 17 | * 加载成功 18 | */ 19 | void onLoadDataSucess(List todoList); 20 | 21 | /** 22 | * 删除成功 23 | */ 24 | void onDeleteSuccess(String msg); 25 | 26 | /** 27 | * 删除失败 28 | */ 29 | void onDeleteFail(String msg); 30 | 31 | /** 32 | * 标记成功 33 | */ 34 | void onChangeStatusSuccess(String msg); 35 | 36 | /** 37 | * 标记失败 38 | */ 39 | void onChangeStatusFail(String msg); 40 | // 41 | // /** 42 | // * 标记成功 43 | // */ 44 | // void onChangeStatusFromNotDo2ToDoSuccess(String msg); 45 | // 46 | // /** 47 | // * 标记失败 48 | // */ 49 | // void onChangeStatusFromNotDo2ToDoFail(String msg); 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_todo_list_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 17 | 18 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/TodoListData.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | import com.chad.library.adapter.base.entity.AbstractExpandableItem; 4 | import com.chad.library.adapter.base.entity.MultiItemEntity; 5 | import com.gank.chen.adapter.TodoListAdapter; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Creat by chen on 2018/11/15 11 | * Describe: 12 | * 13 | * @author chenbo 14 | */ 15 | public class TodoListData extends AbstractExpandableItem implements MultiItemEntity { 16 | private long date; 17 | private List todoList; 18 | 19 | public long getDate() { 20 | return date; 21 | } 22 | 23 | public void setDate(long date) { 24 | this.date = date; 25 | } 26 | 27 | public List getTodoList() { 28 | return todoList; 29 | } 30 | 31 | public void setTodoList(List todoList) { 32 | this.todoList = todoList; 33 | } 34 | 35 | @Override 36 | public int getLevel() { 37 | return 0; 38 | } 39 | 40 | @Override 41 | public int getItemType() { 42 | return TodoListAdapter.TYPE_LEVEL_0; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/MinePresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.ApiSubscriberFlowable; 8 | import com.gank.chen.mvp.model.MeiZi; 9 | import com.gank.chen.mvp.view.OnLoadSuccessViewImp; 10 | import com.gank.chen.widget.StateView; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Created by chen on 2017/12/17 16 | * @author chenbo 17 | */ 18 | 19 | public class MinePresenter extends BasePrestener>> { 20 | 21 | public void getGankData(Context context, StateView stateView, int page) { 22 | 23 | ApiRetrofit.setFlowableSubscribe(apiUtil.getGankData(page), new ApiSubscriberFlowable>(context, stateView) { 24 | @Override 25 | public void onSuccess(List meiZiList) { 26 | if (meiZiList != null && getView() != null) { 27 | getView().onLoadSucess(meiZiList); 28 | } 29 | } 30 | }); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_cars_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 18 | 19 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_mine_top.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 15 | 16 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/model/Event.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.model; 2 | 3 | /** 4 | * Creat by chen on 2018/10/10 5 | * Describe: Rxbus通用bean 6 | * 7 | * @author chenbo 8 | */ 9 | public class Event { 10 | public static final int EVENT_CLOSE_ALL_ACTIVITY = 10001; 11 | /** 12 | * 注册成功 13 | */ 14 | public static final int EVENT_REGRISTER_SUCCESS = 10002; 15 | /** 16 | * 登录成功 17 | */ 18 | public static final int EVENT_LOGIN_SUCCESS = 10003; 19 | /** 20 | * todo的type 21 | */ 22 | public static final int TODO_TYPE = 10004; 23 | 24 | 25 | private T data; 26 | 27 | private int eventCode = -1; 28 | 29 | public Event(int eventCode) { 30 | this(eventCode, null); 31 | } 32 | 33 | public Event(int eventCode, T data) { 34 | this.eventCode = eventCode; 35 | this.data = data; 36 | } 37 | 38 | /** 39 | * get event code 40 | * 41 | * @return 42 | */ 43 | public int getCode() { 44 | return this.eventCode; 45 | } 46 | 47 | /** 48 | * get event reserved data 49 | * 50 | * @return 51 | */ 52 | public T getData() { 53 | return this.data; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/RegisterPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.SubscriberObserverProgress; 8 | import com.gank.chen.mvp.model.RegisterModel; 9 | import com.gank.chen.mvp.view.OnLoadSuccessViewImp; 10 | 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * Creat by chen on 2018/10/18 16 | * Describe: 17 | * @author chenbo 18 | */ 19 | public class RegisterPresenter extends BasePrestener> { 20 | public void RegisterNow(Context context, String phone, String password) { 21 | Map map = new HashMap<>(3); 22 | map.put("username", phone); 23 | map.put("password", password); 24 | map.put("repassword", password); 25 | 26 | ApiRetrofit.setObservableSubscribe(apiUtil.Register(map), new SubscriberObserverProgress(context) { 27 | @Override 28 | public void onSuccess(RegisterModel t) { 29 | getView().onLoadSucess(t); 30 | } 31 | }); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /app/src/main/res/layout/item_main_center_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 17 | 18 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/mvp/presenter/LoginPresenter.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.mvp.presenter; 2 | 3 | import android.content.Context; 4 | 5 | import com.gank.chen.base.BasePrestener; 6 | import com.gank.chen.http.ApiRetrofit; 7 | import com.gank.chen.http.subscriber.SubscriberObserverProgress; 8 | import com.gank.chen.mvp.model.RegisterModel; 9 | import com.gank.chen.mvp.view.OnLoadSuccessViewImp; 10 | 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * Creat by chen on 2018/10/18 16 | * Describe: 17 | * 18 | * @author chenbo 19 | */ 20 | public class LoginPresenter extends BasePrestener> { 21 | public void toLogin(Context context, String phone, String password) { 22 | Map map = new HashMap<>(2); 23 | map.put("username", phone); 24 | map.put("password", password); 25 | 26 | ApiRetrofit.setObservableSubscribe(apiUtil.toLogin(map), new SubscriberObserverProgress(context) { 27 | @Override 28 | public void onSuccess(RegisterModel t) { 29 | t.setPasswordNative(password); 30 | getView().onLoadSucess(t); 31 | } 32 | }); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/gank/chen/util/PixelFormatUtil.java: -------------------------------------------------------------------------------- 1 | package com.gank.chen.util; 2 | 3 | import android.app.Activity; 4 | import android.content.Context; 5 | import android.util.DisplayMetrics; 6 | 7 | /** 8 | * Created by rick on 2015/7/13 9 | * @author chenbo 10 | */ 11 | public class PixelFormatUtil { 12 | /** 13 | * 把dip单位转成px单位 14 | * 15 | * @param context context对象 16 | * @param dip dip数值 17 | * @return 18 | */ 19 | public static int formatDipToPx(Context context, int dip) { 20 | DisplayMetrics dm = new DisplayMetrics(); 21 | ((Activity) context).getWindowManager().getDefaultDisplay() 22 | .getMetrics(dm); 23 | return (int) Math.ceil(dip * dm.density); 24 | } 25 | 26 | /** 27 | * 把px单位转成dip单位 28 | * 29 | * @param context context对象 30 | * @param px px数值 31 | * @return 32 | */ 33 | public static int formatPxToDip(Context context, int px) { 34 | DisplayMetrics dm = new DisplayMetrics(); 35 | ((Activity) context).getWindowManager().getDefaultDisplay() 36 | .getMetrics(dm); 37 | return (int) Math.ceil(((px * 160) / dm.densityDpi)); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/base_retry.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 11 | 12 | 18 | 19 |