├── .gitignore
├── .idea
├── codeStyles
│ ├── Project.xml
│ └── codeStyleConfig.xml
├── compiler.xml
├── copyright
│ ├── cody.xml
│ └── profiles_settings.xml
├── encodings.xml
├── gradle.xml
├── inspectionProfiles
│ └── Project_Default.xml
├── jarRepositories.xml
├── markdown-navigator-enh.xml
├── markdown-navigator.xml
├── misc.xml
├── runConfigurations.xml
├── scopes
│ └── code.xml
└── vcs.xml
├── LICENSE
├── README.md
├── app-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── app
│ │ ├── BaseApplication.java
│ │ ├── IBaseListView.java
│ │ ├── IBasePageListView.java
│ │ ├── activity
│ │ ├── AbsBindActivity.java
│ │ ├── AbsListActivity.java
│ │ ├── AbsPageListActivity.java
│ │ ├── BaseActionbarActivity.java
│ │ ├── BaseActivity.java
│ │ ├── BaseBindActivity.java
│ │ ├── BaseFragmentContainerActivity.java
│ │ ├── FragmentContainerActivity.java
│ │ ├── FragmentContainerWithButtonActivity.java
│ │ ├── FragmentContainerWithCloseActivity.java
│ │ ├── FragmentContainerWithFabActivity.java
│ │ ├── FriendlyBindActivity.java
│ │ └── StaticActivity.java
│ │ ├── fragment
│ │ ├── AbsBindFragment.java
│ │ ├── AbsListFragment.java
│ │ ├── AbsPageListFragment.java
│ │ ├── BaseBindFragment.java
│ │ ├── BaseFragment.java
│ │ ├── BaseLazyFragment.java
│ │ ├── FriendlyBindFragment.java
│ │ ├── ListFragment.java
│ │ ├── PageListFragment.java
│ │ └── StaticFragment.java
│ │ ├── local
│ │ ├── BaseLocalKey.java
│ │ ├── LocalProfile.java
│ │ └── Repository.java
│ │ └── widget
│ │ ├── LoadingDialog.java
│ │ ├── friendly
│ │ ├── FriendlyLayout.java
│ │ └── IFriendlyView.java
│ │ └── swipebacklayout
│ │ ├── BGAKeyboardUtil.java
│ │ ├── BGASwipeBackHelper.java
│ │ ├── BGASwipeBackLayout.java
│ │ ├── BGASwipeBackManager.java
│ │ ├── BGASwipeBackShadowView.java
│ │ └── UIUtil.java
│ └── res
│ ├── anim
│ ├── ani_backward_enter.xml
│ ├── ani_backward_exit.xml
│ ├── ani_forward_enter.xml
│ ├── ani_forward_exit.xml
│ ├── ani_swipeback_enter.xml
│ └── ani_swipeback_exit.xml
│ ├── drawable
│ ├── bg_shadow_line.9.png
│ └── swipeback_shadow.9.png
│ ├── layout
│ ├── activity_fragment_container.xml
│ ├── activity_fragment_container_with_button.xml
│ ├── activity_fragment_container_with_close.xml
│ ├── activity_fragment_container_with_fab.xml
│ ├── fragment_list.xml
│ ├── friendly_empty_view.xml
│ ├── friendly_error_view.xml
│ ├── friendly_init_view.xml
│ └── loading_dialog.xml
│ └── values
│ ├── strings.xml
│ └── styles.xml
├── app-demo
├── .gitignore
├── README.md
├── build.gradle
├── keystore.jks
├── proguard-rules.pro
├── signing.properties
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── demo
│ │ ├── DemoApplication.java
│ │ ├── LiveEventBus.java
│ │ ├── banner
│ │ └── MainActivity.java
│ │ ├── bean
│ │ ├── TestBean.java
│ │ └── TestDataBean.java
│ │ ├── bus
│ │ ├── AppDemo.java
│ │ └── BusDemoActivity.java
│ │ ├── data
│ │ ├── CatApiOpen.java
│ │ └── CatHttpBin.java
│ │ ├── friendly
│ │ └── FriendlyActivity.java
│ │ ├── list
│ │ ├── ItemTestViewData.java
│ │ ├── ListTestActivity.java
│ │ ├── PageListTestFragment.java
│ │ └── TestPageListViewModel.java
│ │ └── repository
│ │ ├── Account.java
│ │ ├── AccountDataSource.java
│ │ ├── AccountRepository.java
│ │ ├── IAccountDataSource.java
│ │ ├── NewsPack.java
│ │ ├── QrCode.java
│ │ └── Weather.java
│ └── res
│ ├── drawable-v24
│ └── ic_launcher_foreground.xml
│ ├── drawable
│ ├── ic_launcher_background.xml
│ ├── ic_shape_red_round_button.xml
│ └── img_update_top.png
│ ├── layout
│ ├── activity_bus_demo.xml
│ ├── activity_friendly.xml
│ ├── activity_main_banner.xml
│ ├── content_scrolling.xml
│ ├── item_test_list.xml
│ └── update_dialog.xml
│ ├── menu
│ └── menu_demo.xml
│ ├── mipmap-anydpi-v26
│ ├── ic_launcher.xml
│ └── ic_launcher_round.xml
│ ├── mipmap-hdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-mdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ ├── mipmap-xxxhdpi
│ ├── ic_launcher.png
│ └── ic_launcher_round.png
│ └── values
│ ├── strings.xml
│ └── styles.xml
├── banner-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── banner
│ │ ├── BindingBanner.java
│ │ ├── ScrollSpeedLinearLayoutManger.java
│ │ ├── adapter
│ │ └── BindingBannerAdapter.java
│ │ └── data
│ │ └── BannerViewData.java
│ └── res
│ ├── layout
│ └── default_binding_banner.xml
│ └── values
│ └── atrrs.xml
├── bind-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── bind
│ │ ├── CoreBR.java
│ │ ├── IBinding.java
│ │ └── adapter
│ │ ├── AlphaTransformation.java
│ │ ├── DataBindingAdapterDefines.java
│ │ └── list
│ │ ├── BindingItemDiffCallback.java
│ │ ├── BindingListAdapter.java
│ │ ├── BindingPageListAdapter.java
│ │ ├── BindingViewHolder.java
│ │ ├── IBindingAdapter.java
│ │ ├── MultiBindingListAdapter.java
│ │ ├── MultiBindingPageListAdapter.java
│ │ └── OnBindingItemClickListener.java
│ └── res
│ └── layout
│ └── item_load_more.xml
├── blues-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── blues
│ ├── Blues.java
│ ├── BluesCallBack.java
│ ├── BluesConfig.java
│ ├── BluesHandler.java
│ ├── BluesQuitException.java
│ └── CrashUtil.java
├── build.gradle
├── cat-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── cat_ic_launcher-web.png
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── cat
│ │ ├── HttpCat.java
│ │ ├── db
│ │ ├── HttpCatDao.java
│ │ ├── HttpCatDatabase.java
│ │ └── data
│ │ │ ├── HttpHeader.java
│ │ │ └── ItemHttpData.java
│ │ ├── exception
│ │ └── NoCatCreatedException.java
│ │ ├── interceptor
│ │ └── HttpCatInterceptor.java
│ │ ├── notification
│ │ └── NotificationManagement.java
│ │ ├── service
│ │ └── CatClearService.java
│ │ ├── ui
│ │ ├── CatDetailsActivity.java
│ │ ├── CatMainActivity.java
│ │ ├── CatOverviewFragment.java
│ │ └── CatPayloadFragment.java
│ │ ├── utils
│ │ ├── Converters.java
│ │ ├── FormatUtils.java
│ │ └── LauncherUtil.java
│ │ └── viewmodel
│ │ └── CatViewModel.java
│ └── res
│ ├── drawable
│ ├── cat_ic_clear.xml
│ ├── cat_ic_https.xml
│ ├── cat_ic_https_selector_for_text_view.xml
│ ├── cat_ic_launcher_background.xml
│ ├── cat_ic_share.xml
│ └── ic_arrow_upward.xml
│ ├── layout
│ ├── cat_activity_details.xml
│ ├── cat_activity_main.xml
│ ├── cat_fragment_overview.xml
│ ├── cat_fragment_payload.xml
│ └── cat_item_main.xml
│ ├── menu
│ ├── cat_menu_main.xml
│ └── cat_menu_share.xml
│ ├── mipmap-anydpi-v26
│ └── cat_ic_launcher.xml
│ ├── mipmap-hdpi
│ ├── cat_ic_launcher.png
│ └── cat_ic_launcher_foreground.png
│ ├── mipmap-mdpi
│ ├── cat_ic_launcher.png
│ └── cat_ic_launcher_foreground.png
│ ├── mipmap-xhdpi
│ ├── cat_ic_launcher.png
│ └── cat_ic_launcher_foreground.png
│ ├── mipmap-xxhdpi
│ ├── cat_ic_launcher.png
│ └── cat_ic_launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ ├── cat_ic_launcher.png
│ └── cat_ic_launcher_foreground.png
│ └── values
│ ├── colors.xml
│ ├── strings.xml
│ └── styles.xml
├── compiler
├── .gitignore
├── README.md
└── build.gradle
├── config-aar.gradle
├── config-compiler.gradle
├── config-define.gradle
├── config-doc.gradle
├── config-lib.gradle
├── config-local-maven.gradle
├── config-versions.gradle
├── core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ └── AndroidManifest.xml
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── handler-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── handler
│ ├── RequestStatusUtil.java
│ ├── UnImplementException.java
│ ├── data
│ ├── FriendlyViewData.java
│ ├── IViewData.java
│ ├── ItemFooterOrHeaderData.java
│ ├── ItemViewDataHolder.java
│ └── ViewData.java
│ ├── define
│ ├── Operation.java
│ ├── PageInfo.java
│ ├── RequestStatus.java
│ ├── Status.java
│ └── ViewAction.java
│ ├── factory
│ └── PageListDataSourceFactory.java
│ ├── interfaces
│ ├── OnFriendlyListener.java
│ ├── OnInitListener.java
│ ├── OnRequestListener.java
│ ├── OnRequestPageListener.java
│ ├── OnRetryListener.java
│ ├── PageResultCallBack.java
│ ├── Refreshable.java
│ ├── ResultCallBack.java
│ └── Scrollable.java
│ ├── livedata
│ ├── BooleanLiveData.java
│ ├── FloatLiveData.java
│ ├── IntegerLiveData.java
│ ├── LongLiveData.java
│ ├── SafeMutableLiveData.java
│ └── StringLiveData.java
│ ├── mapper
│ ├── DataMapper.java
│ └── PageDataMapper.java
│ ├── source
│ └── PageListKeyedDataSource.java
│ ├── view
│ └── IBaseView.java
│ └── viewmodel
│ ├── AbsPageListViewModel.java
│ ├── BaseViewModel.java
│ ├── FriendlyViewModel.java
│ ├── IViewModel.java
│ ├── ListViewModel.java
│ ├── PageListViewModel.java
│ └── SingleViewModel.java
├── http-compiler
├── .gitignore
├── README.md
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── http
│ └── compiler
│ ├── RemoteDataSourceProcessor.java
│ ├── Util.java
│ └── bean
│ ├── DataSourceInfoBean.java
│ ├── DomainBean.java
│ ├── MethodBean.java
│ └── ParameterBean.java
├── http-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── http
│ ├── BaseRemoteDataSource.java
│ ├── BaseSubscriber.java
│ ├── GZIPUtil.java
│ ├── HttpCore.java
│ ├── IDataSource.java
│ ├── RetrofitManagement.java
│ ├── callback
│ ├── RequestCallback.java
│ ├── RequestFriendlyCallback.java
│ └── RequestMultiplyCallback.java
│ ├── db
│ ├── Converters.java
│ ├── HttpCacheDao.java
│ ├── HttpCacheDatabase.java
│ └── data
│ │ └── ItemCacheData.java
│ ├── holder
│ └── ToastHolder.java
│ ├── interceptor
│ ├── HeaderInterceptor.java
│ └── HttpCacheInterceptor.java
│ └── repository
│ └── BaseRepository.java
├── http-lib
├── .gitignore
├── README.md
├── build.gradle
└── src
│ └── main
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── http
│ └── lib
│ ├── annotation
│ └── Domain.java
│ ├── config
│ ├── HttpCode.java
│ └── HttpConfig.java
│ └── exception
│ ├── AccountInvalidHttpException.java
│ ├── ConnectionHttpException.java
│ ├── DomainInvalidHttpException.java
│ ├── ForbiddenHttpException.java
│ ├── GenerateDataSourceHttpException.java
│ ├── InvalidDefineHttpException.java
│ ├── ParameterInvalidHttpException.java
│ ├── ResultInvalidHttpException.java
│ ├── ServerResultHttpException.java
│ ├── TokenInvalidHttpException.java
│ └── base
│ └── BaseHttpException.java
├── hybrid-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── assets
│ ├── JsBridge.js
│ └── hybrid_test.html
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── hybrid
│ │ ├── H5Exception.java
│ │ ├── HtmlViewModel.java
│ │ ├── JsBridge.java
│ │ ├── OnCreateOptionsListener.java
│ │ ├── OnShareListener.java
│ │ ├── OnUrlListener.java
│ │ ├── activity
│ │ └── HtmlActivity.java
│ │ ├── core
│ │ ├── JsCallback.java
│ │ ├── JsCode.java
│ │ ├── JsHandler.java
│ │ ├── JsHandlerFactory.java
│ │ ├── JsInteract.java
│ │ ├── JsLifeCycle.java
│ │ ├── JsWebChromeClient.java
│ │ ├── JsWebViewClient.java
│ │ ├── UrlUtil.java
│ │ └── async
│ │ │ ├── AsyncTaskExecutor.java
│ │ │ └── AsyncTaskThreadFactory.java
│ │ ├── data
│ │ ├── HtmlConfig.java
│ │ └── HtmlViewData.java
│ │ ├── fragment
│ │ └── HtmlFragment.java
│ │ └── handler
│ │ └── JsHandlerCommonImpl.java
│ └── res
│ ├── drawable
│ └── ic_html_progress.xml
│ ├── layout
│ ├── fragment_html.xml
│ ├── hybrid_friendly_error_view.xml
│ └── hybrid_friendly_init_view.xml
│ ├── menu
│ └── html_menu.xml
│ └── values
│ └── strings.xml
├── image-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── image
│ │ ├── IImageViewListener.java
│ │ ├── ImagePicker.java
│ │ ├── ImageViewDelegate.java
│ │ ├── OnImageViewListener.java
│ │ ├── RatioImageView.java
│ │ ├── certificate
│ │ ├── camera
│ │ │ ├── AutoFocusManager.java
│ │ │ ├── CameraActivity.java
│ │ │ ├── CameraPreview.java
│ │ │ ├── CameraUtils.java
│ │ │ └── SensorController.java
│ │ ├── cropper
│ │ │ ├── CropImageView.java
│ │ │ ├── CropListener.java
│ │ │ ├── CropOverlayView.java
│ │ │ └── CropPosition.java
│ │ └── global
│ │ │ └── Constant.java
│ │ ├── preview
│ │ └── ImageActivity.java
│ │ └── scan
│ │ └── ScanActivity.java
│ └── res
│ ├── drawable
│ ├── ic_cancel.xml
│ ├── ic_choose.xml
│ ├── ic_flashlight_off.xml
│ ├── ic_flashlight_on.xml
│ ├── ic_gallery.xml
│ ├── ic_rotate.xml
│ └── ic_shoot.xml
│ ├── layout-land
│ └── activity_camera.xml
│ ├── layout
│ ├── activity_camera.xml
│ ├── activity_image.xml
│ ├── activity_scan.xml
│ └── crop_image_view.xml
│ ├── mipmap-xxhdpi
│ ├── camera_company.png
│ ├── camera_company_landscape.png
│ ├── camera_idcard_back.png
│ └── camera_idcard_front.png
│ └── values
│ ├── atrrs.xml
│ └── strings.xml
├── lib-core
├── .gitignore
├── README.md
├── build.gradle
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── java
│ └── com
│ └── cody
│ └── component
│ └── lib
│ ├── bean
│ ├── ListBean.java
│ └── Result.java
│ ├── exception
│ ├── BaseCode.java
│ ├── BaseException.java
│ └── NotInitializedException.java
│ └── view
│ └── IView.java
├── marquee-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── marquee
│ │ ├── MarqueeFactory.java
│ │ └── MarqueeView.java
│ └── res
│ └── anim
│ ├── core_anim_marquee_in.xml
│ └── core_anim_marquee_out.xml
├── settings.gradle
├── structure
├── APP-structure.xmind
└── module_structure.png
├── ui-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ └── res
│ ├── drawable-v21
│ ├── bg_primary_rectangle_touch_selector.xml
│ ├── bg_primary_round_touch_selector.xml
│ ├── bg_secondary_no_boundary_touch_selector.xml
│ ├── bg_secondary_rectangle_touch_selector.xml
│ ├── bg_secondary_round_touch_selector.xml
│ ├── bg_secondary_touch_selector.xml
│ ├── bg_third_touch_selector.xml
│ ├── bg_transparent_no_boundary_touch_selector.xml
│ └── bg_transparent_round_touch_selector.xml
│ ├── drawable
│ ├── bg_primary_rectangle_touch_selector.xml
│ ├── bg_primary_round_touch_selector.xml
│ ├── bg_secondary_no_boundary_touch_selector.xml
│ ├── bg_secondary_rectangle_touch_selector.xml
│ ├── bg_secondary_round_touch_selector.xml
│ ├── bg_secondary_touch_selector.xml
│ ├── bg_shape_round.xml
│ ├── bg_third_touch_selector.xml
│ ├── bg_transparent_no_boundary_touch_selector.xml
│ ├── bg_transparent_round_touch_selector.xml
│ ├── ic_add.xml
│ ├── ic_back.xml
│ ├── ic_back_white.xml
│ ├── ic_bad_network.xml
│ ├── ic_close.xml
│ ├── ic_default_error.xml
│ ├── ic_default_place_holder.xml
│ ├── ic_load_failed.xml
│ ├── ic_load_failed_selector_for_text_view.xml
│ ├── ic_loading_gif.gif
│ ├── ic_no_content.xml
│ └── ic_share.xml
│ └── values
│ ├── colors.xml
│ ├── default-theme.xml
│ ├── dimens.xml
│ ├── fonts.xml
│ ├── strings.xml
│ └── theme.xml
├── update-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── update
│ │ ├── DownloadService.java
│ │ ├── UpdateBean.java
│ │ ├── UpdateDelegate.java
│ │ └── UpdateViewData.java
│ └── res
│ ├── values
│ └── strings.xml
│ └── xml
│ └── file_paths.xml
├── util-core
├── .gitignore
├── README.md
├── build.gradle
├── proguard-rules.pro
└── src
│ └── main
│ ├── AndroidManifest.xml
│ ├── java
│ └── com
│ │ └── cody
│ │ └── component
│ │ └── util
│ │ ├── ActivityUtil.java
│ │ ├── ApplicationUtil.java
│ │ ├── CameraUtil.java
│ │ ├── DisplayUtil.java
│ │ ├── FileUtil.java
│ │ ├── ImageUtil.java
│ │ ├── LogUtil.java
│ │ ├── NotProguard.java
│ │ ├── PermissionUtil.java
│ │ ├── RecyclerViewUtil.java
│ │ ├── ScreenUtil.java
│ │ ├── SizeUtil.java
│ │ ├── SystemBarUtil.java
│ │ ├── ToastUtil.java
│ │ ├── TypeUtil.java
│ │ └── VersionUtil.java
│ └── res
│ └── values
│ └── util_ids.xml
└── versions-update.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/caches
5 | /.idea/libraries
6 | /.idea/modules.xml
7 | /.idea/workspace.xml
8 | /.idea/navEditor.xml
9 | /.idea/assetWizardSettings.xml
10 | .DS_Store
11 | /build
12 | /captures
13 | .externalNativeBuild
14 |
--------------------------------------------------------------------------------
/.idea/codeStyles/codeStyleConfig.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/.idea/copyright/cody.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/copyright/profiles_settings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/encodings.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/.idea/inspectionProfiles/Project_Default.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/.idea/runConfigurations.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
11 |
12 |
--------------------------------------------------------------------------------
/.idea/scopes/code.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/.idea/vcs.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/app-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/app-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月23日 18:19:41
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api rootProject.ext.dependencies["constraintlayout"]
16 | api rootProject.ext.dependencies["easypermissions"]
17 | api project(':bind-core')
18 | }
--------------------------------------------------------------------------------
/app-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/app-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/IBaseListView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IBaseListView.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.recyclerview.widget.LinearLayoutManager;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import com.cody.component.bind.adapter.list.BindingListAdapter;
20 | import com.cody.component.bind.adapter.list.MultiBindingListAdapter;
21 | import com.cody.component.handler.data.ItemViewDataHolder;
22 | import com.cody.component.handler.interfaces.OnRetryListener;
23 | import com.cody.component.handler.interfaces.Scrollable;
24 |
25 | /**
26 | * Created by xu.yi. on 2019/4/10.
27 | * 列表绑定需要实现的接口
28 | */
29 | public interface IBaseListView extends OnRetryListener, Scrollable {
30 | @NonNull
31 | BindingListAdapter buildListAdapter();
32 |
33 | @NonNull
34 | BindingListAdapter getListAdapter();
35 |
36 | @NonNull
37 | LinearLayoutManager buildLayoutManager();
38 |
39 | @NonNull
40 | RecyclerView getRecyclerView();
41 | }
42 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/IBasePageListView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IBasePageListView.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年07月23日 08:41:20
5 | * 上次修改时间:2019年06月25日 10:52:57
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.recyclerview.widget.LinearLayoutManager;
17 | import androidx.recyclerview.widget.RecyclerView;
18 |
19 | import com.cody.component.bind.adapter.list.BindingPageListAdapter;
20 | import com.cody.component.bind.adapter.list.MultiBindingPageListAdapter;
21 | import com.cody.component.handler.data.ItemViewDataHolder;
22 | import com.cody.component.handler.interfaces.OnRetryListener;
23 | import com.cody.component.handler.interfaces.Scrollable;
24 |
25 | /**
26 | * Created by xu.yi. on 2019/4/10.
27 | * 列表绑定需要实现的接口
28 | */
29 | public interface IBasePageListView extends OnRetryListener, Scrollable {
30 | @NonNull
31 | BindingPageListAdapter buildListAdapter();
32 |
33 | @NonNull
34 | BindingPageListAdapter getListAdapter();
35 |
36 | @NonNull
37 | LinearLayoutManager buildLayoutManager();
38 |
39 | @NonNull
40 | RecyclerView getRecyclerView();
41 | }
42 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/activity/FragmentContainerActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:FragmentContainerActivity.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月14日 17:02:32
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.activity;
14 |
15 |
16 | import androidx.appcompat.widget.Toolbar;
17 | import androidx.fragment.app.Fragment;
18 |
19 | import com.cody.component.app.R;
20 | import com.cody.component.app.databinding.ActivityFragmentContainerBinding;
21 | import com.cody.component.handler.interfaces.Scrollable;
22 |
23 | /**
24 | * 包含返回键和头部
25 | */
26 | public abstract class FragmentContainerActivity extends BaseFragmentContainerActivity implements Scrollable {
27 | public abstract Fragment getFragment();
28 |
29 | @Override
30 | protected int getLayoutID() {
31 | return R.layout.activity_fragment_container;
32 | }
33 |
34 | protected Toolbar getToolbar() {
35 | return getBinding().toolbar;
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/activity/FragmentContainerWithButtonActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:FragmentContainerWithButtonActivity.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月14日 17:02:32
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.activity;
14 |
15 |
16 | import androidx.appcompat.widget.Toolbar;
17 |
18 | import com.cody.component.app.R;
19 | import com.cody.component.app.databinding.ActivityFragmentContainerWithButtonBinding;
20 | import com.cody.component.handler.interfaces.Scrollable;
21 |
22 | /**
23 | * 包含返回键和头部和底部按钮
24 | */
25 | public abstract class FragmentContainerWithButtonActivity extends BaseFragmentContainerActivity implements Scrollable {
26 |
27 | @Override
28 | protected int getLayoutID() {
29 | return R.layout.activity_fragment_container_with_button;
30 | }
31 |
32 | @Override
33 | protected Toolbar getToolbar() {
34 | return getBinding().toolbar;
35 | }
36 | }
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/activity/FragmentContainerWithFabActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:FragmentContainerWithFabActivity.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月14日 23:43:24
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.activity;
14 |
15 |
16 | import androidx.appcompat.widget.Toolbar;
17 | import androidx.fragment.app.Fragment;
18 |
19 | import com.cody.component.app.R;
20 | import com.cody.component.app.databinding.ActivityFragmentContainerWithFabBinding;
21 | import com.cody.component.handler.interfaces.Scrollable;
22 |
23 | /**
24 | * 包含返回键和头部和底部FAB按钮
25 | */
26 | public abstract class FragmentContainerWithFabActivity extends BaseFragmentContainerActivity implements Scrollable {
27 | public abstract Fragment getFragment();
28 |
29 | @Override
30 | protected int getLayoutID() {
31 | return R.layout.activity_fragment_container_with_fab;
32 | }
33 |
34 | @Override
35 | protected Toolbar getToolbar() {
36 | return getBinding().toolbar;
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/activity/StaticActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:StaticActivity.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.activity;
14 |
15 | import androidx.databinding.ViewDataBinding;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/3/25.
19 | * 不需要绑定viewData 页面静态 无需要绑定数据
20 | */
21 | public abstract class StaticActivity extends BaseBindActivity {
22 | @Override
23 | protected void bindViewData() {
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/fragment/StaticFragment.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:StaticFragment.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.fragment;
14 |
15 | import androidx.databinding.ViewDataBinding;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/3/25.
19 | * 不需要绑定viewData 页面静态 无需要绑定数据
20 | */
21 | public abstract class StaticFragment extends BaseBindFragment {
22 | @Override
23 | protected void bindViewData() {
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app-core/src/main/java/com/cody/component/app/local/BaseLocalKey.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BaseLocalKey.java 模块:app-core 项目:component
4 | * 当前修改时间:2019年05月06日 14:20:35
5 | * 上次修改时间:2019年05月06日 13:13:31
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.app.local;
14 |
15 | /**
16 | * Created by cody.yi on 2019/3/30.
17 | * 本地数据存储
18 | * 目前只提供sharePreference方式
19 | */
20 | public interface BaseLocalKey {
21 | String BASE = "BS_";
22 | String VERSION_CODE = BASE + "version_code";
23 | String COOKIE = BASE + "cookie";
24 | String TOKEN = BASE + "token";
25 | String DEVICE_ID = "device_id";//设备唯一号
26 | String CITY_NAME = "cityName";// 城市名称
27 | String CITY_CODE = "cityCode";// 城市code
28 | }
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_backward_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_backward_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_forward_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_forward_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_swipeback_enter.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/anim/ani_swipeback_exit.xml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/app-core/src/main/res/drawable/bg_shadow_line.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-core/src/main/res/drawable/bg_shadow_line.9.png
--------------------------------------------------------------------------------
/app-core/src/main/res/drawable/swipeback_shadow.9.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-core/src/main/res/drawable/swipeback_shadow.9.png
--------------------------------------------------------------------------------
/app-core/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | 发现新版本
16 | 申请权限成功!
17 | 缺少权限!
18 | 版本更新中
19 | 下载中 -
20 | 更新进度:0/100
21 | 立即更新
22 | 以后再说
23 | 下载完成!
24 | 下载进度:%1$s/%2$s
25 | 请打开未知来源权限设置
26 |
--------------------------------------------------------------------------------
/app-core/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
28 |
--------------------------------------------------------------------------------
/app-demo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 | /bugly
3 |
--------------------------------------------------------------------------------
/app-demo/keystore.jks:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/keystore.jks
--------------------------------------------------------------------------------
/app-demo/signing.properties:
--------------------------------------------------------------------------------
1 | #
2 | # *************************************************************
3 | # 文件:signing.properties 模块:app 项目:component
4 | # 当前修改时间:2019年04月23日 18:23:19
5 | # 上次修改时间:2019年04月13日 09:19:28
6 | # 作者:Cody.yi https://github.com/codyer
7 | #
8 | # 描述:app
9 | # Copyright (c) 2019
10 | # *************************************************************
11 | #
12 |
13 | # 你的keystore文件位置
14 | KEYSTORE_FILE=keystore.jks
15 | # 你的keystore文件密码
16 | KEYSTORE_PASSWORD=cody_password
17 | # 你的keystore文件用到的别名
18 | KEY_ALIAS=cody_alias
19 | # 你的keystore文件用到的别名的密码
20 | KEY_PASSWORD=cody_password
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/bean/TestBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:TestBean.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.bean;
14 |
15 | import androidx.annotation.NonNull;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/3.
19 | * LiveEventBus
20 | */
21 | public class TestBean {
22 | private String name;
23 | private String code;
24 |
25 | @NonNull
26 | @Override
27 | public String toString() {
28 | String sb = "TestDataBean{" + "name='" + name + '\'' +
29 | ", code='" + code + '\'' +
30 | '}';
31 | return sb;
32 | }
33 |
34 | public TestBean(String name, String code) {
35 | this.name = name;
36 | this.code = code;
37 | }
38 |
39 | public String getName() {
40 | return name;
41 | }
42 |
43 | public void setName(String name) {
44 | this.name = name;
45 | }
46 |
47 | public String getCode() {
48 | return code;
49 | }
50 |
51 | public void setCode(String code) {
52 | this.code = code;
53 | }
54 | }
55 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/bean/TestDataBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:TestDataBean.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.bean;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/7.
17 | * component
18 | */
19 | public class TestDataBean {
20 | final String thing;
21 |
22 | public TestDataBean(String thing) {
23 | this.thing = thing;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/bus/AppDemo.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:AppDemo.java 模块:app-demo 项目:component
4 | * 当前修改时间:2021年02月27日 15:30:04
5 | * 上次修改时间:2021年02月27日 15:05:41
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app-demo
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.bus;
14 |
15 | import com.cody.component.demo.bean.TestBean;
16 |
17 | import cody.bus.annotation.Event;
18 | import cody.bus.annotation.EventGroup;
19 |
20 | /**
21 | * Created by xu.yi. on 2019/4/3.
22 | * LiveEventBus
23 | */
24 | @EventGroup(name = "DemoGroup", active = true)
25 | public class AppDemo {
26 | @Event(description = "定义一个测试事件")
27 | String testString;
28 | @Event(description = "定义一个测试事件测试对象", multiProcess = true)
29 | TestBean testBean;
30 | }
31 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/data/CatApiOpen.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:CatApiOpen.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.data;
14 |
15 | import com.cody.component.http.lib.annotation.Domain;
16 |
17 | import io.reactivex.Observable;
18 | import retrofit2.http.GET;
19 | import retrofit2.http.Headers;
20 |
21 | /**
22 | * Created by xu.yi. on 2019/4/7.
23 | * component
24 | */
25 | @Domain("https://api.apiopen.top")
26 | public interface CatApiOpen {
27 |
28 | @GET("/singlePoetry")
29 | @Headers({"testHeader" + ":" + "singlePoetry"})
30 | Observable singlePoetry();
31 |
32 | @GET("/recommendPoetry")
33 | @Headers({"testHeader" + ":" + "recommendPoetry"})
34 | Observable recommendPoetry();
35 |
36 | @GET("/musicBroadcasting")
37 | @Headers({"testHeader" + ":" + "musicBroadcasting"})
38 | Observable musicBroadcasting();
39 |
40 | @GET("/novelApi")
41 | @Headers({"testHeader" + ":" + "novelApi"})
42 | Observable novelApi();
43 | }
44 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/list/ListTestActivity.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ListTestActivity.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月14日 16:08:30
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.list;
14 |
15 | import android.view.View;
16 |
17 | import com.cody.component.app.activity.FragmentContainerActivity;
18 |
19 | import androidx.fragment.app.Fragment;
20 |
21 | public class ListTestActivity extends FragmentContainerActivity {
22 |
23 | @Override
24 | public Fragment getFragment() {
25 | return new PageListTestFragment();
26 | }
27 |
28 | @Override
29 | public void onClick(final View v) {
30 |
31 | }
32 |
33 | @Override
34 | public void scrollToTop() {
35 |
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/repository/Account.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Account.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.repository;
14 |
15 | import com.cody.component.http.lib.annotation.Domain;
16 | import com.cody.component.lib.bean.Result;
17 |
18 | import java.util.List;
19 |
20 | import io.reactivex.Observable;
21 | import retrofit2.http.GET;
22 | import retrofit2.http.Query;
23 |
24 | /**
25 | *
26 | */
27 | @Domain("https://www.jianshu.com/")
28 | public interface Account {
29 |
30 | @GET("onebox/weather/query")
31 | Observable> queryWeather(@Query("cityname") String cityName);
32 |
33 | @GET("qrcode/api")
34 | Observable> createQrCode(@Query("text") String text, @Query("w") int width);
35 |
36 | @GET("toutiao/index")
37 | Observable> getNews();
38 |
39 | @GET("toutiao/index")
40 | Observable>> getNewList();
41 |
42 | @GET("leavesC/test1")
43 | Observable> test1();
44 |
45 | @GET("leavesC/test2")
46 | Observable> test2();
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/repository/IAccountDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IAccountDataSource.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.repository;
14 |
15 |
16 | import com.cody.component.http.callback.RequestCallback;
17 |
18 | /**
19 | * 自动生成,不要修改
20 | */
21 | public interface IAccountDataSource {
22 |
23 | void queryWeather(String cityName, RequestCallback callback);
24 |
25 | void createQrCode(String text, int width, RequestCallback callback);
26 |
27 | void getNews(RequestCallback callback);
28 |
29 | void test1(RequestCallback callback);
30 |
31 | void test2(RequestCallback callback);
32 | }
33 |
--------------------------------------------------------------------------------
/app-demo/src/main/java/com/cody/component/demo/repository/QrCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:QrCode.java 模块:app 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:app
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.demo.repository;
14 |
15 | import android.graphics.Bitmap;
16 |
17 | /**
18 | * 作者:leavesC
19 | * 时间:2018/10/29 21:22
20 | * 描述:
21 | * GitHub:https://github.com/leavesC
22 | * Blog:https://www.jianshu.com/u/9df45b87cfdf
23 | */
24 | public class QrCode {
25 |
26 | private String base64_image;
27 |
28 | private Bitmap bitmap;
29 |
30 | public String getBase64_image() {
31 | return base64_image;
32 | }
33 |
34 | public void setBase64_image(String base64_image) {
35 | this.base64_image = base64_image;
36 | }
37 |
38 | public Bitmap getBitmap() {
39 | return bitmap;
40 | }
41 |
42 | public void setBitmap(Bitmap bitmap) {
43 | this.bitmap = bitmap;
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/drawable/ic_shape_red_round_button.xml:
--------------------------------------------------------------------------------
1 |
11 |
12 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/drawable/img_update_top.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/drawable/img_update_top.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/layout/content_scrolling.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
22 |
23 |
29 |
30 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/menu/menu_demo.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
23 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/app-demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/app-demo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/banner-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/banner-core/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * ************************************************************
4 | * 文件:build.gradle 模块:bind-banner 项目:component
5 | * 当前修改时间:2019年04月23日 18:23:20
6 | * 上次修改时间:2019年04月13日 08:44:03
7 | * 作者:Cody.yi https://github.com/codyer
8 | *
9 | * 描述:bind-banner
10 | * Copyright (c) 2019
11 | * ************************************************************
12 | */
13 |
14 | apply from: "${project.rootDir}/config-aar.gradle"
15 | dependencies {
16 | api project(':bind-core')
17 | }
18 |
--------------------------------------------------------------------------------
/banner-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/banner-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/banner-core/src/main/res/layout/default_binding_banner.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
17 |
18 |
19 |
20 |
21 |
24 |
25 |
28 |
29 |
30 |
40 |
--------------------------------------------------------------------------------
/banner-core/src/main/res/values/atrrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/bind-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/bind-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:bind-adapter 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:17:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-adapter
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':handler-core')
16 | }
17 |
--------------------------------------------------------------------------------
/bind-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/bind-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/bind-core/src/main/java/com/cody/component/bind/CoreBR.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:CoreBR.java 模块:bind-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:44:46
5 | * 上次修改时间:2019年04月23日 18:23:20
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.bind;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/23.
17 | * 所有用到BR的地方都使用这个,XML中不能自定义其他数据变量
18 | */
19 | public class CoreBR {
20 | public static final int _all = BR._all;
21 |
22 | public static final int viewData = BR.viewData;
23 |
24 | public static final int onClickListener = BR.onClickListener;
25 | }
--------------------------------------------------------------------------------
/bind-core/src/main/java/com/cody/component/bind/IBinding.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IBinding.java 模块:bind-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:42:41
5 | * 上次修改时间:2019年04月23日 18:23:19
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.bind;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/3/25.
17 | * component
18 | */
19 | public interface IBinding {
20 | /**
21 | * 是否已经设置bind
22 | */
23 | boolean unBound();
24 |
25 | B getBinding();
26 | }
27 |
--------------------------------------------------------------------------------
/bind-core/src/main/java/com/cody/component/bind/adapter/list/BindingItemDiffCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BindingItemDiffCallback.java 模块:bind-adapter 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 12:54:46
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-adapter
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.bind.adapter.list;
14 |
15 | import com.cody.component.handler.data.ItemViewDataHolder;
16 |
17 | import androidx.annotation.NonNull;
18 | import androidx.recyclerview.widget.DiffUtil;
19 |
20 | /**
21 | * Created by xu.yi. on 2019/4/4.
22 | * component
23 | */
24 | public class BindingItemDiffCallback- extends DiffUtil.ItemCallback
- {
25 | @Override
26 | public boolean areItemsTheSame(@NonNull Item oldItem, @NonNull Item newItem) {
27 | return oldItem.areItemsTheSame(newItem);
28 | }
29 |
30 | @Override
31 | public boolean areContentsTheSame(@NonNull Item oldItem, @NonNull Item newItem) {
32 | return oldItem.areContentsTheSame(newItem);
33 | }
34 | }
--------------------------------------------------------------------------------
/bind-core/src/main/java/com/cody/component/bind/adapter/list/IBindingAdapter.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IBindingAdapter.java 模块:bind-adapter 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 14:08:23
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-adapter
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.bind.adapter.list;
14 |
15 | import android.view.View;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/4.
19 | * binding adapter基类
20 | */
21 | interface IBindingAdapter {
22 | /**
23 | * 获取List中的Item的Layout ID
24 | *
25 | * @param viewType 支持多个itemType
26 | * @return LayoutId
27 | */
28 | int getItemLayoutId(int viewType);
29 |
30 | /**
31 | * 设置点击事件
32 | */
33 | void setItemClickListener(OnBindingItemClickListener itemClickListener);
34 |
35 | /**
36 | * 设置长按事件
37 | */
38 | void setItemLongClickListener(View.OnCreateContextMenuListener itemLongClickListener);
39 | }
40 |
--------------------------------------------------------------------------------
/blues-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/blues-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:blues-core 项目:component
4 | * 当前修改时间:2019年05月31日 15:57:18
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-update
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api rootProject.ext.dependencies["bugly-crashreport"]
16 | api rootProject.ext.dependencies["bugly-nativecrashreport"]
17 | }
--------------------------------------------------------------------------------
/blues-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/blues-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/blues-core/src/main/java/com/cody/component/blues/BluesCallBack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BluesCallBack.java 模块:blues-core 项目:component
4 | * 当前修改时间:2019年06月01日 14:07:39
5 | * 上次修改时间:2019年06月01日 14:07:39
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:blues-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.blues;
14 |
15 | import java.util.Map;
16 |
17 | public interface BluesCallBack {
18 | //showToast
19 | void showException(final String msg);
20 | //多次发生同样的异常
21 | void sameException(final Thread thread, final Throwable throwable);
22 | //上报异常数据
23 | void fillCrashData(Map map);
24 | }
25 |
--------------------------------------------------------------------------------
/blues-core/src/main/java/com/cody/component/blues/BluesQuitException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BluesQuitException.java 模块:cody-component 项目:component
4 | * 当前修改时间:2019年05月31日 18:46:49
5 | * 上次修改时间:2018年12月07日 16:22:12
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:cody-component
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.blues;
14 |
15 | /**
16 | * Created by cody.yi on 2018/6/6.
17 | * blues 退出异常处理类
18 | */
19 | final public class BluesQuitException extends RuntimeException {
20 | public BluesQuitException(String message) {
21 | super(message);
22 | }
23 |
24 | public BluesQuitException(Throwable cause) {
25 | super(cause);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/cat-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/cat-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:http-cat 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-cat
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':app-core')
16 | api rootProject.ext.dependencies["okhttp3"]
17 | api rootProject.ext.dependencies["legacy"]
18 | api rootProject.ext.dependencies["room-runtime"]
19 | api rootProject.ext.dependencies["jsonhandleview"]
20 | annotationProcessor rootProject.ext.dependencies["room-compiler"]
21 | }
22 |
--------------------------------------------------------------------------------
/cat-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/cat-core/src/main/cat_ic_launcher-web.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/cat_ic_launcher-web.png
--------------------------------------------------------------------------------
/cat-core/src/main/java/com/cody/component/cat/db/data/HttpHeader.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:HttpHeader.java 模块:http-cat 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-cat
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.cat.db.data;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/3/31.
17 | * http header
18 | */
19 | public class HttpHeader {
20 |
21 | private String name;
22 |
23 | private String value;
24 |
25 | public HttpHeader() {
26 | }
27 |
28 | HttpHeader(String name, String value) {
29 | this.name = name;
30 | this.value = value;
31 | }
32 |
33 | public void setName(final String name) {
34 | this.name = name;
35 | }
36 |
37 | public void setValue(final String value) {
38 | this.value = value;
39 | }
40 |
41 | public String getName() {
42 | return name;
43 | }
44 |
45 | public String getValue() {
46 | return value;
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/cat-core/src/main/java/com/cody/component/cat/exception/NoCatCreatedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:NoCatCreatedException.java 模块:http-cat 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-cat
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.cat.exception;
14 |
15 | import com.cody.component.lib.exception.BaseException;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/7.
19 | * component
20 | */
21 | public class NoCatCreatedException extends BaseException {
22 | private static final long serialVersionUID = -4749478194441091368L;
23 |
24 | public NoCatCreatedException() {
25 | super("使用实例必须先调用createCat");
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/cat-core/src/main/java/com/cody/component/cat/service/CatClearService.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:CatClearService.java 模块:http-cat 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-cat
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.cat.service;
14 |
15 | import android.app.IntentService;
16 | import android.content.Intent;
17 | import androidx.annotation.Nullable;
18 |
19 | import com.cody.component.cat.notification.NotificationManagement;
20 |
21 | /**
22 | * Created by xu.yi. on 2019/4/5.
23 | * CatClearService
24 | */
25 | public class CatClearService extends IntentService {
26 |
27 | public CatClearService() {
28 | super(CatClearService.class.getName());
29 | }
30 |
31 | @Override
32 | protected void onHandleIntent(@Nullable Intent intent) {
33 | NotificationManagement holder = NotificationManagement.getInstance(this);
34 | holder.clearBuffer();
35 | holder.dismiss();
36 | }
37 |
38 | }
--------------------------------------------------------------------------------
/cat-core/src/main/java/com/cody/component/cat/utils/Converters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Converters.java 模块:http-cat 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-cat
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.cat.utils;
14 |
15 | import androidx.room.TypeConverter;
16 |
17 | import java.util.Date;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/5.
21 | * Converters
22 | */
23 | public class Converters {
24 |
25 | @TypeConverter
26 | public static Date fromTimestamp(Long value) {
27 | return value == null ? null : new Date(value);
28 | }
29 |
30 | @TypeConverter
31 | public static Long dateToTimestamp(Date date) {
32 | return date == null ? null : date.getTime();
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/cat-core/src/main/res/drawable/cat_ic_https.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/drawable/cat_ic_https_selector_for_text_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/drawable/cat_ic_share.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/drawable/ic_arrow_upward.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/menu/cat_menu_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/menu/cat_menu_share.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-anydpi-v26/cat_ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-hdpi/cat_ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-hdpi/cat_ic_launcher.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-hdpi/cat_ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-hdpi/cat_ic_launcher_foreground.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-mdpi/cat_ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-mdpi/cat_ic_launcher.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-mdpi/cat_ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-mdpi/cat_ic_launcher_foreground.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xhdpi/cat_ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xhdpi/cat_ic_launcher.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xhdpi/cat_ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xhdpi/cat_ic_launcher_foreground.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xxhdpi/cat_ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xxhdpi/cat_ic_launcher.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xxhdpi/cat_ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xxhdpi/cat_ic_launcher_foreground.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xxxhdpi/cat_ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xxxhdpi/cat_ic_launcher.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/mipmap-xxxhdpi/cat_ic_launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/cat-core/src/main/res/mipmap-xxxhdpi/cat_ic_launcher_foreground.png
--------------------------------------------------------------------------------
/cat-core/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | #008577
16 | #00574B
17 | #D81B60
18 |
19 | #666666
20 | #f23c61
21 | #F0F0F0
22 |
23 |
--------------------------------------------------------------------------------
/cat-core/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | Cat
15 | Share
16 | Clear
17 |
18 |
--------------------------------------------------------------------------------
/compiler/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/compiler/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:compiler 项目:component
4 | * 当前修改时间:2021年02月27日 15:30:04
5 | * 上次修改时间:2021年02月27日 14:54:00
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:compiler
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 | apply from: "${project.rootDir}/config-compiler.gradle"
13 | dependencies {
14 | implementation project(':http-compiler')
15 | }
--------------------------------------------------------------------------------
/config-compiler.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:config-compiler.gradle 模块:component 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:component
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 | apply from: "${project.rootDir}/config-lib.gradle"
--------------------------------------------------------------------------------
/config-lib.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:config-lib.gradle 模块:component 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:component
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply plugin: 'java-library'
14 |
15 | sourceCompatibility = "7"
16 | targetCompatibility = "7"
17 |
18 | if (isLocalMaven) {
19 | apply from: "${project.rootDir}/config-local-maven.gradle"
20 | } else {
21 | apply plugin: 'com.github.dcendents.android-maven'
22 | group = 'com.github.codyer'
23 | }
24 |
25 | //指定编译的编码
26 | tasks.withType(JavaCompile) {
27 | options.encoding = "UTF-8"
28 | }
29 |
30 | tasks.withType(Javadoc) {
31 | options.encoding = "UTF-8"
32 | }
33 |
34 | task lint {}
35 |
36 | task sourcesJar(type: Jar, dependsOn: classes) {
37 | classifier = 'sources'
38 | from sourceSets.main.allSource
39 | }
40 |
41 | task javadocJar(type: Jar, dependsOn: javadoc) {
42 | classifier = 'javadoc'
43 | from javadoc.destinationDir
44 | }
45 |
46 | artifacts {
47 | archives sourcesJar
48 | archives javadocJar
49 | }
50 |
51 | javadoc {
52 | options {
53 | // 语言
54 | locale 'en_US'
55 | encoding 'UTF-8'
56 | charSet 'UTF-8'
57 | links "http://docs.oracle.com/javase/7/docs/api"
58 | }
59 | }
--------------------------------------------------------------------------------
/config-local-maven.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:config-local-maven.gradle 模块:component 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:component
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 | apply plugin: 'maven'
13 | uploadArchives {
14 | repositories {
15 | mavenDeployer {
16 | repository(url: LOCAL_REPOSITORY) {
17 | pom.groupId = LOCAL_GROUP_ID// 唯一标识(通常为模块包名,也可以任意)
18 | pom.artifactId = this.getName() // 项目名称(通常为类库模块名称,也可以任意)
19 | pom.version = rootProject.ext.componentVersion // 版本号
20 | }
21 | pom.whenConfigured { pom ->
22 | pom.dependencies.forEach { dep ->
23 | if (dep.getVersion() == "unspecified") {
24 | println("--modify the dependenies module in pom.xml--->>" + dep.getArtifactId())
25 | dep.setGroupId(LOCAL_GROUP_ID)
26 | dep.setVersion(rootProject.ext.componentVersion)
27 | }
28 | }
29 | }
30 | }
31 | }
32 | }
--------------------------------------------------------------------------------
/core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:core 项目:component
4 | * 当前修改时间:2021年02月27日 15:30:04
5 | * 上次修改时间:2021年02月27日 14:54:42
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:core
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':cat-core')
16 | api project(':update-core')
17 | api project(":hybrid-core")
18 | api project(":marquee-core")
19 | api project(':banner-core')
20 | api project(":http-core")
21 | }
--------------------------------------------------------------------------------
/core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | #
2 | # *************************************************************
3 | # 文件:gradle.properties 模块:component 项目:component
4 | # 当前修改时间:2021年03月03日 23:46:06
5 | # 上次修改时间:2021年02月27日 16:11:43
6 | # 作者:Cody.yi https://github.com/codyer
7 | #
8 | # 描述:component
9 | # Copyright (c) 2021
10 | # *************************************************************
11 | #
12 |
13 | # Project-wide Gradle settings.
14 | # IDE (e.g. Android Studio) users:
15 | # Gradle settings configured through the IDE *will override*
16 | # any settings specified in this file.
17 | # For more details on how to configure your build environment visit
18 | # http://www.gradle.org/docs/current/userguide/build_environment.html
19 | # Specifies the JVM arguments used for the daemon process.
20 | # The setting is particularly useful for tweaking memory settings.
21 | android.enableJetifier=true
22 | android.useAndroidX=true
23 | org.gradle.jvmargs=-Xmx1536m
24 | android.enableR8=true
25 | #debug apt 调试远程代码的时候打开下面两行
26 | #org.gradle.jvmargs=-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5033
27 | #-Dorg.gradle.debug=true
28 | # When configured, Gradle will run in incubating parallel mode.
29 | # This option should only be used with decoupled projects. More details, visit
30 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
31 | # org.gradle.parallel=true
32 | LOCAL_REPOSITORY=file:///Users/Shared/local-maven
33 | #LOCAL_REPOSITORY=file://E://local-maven
34 | LOCAL_GROUP_ID=local.component
35 |
36 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | #Fri Apr 10 14:39:58 CST 2020
2 | distributionBase=GRADLE_USER_HOME
3 | distributionPath=wrapper/dists
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
--------------------------------------------------------------------------------
/handler-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/handler-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':lib-core')
16 | api project(':ui-core')
17 | api project(":util-core")
18 | api rootProject.ext.dependencies["material"]
19 | api rootProject.ext.dependencies["lifecycle"]
20 | api(rootProject.ext.dependencies["glide"]) {
21 | exclude group: "com.android.support"
22 | }
23 | }
--------------------------------------------------------------------------------
/handler-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/handler-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/UnImplementException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:UnImplementException.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月27日 21:30:39
5 | * 上次修改时间:2019年04月27日 21:30:39
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/27.
17 | * component 提供了默认实现,但是没有实现任何一个方法
18 | */
19 | public class UnImplementException extends RuntimeException {
20 | private static final long serialVersionUID = 3655252154583356087L;
21 |
22 | public UnImplementException(final String message) {
23 | super(message);
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/data/IViewData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IViewData.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:39:11
5 | * 上次修改时间:2019年04月23日 18:23:19
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.data;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/3/26.
17 | * 和界面绑定的数据基类接口
18 | */
19 | public interface IViewData {
20 | boolean areItemsTheSame(IViewData newData);
21 |
22 | boolean areContentsTheSame(IViewData newData);
23 | }
24 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/define/Operation.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Operation.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.define;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/8.
17 | * 对进行操作的状态
18 | */
19 | public enum Operation {
20 | INIT,
21 | REFRESH,
22 | RETRY,
23 | LOAD_BEFORE,
24 | LOAD_AFTER
25 | }
26 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/define/Status.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Status.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.define;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/8.
17 | * 状态
18 | */
19 | public enum Status {
20 | RUNNING,
21 | SUCCESS,
22 | FAILED,
23 | EMPTY,
24 | CANCEL,
25 | END
26 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/OnFriendlyListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnFriendlyListener.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | import androidx.annotation.NonNull;
16 | import androidx.lifecycle.MutableLiveData;
17 |
18 | import com.cody.component.handler.define.RequestStatus;
19 |
20 |
21 | /**
22 | * Created by xu.yi. on 2019/4/9.
23 | * 用户友好 通用监听
24 | */
25 | public interface OnFriendlyListener extends Refreshable, OnRetryListener, OnInitListener {
26 | @NonNull
27 | RequestStatus getRequestStatus();
28 |
29 | @NonNull
30 | MutableLiveData getRequestStatusLive();
31 |
32 | void submitStatus(RequestStatus status);
33 |
34 | default void onCancel() {
35 | submitStatus(getRequestStatus().cancel());
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/OnInitListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnInitListener.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月28日 15:40:26
5 | * 上次修改时间:2019年04月27日 16:06:30
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/8.
17 | * 请求数据,可以通过数据库或者网络加载方式实现
18 | */
19 | public interface OnInitListener {
20 | void onInit();
21 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/OnRequestListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnRequestListener.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 19:07:41
5 | * 上次修改时间:2019年04月23日 18:26:51
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | import com.cody.component.handler.define.Operation;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/8.
19 | * 请求数据,可以通过数据库或者网络加载方式实现
20 | */
21 | public interface OnRequestListener {
22 | void onRequestData(Operation operation);
23 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/OnRequestPageListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnRequestPageListener.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | import com.cody.component.handler.define.Operation;
16 | import com.cody.component.handler.define.PageInfo;
17 |
18 | /**
19 | * Created by xu.yi. on 2019/4/8.
20 | * 请求分页数据,可以通过数据库或者网络加载方式实现
21 | */
22 | public interface OnRequestPageListener {
23 | void onRequestPageData(Operation operation, PageInfo oldPageInfo, PageResultCallBack callBack);
24 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/OnRetryListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnRetryListener.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月23日 18:16:18
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/8.
17 | * 重新请求数据
18 | */
19 | public interface OnRetryListener {
20 | /**
21 | * 出错重试按钮被点击时调用
22 | */
23 | void retry();
24 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/PageResultCallBack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:PageResultCallBack.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:53:13
5 | * 上次修改时间:2019年04月23日 18:23:20
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 |
16 | import com.cody.component.lib.bean.ListBean;
17 | import com.cody.component.handler.define.PageInfo;
18 |
19 | import java.util.List;
20 |
21 | import androidx.annotation.NonNull;
22 | import androidx.annotation.Nullable;
23 |
24 | /**
25 | * Created by xu.yi. on 2019/4/8.
26 | * 获取分页数据后进行回调的接口
27 | */
28 | public interface PageResultCallBack {
29 | /**
30 | * eg: callBack.onResult(listResult.getData().getItems(), PageInfo.getPrePageInfo(listResult), PageInfo.getNextPageInfo(listResult));
31 | */
32 | void onResult(@NonNull List data, @Nullable PageInfo prePageKey, @Nullable PageInfo nextPageKey);
33 |
34 | /**
35 | * eg: callBack.onResult(result);
36 | */
37 | default void onResult(List data, @Nullable PageInfo prePageKey, @NonNull ListBean> listBean) {
38 | onResult(data, PageInfo.getPrePageInfo(prePageKey, listBean), PageInfo.getNextPageInfo(prePageKey, listBean));
39 | }
40 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/Refreshable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Refreshable.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:50:01
5 | * 上次修改时间:2019年04月23日 18:23:21
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | /**
16 | * Created by cody.yi on 2019/1/10.
17 | * 界面可刷新
18 | */
19 | public interface Refreshable {
20 | void refresh();
21 | }
22 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/ResultCallBack.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ResultCallBack.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月29日 10:43:36
5 | * 上次修改时间:2019年04月29日 08:26:25
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 |
16 | /**
17 | * Created by xu.yi. on 2019/4/8.
18 | * 获取分页数据后进行回调的接口
19 | */
20 | public interface ResultCallBack {
21 | /**
22 | * eg: callBack.onSuccess();
23 | */
24 | void onSuccess();
25 |
26 | /**
27 | * eg: callBack.onFailure(message);
28 | */
29 | void onFailure(String message);
30 | }
31 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/interfaces/Scrollable.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Scrollable.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月24日 09:50:01
5 | * 上次修改时间:2019年04月23日 18:23:20
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.interfaces;
14 |
15 | /**
16 | * Created by cody.yi on 2019/1/10.
17 | * 界面可滚动
18 | */
19 | public interface Scrollable {
20 | void scrollToTop();
21 | }
22 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/BooleanLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BooleanLiveData.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月15日 23:01:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/15.
17 | * component
18 | */
19 | public class BooleanLiveData extends SafeMutableLiveData{
20 |
21 | public BooleanLiveData(final Boolean value) {
22 | super(value);
23 | }
24 |
25 | public void negation() {
26 | Boolean old = getValue();
27 | if (old != null) {
28 | setValue(!old);
29 | }
30 | }
31 |
32 | public void postNegation() {
33 | Boolean old = getValue();
34 | if (old != null) {
35 | postValue(!old);
36 | }
37 | }
38 |
39 | public boolean get() {
40 | Boolean old = getValue();
41 | if (old != null) {
42 | return old;
43 | }
44 | return false;
45 | }
46 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/FloatLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:FloatLiveData.java 模块:component.handler-core 项目:component
4 | * 当前修改时间:2021年03月03日 23:46:06
5 | * 上次修改时间:2021年02月27日 23:52:58
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:component.handler-core
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/15.
17 | * component
18 | */
19 | public class FloatLiveData extends SafeMutableLiveData {
20 |
21 | public FloatLiveData(final Float value) {
22 | super(value);
23 | }
24 |
25 | public float get() {
26 | Float old = getValue();
27 | if (old != null) {
28 | return old;
29 | }
30 | return 0f;
31 | }
32 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/IntegerLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IntegerLiveData.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月15日 23:04:22
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/15.
17 | * component
18 | */
19 | public class IntegerLiveData extends SafeMutableLiveData {
20 |
21 | public IntegerLiveData(final Integer value) {
22 | super(value);
23 | }
24 |
25 | public int get() {
26 | Integer old = getValue();
27 | if (old != null) {
28 | return old;
29 | }
30 | return 0;
31 | }
32 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/LongLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:LongLiveData.java 模块:component.handler-core 项目:component
4 | * 当前修改时间:2021年03月03日 23:46:06
5 | * 上次修改时间:2021年02月27日 15:56:36
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:component.handler-core
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/15.
17 | * component
18 | */
19 | public class LongLiveData extends SafeMutableLiveData {
20 |
21 | public LongLiveData(final Long value) {
22 | super(value);
23 | }
24 |
25 | public long get() {
26 | Long old = getValue();
27 | if (old != null) {
28 | return old;
29 | }
30 | return 0L;
31 | }
32 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/SafeMutableLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:SafeMutableLiveData.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月15日 22:51:47
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | import androidx.lifecycle.MutableLiveData;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/11.
19 | * 防止空指针
20 | */
21 | public class SafeMutableLiveData extends MutableLiveData {
22 |
23 | public SafeMutableLiveData(final T value) {
24 | super(value);
25 | }
26 |
27 | public SafeMutableLiveData() {
28 | }
29 |
30 | @Override
31 | public void postValue(final T value) {
32 | if (value != null) {
33 | super.postValue(value);
34 | }
35 | }
36 |
37 | @Override
38 | public void setValue(final T value) {
39 | if (value != null) {
40 | super.setValue(value);
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/livedata/StringLiveData.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:StringLiveData.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月15日 23:01:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.livedata;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/15.
17 | * component
18 | */
19 | public class StringLiveData extends SafeMutableLiveData {
20 |
21 | public StringLiveData(final String value) {
22 | super(value);
23 | }
24 |
25 | public String get() {
26 | String old = getValue();
27 | if (old != null) {
28 | return old;
29 | }
30 | return "";
31 | }
32 | }
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/mapper/PageDataMapper.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:PageDataMapper.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年05月13日 12:45:40
5 | * 上次修改时间:2019年04月29日 08:26:25
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.mapper;
14 |
15 | import androidx.arch.core.util.Function;
16 |
17 | import com.cody.component.handler.data.ItemViewDataHolder;
18 |
19 | /**
20 | * Created by cody.yi on 2016/8/24.
21 | * 将 DataModel 映射到 ViewData
22 | * 当获取的数据和ViewData有差距时需要使用mapper
23 | */
24 | public abstract class PageDataMapper- extends DataMapper
- implements Function {
25 |
26 | @Override
27 | public Item apply(Bean bean) {
28 | Item item = mapperItem(bean);
29 | increase();
30 | return item;
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/view/IBaseView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IBaseView.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月14日 00:14:46
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.view;
14 |
15 | import com.cody.component.handler.viewmodel.BaseViewModel;
16 | import com.cody.component.lib.view.IView;
17 |
18 | import androidx.annotation.NonNull;
19 | import androidx.annotation.Nullable;
20 | import androidx.lifecycle.ViewModelProvider;
21 |
22 | /**
23 | * Created by xu.yi. on 2019/3/25.
24 | * component
25 | */
26 | public interface IBaseView extends IView {
27 | default VM getViewModel(@NonNull Class viewModelClass) {
28 | return getViewModel(viewModelClass, null);
29 | }
30 |
31 | VM getViewModel(@NonNull Class viewModelClass, @Nullable ViewModelProvider.Factory factory);
32 | }
33 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/viewmodel/IViewModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IViewModel.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:51:40
5 | * 上次修改时间:2019年04月23日 18:23:20
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.viewmodel;
14 |
15 | import androidx.lifecycle.LifecycleOwner;
16 | import androidx.lifecycle.MutableLiveData;
17 |
18 | import com.cody.component.handler.define.ViewAction;
19 | import com.cody.component.lib.view.IView;
20 |
21 | /**
22 | * Created by xu.yi. on 2019/3/25.
23 | * component
24 | */
25 | public interface IViewModel extends IView {
26 | MutableLiveData getActionLiveData();
27 |
28 | /**
29 | * 处理其他action,扩展用
30 | */
31 | void executeAction(ViewAction action);
32 | T setLifecycleOwner(LifecycleOwner lifecycleOwner);
33 | }
34 |
--------------------------------------------------------------------------------
/handler-core/src/main/java/com/cody/component/handler/viewmodel/SingleViewModel.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:SingleViewModel.java 模块:handler-core 项目:component
4 | * 当前修改时间:2019年04月24日 13:27:47
5 | * 上次修改时间:2019年04月24日 13:27:47
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:handler-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.handler.viewmodel;
14 |
15 |
16 | import com.cody.component.handler.data.FriendlyViewData;
17 | import com.cody.component.handler.define.RequestStatus;
18 | import com.cody.component.handler.interfaces.OnRequestListener;
19 |
20 | /**
21 | * Created by xu.yi. on 2019/4/23.
22 | * component 用户友好的view model
23 | * 类似详情页,请求数据不要分页使用
24 | * 包含刷新,重试,出错默认提示页面
25 | */
26 | public abstract class SingleViewModel extends FriendlyViewModel implements OnRequestListener {
27 |
28 | public SingleViewModel(final VD friendlyViewData) {
29 | super(friendlyViewData);
30 | }
31 |
32 | /**
33 | * 执行一个操作
34 | */
35 | @Override
36 | protected void startOperation(RequestStatus requestStatus) {
37 | super.startOperation(requestStatus);
38 | onRequestData(requestStatus.getOperation());
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/http-compiler/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/http-compiler/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:http-compiler 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-compiler
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | import org.gradle.internal.jvm.Jvm
14 |
15 | apply from: "${project.rootDir}/config-compiler.gradle"
16 | dependencies {
17 | compileOnly files(Jvm.current().getToolsJar())
18 | api project(':http-lib')
19 | api rootProject.ext.dependencies["javapoet"]
20 | api rootProject.ext.dependencies["auto-service"]
21 | annotationProcessor rootProject.ext.dependencies["auto-service"]
22 | }
--------------------------------------------------------------------------------
/http-compiler/src/main/java/com/cody/component/http/compiler/bean/DomainBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:DomainBean.java 模块:http-compiler 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-compiler
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.compiler.bean;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/2.
17 | * 解析出来的生成类注解信息
18 | */
19 | public class DomainBean {
20 | private String host = "";
21 |
22 | public String getHost() {
23 | return host;
24 | }
25 |
26 | public void setHost(String host) {
27 | this.host = host;
28 | }
29 | }
30 |
--------------------------------------------------------------------------------
/http-compiler/src/main/java/com/cody/component/http/compiler/bean/ParameterBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ParameterBean.java 模块:http-compiler 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-compiler
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.compiler.bean;
14 |
15 | import com.squareup.javapoet.TypeName;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/2.
19 | * 根据注解获取的方法参数信息
20 | */
21 | public class ParameterBean {
22 | private String name = "";
23 | private TypeName type;
24 |
25 | public String getName() {
26 | return name;
27 | }
28 |
29 | public void setName(String name) {
30 | this.name = name;
31 | }
32 |
33 | public TypeName getType() {
34 | return type;
35 | }
36 |
37 | public void setType(TypeName type) {
38 | this.type = type;
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/http-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/http-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 |
15 | dependencies {
16 | api project(':http-lib')
17 | api rootProject.ext.dependencies["retrofit"]
18 | api rootProject.ext.dependencies["converter-fastjson"]
19 | api rootProject.ext.dependencies["logging"]
20 | api rootProject.ext.dependencies["adapter-rxjava2"]
21 | api rootProject.ext.dependencies["rxandroid"]
22 | implementation rootProject.ext.dependencies["appcompat"]
23 | implementation rootProject.ext.dependencies["room-runtime"]
24 | annotationProcessor rootProject.ext.dependencies["room-compiler"]
25 | }
26 |
--------------------------------------------------------------------------------
/http-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/http-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/IDataSource.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IDataSource.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年11月05日 10:04:42
5 | * 上次修改时间:2019年11月05日 10:04:42
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http;
14 |
15 | /**
16 | * Created by xu.yi. on 2019-11-05.
17 | * component
18 | */
19 | public interface IDataSource {
20 | void clear();
21 | }
22 |
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/callback/RequestCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:RequestCallback.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.callback;
14 |
15 | import android.text.TextUtils;
16 |
17 | import com.cody.component.http.holder.ToastHolder;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | */
22 | public interface RequestCallback {
23 |
24 | void onSuccess(T t);
25 |
26 | default boolean startWithLoading() {
27 | return true;
28 | }
29 |
30 | default boolean endDismissLoading() {
31 | return true;
32 | }
33 |
34 | default void showToast(String message) {
35 | if (TextUtils.isEmpty(message)){
36 | message = "未知错误";
37 | }
38 | ToastHolder.showToast(message);
39 | }
40 |
41 | default void showToast(int message) {
42 | ToastHolder.showToast(message);
43 | }
44 | }
45 |
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/callback/RequestFriendlyCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:RequestFriendlyCallback.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月29日 10:55:50
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.callback;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/6.
17 | * 页面自己处理loading,无需框架处理
18 | */
19 | public interface RequestFriendlyCallback extends RequestMultiplyCallback {
20 |
21 | @Override
22 | default boolean startWithLoading() {
23 | return false;
24 | }
25 |
26 | @Override
27 | default boolean endDismissLoading() {
28 | return false;
29 | }
30 | }
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/callback/RequestMultiplyCallback.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:RequestMultiplyCallback.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.callback;
14 |
15 | import com.cody.component.http.lib.exception.base.BaseHttpException;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/6.
19 | * 自定义处理错误,默认是弹出toast提示错误信息
20 | */
21 | public interface RequestMultiplyCallback extends RequestCallback {
22 |
23 | void onFail(BaseHttpException e);
24 | }
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/db/Converters.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Converters.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年05月22日 11:03:04
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.db;
14 |
15 | import androidx.room.TypeConverter;
16 |
17 | import java.util.Date;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/5.
21 | * Converters
22 | */
23 | public class Converters {
24 |
25 | @TypeConverter
26 | public static Date fromTimestamp(Long value) {
27 | return value == null ? null : new Date(value);
28 | }
29 |
30 | @TypeConverter
31 | public static Long dateToTimestamp(Date date) {
32 | return date == null ? null : date.getTime();
33 | }
34 |
35 | }
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/interceptor/HeaderInterceptor.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:HeaderInterceptor.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.interceptor;
14 |
15 |
16 | import java.io.IOException;
17 |
18 | import androidx.annotation.NonNull;
19 | import okhttp3.Interceptor;
20 | import okhttp3.Request;
21 | import okhttp3.Response;
22 |
23 | /**
24 | * Created by xu.yi. on 2019/4/6.
25 | *
26 | */
27 | public class HeaderInterceptor implements Interceptor {
28 |
29 | @NonNull
30 | @Override
31 | public Response intercept(@NonNull Chain chain) throws IOException {
32 | Request originalRequest = chain.request();
33 | Request.Builder requestBuilder = originalRequest.newBuilder()
34 | // .addHeader("Accept-Encoding", "gzip")
35 | .addHeader("Accept", "application/json")
36 | .addHeader("Content-Type", "application/json; charset=utf-8")
37 | .method(originalRequest.method(), originalRequest.body());
38 | return chain.proceed(requestBuilder.build());
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/http-core/src/main/java/com/cody/component/http/repository/BaseRepository.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BaseRepository.java 模块:http-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.repository;
14 |
15 | import com.cody.component.http.IDataSource;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/6.
19 | */
20 | public class BaseRepository {
21 |
22 | protected final T mDataSource;
23 |
24 | public BaseRepository(T dataSource) {
25 | this.mDataSource = dataSource;
26 | }
27 |
28 | public void clear() {
29 | if (mDataSource != null) {
30 | mDataSource.clear();
31 | }
32 | }
33 | }
--------------------------------------------------------------------------------
/http-lib/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/http-lib/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-lib.gradle"
14 |
15 | dependencies {
16 | api project(':lib-core')
17 | }
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/annotation/Domain.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Domain.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 | package com.cody.component.http.lib.annotation;
13 |
14 | import java.lang.annotation.Documented;
15 | import java.lang.annotation.Retention;
16 | import java.lang.annotation.Target;
17 |
18 | import static java.lang.annotation.ElementType.TYPE;
19 | import static java.lang.annotation.RetentionPolicy.RUNTIME;
20 |
21 | /**
22 | * Created by cody.yi on 2019/4/5.
23 | * 定义baseUrl 一般用于定义服务器域名 domain
24 | */
25 | @Documented
26 | @Target(TYPE)
27 | @Retention(RUNTIME)
28 | public @interface Domain {
29 | String value() default "";
30 | }
31 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/config/HttpCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:HttpCode.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.config;
14 |
15 | import com.cody.component.lib.exception.BaseCode;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/6.
19 | */
20 | public interface HttpCode extends BaseCode {
21 |
22 | int CODE_SUCCESS = 200;
23 |
24 | int CODE_TOKEN_INVALID = 401;
25 |
26 | int CODE_ACCOUNT_INVALID = -3;
27 |
28 | int CODE_PARAMETER_INVALID = -4;
29 |
30 | int CODE_CONNECTION_FAILED = -5;
31 |
32 | int CODE_FORBIDDEN = -6;
33 |
34 | int CODE_RESULT_INVALID = -7;
35 | int CODE_DOMAIN_INVALID = -8;
36 | int CODE_DOMAIN_DEFINE_INVALID = -9;
37 | int CODE_GENERATE_FAILED = -10;
38 | }
39 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/config/HttpConfig.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:HttpConfig.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.config;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/6.
17 | */
18 | public class HttpConfig {
19 | public static final long CACHE_SIZE = 1024 * 1024 * 2;
20 | public static final long WINDOW_DURATION = 500;
21 | public static final long READ_TIMEOUT = 6000;
22 | public static final long WRITE_TIMEOUT = 6000;
23 | public static final long CONNECT_TIMEOUT = 6000;
24 | }
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/AccountInvalidHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:AccountInvalidHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class AccountInvalidHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = -9162649761577759500L;
26 |
27 | public AccountInvalidHttpException() {
28 | super(HttpCode.CODE_ACCOUNT_INVALID, "账号或者密码错误");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/ConnectionHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ConnectionHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class ConnectionHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = 5857118712581692912L;
26 |
27 | public ConnectionHttpException() {
28 | super(HttpCode.CODE_CONNECTION_FAILED, "网络连接不可用,请稍后重试");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/DomainInvalidHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:DomainInvalidHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | * 用注解 @Domain("http://www.abc.com/")注解接口定义
22 | */
23 | public class DomainInvalidHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = 3758965851939602176L;
26 |
27 | public DomainInvalidHttpException() {
28 | super(HttpCode.CODE_DOMAIN_INVALID, "接口未指定域名:baseUrl");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/ForbiddenHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ForbiddenHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class ForbiddenHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = 4157660885240551288L;
26 |
27 | public ForbiddenHttpException() {
28 | super(HttpCode.CODE_PARAMETER_INVALID, "404错误");
29 | }
30 |
31 | }
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/GenerateDataSourceHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:GenerateDataSourceHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | */
22 | public class GenerateDataSourceHttpException extends BaseHttpException {
23 | private static final long serialVersionUID = -5191572865283665745L;
24 |
25 | public GenerateDataSourceHttpException(String errorMessage) {
26 | super(HttpCode.CODE_GENERATE_FAILED, errorMessage);
27 | }
28 |
29 | public GenerateDataSourceHttpException() {
30 | super(HttpCode.CODE_GENERATE_FAILED, "生成代码失败");
31 | }
32 |
33 | }
34 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/InvalidDefineHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:InvalidDefineHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | * 用注解 @Domain("http://www.abc.com/")注解接口定义
22 | */
23 | public class InvalidDefineHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = -1004291191431701343L;
26 |
27 | public InvalidDefineHttpException() {
28 | super(HttpCode.CODE_DOMAIN_DEFINE_INVALID, "Domain注解未定义在接口上");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/ParameterInvalidHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ParameterInvalidHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class ParameterInvalidHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = -251073341780032288L;
26 |
27 | public ParameterInvalidHttpException() {
28 | super(HttpCode.CODE_PARAMETER_INVALID, "参数有误");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/ResultInvalidHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ResultInvalidHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class ResultInvalidHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = -5601882119845336021L;
26 |
27 | public ResultInvalidHttpException() {
28 | super(HttpCode.CODE_RESULT_INVALID, "无效请求");
29 | }
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/ServerResultHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ServerResultHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.exception.base.BaseHttpException;
17 |
18 | /**
19 | * Created by xu.yi. on 2019/4/6.
20 | *
21 | */
22 | public class ServerResultHttpException extends BaseHttpException {
23 |
24 | private static final long serialVersionUID = -3348529211360188415L;
25 |
26 | public ServerResultHttpException(int code, String message) {
27 | super(code, message);
28 | }
29 |
30 | }
31 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/TokenInvalidHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:TokenInvalidHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception;
14 |
15 |
16 | import com.cody.component.http.lib.config.HttpCode;
17 | import com.cody.component.http.lib.exception.base.BaseHttpException;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/6.
21 | *
22 | */
23 | public class TokenInvalidHttpException extends BaseHttpException {
24 |
25 | private static final long serialVersionUID = 275593545034454755L;
26 |
27 | public TokenInvalidHttpException() {
28 | super(HttpCode.CODE_TOKEN_INVALID, "登录状态已过期,请重新登录");
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/http-lib/src/main/java/com/cody/component/http/lib/exception/base/BaseHttpException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BaseHttpException.java 模块:http-lib 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:19
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:http-lib
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.http.lib.exception.base;
14 |
15 |
16 | import com.cody.component.lib.exception.BaseException;
17 |
18 | /**
19 | * Created by xu.yi. on 2019/4/6.
20 | *
21 | */
22 | public class BaseHttpException extends BaseException {
23 |
24 | private static final long serialVersionUID = -7839621263913749123L;
25 |
26 | public BaseHttpException() {
27 | }
28 |
29 | public BaseHttpException(final int code, final String message) {
30 | super(code, message);
31 | }
32 | }
--------------------------------------------------------------------------------
/hybrid-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/hybrid-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 17:21:46
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':image-core')
16 | api project(':blues-core')
17 |
18 | api rootProject.ext.dependencies["umeng-common"]
19 | api rootProject.ext.dependencies["umeng-utdid"]
20 | api rootProject.ext.dependencies["share-core"]
21 | api rootProject.ext.dependencies["share-qq"]
22 | api rootProject.ext.dependencies["share-wechat"]
23 | // api rootProject.ext.dependencies["share-sina"]
24 | api rootProject.ext.dependencies["share-widget"]
25 | }
26 |
--------------------------------------------------------------------------------
/hybrid-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/hybrid-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
15 |
16 |
17 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/H5Exception.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:H5Exception.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年06月19日 11:38:13
5 | * 上次修改时间:2019年06月19日 11:38:13
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid;
14 |
15 | import com.cody.component.lib.exception.BaseException;
16 |
17 | /**
18 | * Created by xu.yi. on 2019-06-19.
19 | * component H5
20 | */
21 | public class H5Exception extends BaseException {
22 | private static final long serialVersionUID = 2972956667521489395L;
23 |
24 | public H5Exception(final String message) {
25 | super(message);
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/OnCreateOptionsListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnCreateOptionsListener.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid;
14 |
15 | import android.view.Menu;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/11.
19 | * 动态创建菜单
20 | * TODO 实现动态创建
21 | */
22 | public interface OnCreateOptionsListener {
23 | void onCreateOptionsMenu(Menu menu);
24 | }
25 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/OnShareListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnShareListener.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年07月02日 10:15:13
5 | * 上次修改时间:2019年05月06日 19:33:24
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid;
14 |
15 | import android.app.Activity;
16 |
17 | import com.cody.component.hybrid.data.HtmlConfig;
18 |
19 | /**
20 | * Created by xu.yi. on 2019/4/11.
21 | * 分享监听
22 | */
23 | public interface OnShareListener {
24 | void share(Activity activity, HtmlConfig config);
25 | }
26 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/OnUrlListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnUrlListener.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年04月30日 13:36:27
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/11.
17 | * url 变化监听
18 | */
19 | public interface OnUrlListener {
20 | void onTitleChange(String title);
21 |
22 | void onUrlChange(String url, boolean canGoBack);
23 | }
24 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/core/JsCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:JsCode.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid.core;
14 |
15 | /**
16 | * Created by cody.yi on 2017/4/12.
17 | * js 调用返回码
18 | */
19 |
20 | public interface JsCode {
21 | int SUCCESS = 200;
22 | int FAILURE = 400;
23 | }
24 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/java/com/cody/component/hybrid/core/JsHandler.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:JsHandler.java 模块:hybrid-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:hybrid-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.hybrid.core;
14 |
15 |
16 | import com.cody.component.util.NotProguard;
17 |
18 | /**
19 | * Created by cody.yi on 2017/4/13.
20 | * 所有Js处理类实现这个接口
21 | * Js调用的方法必须按照一定的格式定义,否则不生效
22 | * 格式:
23 | * public static void ***(WebView webView, JsonObject data, JsCallback callback){}
24 | */
25 | @NotProguard
26 | public interface JsHandler {
27 | }
28 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/res/drawable/ic_html_progress.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
-
17 |
18 |
19 |
24 |
25 |
26 | -
27 |
28 |
29 |
30 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/res/menu/html_menu.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/hybrid-core/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | 须开启相应权限才能正常使用此功能,是否授权?
16 |
--------------------------------------------------------------------------------
/image-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/image-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:image-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 19:58:34
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:image-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(":app-core")
16 | api rootProject.ext.dependencies["image-picker"]
17 | api rootProject.ext.dependencies["qrcode"]
18 | api rootProject.ext.dependencies["exifinterface"]
19 | }
20 |
--------------------------------------------------------------------------------
/image-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/image-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
14 |
17 |
18 |
19 |
21 |
25 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/image-core/src/main/java/com/cody/component/image/OnImageViewListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:OnImageViewListener.java 模块:image-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 10:52:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:image-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.image;
14 |
15 |
16 | import com.lzy.imagepicker.bean.ImageItem;
17 |
18 | import java.util.List;
19 |
20 | /**
21 | * Created by cody.yi on 2017/5/19.
22 | * 获取图片成功
23 | */
24 | public interface OnImageViewListener {
25 | /**
26 | * 预览成功
27 | *
28 | * @param id delegate id
29 | * @param images 预览操作后剩余图片列表
30 | */
31 | void onPreview(int id, List images); // 预览
32 |
33 | /**
34 | * 选择成功
35 | *
36 | * @param id delegate id
37 | * @param images 操作后图片列表
38 | */
39 | void onPickImage(int id, List images); // 获取图片
40 | }
41 |
--------------------------------------------------------------------------------
/image-core/src/main/java/com/cody/component/image/certificate/cropper/CropListener.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:CropListener.java 模块:image-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 11:14:45
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:image-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.image.certificate.cropper;
14 |
15 | import android.graphics.Bitmap;
16 |
17 | /**
18 | * Desc ${裁剪监听接口}
19 | */
20 | public interface CropListener {
21 |
22 | void onFinish(Bitmap bitmap);
23 |
24 | }
25 |
--------------------------------------------------------------------------------
/image-core/src/main/java/com/cody/component/image/certificate/cropper/CropPosition.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:CropPosition.java 模块:image-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 11:14:45
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:image-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.image.certificate.cropper;
14 |
15 | /**
16 | * Desc ${裁剪位置}
17 | */
18 | public enum CropPosition {
19 | TOP_LEFT,
20 | TOP_RIGHT,
21 | BOTTOM_LEFT,
22 | BOTTOM_RIGHT
23 | }
24 |
--------------------------------------------------------------------------------
/image-core/src/main/java/com/cody/component/image/certificate/global/Constant.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:Constant.java 模块:image-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 17:52:42
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:image-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.image.certificate.global;
14 |
15 | import com.cody.component.util.FileUtil;
16 |
17 | import java.io.File;
18 |
19 | /**
20 | * Desc ${常量}
21 | */
22 | public class Constant {
23 | public static final String APP_NAME = "Camera";//app名称
24 | public static final String BASE_DIR = APP_NAME + File.separator;//Camera/
25 | public static final String DIR_ROOT = FileUtil.getRootPath() + File.separator + Constant.BASE_DIR;//文件夹根目录 /storage/emulated/0/Camera/
26 | }
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_cancel.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_choose.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_flashlight_off.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_flashlight_on.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_rotate.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/image-core/src/main/res/drawable/ic_shoot.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
22 |
--------------------------------------------------------------------------------
/image-core/src/main/res/layout/crop_image_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
20 |
21 |
27 |
28 |
33 |
34 |
35 |
36 |
--------------------------------------------------------------------------------
/image-core/src/main/res/mipmap-xxhdpi/camera_company.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/image-core/src/main/res/mipmap-xxhdpi/camera_company.png
--------------------------------------------------------------------------------
/image-core/src/main/res/mipmap-xxhdpi/camera_company_landscape.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/image-core/src/main/res/mipmap-xxhdpi/camera_company_landscape.png
--------------------------------------------------------------------------------
/image-core/src/main/res/mipmap-xxhdpi/camera_idcard_back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/image-core/src/main/res/mipmap-xxhdpi/camera_idcard_back.png
--------------------------------------------------------------------------------
/image-core/src/main/res/mipmap-xxhdpi/camera_idcard_front.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/image-core/src/main/res/mipmap-xxhdpi/camera_idcard_front.png
--------------------------------------------------------------------------------
/image-core/src/main/res/values/atrrs.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/image-core/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | 相册
15 | 触摸屏幕对焦
16 | 裁剪失败
17 | 将二维码/条码放入框内,即可自动扫描
18 |
19 |
20 | Hello blank fragment
21 |
22 |
--------------------------------------------------------------------------------
/lib-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/lib-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:54
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-lib.gradle"
14 |
15 | dependencies {
16 | api rootProject.ext.dependencies["fastjson"]
17 | }
--------------------------------------------------------------------------------
/lib-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/lib-core/src/main/java/com/cody/component/lib/exception/BaseCode.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BaseCode.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年06月19日 10:31:07
5 | * 上次修改时间:2019年06月19日 10:31:07
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.lib.exception;
14 |
15 | /**
16 | * Created by xu.yi. on 2019-06-19.
17 | * component exception Code
18 | */
19 | public interface BaseCode {
20 | int CODE_UNKNOWN = -1;
21 | }
22 |
--------------------------------------------------------------------------------
/lib-core/src/main/java/com/cody/component/lib/exception/BaseException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:BaseException.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年06月19日 10:32:21
5 | * 上次修改时间:2019年06月19日 10:32:21
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.lib.exception;
14 |
15 | /**
16 | * Created by xu.yi. on 2019-06-19.
17 | * component
18 | */
19 | public class BaseException extends RuntimeException {
20 |
21 | private static final long serialVersionUID = -4760213625687945508L;
22 | private int mCode = BaseCode.CODE_UNKNOWN;
23 |
24 | public BaseException() {
25 | }
26 |
27 | public BaseException(String message) {
28 | super(message);
29 | }
30 |
31 | public BaseException(final String s, final Throwable throwable) {
32 | super(s, throwable);
33 | }
34 |
35 | public BaseException(final Throwable throwable) {
36 | super(throwable);
37 | }
38 |
39 | public BaseException(int code, String message) {
40 | super(message);
41 | this.mCode = code;
42 | }
43 |
44 | public int getCode() {
45 | return mCode;
46 | }
47 | }
48 |
--------------------------------------------------------------------------------
/lib-core/src/main/java/com/cody/component/lib/exception/NotInitializedException.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:NotInitializedException.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年11月05日 15:43:45
5 | * 上次修改时间:2019年11月05日 15:42:57
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.lib.exception;
14 |
15 | /**
16 | * Created by xu.yi. on 2019/4/7.
17 | * component
18 | */
19 | public class NotInitializedException extends BaseException {
20 | private static final long serialVersionUID = -2553683554516417069L;
21 |
22 | public NotInitializedException(final String s) {
23 | super(s +": 使用实例必须先调用 init");
24 | }
25 | }
--------------------------------------------------------------------------------
/lib-core/src/main/java/com/cody/component/lib/view/IView.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:IView.java 模块:lib-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:43:55
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:lib-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.lib.view;
14 |
15 |
16 | /**
17 | * Created by xu.yi. on 2019/3/25.
18 | * base activity and base fragment 需要实现的接口
19 | */
20 | public interface IView {
21 | /**
22 | * show loading message
23 | */
24 | void showLoading();
25 |
26 | /**
27 | * show loading message
28 | *
29 | * @param message 需要显示的消息:正在加载。。。
30 | */
31 | void showLoading(String message);
32 |
33 | /**
34 | * hide loading
35 | */
36 | void hideLoading();
37 |
38 | /**
39 | * show toast message
40 | *
41 | * @param message 需要显示的消息:正在加载。。。
42 | */
43 | void showToast(String message);
44 |
45 | /**
46 | * show toast message
47 | *
48 | * @param message 需要显示的消息:正在加载。。。
49 | */
50 | void showToast(int message);
51 |
52 | /**
53 | * 关闭当前activity
54 | */
55 | void finish();
56 |
57 | /**
58 | * 关闭当前activity,并设置返回结果
59 | */
60 | void finishWithResultOk();
61 | }
62 |
--------------------------------------------------------------------------------
/marquee-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/marquee-core/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * ************************************************************
4 | * 文件:build.gradle 模块:marquee-core 项目:component
5 | * 当前修改时间:2019年12月05日 14:57:03
6 | * 上次修改时间:2019年06月05日 13:52:59
7 | * 作者:Cody.yi https://github.com/codyer
8 | *
9 | * 描述:marquee-core
10 | * Copyright (c) 2019
11 | * ************************************************************
12 | */
13 |
14 | apply from: "${project.rootDir}/config-aar.gradle"
--------------------------------------------------------------------------------
/marquee-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/marquee-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/marquee-core/src/main/res/anim/core_anim_marquee_in.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
--------------------------------------------------------------------------------
/marquee-core/src/main/res/anim/core_anim_marquee_out.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
7 |
11 |
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':app-demo'
2 | include ':core'
3 | /*
4 | * ************************************************************
5 | * 文件:settings.gradle 模块:component 项目:component
6 | * 当前修改时间:2021年02月27日 15:30:04
7 | * 上次修改时间:2021年02月27日 14:45:35
8 | * 作者:Cody.yi https://github.com/codyer
9 | *
10 | * 描述:component
11 | * Copyright (c) 2021
12 | * ************************************************************
13 | */
14 |
15 | // holder
16 | include ':compiler'
17 |
18 | // components
19 | include ':cat-core'
20 | include ':app-core', ':bind-core', ':handler-core', ':image-core', ':ui-core', ':lib-core'
21 | include ':hybrid-core', 'util-core'
22 | include ':banner-core'
23 | include ':marquee-core'
24 | include ':update-core'
25 | include ':blues-core'
26 | //include ':bus-core', ':bus-lib', ':bus-compiler'
27 | include ':http-core', ':http-lib', ':http-compiler'
--------------------------------------------------------------------------------
/structure/APP-structure.xmind:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/structure/APP-structure.xmind
--------------------------------------------------------------------------------
/structure/module_structure.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/structure/module_structure.png
--------------------------------------------------------------------------------
/ui-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/ui-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:ui-core 项目:component
4 | * 当前修改时间:2021年02月27日 15:30:04
5 | * 上次修改时间:2021年02月27日 14:35:30
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:ui-core
9 | * Copyright (c) 2021
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api rootProject.ext.dependencies["appcompat"]
16 | api rootProject.ext.dependencies["swiperefreshlayout"]
17 | }
--------------------------------------------------------------------------------
/ui-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/ui-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable-v21/bg_secondary_no_boundary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
17 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable-v21/bg_secondary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
17 | -
18 |
19 |
22 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable-v21/bg_third_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
17 | -
18 |
19 |
22 |
25 |
28 |
29 |
30 |
31 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable-v21/bg_transparent_no_boundary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
17 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_primary_rectangle_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | -
15 |
16 |
17 |
18 |
19 | -
20 |
21 |
22 |
23 |
24 | -
25 |
26 |
27 |
28 |
29 | -
30 |
31 |
32 |
33 |
34 | -
35 |
36 |
37 |
38 |
39 |
40 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_secondary_no_boundary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_secondary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_shape_round.xml:
--------------------------------------------------------------------------------
1 |
12 |
14 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_third_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/bg_transparent_no_boundary_touch_selector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_add.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_back.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_back_white.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
19 |
22 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_close.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_default_error.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_default_place_holder.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
16 |
17 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_load_failed_selector_for_text_view.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_loading_gif.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/codyer/component/3e81bc0c1ffefbc7f16089ced155b5568b049e75/ui-core/src/main/res/drawable/ic_loading_gif.gif
--------------------------------------------------------------------------------
/ui-core/src/main/res/drawable/ic_share.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
18 |
21 |
24 |
25 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/values/dimens.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 | 34dp
15 | 32dp
16 | 30dp
17 | 28dp
18 | 26dp
19 | 24dp
20 | 22dp
21 | 20dp
22 | 18dp
23 | 16dp
24 | 14dp
25 | 12dp
26 | 10dp
27 | 8dp
28 | 6dp
29 | 4dp
30 | 2dp
31 | 1dp
32 |
33 | 0.5dp
34 | 0dp
35 |
--------------------------------------------------------------------------------
/ui-core/src/main/res/values/theme.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
14 |
15 |
20 |
--------------------------------------------------------------------------------
/update-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/update-core/build.gradle:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:build.gradle 模块:bind-update 项目:component
4 | * 当前修改时间:2019年05月31日 15:57:18
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-update
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | apply from: "${project.rootDir}/config-aar.gradle"
14 | dependencies {
15 | api project(':app-core')
16 | }
--------------------------------------------------------------------------------
/update-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/update-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
15 |
16 |
17 |
18 |
19 |
20 |
25 |
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/update-core/src/main/java/com/cody/component/update/UpdateBean.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:UpdateBean.java 模块:bind-update 项目:component
4 | * 当前修改时间:2019年05月31日 15:56:34
5 | * 上次修改时间:2019年04月26日 22:46:37
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:bind-update
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.update;
14 |
15 | /**
16 | * Created by cody.yi on 2017/5/5.
17 | * App 版本信息
18 | * 检查更新接口使用
19 | */
20 | public class UpdateBean {
21 | /**
22 | * id : 77
23 | * type : Android
24 | * downloadUrl : https://www.app.com/ftpupload/app-release.apk
25 | * latestVersion : 2.0.0
26 | * lowestVersion : 1.2.0
27 | * isForcedUpdate : true
28 | * isNeedUpdate : true
29 | * userSide : app
30 | * apkName : cody-app
31 | * updateInfo : 更新了用户信息界操作逻辑
32 | * market : 应用宝
33 | * createDate : 1493800434000
34 | * updateDate : 1493800322000
35 | */
36 | public String type;
37 | public String downloadUrl;
38 | public String latestVersion;
39 | public String lowestVersion;
40 | public boolean isForcedUpdate;
41 | public boolean isNeedUpdate;
42 | public String userSide;
43 | public String apkName;
44 | public String updateInfo;
45 | public String market;
46 | public long createDate;
47 | public long updateDate;
48 | }
49 |
--------------------------------------------------------------------------------
/update-core/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 | component
16 |
--------------------------------------------------------------------------------
/update-core/src/main/res/xml/file_paths.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
18 |
21 |
24 |
27 |
30 |
31 |
--------------------------------------------------------------------------------
/util-core/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/util-core/build.gradle:
--------------------------------------------------------------------------------
1 |
2 | /*
3 | * ************************************************************
4 | * 文件:build.gradle 模块:util-core 项目:component
5 | * 当前修改时间:2019年04月23日 18:23:20
6 | * 上次修改时间:2019年04月13日 08:44:03
7 | * 作者:Cody.yi https://github.com/codyer
8 | *
9 | * 描述:util-core
10 | * Copyright (c) 2019
11 | * ************************************************************
12 | */
13 |
14 | apply from: "${project.rootDir}/config-aar.gradle"
15 | dependencies {
16 | api rootProject.ext.dependencies["appcompat"]
17 | api rootProject.ext.dependencies["paging"]
18 | }
19 |
--------------------------------------------------------------------------------
/util-core/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 |
23 | #不混淆所有类名中包含了“cody”的类及其成员
24 | -keep public class **.*cody*.** {*;}
--------------------------------------------------------------------------------
/util-core/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
12 |
13 |
--------------------------------------------------------------------------------
/util-core/src/main/java/com/cody/component/util/ApplicationUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ApplicationUtil.java 模块:util-core 项目:component
4 | * 当前修改时间:2019年06月18日 09:26:58
5 | * 上次修改时间:2019年06月18日 09:26:58
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:util-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.util;
14 |
15 | import android.app.Application;
16 |
17 | /**
18 | * Created by xu.yi. on 2019-06-18.
19 | * component holder application
20 | */
21 | public class ApplicationUtil {
22 | private static Application sApplication;
23 |
24 | public static void install(Application application) {
25 | sApplication = application;
26 | }
27 |
28 | public static Application getApplication() {
29 | if (sApplication == null){
30 | throw new NullPointerException("You should call ApplicationUtil.install() in you application first!");
31 | }
32 | return sApplication;
33 | }
34 | }
35 |
--------------------------------------------------------------------------------
/util-core/src/main/java/com/cody/component/util/NotProguard.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:NotProguard.java 模块:util-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月13日 08:44:03
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:util-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.util;
14 |
15 | import java.lang.annotation.ElementType;
16 | import java.lang.annotation.Retention;
17 | import java.lang.annotation.RetentionPolicy;
18 | import java.lang.annotation.Target;
19 |
20 | /**
21 | * NotProguard, Means not proguard something, like class, method, field
22 | *
23 | * @author Trinea 2015-08-07
24 | */
25 | @Retention(RetentionPolicy.CLASS)
26 | @Target({ElementType.TYPE, ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD})
27 | public @interface NotProguard {
28 |
29 | }
30 |
--------------------------------------------------------------------------------
/util-core/src/main/java/com/cody/component/util/ScreenUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:ScreenUtil.java 模块:util-core 项目:component
4 | * 当前修改时间:2019年04月26日 13:33:35
5 | * 上次修改时间:2019年04月23日 18:23:20
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:util-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.util;
14 |
15 | import android.content.Context;
16 |
17 | /**
18 | * Desc ${屏幕相关工具类}
19 | */
20 | public class ScreenUtil {
21 |
22 | /**
23 | * 获取屏幕宽度(px)
24 | */
25 | public static int getScreenWidth(Context context) {
26 | return context.getResources().getDisplayMetrics().widthPixels;
27 | }
28 |
29 | /**
30 | * 获取屏幕高度(px)
31 | */
32 | public static int getScreenHeight(Context context) {
33 | return context.getResources().getDisplayMetrics().heightPixels;
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/util-core/src/main/java/com/cody/component/util/SizeUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:SizeUtil.java 模块:util-core 项目:component
4 | * 当前修改时间:2019年04月23日 18:23:20
5 | * 上次修改时间:2019年04月21日 22:20:27
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:util-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.util;
14 |
15 | import java.text.DecimalFormat;
16 |
17 | /**
18 | * Created by xu.yi. on 2019/4/21.
19 | * component
20 | */
21 | public class SizeUtil {
22 | private static final double BASE = 1024, KB = BASE, MB = KB * BASE, GB = MB * BASE, TB = GB * BASE;
23 | private static final DecimalFormat df = new DecimalFormat("#.##");
24 |
25 | public static String formatSize(double size) {
26 | if (size >= TB) {
27 | return df.format(size / TB) + " TB";
28 | }
29 | if (size >= GB) {
30 | return df.format(size / GB) + " GB";
31 | }
32 | if (size >= MB) {
33 | return df.format(size / MB) + " MB";
34 | }
35 | if (size >= KB) {
36 | return df.format(size / KB) + " KB";
37 | }
38 | return "" + (int) size + " bytes";
39 | }
40 |
41 | }
42 |
--------------------------------------------------------------------------------
/util-core/src/main/java/com/cody/component/util/TypeUtil.java:
--------------------------------------------------------------------------------
1 | /*
2 | * ************************************************************
3 | * 文件:TypeUtil.java 模块:util-core 项目:component
4 | * 当前修改时间:2019年11月05日 10:44:26
5 | * 上次修改时间:2019年11月05日 10:44:26
6 | * 作者:Cody.yi https://github.com/codyer
7 | *
8 | * 描述:util-core
9 | * Copyright (c) 2019
10 | * ************************************************************
11 | */
12 |
13 | package com.cody.component.util;
14 |
15 | import androidx.annotation.NonNull;
16 |
17 | import java.lang.reflect.ParameterizedType;
18 | import java.lang.reflect.Type;
19 |
20 | /**
21 | * Created by xu.yi. on 2019-11-05.
22 | * component
23 | */
24 | public class TypeUtil {
25 |
26 | /**
27 | * 获取组合类类型
28 | */
29 | public static ParameterizedType getType(final Class raw, final Type... args) {
30 | return new ParameterizedType() {
31 | @NonNull
32 | public Type getRawType() {
33 | return raw;
34 | }
35 |
36 | @NonNull
37 | public Type[] getActualTypeArguments() {
38 | return args;
39 | }
40 |
41 | public Type getOwnerType() {
42 | return null;
43 | }
44 | };
45 | }
46 | }
47 |
--------------------------------------------------------------------------------
/util-core/src/main/res/values/util_ids.xml:
--------------------------------------------------------------------------------
1 |
2 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------